فهرست منبع

add PhysicsControllerCallback

mikymod 12 سال پیش
والد
کامیت
eb80aff111
1فایلهای تغییر یافته به همراه31 افزوده شده و 2 حذف شده
  1. 31 2
      engine/physics/PhysicsCallback.h

+ 31 - 2
engine/physics/PhysicsCallback.h

@@ -27,24 +27,31 @@ OTHER DEALINGS IN THE SOFTWARE.
 #pragma once
 
 #include "PxSimulationEventCallback.h"
+#include "PxController.h"
 
 using physx::PxSimulationEventCallback;
 using physx::PxContactPairHeader;
 using physx::PxContactPair;
 using physx::PxConstraintInfo;
 using physx::PxTriggerPair;
+using physx::PxActor;
 using physx::PxU32;
 
+using physx::PxUserControllerHitReport;
+using physx::PxControllerShapeHit;
+using physx::PxControllersHit;
+using physx::PxControllerObstacleHit;
+
 namespace crown
 {
 
 //-----------------------------------------------------------------------------
-class PhysicsCallback : public PxSimulationEventCallback
+class PhysicsSimulationCallback : public PxSimulationEventCallback
 {
 public:
 
 	//-----------------------------------------------------------------------------
-	PhysicsCallback() {}
+	PhysicsSimulationCallback() {}
 
 	//-----------------------------------------------------------------------------
 	void onConstraintBreak(PxConstraintInfo* /*constraints*/, PxU32 /*count*/)
@@ -77,4 +84,26 @@ public:
 	}
 };
 
+//-----------------------------------------------------------------------------
+class PhysicsControllerCallback : public PxUserControllerHitReport
+{
+	//-----------------------------------------------------------------------------
+	void onShapeHit(const PxControllerShapeHit& hit)
+	{
+		Log::i("SHAPE HIT");
+	}
+
+	//-----------------------------------------------------------------------------
+	void onControllerHit(const PxControllersHit& hit)
+	{
+		Log::i("CONTROLLER HIT");
+	}
+
+	//-----------------------------------------------------------------------------
+	void onObstacleHit(const PxControllerObstacleHit& hit)
+	{
+		Log::i("OBSTACLE HIT");
+	}
+};
+
 } // namespace crown