Sign in to follow this  
Alundra

[PhysX 3.3.4] Filter shader issue with trigger

Recommended Posts

Hi,
I have this warning when my character enter in one box trigger :

warning : Trigger pairs do not support PxPairFlag::eNOTIFY_TOUCH_PERSISTS events any longer.

Here my filter shader :

physx::PxFilterFlags ContactReportFilterShader( physx::PxFilterObjectAttributes attributes0, physx::PxFilterData filterData0, physx::PxFilterObjectAttributes attributes1, physx::PxFilterData filterData1, physx::PxPairFlags& pairFlags, const void* constantBlock, physx::PxU32 constantBlockSize )
{
  pairFlags = physx::PxPairFlag::eCONTACT_DEFAULT | physx::PxPairFlag::eTRIGGER_DEFAULT | physx::PxPairFlag::eNOTIFY_TOUCH_PERSISTS | physx::PxPairFlag::eNOTIFY_CONTACT_POINTS;
  return physx::PxFilterFlag::eDEFAULT;
}

Is it possible to have more informations and how correct this filter shader to have it correct ?
Thanks

EDIT:
I modified the filter shader like that :

physx::PxFilterFlags ContactReportFilterShader( physx::PxFilterObjectAttributes attributes0, physx::PxFilterData filterData0, physx::PxFilterObjectAttributes attributes1, physx::PxFilterData filterData1, physx::PxPairFlags& pairFlags, const void* constantBlock, physx::PxU32 constantBlockSize )
{
  if( physx::PxFilterObjectIsTrigger( attributes0 ) || physx::PxFilterObjectIsTrigger( attributes1 ) )
    pairFlags = physx::PxPairFlag::eTRIGGER_DEFAULT;
  else
    pairFlags = physx::PxPairFlag::eCONTACT_DEFAULT | physx::PxPairFlag::eNOTIFY_TOUCH_PERSISTS | physx::PxPairFlag::eNOTIFY_CONTACT_POINTS;
  return physx::PxFilterFlag::eDEFAULT;
}

I don't have a big experience of the filter shader in PhysX, so I would have a confirmation it's the correct way.
The warning is not there anymore and I don't have issue on my current tests.

Edited by Alundra

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this