void TermGamePhys() { #if WITH_BOX2D FPhysicsIntegration2D::ShutdownPhysics(); #endif #if WITH_PHYSX // Do nothing if they were never initialized if(GPhysXFoundation == NULL) { return; } if (GPhysCommandHandler != NULL) { GPhysCommandHandler->Flush(); //finish off any remaining commands delete GPhysCommandHandler; GPhysCommandHandler = NULL; } #if WITH_APEX #if WITH_APEX_LEGACY if(GApexModuleLegacy != NULL) { GApexModuleLegacy->release(); GApexModuleLegacy = NULL; } #endif // WITH_APEX_LEGACY if(GApexSDK != NULL) { GApexSDK->release(); GApexSDK = NULL; } #endif // #if WITH_APEX #if WITH_PHYSICS_COOKING || WITH_RUNTIME_PHYSICS_COOKING if(GPhysXCooking != NULL) { GPhysXCooking->release(); GPhysXCooking = NULL; } #endif PxCloseExtensions(); PxCloseVehicleSDK(); if(GPhysXSDK != NULL) { GPhysXSDK->release(); GPhysXSDK = NULL; } // @todo delete FPhysXAllocator // @todo delete FPhysXOutputStream UnloadPhysXModules(); #endif }
void SampleVehicle_VehicleManager::shutdown() { //Remove the N-wheeled vehicles. for(PxU32 i=0;i<mNumVehicles;i++) { PX_ASSERT(eVEHICLE_TYPE_DRIVE4W==mVehicles[i]->getVehicleType()); PxVehicleDrive4W* veh=(PxVehicleDrive4W*)mVehicles[i]; veh->free(); } //Deallocate scene query data that was used for suspension raycasts. mSqData->free(); //Release the friction values used for combinations of tire type and surface type. mSurfaceTirePairs->release(); //Scene query. if(mSqWheelRaycastBatchQuery) { mSqWheelRaycastBatchQuery=NULL; } PxCloseVehicleSDK(); }
void TermGamePhys() { #if WITH_BOX2D FPhysicsIntegration2D::ShutdownPhysics(); #endif #if WITH_PHYSX FPhysxSharedData::Terminate(); // Do nothing if they were never initialized if(GPhysXFoundation == NULL) { return; } if (GPhysCommandHandler != NULL) { GPhysCommandHandler->Flush(); //finish off any remaining commands FCoreUObjectDelegates::PreGarbageCollect.Remove(GPreGarbageCollectDelegateHandle); delete GPhysCommandHandler; GPhysCommandHandler = NULL; } #if WITH_APEX #if WITH_APEX_LEGACY if(GApexModuleLegacy != NULL) { GApexModuleLegacy->release(); GApexModuleLegacy = NULL; } #endif // WITH_APEX_LEGACY if(GApexSDK != NULL) { GApexSDK->release(); GApexSDK = NULL; } #endif // #if WITH_APEX //Remove all scenes still registered if (int32 NumScenes = GPhysXSDK->getNbScenes()) { TArray<PxScene*> PScenes; PScenes.AddUninitialized(NumScenes); GPhysXSDK->getScenes(PScenes.GetData(), sizeof(PxScene*)* NumScenes); for (PxScene* PScene : PScenes) { if (PScene) { PScene->release(); } } } #if WITH_PHYSICS_COOKING || WITH_RUNTIME_PHYSICS_COOKING if(GPhysXCooking != NULL) { GPhysXCooking->release(); GPhysXCooking = NULL; } #endif PxCloseExtensions(); PxCloseVehicleSDK(); if(GPhysXSDK != NULL) { GPhysXSDK->release(); GPhysXSDK = NULL; } // @todo delete FPhysXAllocator // @todo delete FPhysXOutputStream UnloadPhysXModules(); #endif }