Przeglądaj źródła

init and close physx extensions

mikymod 12 lat temu
rodzic
commit
928c476af6
1 zmienionych plików z 5 dodań i 0 usunięć
  1. 5 0
      engine/physics/Physics.h

+ 5 - 0
engine/physics/Physics.h

@@ -31,6 +31,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "PxCooking.h"
 #include "PxDefaultAllocator.h"
 #include "PxDefaultErrorCallback.h"
+#include "PxExtensionsAPI.h"
 
 namespace crown
 {
@@ -62,6 +63,9 @@ inline Physics::Physics()
 	m_physics = PxCreatePhysics(PX_PHYSICS_VERSION, *m_foundation, physx::PxTolerancesScale());
 	CE_ASSERT_NOT_NULL(m_physics);
 
+	bool extension = PxInitExtensions(*m_physics);
+	CE_ASSERT(extension, "Unable to initialize Physx extension");
+
 	m_cooking = PxCreateCooking(PX_PHYSICS_VERSION, *m_foundation, physx::PxCookingParams());
 	CE_ASSERT_NOT_NULL(m_cooking);
 }
@@ -69,6 +73,7 @@ inline Physics::Physics()
 //-----------------------------------------------------------------------------
 inline Physics::~Physics()
 {
+	PxCloseExtensions();
 	m_physics->release();
 	m_foundation->release();
 }