Question about appConstraintDemo
-
- Posts: 7
- Joined: Tue Mar 06, 2007 3:26 am
Question about appConstraintDemo
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
-
- Posts: 15
- Joined: Fri Sep 08, 2006 3:39 pm
-
- Posts: 127
- Joined: Sun Aug 13, 2006 4:41 pm
- Location: Cedar Hill, Texas
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.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.
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.
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
-
- Posts: 7
- Joined: Tue Mar 06, 2007 3:26 am
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);
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
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
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
-
- Posts: 7
- Joined: Tue Mar 06, 2007 3:26 am