Constraint angular and linear velocity

mp3butcher
Posts: 13
Joined: Wed Jun 06, 2007 8:05 am

Constraint angular and linear velocity

Post by mp3butcher »

Hello I havent search a lot on the forum but i need a mean to constraint speed of a rigidbody in order not to exceed a certain treshold.(and idem for the angular velocity). Is there a mean to specify these kind of constraints in bullet?
Thanks
robtherich
Posts: 6
Joined: Thu Apr 03, 2008 7:39 pm

Re: Constraint angular and linear velocity

Post by robtherich »

i believe you need to implement a physics tick callback.
http://www.bulletphysics.com/mediawiki- ... e_Snippets
mp3butcher
Posts: 13
Joined: Wed Jun 06, 2007 8:05 am

Re: Constraint angular and linear velocity

Post by mp3butcher »

Thanks for your advice but it doesnt work:
I replace body->setAngularFactor(0) by a 6DConstraint setting limit on all rotation axis.
I apply some angular force on body and after a physic update I check the rotation of my body :
it always return return me a different quat...:/
Then I now constraint rotation by hand in a callback...:/
Is there anyone who knows where i've gone wrong?
chunky
Posts: 145
Joined: Tue Oct 30, 2007 9:23 pm

Re: Constraint angular and linear velocity

Post by chunky »

it always return return me a different quat...:/
It's worth noting that that doesn't necessarily mean the rotation is different, IIRC. You might want to convert it to euler angles and see what you've got.
I replace body->setAngularFactor(0) by a 6DConstraint setting limit on all rotation axis.
Perhaps the 6dof isn't doing quite what you think it is?

Gary (-;
mp3butcher
Posts: 13
Joined: Wed Jun 06, 2007 8:05 am

Re: Constraint angular and linear velocity

Post by mp3butcher »

to compare quaternions i normalize them in order they take their canonical form
I know there can be approximation but i write them in console when they dont match and it appears that differences are huge...:(
if someone is interested by this stange behavior I can give the code...