Is it possible to modify the impulse vector applied to two bodies during the gContactAddedCallback? Say I have object A running into object B at a given velocity, I want to double the force applied to B and halve the force applied to A.
Obviously I can increase the mass of A, but that would involve tweaking a whole bunch of parameters to get it to behave the same way on the game side of things, and I'd rather not go down that path if it can be avoided.
Alternatively I could reduce the mass of B to make it lighter, but I don't want to change the result of any other objects colliding with B.
I've tried messing with the parameters of btManifoldPoint inside the contact added callback, but haven't been able to get the desired result.
Any ideas?
Thanks,
s.
Edit: so diving through the code some more, it appears that the callback occurs during the code that collects all the collision pairs to be processed at a later date. Is that correct? It would certainly explain why you can only modify the restitution and friction in there.
Altering the collision response at impact time.
-
- Posts: 3
- Joined: Mon Mar 01, 2010 12:35 am
-
- Posts: 8
- Joined: Mon Jan 18, 2010 1:34 pm
- Location: Sydney, Australia
Re: Altering the collision response at impact time.
Have you managed to achieve this yet? I'm also trying to manipulate the collision response of two objects, but in my case I'm trying to scale it down.
Does anybody out there have a solution, or ideas?
CheerZ,
Van Aarde.
Does anybody out there have a solution, or ideas?
CheerZ,
Van Aarde.