hello, I’m implementing physx using c++ (not using gameengines like unreal/unity)
currently, I facing problems. EventCallback::OnTrigger() is not being activated.
when I make a dynamic actor and a trigger setted collider overlap,this works:
PxFilterFlags CustomFilterShader::PxDefaultSimulationFilterShader(PxFilterObjectAttributes attributes0, PxFilterData filterData0,
PxFilterObjectAttributes attributes1, PxFilterData filterData1,
PxPairFlags& pairFlags, const void* constantBlock, PxU32 constantBlockSize)
{
if (PxFilterObjectIsTrigger(attributes0) || PxFilterObjectIsTrigger(attributes1))
{
std::cout << "trigger 1" << std::endl;
}
return PxFilterFlag::eCALLBACK;
}
this works, so “trigger1” is being printed.
but this doesn’t work:
PxFilterFlags CustomFilterShader::pairFound(PxU32 pairID, PxFilterObjectAttributes attributes0, PxFilterData filterData0,
const PxActor* a0, const PxShape* s0, PxFilterObjectAttributes attributes1, PxFilterData filterData1,
const PxActor* a1, const PxShape* s1, PxPairFlags& pairFlags)
{
const static PxU32 eNotifyFlags =
PxPairFlag::eDETECT_CCD_CONTACT |
PxPairFlag::eNOTIFY_TOUCH_FOUND |
PxPairFlag::eNOTIFY_TOUCH_LOST |
PxPairFlag::eNOTIFY_CONTACT_POINTS;
const static PxPairFlags eTriggerFlags =
PxPairFlag::eTRIGGER_DEFAULT |
PxPairFlag::eNOTIFY_TOUCH_FOUND |
PxPairFlag::eNOTIFY_TOUCH_LOST;
const static PxPairFlags eContactFlags =
PxPairFlag::eCONTACT_DEFAULT |
(PxPairFlag::Enum)eNotifyFlags |
PxPairFlag::eDETECT_CCD_CONTACT |
PxPairFlag::eNOTIFY_TOUCH_CCD |
PxPairFlag::eNOTIFY_TOUCH_PERSISTS;
if (PxFilterObjectIsTrigger(attributes0) || PxFilterObjectIsTrigger(attributes1))
{
std::cout << "trigger3" << std::endl;
}
else
{
pairFlags = eContactFlags;
}
return PxFilterFlag::eDEFAULT;
}
“trigger3” isn’t printed, so therefore, so does eventcallback::onTrigger().
currently eventcallback::onContact() is working well. so please, anyone who can guess what’s happening, let me know the possible reasons. thank you.