I can get a list of btCollisionObject pairs that have collided but how do I find a way of getting the force of that collision?
Cheers.
Getting the impulse force from a collision?
- Erwin Coumans
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
- Contact:
Re: Getting the impulse force from a collision?
Each contact points stores the applied impulse (m_appliedImpulse).
You can check how to iterate over contact points (and manifolds) in Bullet/Demos/CollisionInterfaceDemo
Hope this helps,
Erwin
You can check how to iterate over contact points (and manifolds) in Bullet/Demos/CollisionInterfaceDemo
Hope this helps,
Erwin
Re: Getting the impulse force from a collision?
Thanks Erwin,
Cheers, that worked.
However what's the best way to get the resultant collision normal?
I suspect I have to iterate over the points using getPositionWorldOnA and getPositionWorldOnB however I'm not sure.
Cheers, that worked.
However what's the best way to get the resultant collision normal?
I suspect I have to iterate over the points using getPositionWorldOnA and getPositionWorldOnB however I'm not sure.
Re: Getting the impulse force from a collision?
hi, is getAppliedImpulse still working?
I used this method in my callbacks, but found this always returned 0.
I googled, and there's a saying in 2009 that this method is not used any more.
And I lookuped btPersistentManifold and found the impulse variables still exists.
So, I'm confused.
And my scenario using this method is to get the force (or impulse) between feet and ground when walking.
I used this method in my callbacks, but found this always returned 0.
I googled, and there's a saying in 2009 that this method is not used any more.
And I lookuped btPersistentManifold and found the impulse variables still exists.
So, I'm confused.
And my scenario using this method is to get the force (or impulse) between feet and ground when walking.
Re: Getting the impulse force from a collision?
Yes, as far as I know it's not available in the callbacks (e.g. "custom material callback"), but it works when you manually iterate the contact manifold for contact points.justin wrote:is getAppliedImpulse still working?
Re: Getting the impulse force from a collision?
It would be wonderful to be possibly get impulse before collision process (inside gContactAddedCallback for example).
Re: Getting the impulse force from a collision?
Just the opposite in my opinion, because they belong to different stages.almatea wrote:It would be wonderful to be possibly get impulse before collision process (inside gContactAddedCallback for example).