Page 1 of 1

basic question on hinge constraint

Posted: Mon Apr 11, 2011 2:30 pm
by zeder3d
Hello,

I'm confused about how to use btHingeConstraint. In particular, I don't understand what is the difference between Axis, and Pivot parameters in the constructor.
Thank you in advance

Z.

Re: basic question on hinge constraint

Posted: Tue Apr 12, 2011 4:14 pm
by fwip
I'm pretty new to Bullet, but I think I know this one. The 'Axis' represents the orientation of the joint, relative to the part. For example, a door would have an axis of (0,1,0), assuming that y is up. A trashcan lid might have an axis of (1,0,0).

The 'Pivot' is the point that attaches to the joint, relative to the object. In my case, I've found it useful to specify a point a little outside of each body. If the pivot point is in the object, the constraint will try to put the objects overlapping one another. Some people recommend disabling collisions between the two constrained objects, partly for this reason.