Ver código fonte

Changed method of releasing a physics body with physx 2.8

rextimmy 11 anos atrás
pai
commit
8f550d5f8c
1 arquivos alterados com 2 adições e 3 exclusões
  1. 2 3
      Engine/source/T3D/physics/physx/pxWorld.cpp

+ 2 - 3
Engine/source/T3D/physics/physx/pxWorld.cpp

@@ -448,9 +448,8 @@ void PxWorld::releaseActor( NxActor &actor )
    // Clear the userdata.
    // Clear the userdata.
    actor.userData = NULL;   
    actor.userData = NULL;   
 
 
-   // If the scene is not simulating then we have the
-   // write lock and can safely delete it now.
-   if ( !mIsSimulating )
+   // actors are one of the few objects that are stable removing this way in physx 2.8
+   if (mScene->isWritable() )
    {
    {
       mScene->releaseActor( actor );
       mScene->releaseActor( actor );
    }
    }