本文整理汇总了C++中NxShape::setName方法的典型用法代码示例。如果您正苦于以下问题:C++ NxShape::setName方法的具体用法?C++ NxShape::setName怎么用?C++ NxShape::setName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NxShape
的用法示例。
在下文中一共展示了NxShape::setName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
}
}
if ( !isDeformable)
{
actorDesc.globalPose.t = pos;
actorDesc.globalPose.M = rot;
}
//----------------------------------------------------------------
//
// Create the final NxActor
//
if (oDescr.flags & BF_Moving)
actorDesc.body = &bodyDesc;
NxActor *actor = world->getScene()->createActor(actorDesc);
if (!actor)
{
xLogger::xLog(ELOGERROR,E_LI_AGEIA,"Couldn't create actor");
delete result;
return NULL;
}
//----------------------------------------------------------------
//
//
//
result->setActor(actor);
actor->setName(referenceObject->GetName());
result->SetVT3DObject(referenceObject);
actor->userData= result;
//////////////////////////////////////////////////////////////////////////
//Deformable :
if (isDeformable && cloth)
{
pDeformableSettings dSettings;
dSettings.ImpulsThresold = 50.0f;
dSettings.PenetrationDepth= 0.1f ;
dSettings.MaxDeform = 2.0f;
CKParameterOut *poutDS = referenceObject->GetAttributeParameter(GetPMan()->att_deformable);
if (poutDS)
{
pFactory::Instance()->copyTo(dSettings,poutDS);
}
cloth->attachToCore(referenceObject,dSettings.ImpulsThresold,dSettings.PenetrationDepth,dSettings.MaxDeform);
result->setCloth(cloth);
}
//////////////////////////////////////////////////////////////////////////
//
// Extra settings :
//
if (result->getFlags() & BF_Moving)
{
VxVector massOffsetOut;referenceObject->Transform(&massOffsetOut,&oDescr.massOffsetLinear);
示例2: createBody
//.........这里部分代码省略.........
NxMaterialDesc *entMat = createMaterialFromEntity(referenceObject);
material = world->getScene()->createMaterial(entMatNull);
material->loadFromDesc(*entMat);
result->setMaterial(material);
}else{
if (world->getDefaultMaterial())
{
result->setMaterial(world->getDefaultMaterial());
}
}
//////////////////////////////////////////////////////////////////////////
NxBoxShapeDesc boxShape;
if (creationFlags & E_OFC_DIMENSION )
{
boxShape.dimensions = pMath::getFrom(box_s)*0.5f;
}
boxShape.density = descr->density;
boxShape.materialIndex = result->getMaterial()->getMaterialIndex();
if (result->getSkinWidth()!=-1.0f)
boxShape.skinWidth = result->getSkinWidth();
actorDesc.shapes.pushBack(&boxShape);
//////////////////////////////////////////////////////////////////////////
//dynamic object ?
if (result->getFlags() & BF_Moving){
actorDesc.body = &bodyDesc;
}
else
actorDesc.body = NULL;
//////////////////////////////////////////////////////////////////////////
//set transformations
actorDesc.density = descr->density;
if (creationFlags & E_OFC_POSITION)
{
actorDesc.globalPose.t = pos;
}
if (creationFlags & E_OFC_POSITION)
{
actorDesc.globalPose.M = rot;
}
//////////////////////////////////////////////////////////////////////////
//create the actor
int v = actorDesc.isValid();
NxActor *actor = world->getScene()->createActor(actorDesc);
if (!actor)
{
xLogger::xLog(ELOGERROR,E_LI_AGEIA,"Couldn't create actor");
delete result;
return NULL;
}
//////////////////////////////////////////////////////////////////////////
//set additional settings :
result->setActor(actor);
actor->setName(referenceObject->GetName());
actor->userData= result;
if (result->getFlags() & BF_Moving)
{
VxVector massOffsetOut;referenceObject->Transform(&massOffsetOut,&result->getMassOffset());
actor->setCMassOffsetGlobalPosition(pMath::getFrom(massOffsetOut));
}
if (result->getFlags() & BF_Kinematic)
{
actor->raiseBodyFlag(NX_BF_KINEMATIC);
}
result->enableCollision((result->getFlags() & BF_Collision));
if (result->getFlags() & BF_Moving)
{
if (!(result->getFlags() & BF_Gravity))
{
actor->raiseBodyFlag(NX_BF_DISABLE_GRAVITY);
}
}
NxShape *shape = result->getShapeByIndex();
if (shape)
{
pSubMeshInfo *sInfo = new pSubMeshInfo();
sInfo->entID = referenceObject->GetID();
sInfo->refObject = (CKBeObject*)referenceObject;
shape->userData = (void*)sInfo;
result->setMainShape(shape);
shape->setName(referenceObject->GetName());
}
}
return result;
}