Page 1 of 1

Question about appConstraintDemo

Posted: Fri Mar 09, 2007 4:29 am
by Butters9637
Okay, after reading some posts here, I have to edit the my post again. I`m new to physics engine and I want to know how to lock some degrees of freedom using constraint? for example X axis. thanks

Posted: Fri Mar 09, 2007 1:10 pm
by luke.titley
Hey,
Which degrees of freedom would you like to lock?

You can have a Hinge, point2point ( ball and socket ) or a Generic6Dof joint.
The Demos/ConstraintDemo directory in the download of the bullet sdk has examples of them all.

Posted: Sat Mar 10, 2007 12:43 am
by SteveBaker
luke.titley wrote:Hey,
Which degrees of freedom would you like to lock?

You can have a Hinge, point2point ( ball and socket ) or a Generic6Dof joint.
The Demos/ConstraintDemo directory in the download of the bullet sdk has examples of them all.
The Generic6Dof constraint is the only one that you can sellectively lock axes of. Also, the point2point and hinge constraints don't have limits - so if you have a hinge, the object can rotate 360 degrees (unless it hits something) and if you use point2point, it'll be able to move in all three rotational axes without limits.

Generic6Dof ought to be the way to go - but I havn't had much luck with it - even if you lock a bunch of the axes, the object will kinda wobble around in those directions like it's mounted on a block of jello.

Bullet needs some serious work on it's constraint system.

Posted: Sat Mar 10, 2007 2:51 am
by Erwin Coumans
Yes, more work on the constraints, motors and limits (angular and plane limits) is desired and definately on the long todo list.

Collision detection and cleanup has received most attention,
please stay tuned,
Erwin

Posted: Sat Mar 10, 2007 4:36 am
by Butters9637

Code: Select all

slider->SetLimit(0,-1.0f,-1.0f);
slider->SetLimit(1,-1.0f,-1.0f);
slider->SetLimit(2,-1.0f,-1.0f);
slider->SetLimit(3,1.0f,1.0f);
slider->SetLimit(4,1.0f,1.0f);
slider->SetLimit(5,1.0f,1.0f);
I try to lock all 6 directions using the code above.but It simply doesn`t work,the Box could still move around if I drag it using my mouse. how to solve it? thanks.

Posted: Sat Mar 10, 2007 4:37 pm
by Erwin Coumans
By default, without setting any limits they are all locked. This means both lower and upper limit values are 0.

One of the issues with the generic 6dof constraint is that the various degrees of freedom have dependencies and can conflict with eachother.
The angular dofs are order dependend, and use X-Y-Z by default. This means that if you want one rotation axis to be free, you should use the x-axis.

Please try experimenting enabling one degree of freedom at a time. You can make one degree of freedom totally free by setting the upper limit lower then the lower limit.

Hope this helps,
Erwin

Posted: Sun Mar 11, 2007 1:02 pm
by Butters9637
After doing some experiments I think I generally know what this constraint is capable of. thank you very much for you patiently explanation about this issue :D .

Edit:I tried the new version of Bullet, it works this time. thank you.