Hi everyone !
I really can’t understand how to define my scenedesc’s filtershader, in order to get a callback when an object collides with another. I tried to follow the official tutorials, but it seems like I can’t convert a PxSimulationFilterShader into a PxFlags (which works in the tutorials)… I get an error when I try to do this : sceneDesc.filterShader = CreateFilterShader;
Here is my code :
PhysX.cpp
physx::PxFilterFlags Physics::CreateFilterShader(
physx::PxFilterObjectAttributes p_attributes0, physx::PxFilterData p_filterData0,
physx::PxFilterObjectAttributes p_attributes1, physx::PxFilterData p_filterData1,
physx::PxPairFlags& p_pairFlags, const void* p_constantBlock, physx::PxU32 constantBlockSize)
{
PX_UNUSED(p_attributes0);
PX_UNUSED(p_attributes1);
PX_UNUSED(p_filterData0);
PX_UNUSED(p_filterData1);
PX_UNUSED(constantBlockSize);
PX_UNUSED(p_constantBlock);
// all initial and persisting reports for everything, with per-point data
p_pairFlags = PxPairFlag::eSOLVE_CONTACT | PxPairFlag::eDETECT_DISCRETE_CONTACT
| PxPairFlag::eNOTIFY_TOUCH_FOUND
| PxPairFlag::eNOTIFY_TOUCH_PERSISTS
| PxPairFlag::eNOTIFY_CONTACT_POINTS;
return PxFilterFlag::eDEFAULT;
};
I don’t even see why it would work though… Can anyone help me ? I’ve been stuck for a week now…