Fix physics trigger layer mask matching trigger events (filter body types)
This commit is contained in:
@@ -428,11 +428,17 @@ PxFilterFlags FilterShader(
|
||||
PxFilterObjectAttributes attributes1, PxFilterData filterData1,
|
||||
PxPairFlags& pairFlags, const void* constantBlock, PxU32 constantBlockSize)
|
||||
{
|
||||
const bool maskTest = (filterData0.word0 & filterData1.word1) && (filterData1.word0 & filterData0.word1);
|
||||
|
||||
// Let triggers through
|
||||
if (PxFilterObjectIsTrigger(attributes0) || PxFilterObjectIsTrigger(attributes1))
|
||||
{
|
||||
if (maskTest)
|
||||
{
|
||||
// Notify trigger if masks specify it
|
||||
pairFlags |= PxPairFlag::eNOTIFY_TOUCH_FOUND;
|
||||
pairFlags |= PxPairFlag::eNOTIFY_TOUCH_LOST;
|
||||
}
|
||||
pairFlags |= PxPairFlag::eDETECT_DISCRETE_CONTACT;
|
||||
return PxFilterFlag::eDEFAULT;
|
||||
}
|
||||
@@ -448,7 +454,7 @@ PxFilterFlags FilterShader(
|
||||
}
|
||||
|
||||
// Trigger the contact callback for pairs (A,B) where the filtermask of A contains the ID of B and vice versa
|
||||
if ((filterData0.word0 & filterData1.word1) && (filterData1.word0 & filterData0.word1))
|
||||
if (maskTest)
|
||||
{
|
||||
pairFlags |= PxPairFlag::eSOLVE_CONTACT;
|
||||
pairFlags |= PxPairFlag::eDETECT_DISCRETE_CONTACT;
|
||||
|
||||
Reference in New Issue
Block a user