本文整理汇总了C++中NxShape::setGroup方法的典型用法代码示例。如果您正苦于以下问题:C++ NxShape::setGroup方法的具体用法?C++ NxShape::setGroup怎么用?C++ NxShape::setGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NxShape
的用法示例。
在下文中一共展示了NxShape::setGroup方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ExcludeRegionHack
void plPXPhysical::ExcludeRegionHack(bool cleared)
{
NxShape* shape = fActor->getShapes()[0];
shape->setFlag(NX_TRIGGER_ON_ENTER, !cleared);
shape->setFlag(NX_TRIGGER_ON_LEAVE, !cleared);
fGroup = cleared ? plSimDefs::kGroupExcludeRegion : plSimDefs::kGroupDetector;
shape->setGroup(fGroup);
/*if switching a static need to inform the controller that it needs to rebuild
the collision cache otherwise will still think that the detector is still static or that
the static is still a detector*/
plPXPhysicalControllerCore::RebuildCache();
}
示例2: ReleaseActorCapsule
void CPhysicsManager::ReleaseActorCapsule (CPhysicActor* actor)
{
assert(actor != NULL);
assert(m_pScene != NULL);
assert(m_pPhysicsSDK != NULL);
NxActor* nxActor = actor->GetPhXActor();
if( nxActor != 0)
{
NxArray<NxCCDSkeleton*> skeletons;
for (NxU32 i = 0; i < nxActor->getNbShapes(); i++)
{
NxShape* shape = nxActor->getShapes()[i];
if (shape->isCapsule())
shape->setGroup(ECG_LAST_GROUP);
}
}
}
示例3: SetCollisionGroup
void CPhysicsActor::SetCollisionGroup( COLLISIONGROUP group )
{
unsigned int numShapes = m_Actor->getNbShapes();
NxShape*const* shapes = m_Actor->getShapes();
NxShape* shape;
if( group < 0 || group >= 32 )
{
m_ToolBox->Log( LOGERROR, _T("CPhysicsObject::SetCollisionGroup() Invalid collision group! Group must be between 1-31!\n") );
return;
}
while( numShapes-- )
{
shape = shapes[numShapes];
shape->setGroup( group );
}
}
示例4: ICreateController
void plPXPhysicalControllerCore::ICreateController(const hsPoint3& pos)
{
NxScene* scene = plSimulationMgr::GetInstance()->GetScene(fWorldKey);
NxCapsuleControllerDesc desc;
desc.position.x = pos.fX;
desc.position.y = pos.fY;
desc.position.z = pos.fZ;
desc.upDirection = NX_Z;
desc.slopeLimit = kSLOPELIMIT;
desc.skinWidth = kPhysxSkinWidth;
desc.stepOffset = STEP_OFFSET;
desc.callback = &gMyReport;
desc.userData = this;
desc.radius = fRadius;
desc.height = fHeight;
desc.interactionFlag = NXIF_INTERACTION_EXCLUDE;
//desc.interactionFlag = NXIF_INTERACTION_INCLUDE;
fController = (NxCapsuleController*)gControllerMgr.createController(scene, desc);
// Change the avatars shape groups. The avatar doesn't actually use these when
// it's determining collision, but if you're standing still and an object runs
// into you, it'll pass through without this.
NxActor* actor = fController->getActor();
NxShape* shape = actor->getShapes()[0];
shape->setGroup(plSimDefs::kGroupAvatar);
// need to create the non-bouncing object that can be used to trigger things while the avatar is doing behaviors.
NxActorDesc actorDesc;
NxCapsuleShapeDesc capDesc;
capDesc.radius = fRadius;
capDesc.height = fHeight;
capDesc.group = plSimDefs::kGroupAvatar;
actorDesc.shapes.pushBack(&capDesc);
capDesc.materialIndex= plSimulationMgr::GetInstance()->GetMaterialIdx(scene, 0.0,0.0);
actorDesc.globalPose=actor->getGlobalPose();
NxBodyDesc bodyDesc;
bodyDesc.mass = kAvatarMass;
actorDesc.body = &bodyDesc;
bodyDesc.flags = NX_BF_KINEMATIC;
bodyDesc.flags |=NX_BF_DISABLE_GRAVITY ;
actorDesc.name = "AvatarTriggerKinematicGuy";
fSeeking=false;
try
{
fKinematicActor = scene->createActor(actorDesc);
}
catch (...)
{
hsAssert(false, "Actor creation crashed");
}
// set the matrix to be the same as the controller's actor... that should orient it to be the same
//fKinematicActor->setGlobalPose(actor->getGlobalPose());
// the proxy for the debug display
//hsAssert(!fProxyGen, "Already have proxy gen, double read?");
hsColorRGBA physColor;
float opac = 1.0f;
// local avatar is light purple and transparent
physColor.Set(.2f, .1f, .2f, 1.f);
opac = 0.8f;
/*
// the avatar proxy doesn't seem to work... not sure why?
fProxyGen = new plPhysicalProxy(hsColorRGBA().Set(0,0,0,1.f), physColor, opac);
fProxyGen->Init(this);
*/
}