本文整理汇总了C++中IEntityPhysicalProxy::Physicalize方法的典型用法代码示例。如果您正苦于以下问题:C++ IEntityPhysicalProxy::Physicalize方法的具体用法?C++ IEntityPhysicalProxy::Physicalize怎么用?C++ IEntityPhysicalProxy::Physicalize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEntityPhysicalProxy
的用法示例。
在下文中一共展示了IEntityPhysicalProxy::Physicalize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetAspectProfile
bool CJaw::SetAspectProfile(EEntityAspects aspect, uint8 profile)
{
if(aspect!=eEA_Physics)
return BaseClass::SetAspectProfile(aspect, profile);
bool ok = false;
if(!gEnv->bMultiplayer && gEnv->pSystem->IsSerializingFile() && m_auxSlotUsedBQS)
ok = true;
int slot = (m_auxSlotUsed||ok)?eIGS_ThirdPersonAux:eIGS_ThirdPerson;
if (aspect == eEA_Physics)
{
switch (profile)
{
case eIPhys_PhysicalizedStatic:
{
SEntityPhysicalizeParams params;
params.type = PE_STATIC;
params.nSlot = slot;
GetEntity()->Physicalize(params);
return true;
}
break;
case eIPhys_PhysicalizedRigid:
{
SEntityPhysicalizeParams params;
params.type = PE_RIGID;
params.nSlot = slot;
params.mass = m_sharedparams->params.mass;
pe_params_buoyancy buoyancy;
buoyancy.waterDamping = 1.5;
buoyancy.waterResistance = 1000;
buoyancy.waterDensity = 0;
params.pBuoyancy = &buoyancy;
GetEntity()->Physicalize(params);
IPhysicalEntity *pPhysics = GetEntity()->GetPhysics();
if (pPhysics)
{
pe_action_awake action;
action.bAwake = m_owner.GetId()!=0;
pPhysics->Action(&action);
}
}
return true;
case eIPhys_NotPhysicalized:
{
IEntityPhysicalProxy *pPhysicsProxy = GetPhysicalProxy();
if (pPhysicsProxy)
{
SEntityPhysicalizeParams params;
params.type = PE_NONE;
params.nSlot = slot;
pPhysicsProxy->Physicalize(params);
}
}
return true;
}
}
return false;
}