本文整理汇总了C++中IPhysicalEntity::RemoveGeometry方法的典型用法代码示例。如果您正苦于以下问题:C++ IPhysicalEntity::RemoveGeometry方法的具体用法?C++ IPhysicalEntity::RemoveGeometry怎么用?C++ IPhysicalEntity::RemoveGeometry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPhysicalEntity
的用法示例。
在下文中一共展示了IPhysicalEntity::RemoveGeometry方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PhysicalizeCanvas
//------------------------------------------------------------------------
void CParachute::PhysicalizeCanvas(bool enable)
{
IEntity* pCanvas = m_pEntitySystem->GetEntity(m_canvasId);
if (!pCanvas)
return;
if (enable)
{
SEntityPhysicalizeParams params;
params.type = PE_RIGID;
params.mass = 0;
pCanvas->Physicalize(params);
IPhysicalEntity* pPhysics = pCanvas->GetPhysics();
if (!pPhysics)
return;
// add parachute physics geometry
m_paraPhysIds.clear();
m_paraPhysIds.resize(8);
for(int iCel=0; iCel<7; iCel++)
{
SWing *pCel = &m_aCels[iCel];
m_paraPhysIds.push_back( AddCel(pPhysics, iCel+1, pCel) );
pCel->fSurface = pCel->vSize.x * pCel->vSize.y;
pCel->pLiftPointsMap = &m_LiftPointsMap;
pCel->pDragPointsMap = &m_DragPointsMap;
}
Vec3 minExt(0.0f,0.0f,0.95f), maxExt(0.5f,0.3f,1.9f);
m_paraPhysIds.push_back( AddBox(&minExt, &maxExt, 70.0f) );
pe_params_part pp;
pp.partid = m_paraPhysIds.back();
pp.flagsAND = ~(geom_collides);
pPhysics->SetParams(&pp);
pe_status_dynamics stats;
pPhysics->GetStatus(&stats);
CryLog("Parachute mass: %f", stats.mass);
}
else
{
IPhysicalEntity* pPhysics = pCanvas->GetPhysics();
if (pPhysics)
{
// remove parachute geometry
for (std::vector<int>::iterator it = m_paraPhysIds.begin(); it != m_paraPhysIds.end(); ++it)
{
pPhysics->RemoveGeometry(*it);
}
}
m_paraPhysIds.clear();
}
}