本文整理汇总了C++中NxScene::setUserTriggerReport方法的典型用法代码示例。如果您正苦于以下问题:C++ NxScene::setUserTriggerReport方法的具体用法?C++ NxScene::setUserTriggerReport怎么用?C++ NxScene::setUserTriggerReport使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NxScene
的用法示例。
在下文中一共展示了NxScene::setUserTriggerReport方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetPMan
pWorld*pFactory::createWorld(CK3dEntity* referenceObject, pWorldSettings *worldSettings,pSleepingSettings *sleepSettings)
{
using namespace vtTools::AttributeTools;
using namespace vtTools::ParameterTools;
//////////////////////////////////////////////////////////////////////////
//sanity checks :
if (!referenceObject || !GetPMan() )
{
return NULL;
}
if (!getPhysicSDK())
{
//xLogger::xLog(XL_START,ELOGWARNING,E_LI_MANAGER,"No physic sdk loaded");
return NULL;
}
int worldAtt = GetPMan()->att_world_object;
int surfaceAttribute = GetPMan()->att_surface_props;
//exists ? Delete it !
pWorld *w = GetPMan()->getWorld(referenceObject->GetID());
if (w)
{
GetPMan()->deleteWorld(referenceObject->GetID());
}
//our new world :
pWorld *result = new pWorld(referenceObject);
GetPMan()->getWorlds()->InsertUnique(referenceObject,result);
result->initUserReports();
//////////////////////////////////////////////////////////////////////////
//there is no world settings attribute :
if (!referenceObject->HasAttribute(worldAtt) )
{
referenceObject->SetAttribute(worldAtt);
using namespace vtTools;
VxVector grav = worldSettings->getGravity();
float sWith = worldSettings->getSkinWith();
AttributeTools::SetAttributeValue<VxVector>(referenceObject,worldAtt,0,&grav);
AttributeTools::SetAttributeValue<float>(referenceObject,worldAtt,1,&sWith);
}
if (!worldSettings)
{
worldSettings = pFactory::Instance()->createWorldSettings(XString("Default"),GetPMan()->getDefaultConfig());
}
if (!worldSettings)
{
worldSettings = new pWorldSettings();
}
//////////////////////////////////////////////////////////////////////////
//pSDK Scene creation :
// Create a scene
NxSceneDesc sceneDesc;
sceneDesc.gravity = pMath::getFrom(worldSettings->getGravity());
sceneDesc.upAxis = 1;
sceneDesc.flags |=NX_SF_ENABLE_ACTIVETRANSFORMS;
sceneDesc.userNotify =&myNotify;
sceneDesc.userContactReport = result->contactReport;
NxScene *scene = NULL;
if (getPhysicSDK())
{
scene = getPhysicSDK()->createScene(sceneDesc);
if(scene == NULL)
{
xLogger::xLog(XL_START,ELOGERROR,E_LI_MANAGER,"Couldn't create scene!");
return NULL;
}
}
result->setScene(scene);
scene->setUserContactReport(result->contactReport);
scene->setUserTriggerReport(result->triggerReport);
NxMaterialDesc *materialDescr = NULL;
NxMaterial *material = NULL;
if (referenceObject->HasAttribute(surfaceAttribute))
{
materialDescr = createMaterialFromEntity(referenceObject);
material = result->getScene()->createMaterial(*materialDescr);
material->userData = (void*)GetValueFromParameterStruct<int>(referenceObject->GetAttributeParameter(surfaceAttribute) ,E_MS_XML_TYPE);
}else{
if (getDefaultDocument())
{
//.........这里部分代码省略.........