本文整理汇总了C++中IStatObj::IsDefaultObject方法的典型用法代码示例。如果您正苦于以下问题:C++ IStatObj::IsDefaultObject方法的具体用法?C++ IStatObj::IsDefaultObject怎么用?C++ IStatObj::IsDefaultObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IStatObj
的用法示例。
在下文中一共展示了IStatObj::IsDefaultObject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RegisterExplosionCrack
int CScriptBind_Physics::RegisterExplosionCrack(IFunctionHandler *pH,const char *sGeometryFile,int nIdMaterial )
{
IStatObj *pObj = gEnv->p3DEngine->LoadStatObj( sGeometryFile,"#ForceBreakable",NULL,false);
if (!pObj || pObj->IsDefaultObject())
{
ScriptWarning( "<RegisterExplosionCrack> Object file %s not found",sGeometryFile );
return pH->EndFunction();
}
pObj->AddRef();
Vec3 vtx[3] = { pObj->GetHelperPos("1"),pObj->GetHelperPos("2"),pObj->GetHelperPos("3") };
//@TODO: restore it.
m_pPhysicalWorld->GetGeomManager()->RegisterCrack( pObj->GetPhysGeom()->pGeom,vtx,0 );
return pH->EndFunction();
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:14,代码来源:ScriptBind_Physics.cpp
示例2: RegisterExplosionShape
int CScriptBind_Physics::RegisterExplosionShape(IFunctionHandler *pH,const char *sGeometryFile,float fSize,int nIdMaterial,float fProbability,
const char *sSplintersFile, float fSplintersOffset, const char *sSplintersCloudEffect)
{
//////////////////////////////////////////////////////////////////////////
// Remove all this.
//////////////////////////////////////////////////////////////////////////
IStatObj *pObj = gEnv->p3DEngine->LoadStatObj( sGeometryFile,"#ForceBreakable",NULL,false );
if (!pObj || pObj->IsDefaultObject())
{
ScriptWarning( "<RegisterExplosionShape> Object file %s not found",sGeometryFile );
return pH->EndFunction();
}
pObj->AddRef();
pObj->GetIndexedMesh(true); // prepare idxMesh now
if(sSplintersFile && *sSplintersFile!=0) // if sSplintersFile was specified
{
IStatObj *pSplinters = gEnv->p3DEngine->LoadStatObj(sSplintersFile,NULL,NULL,false);
if (pSplinters)
{
pObj->SetSubObjectCount(pObj->GetSubObjectCount()+1);
IStatObj::SSubObject *pSubObj = pObj->GetSubObject(pObj->GetSubObjectCount()-1);
pSubObj->nType = STATIC_SUB_OBJECT_MESH;
pSubObj->bHidden = true;
pSubObj->name = "splinters";
(pSubObj->pStatObj = pSplinters)->AddRef();
pSubObj->helperSize.x = fSplintersOffset;
nIdMaterial |= 1<<16;
if (*sSplintersCloudEffect)
{
pSplinters->SetSubObjectCount(pSplinters->GetSubObjectCount()+1);
pSplinters->SetFlags(pSplinters->GetFlags() & ~STATIC_OBJECT_COMPOUND);
pSubObj = pSplinters->GetSubObject(pSplinters->GetSubObjectCount()-1);
pSubObj->nType = STATIC_SUB_OBJECT_DUMMY;
pSubObj->bHidden = true;
pSubObj->name = "splinters_cloud";
pSubObj->properties = sSplintersCloudEffect;
}
}
}
phys_geometry *pPhysGeom = pObj->GetPhysGeom();
if (pPhysGeom)
{
m_pPhysicalWorld->AddExplosionShape( pPhysGeom->pGeom,fSize,nIdMaterial,fProbability );
}
return pH->EndFunction();
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:49,代码来源:ScriptBind_Physics.cpp