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.
Rigid body collision
-
- Posts: 55
- Joined: Sun Jan 01, 2012 7:37 pm
Re: Rigid body collision
Collision callbacks can help you out.
http://www.bulletphysics.org/mediawiki- ... d_Triggers
http://www.bulletphysics.org/mediawiki- ... d_Triggers
-
- Posts: 15
- Joined: Fri Sep 02, 2011 11:54 am
Re: Rigid body collision
Thanks for the reply,kloplop321 wrote:Collision callbacks can help you out.
http://www.bulletphysics.org/mediawiki- ... d_Triggers
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?
-
- Posts: 55
- Joined: Sun Jan 01, 2012 7:37 pm
Re: Rigid body collision
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));
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));
-
- Posts: 15
- Joined: Fri Sep 02, 2011 11:54 am
Re: Rigid body collision
Ok but,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));
After collision where the impulse and forces are calculated in bullet?
and where do i use these command ? at simulation tick callback ?.
Thanks