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
Constraint angular and linear velocity
-
- Posts: 6
- Joined: Thu Apr 03, 2008 7:39 pm
Re: Constraint angular and linear velocity
i believe you need to implement a physics tick callback.
http://www.bulletphysics.com/mediawiki- ... e_Snippets
http://www.bulletphysics.com/mediawiki- ... e_Snippets
-
- Posts: 13
- Joined: Wed Jun 06, 2007 8:05 am
Re: Constraint angular and linear velocity
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?
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?
-
- Posts: 145
- Joined: Tue Oct 30, 2007 9:23 pm
Re: Constraint angular and linear velocity
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.it always return return me a different quat...:/
Perhaps the 6dof isn't doing quite what you think it is?I replace body->setAngularFactor(0) by a 6DConstraint setting limit on all rotation axis.
Gary (-;
-
- Posts: 13
- Joined: Wed Jun 06, 2007 8:05 am
Re: Constraint angular and linear velocity
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...
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...