I'm trying to improving this class, but the rotation algebra gets me crazy;

At this moment, I've implemented an alternative method using the axes at the global frame on A (bodyA.Transform*localFrameA), and the angles are calculated with the computeAngle method. Works fine when you have limits between -PI/2 to PI/2, but when you have limits equal or superior to PI/2, it becomes weird.
Yes, there are hinges those work fine for most cases(Hinge, Cone), but I think that D6 constraints are very important for fulfill the COLLADA specification.