Rigid body collision

Post Reply
John1789
Posts: 15
Joined: Fri Sep 02, 2011 11:54 am

Rigid body collision

Post 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.
kloplop321
Posts: 55
Joined: Sun Jan 01, 2012 7:37 pm

Re: Rigid body collision

Post by kloplop321 »

Collision callbacks can help you out.
http://www.bulletphysics.org/mediawiki- ... d_Triggers
John1789
Posts: 15
Joined: Fri Sep 02, 2011 11:54 am

Re: Rigid body collision

Post 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?
kloplop321
Posts: 55
Joined: Sun Jan 01, 2012 7:37 pm

Re: Rigid body collision

Post 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));
John1789
Posts: 15
Joined: Fri Sep 02, 2011 11:54 am

Re: Rigid body collision

Post 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
Post Reply