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?
-
- Posts: 19
- Joined: Mon Nov 10, 2008 11:24 am
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
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
-
- Posts: 19
- Joined: Mon Nov 10, 2008 11:24 am
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.
-
- Posts: 8
- Joined: Fri Mar 04, 2011 1:19 pm
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.
-
- Posts: 456
- Joined: Tue Dec 25, 2007 1:06 pm
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?
-
- Posts: 29
- Joined: Mon Nov 02, 2009 10:15 am
Re: Getting the impulse force from a collision?
It would be wonderful to be possibly get impulse before collision process (inside gContactAddedCallback for example).
-
- Posts: 8
- Joined: Fri Mar 04, 2011 1:19 pm
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).