Reputation: 711
Two dynamic bodies collide, and I want to remove one (a bullet) when it collides with the other. I do not want the bullet to push the other body at all. It should be removed before the physics interaction. Where should I place the remove code?
Upvotes: 0
Views: 67
Reputation: 123640
You can make it a sensor:
A fixture can be made into a 'sensor' by setting the isSensor member of the fixture definition to true when you create it, or by calling SetSensor(bool) on the fixture after it has been created if you need to change it during the simulation. Sensors behave as if their maskBits is set to zero - they never collide with anything. But they do generate BeginContact/EndContact callbacks to let us know when they start or stop overlapping another fixture.
You will then get all the collision detection, but none of the physics recoil.
Upvotes: 1