Hi folks,
I'm trying to use sensors to help me trigger events when a high speed body enters an area. I only wish to trigger my event when the body is sufficiently inside the sensor region so have found myself having to use the
Persist()
callback in the contact listener rather than the
Add()
function. This works fine for bodies moving with a reasonable speed, but high speed bodies are seemingly able to be in the sensor perhaps only once for the Add() but never persisting. I'm assuming the continuous collision detection only happens when the geometry is not a sensor?
To try and fix this i'm able to enclose the sensor inside a set of normal static bodies to try and catch any high speed bodies from passing through in one frame, frustratingly due to restitution being evaluated as the max of the two colliding bodies restitutions i'm unable to let these bodies absorb most if not all the high speed bodies velocity and then let them exist inside the sensor ready to trigger my event.
What are the options for fixing this? Is there an option i can turn on that will let the sensors benefit from the continuous collision detection so that they don't miss a high speed body passing through it. Or can i possibly enable some option so that my enclosing shapes can enforce a very very low restitution to absorb all the high speed bodies velocity as i described.
Cheers
Jim
I'm trying to use sensors to help me trigger events when a high speed body enters an area. I only wish to trigger my event when the body is sufficiently inside the sensor region so have found myself having to use the
Persist()
callback in the contact listener rather than the
Add()
function. This works fine for bodies moving with a reasonable speed, but high speed bodies are seemingly able to be in the sensor perhaps only once for the Add() but never persisting. I'm assuming the continuous collision detection only happens when the geometry is not a sensor?
To try and fix this i'm able to enclose the sensor inside a set of normal static bodies to try and catch any high speed bodies from passing through in one frame, frustratingly due to restitution being evaluated as the max of the two colliding bodies restitutions i'm unable to let these bodies absorb most if not all the high speed bodies velocity and then let them exist inside the sensor ready to trigger my event.
What are the options for fixing this? Is there an option i can turn on that will let the sensors benefit from the continuous collision detection so that they don't miss a high speed body passing through it. Or can i possibly enable some option so that my enclosing shapes can enforce a very very low restitution to absorb all the high speed bodies velocity as i described.
Cheers
Jim