Przeglądaj źródła

add debug informations

mikymod 12 lat temu
rodzic
commit
7d5c72fc1a
2 zmienionych plików z 7 dodań i 5 usunięć
  1. 4 4
      engine/physics/Raycast.cpp
  2. 3 1
      engine/physics/Raycast.h

+ 4 - 4
engine/physics/Raycast.cpp

@@ -82,10 +82,10 @@ void Raycast::cast(const Vector3& from, const Vector3& dir, const float length)
 		ev.normal.z = rh.normal.z;
 		ev.actor = (Actor*)(rh.actor->userData);
 
-		// Log::i("callback: %s", ev.callback);
-		// Log::i("position: (%f, %f, %f)", ev.position.x, ev.position.y, ev.position.z);
-		// Log::i("normal: (%f, %f, %f)", ev.normal.x, ev.normal.y, ev.normal.z);
-		// Log::i("distance: %f", ev.distance);
+		Log::i("callback: %s", ev.callback);
+		Log::i("position: (%f, %f, %f)", ev.position.x, ev.position.y, ev.position.z);
+		Log::i("normal: (%f, %f, %f)", ev.normal.x, ev.normal.y, ev.normal.z);
+		Log::i("distance: %f", ev.distance);
 
 		event_stream::write(m_events, physics_world::EventType::RAYCAST, ev);
 	}

+ 3 - 1
engine/physics/Raycast.h

@@ -30,6 +30,8 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "PxScene.h"
 #include "PxVec3.h"
 #include "EventStream.h"
+// workaround
+#include "Matrix4x4.h"
 
 using physx::PxQueryFilterData;
 using physx::PxQueryFlag;
@@ -40,7 +42,7 @@ using physx::PxRaycastBuffer;
 using physx::PxScene;
 using physx::PxVec3;
 
-#define MAX_RAYCAST_INTERSECTIONS 32
+#define MAX_RAYCAST_INTERSECTIONS 8
 
 namespace crown
 {