Generic 6Dof constraint from global pivot and axis

Rawsock
Posts: 3
Joined: Mon Apr 16, 2007 2:41 pm

Generic 6Dof constraint from global pivot and axis

Post by Rawsock »

I'm currently trying to implement the usual set of joints ODE has ( slider, prismatic, point-on-plane, etc ) using btGeneric6DofConstraint only.

I known that i need to set two local transforms that define the relative orientation and position of the constraint (frame InA, frameInB). Obtaining the local pivot points from the global pivot point is dead simple :

Code: Select all

    btTransform localFrame  = body1->getCenterOfMassTransform();
    btTransform globaltransform;
    globaltransform.setIdentity();
    globaltransform.setOrigin(globalpos);

    btVector3 localPivot =  (localframe.inverse() * globaltransform).getOrigin();
¿How do i compute the local rotations from a single global axis?

Thanks.