MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / setupFiltering

Method setupFiltering

src/PhysicsSolver.cpp:60–77  ·  view source on GitHub ↗

* Given an actor, set its filter layer group * @param actor the rigid actor to add * @param filterGroup which layer to assign the object (use the enum) * @param filterMask a bitmask of which layers the object should collide with */

Source from the content-addressed store, hash-verified

58 * @param filterMask a bitmask of which layers the object should collide with
59 */
60void PhysicsSolver::setupFiltering(PxRigidActor* actor, PxU32 filterGroup, PxU32 filterMask)
61{
62 PxFilterData filterData;
63 filterData.word0 = filterGroup; // word0 = own ID
64 filterData.word1 = filterMask; // word1 = ID mask to filter pairs that trigger a
65 // contact callback;
66 const PxU32 numShapes = actor->getNbShapes();
67 //PxShape** shapes = (PxShape**)SAMPLE_ALLOC(sizeof(PxShape*) * numShapes);
68 PxShape** shapes = new PxShape*[sizeof(PxShape*) * numShapes];
69 actor->getShapes(shapes, numShapes);
70 for (PxU32 i = 0; i < numShapes; i++)
71 {
72 PxShape* shape = shapes[i];
73 shape->setSimulationFilterData(filterData);
74 }
75 delete[] shapes;
76 //SAMPLE_FREE(shapes);
77}
78
79// Invoked by PhysX after simulation each tick
80void PhysicsSolver::onContact(const physx::PxContactPairHeader& pairHeader, const physx::PxContactPair* pairs, physx::PxU32 nbPairs)

Callers

nothing calls this directly

Calls 3

getNbShapesMethod · 0.45
getShapesMethod · 0.45

Tested by

no test coverage detected