Manual Collision Response
Posted: Fri Dec 04, 2015 5:00 pm
Hi there,
I have BEPU integrated into an engine I'm writing, and have recently knocked up a little practice project to test things out.
Is it possible to use BEPU only for collision detection, but provide the response myself? I had assumed this would be trivial, but I'm either confused or it's going to be a little more difficult than thought.
I set up some entities and a static mesh, and detection is fine - my problem comes when I try to use the collision information to formulate a response. I detect collisions, and use the collision location, normal and penetration depth to formulate a response, then I amend the world transform of the physics entity manually to resolve the collision.
What I’d expected was that, on the next frame, no more collision. But what I’m seeing is that the collisions are present (I am polling the collision info on the entity of interest) on the following frames that don’t take account of my manual transformation of the physics entity. I am updating the physics system on every frame.
Can someone help me understand what’s happening here? Is the system simply not designed to be used this way? Must I rely on Bepu’s own collision response if I want response behaviour? Or am I missing some other manual step, say a way to tell Bepu that I’ve handled a particular collision, or to notify it to recalculate collision pairs for a particular entity?
Thanks
I have BEPU integrated into an engine I'm writing, and have recently knocked up a little practice project to test things out.
Is it possible to use BEPU only for collision detection, but provide the response myself? I had assumed this would be trivial, but I'm either confused or it's going to be a little more difficult than thought.
I set up some entities and a static mesh, and detection is fine - my problem comes when I try to use the collision information to formulate a response. I detect collisions, and use the collision location, normal and penetration depth to formulate a response, then I amend the world transform of the physics entity manually to resolve the collision.
What I’d expected was that, on the next frame, no more collision. But what I’m seeing is that the collisions are present (I am polling the collision info on the entity of interest) on the following frames that don’t take account of my manual transformation of the physics entity. I am updating the physics system on every frame.
Can someone help me understand what’s happening here? Is the system simply not designed to be used this way? Must I rely on Bepu’s own collision response if I want response behaviour? Or am I missing some other manual step, say a way to tell Bepu that I’ve handled a particular collision, or to notify it to recalculate collision pairs for a particular entity?
Thanks