I’m having some difficulty detecting collisions between a Kinematic Box and a Static Triangle Mesh using PhysX 3.3.1. I have enabled the eENABLE_KINEMATIC_STATIC_PAIRS flag (before creating the scene), and implemented a simple filter shader which results in PxSimulationEventCallback::onContact() getting called. Once inside the callback I can see the actors involved, and the eNOTIFY_TOUCH_FOUND flag is raised, but my problem is that I get an empty contact stream :(
To further investigate, I added a contact modification callback; at this point multiple contact points are present, so I’m guessing something is happening when the contact is “solved”, resulting in the empty stream I see later in the pipeline?
I further simplified the problem by using a simple triangle mesh consisting of two co-planar triangles, as the mesh I was previously using contained a few thousand triangles. In this case, I do get contact points when the kinematic object is moved through the mesh.
Does anybody have any idea why this might be happening? Are there special considerations that need to be made when dealing with complex triangle meshes? Any suggestions would be awesome, as I’m running out of avenues of investigation… :(
For reference, here’s the filter shader:
// Only care about collisions involving kinematic actors. if(!(physx::PxFilterObjectIsKinematic(attributes0) || physx::PxFilterObjectIsKinematic(attributes1))) return physx::PxFilterFlag::eKILL; pairFlags|=physx::PxPairFlag::eSOLVE_CONTACT; pairFlags|=physx::PxPairFlag::eDETECT_DISCRETE_CONTACT; pairFlags|=physx::PxPairFlag::eNOTIFY_CONTACT_POINTS; pairFlags|=physx::PxPairFlag::eNOTIFY_TOUCH_FOUND; return physx::PxFilterFlag::eDEFAULT;