Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PhysX 4.1 Character Controller hit report against triggers #212

Closed
ahanganu opened this issue Oct 29, 2019 · 3 comments
Closed

PhysX 4.1 Character Controller hit report against triggers #212

ahanganu opened this issue Oct 29, 2019 · 3 comments

Comments

@ahanganu
Copy link

Hello,

I have a small question I can't seem to find a lot of information on.

Is it normal for character controllers to not report collisions with trigger shapes?

To give a bit more context now. I've created a simple character controller, and simple static sphere shape. If I leave the shape with PxShapeFlag::eSIMULATION_SHAPE = true and PxShapeFlag::eTRIGGER_SHAPE = false I get the
onShapeHit(const PxControllerShapeHit& hit) callback with it. If I just swap the shape flags and make the sphere a trigger I no longer get any callback.

I've seen a solution of creating such "character only triggers" is to use obstacles but I keep wondering if this is the normal behavior or is it I am doing something wrong?

Any tips would be appreciated.

@PierreTerdiman
Copy link

I think it's normal, yes. See these lines:

https://github.com/NVIDIAGameWorks/PhysX/blob/4.1/physx/source/physxcharacterkinematic/src/CctCharacterControllerCallbacks.cpp#L978

https://github.com/NVIDIAGameWorks/PhysX/blob/4.1/physx/source/physxcharacterkinematic/src/CctCharacterController.cpp#L1983

For me a trigger shape is like an intangible "sensor" zone so I don't understand why you would want to collide with them, but I suppose you can probably re-enable contacts with triggers by commenting out these lines.

@ahanganu
Copy link
Author

Thank you for pointing that out.

I guess what I expected is not to have collisions (in term of reactivity, contact response) with them but get the overlap touch callback to use them as triggers for character controllers.

We'll definitely give your suggestion a try as I am currently having triggers which can only be activated by character controllers. Now I'm using normal static actors and just removing them when I get the collision contact but it's not ideal performance-wise.

@PierreTerdiman
Copy link

The character controllers create a regular PxActor under the hood, that should get reported by triggers. It's only the CCT module that disables collisions with trigger obstacles, but once the CCT is in a trigger zone its PxActor/PxShape should get reported by the trigger - I think (haven't double-checked).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants