How to change impulse?
-
- Posts: 28
- Joined: Mon Aug 29, 2011 11:02 am
How to change impulse?
In my case, a rigid body(car) is colliding with the wall, and by using contact callback method i am getting the collision callback, now i want to change the impulse that the wall applied to the car vehicle, Any suggestions will be of great help.
-
- Posts: 168
- Joined: Tue Jan 04, 2011 11:47 pm
Re: How to change impulse?
I think we can learn a lot from this post
http://www.bulletphysics.org/Bullet/php ... =17&t=3416
This should be done by setting up a custom collision callback
http://www.bulletphysics.org/Bullet/php ... =17&t=3416
This should be done by setting up a custom collision callback
-
- Posts: 168
- Joined: Tue Jan 04, 2011 11:47 pm
Re: How to change impulse?
Sorry, but when I go through the that post today, I found you post the same question there. Hope @mi076@ could notice this post and reply.
Before that, we may discuss a bit.
What kind of methods did you try previously ?
If I am doing this, I may set up a custom collision callback, using:
So you can add up the custom callback to modify the collision response:
Come on, mi076, we need your help !
Before that, we may discuss a bit.
What kind of methods did you try previously ?
If I am doing this, I may set up a custom collision callback, using:
Code: Select all
mBody->setCollisionFlags(mBody->getCollisionFlags() | btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK);
Code: Select all
gContactAddedCallback
-
- Posts: 28
- Joined: Mon Aug 29, 2011 11:02 am
Re: How to change impulse?
Thanks for reply,Dr.Shepherd wrote:Sorry, but when I go through the that post today, I found you post the same question there. Hope @mi076@ could notice this post and reply.
Before that, we may discuss a bit.
What kind of methods did you try previously ?
If I am doing this, I may set up a custom collision callback, using:So you can add up the custom callback to modify the collision response:Code: Select all
mBody->setCollisionFlags(mBody->getCollisionFlags() | btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK);
Come on, mi076, we need your help !Code: Select all
gContactAddedCallback
Well using gContactAddedCallback method i am getting a callback when the car is colliding with the walls, but i don't know what parameters should be changed for proper response (as i am thinking of only impulse right now, may be there are other parameters too that should be changed ).
-
- Posts: 144
- Joined: Fri Aug 01, 2008 6:36 am
- Location: Bonn, Germany
Re: How to change impulse?
it depends why... if it is too bouncy - may be adjusting restitution will be enough, or may be the vehicle itself have to be damped a little.. if you don't use any resistance forces you might add a little linear/angular damping..now i want to change the impulse that the wall applied to the car vehicle
for custom collision response look at (with example)
http://www.bulletphysics.org/Bullet/php ... f=9&t=6076
also, if the wall have to do something special, for example, apply very strong impulse or full damp you can use trigger - disable contact response and apply impulses yourself... there are many ways to achieve it..
-
- Posts: 168
- Joined: Tue Jan 04, 2011 11:47 pm
Re: How to change impulse?
Another question I want to ask by myself, if I added a "ContactAddedCallback", and set it as the custom callback, but all the objects, whose CollisionFlag has been set as CF_CUSTOM_MATERIAL_CALLBACK, will trigger the same custom callback, is it?mi076 wrote: also, if the wall have to do something special, for example, apply very strong impulse or full damp you can use trigger - disable contact response and apply impulses yourself... there are many ways to achieve it..
Is there a way to specify individual custom callback for individual object?
-
- Posts: 28
- Joined: Mon Aug 29, 2011 11:02 am
Re: How to change impulse?
Thanks for reply, i have few doubts..
Or there are some other forces which i should take care of ?.
Can i make custom callback of an object with a particular object?
Thanks.
for a plane its working good, but when the body collides with a straight wall ..due to high speed it start over turn in the air... i think its due to impulse by the wall on the car body( m i right? ).mi076 wrote:it depends why... if it is too bouncy - may be adjusting restitution will be enough, or may be the vehicle itself have to be damped a little.. if you don't use any resistance forces you might add a little linear/angular damping..
Or there are some other forces which i should take care of ?.
also, if the wall have to do something special, for example, apply very strong impulse or full damp you can use trigger - disable contact response
Can i make custom callback of an object with a particular object?
Any example regarding that ?.and apply impulses yourself...there are many ways to achieve it..
Thanks.