btGeneric6DofConstraint, what do frameInA, frameInB mean?

nikolai
Posts: 1
Joined: Thu Apr 28, 2011 11:13 am

btGeneric6DofConstraint, what do frameInA, frameInB mean?

Post by nikolai »

Hello! I'm attempting to build a robot using 6dof constraints, I want all 6 axis locked. What I'm having trouble getting my head around is what exactly I should be setting the frameIn's to, specifically the rotations.

When I set the frameIn's origin to the position's at which I wish to constrain the two rigid bodies, it appears to position the two bodies correctly. For example if I attempt to join an arm to the torso, I set the origin for frameInA to vector3 representing the position of the shoulder or thereabouts, and it works fine.

Where I am getting caught up is the rotational aspect of the constraint. In addition to the vector3 representing the shoulder position, I have a vector3 representing the direction at which an arm would be connected to that shoulder point. However, when I set the rotation of the frameIn's the two bodies appear to become connected at very strange angles to each other, which don't appear to reflect the rotations I've set.

I have found it hard to find any documentation listing exactly how the frameIn's are interpreted by bullet, so I don't really understand what I'm supposed to be setting them to. Am I wrong in assuming that because I should set the origin of the frameIn to directly the position, that I should also set the rotation directly to the direction at which it should be connected? I've tried looking over the skeletal demo source, but it doesn't seem to be concerned with rotation either, just the position aspect.

Any advice would be much appreciated,
Nik.