I need to make a NULL like rigid body in PhysX 3.2. A non-colliding one - only as an anchor point. Is there anyway to do it? I just need it to resolve some joints combination. Thanks in advance
Asked
Active
Viewed 432 times
1 Answers
2
First create a filter for pairs:
PxFilterFlags Simplefilter( PxFilterObjectAttributes attributes0,
PxFilterData filterData0,
PxFilterObjectAttributes attributes1,
PxFilterData filterData1,
PxPairFlags& pairFlags,
const void* constantBlock,
PxU32 constantBlockSize )
{
if(filterData0.word0 = -99) //-99 is random
{
return PxFilterFlag::eKILL;
}
pairFlags = PxPairFlag::eRESOLVE_CONTACTS;
pairFlags |= PxPairFlag::eCONTACT_DEFAULT;
pairFlags |= PxPairFlag::eNOTIFY_TOUCH_FOUND;
pairFlags |= PxPairFlag::eNOTIFY_CONTACT_POINTS;
return PxFilterFlag::eDEFAULT;
}
Then, while creating the PxScene add this line:
PxSceneDesc sceneDesc(gPhysicsSDK->getTolerancesScale());
...
sceneDesc.filterShader = Simplefilter;
gScene = gPhysicsSDK->createScene(sceneDesc);
Finally, make the shapes of your actor (gSphere in my example) not collidible by:
unsigned int nbShapes = gSphere->getNbShapes();
PxShape** shapes = new PxShape*[nbShapes];
if(nbShapes > 0)
{
gSphere->getShapes(shapes,nbShapes,0);
for(unsigned int j = 0; j< nbShapes; j++)
{
PxFilterData data;
data.word0 = -99; // the same number above
shapes[j]->setSimulationFilterData(data);
}
}

Semih Kekül
- 399
- 3
- 14