Page 1 of 1

Rigid body collision

Posted: Wed Jan 25, 2012 10:31 am
by John1789
Hi,

I am new to bullet so i am struggling to google my problem because i don't know what to search.
In my game i have three objects, Body A (rigid body of btRaycast vehicle), Body B( static object), Body C (static object).
Now when body A collides with Body B , bullet physics handles it accuratly.
But when Body A collides with Body C, i want to know what are the forces and impulses acting on body A so that i can change it according to my need and then bullet do its remaining work with that data. Any suggestions how to achieve that?
Thanks in Advance.

Re: Rigid body collision

Posted: Wed Jan 25, 2012 3:40 pm
by kloplop321
Collision callbacks can help you out.
http://www.bulletphysics.org/mediawiki- ... d_Triggers

Re: Rigid body collision

Posted: Fri Jan 27, 2012 4:50 am
by John1789
kloplop321 wrote:Collision callbacks can help you out.
http://www.bulletphysics.org/mediawiki- ... d_Triggers
Thanks for the reply,
i go through your given link, it is useful for collision trigger thats ok. It helps me to make my half work done.
but what about the other half, where i want to change the forces and impulses in the physics engine?

Re: Rigid body collision

Posted: Fri Jan 27, 2012 4:54 pm
by kloplop321
http://bulletphysics.com/Bullet/BulletF ... dBody.html
body->clearForces();
and then
body->applyForce(btVector3(blah,blah,blah),btvector3(0,0,0));
or
body->applyImpulse(btVector3(blah,blah,blah),btvector3(0,0,0));

Re: Rigid body collision

Posted: Sat Jan 28, 2012 5:50 am
by John1789
kloplop321 wrote:http://bulletphysics.com/Bullet/BulletF ... dBody.html
body->clearForces();
and then
body->applyForce(btVector3(blah,blah,blah),btvector3(0,0,0));
or
body->applyImpulse(btVector3(blah,blah,blah),btvector3(0,0,0));
Ok but,
After collision where the impulse and forces are calculated in bullet?
and where do i use these command ? at simulation tick callback ?.
Thanks