本文整理汇总了C++中NxScene::releaseActor方法的典型用法代码示例。如果您正苦于以下问题:C++ NxScene::releaseActor方法的具体用法?C++ NxScene::releaseActor怎么用?C++ NxScene::releaseActor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NxScene
的用法示例。
在下文中一共展示了NxScene::releaseActor方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
plPXPhysical::~plPXPhysical()
{
SpamMsg(plSimulationMgr::Log("Destroying physical %s", GetKeyName().c_str()));
if (fActor)
{
// Grab any mesh we may have (they need to be released manually)
NxConvexMesh* convexMesh = nil;
NxTriangleMesh* triMesh = nil;
NxShape* shape = fActor->getShapes()[0];
if (NxConvexShape* convexShape = shape->isConvexMesh())
convexMesh = &convexShape->getConvexMesh();
else if (NxTriangleMeshShape* trimeshShape = shape->isTriangleMesh())
triMesh = &trimeshShape->getTriangleMesh();
if (!fActor->isDynamic())
plPXPhysicalControllerCore::RebuildCache();
if (fActor->isDynamic() && fActor->readBodyFlag(NX_BF_KINEMATIC))
{
if (fGroup == plSimDefs::kGroupDynamic)
fNumberAnimatedPhysicals--;
else
fNumberAnimatedActivators--;
}
// Release the actor
NxScene* scene = plSimulationMgr::GetInstance()->GetScene(fWorldKey);
scene->releaseActor(*fActor);
fActor = nil;
// Now that the actor is freed, release the mesh
if (convexMesh)
plSimulationMgr::GetInstance()->GetSDK()->releaseConvexMesh(*convexMesh);
if (triMesh)
plSimulationMgr::GetInstance()->GetSDK()->releaseTriangleMesh(*triMesh);
// Release the scene, so it can be cleaned up if no one else is using it
plSimulationMgr::GetInstance()->ReleaseScene(fWorldKey);
}
if (fWorldHull)
delete [] fWorldHull;
if (fSaveTriangles)
delete [] fSaveTriangles;
delete fProxyGen;
// remove sdl modifier
plSceneObject* sceneObj = plSceneObject::ConvertNoRef(fObjectKey->ObjectIsLoaded());
if (sceneObj && fSDLMod)
{
sceneObj->RemoveModifier(fSDLMod);
}
delete fSDLMod;
}
示例2: removeFluidContainmentSphere
void removeFluidContainmentSphere()
{
assert(scene->isWritable());
if(physicslib_fluid_containment_sphere_actor != NULL)
{
if(scene && physicslib_fluid_containment_sphere_actor)
{
assert(scene->isWritable());
scene->releaseActor(*physicslib_fluid_containment_sphere_actor);
}
physicslib_fluid_containment_sphere_actor = NULL;
physicslib_fluid_containment_sphere_shape = NULL;
}
}
示例3: IDeleteController
void plPXPhysicalControllerCore::IDeleteController()
{
if (fController)
{
gControllerMgr.releaseController(*fController);
fController = nil;
if (fKinematicActor)
{
NxScene* scene = plSimulationMgr::GetInstance()->GetScene(fWorldKey);
scene->releaseActor(*fKinematicActor);
fKinematicActor = nil;
}
plSimulationMgr::GetInstance()->ReleaseScene(fWorldKey);
}
}
示例4:
~Data()
{
removeFluidContainmentSphere();
#ifdef PROJECT_CLAW_PROTO
unitMaterial = NULL;
#endif
if(physicslib_fluid_containment_actor != NULL)
{
if(scene && physicslib_fluid_containment_actor)
{
assert(scene->isWritable());
scene->releaseActor(*physicslib_fluid_containment_actor);
}
physicslib_fluid_containment_actor = NULL;
physicslib_fluid_containment_shape = NULL;
}
if(sdk && scene)
{
#ifndef NDEBUG
int actors = scene->getNbActors();
assert(actors == 1 || actors == 2);
#ifndef NX_DISABLE_FLUIDS
int fluids = scene->getNbFluids();
assert(fluids == 0);
#endif
#endif
scene->shutdownWorkerThreads();
sdk->releaseScene(*scene);
}
if(sdk)
sdk->release();
}
示例5: Destroy
CVoid CScene::Destroy()
{
NxScene* tempScene = gPhysXscene/*gPhysicsSDK->getScene(i)*/;
if(tempScene && !g_clickedNew && !g_clickedOpen)
{
for( CUInt i = 0; i < m_instanceGeometries.size(); i++ )
{
CInstanceGeometry* m_instanceGeo = m_instanceGeometries[i];
if( tempScene )
{
for( CUInt j = 0; j < tempScene->getNbActors(); j++ )
{
CChar actorName[MAX_NAME_SIZE];
if( !tempScene->getActors()[j]->getName() ) continue;
Cpy( actorName, tempScene->getActors()[j]->getName() );
if( !Cmp(m_instanceGeo->m_physXName, "\n" ) && Cmp( actorName, m_instanceGeo->m_physXName ) )
{
for(CInt nItem =0 ; nItem < ex_pVandaEngine1Dlg->m_listBoxPhysXElements.GetItemCount(); nItem++)
{
CString strText = ex_pVandaEngine1Dlg->m_listBoxPhysXElements.GetItemText(nItem, 0);
char charPtr[MAX_NAME_SIZE];
sprintf(charPtr, "%s", strText);
if(Cmp( m_instanceGeo->m_physXName, charPtr ) )
{
ex_pVandaEngine1Dlg->m_listBoxPhysXElements.DeleteItem(nItem);
ex_pVandaEngine1Dlg->SortPhysXList();
}
}
tempScene->releaseActor( *tempScene->getActors()[j] );
g_multipleView->m_nx->gControllers->reportSceneChanged();
m_instanceGeo->m_hasPhysX = CFalse;
Cpy( m_instanceGeo->m_physXName, "\n" );
}
}
}
}
}
//while(!m_cfxMaterials.empty())
//{
//std::map<std::string, cfxMaterial*>::iterator iter = m_cfxMaterials.begin();
//CDelete(iter->second);
//m_cfxMaterials.erase(iter);
//}
//m_cfxEffects.clear();
//while(!m_cfxEffects.empty())
//{
//std::map<std::string, cfxEffect*>::iterator iter = m_cfxEffects.begin();
//CDelete(iter->second);
//m_cfxEffects.erase(iter);
//}
//m_cfxEffects.clear();
//delete all the geometries
m_textureList.clear(); //save functions
m_prefabList.clear(); //save functions
if (g_editorMode == eMODE_PREFAB)
{
while (!m_geometries.empty())
{
CDelete(m_geometries[0]);
m_geometries.erase(m_geometries.begin());
}
m_geometries.clear();
}
m_instanceGeometries.clear();
//m_instanceControllers.clear();
while(!m_lightInstances.empty())
{
CDelete(m_lightInstances[0]);
m_lightInstances.erase(m_lightInstances.begin());
}
while(!m_lights.empty())
{
CDelete( m_lights[0] );
m_lights.erase(m_lights.begin());
}
while(!m_cameraInstances.empty())
{
for( CUInt size = 0; size < g_cameraInstances.size(); size++ )
{
if( Cmp( m_cameraInstances[0]->m_abstractCamera->GetName(), g_cameraInstances[size]->m_abstractCamera->GetName() ) )
{
if( g_render.GetActiveInstanceCamera() == g_cameraInstances[size] )
{
if (g_multipleView && g_render.GetDefaultInstanceCamera())
{
g_render.SetActiveInstanceCamera(g_render.GetDefaultInstanceCamera());
g_currentCameraType = eCAMERA_DEFAULT_FREE;
g_multipleView->m_lockInput = CFalse;
}
else
{
g_render.SetActiveInstanceCamera(NULL);
}
}
g_cameraInstances.erase( g_cameraInstances.begin() + size );
//.........这里部分代码省略.........
示例6: Destroy
CVoid CScene::Destroy()
{
NxScene* tempScene = gPhysXscene/*gPhysicsSDK->getScene(i)*/;
if(tempScene && !g_clickedNew && !g_clickedOpen)
{
for( CUInt i = 0; i < m_instanceGeometries.size(); i++ )
{
CInstanceGeometry* m_instanceGeo = m_instanceGeometries[i];
if( tempScene )
{
for( CUInt j = 0; j < tempScene->getNbActors(); j++ )
{
CChar actorName[MAX_URI_SIZE];
if( !tempScene->getActors()[j]->getName() ) continue;
Cpy( actorName, tempScene->getActors()[j]->getName() );
if( !Cmp(m_instanceGeo->m_physXName, "\n" ) && Cmp( actorName, m_instanceGeo->m_physXName ) )
{
tempScene->releaseActor( *tempScene->getActors()[j] );
g_nx->gControllers->reportSceneChanged();
m_instanceGeo->m_hasPhysX = CFalse;
Cpy( m_instanceGeo->m_physXName, "\n" );
}
}
}
}
}
//while(!m_cfxMaterials.empty())
//{
// std::map<std::string, cfxMaterial*>::iterator iter = m_cfxMaterials.begin();
// CDelete(iter->second);
// m_cfxMaterials.erase(iter);
//}
//m_cfxEffects.clear();
//while(!m_cfxEffects.empty())
//{
// std::map<std::string, cfxEffect*>::iterator iter = m_cfxEffects.begin();
// CDelete(iter->second);
// m_cfxEffects.erase(iter);
//}
//m_cfxEffects.clear();
//delete all the geometries
//while(!m_geometries.empty())
//{
// CDelete( m_geometries[0] );
// m_geometries.erase( m_geometries.begin() );
//}
//m_geometries.clear();
m_instanceGeometries.clear();
while(!m_lightInstances.empty())
{
CDelete(m_lightInstances[0]);
m_lightInstances.erase(m_lightInstances.begin());
}
while(!m_lights.empty())
{
CDelete( m_lights[0] );
m_lights.erase(m_lights.begin());
}
while(!m_cameraInstances.empty())
{
for( CUInt size = 0; size < g_cameraInstances.size(); size++ )
{
if( Cmp( m_cameraInstances[0]->m_abstractCamera->GetName(), g_cameraInstances[size]->m_abstractCamera->GetName() ) )
{
if( g_render.GetActiveInstanceCamera() == g_cameraInstances[size] )
{
if (g_main && g_render.GetDefaultInstanceCamera())
{
g_render.SetActiveInstanceCamera(g_render.GetDefaultInstanceCamera());
g_currentCameraType = eCAMERA_DEFAULT_FREE;
g_main->m_lockInput = CFalse;
}
else
{
g_render.SetActiveInstanceCamera(NULL);
}
}
g_cameraInstances.erase( g_cameraInstances.begin() + size );
}
}
CDelete(m_cameraInstances[0]);
m_cameraInstances.erase(m_cameraInstances.begin());
}
while(!m_cameras.empty())
{
CDelete( m_cameras[0] );
m_cameras.erase(m_cameras.begin());
}
while(!m_controllers.empty())
{
CDelete( m_controllers[0] );
m_controllers.erase(m_controllers.begin());
}
//Delete all the nodes
CDelete( m_sceneRoot );
m_nodes.clear();
//.........这里部分代码省略.........