Location of joints?

gm09
Posts: 9
Joined: Fri Aug 05, 2011 1:27 am

Location of joints?

Post by gm09 »

Hi,

I'm using the btGeneric6DofConstraint to create a rigid joint between two rigid bodies. How can I tell where the location of the joint is? I'm assuming it's automatically placed midway between the center of masses of the two bodies, but I'm not sure. Below is the code for creating the constraint:

Code: Select all

                                btTransform frameInCurrent, frameInNeighbor;
                                frameInCurrent = btTransform::getIdentity();
                                frameInCurrent.setOrigin(rbBox->getCenterOfMassPosition());
                                frameInNeighbor = btTransform::getIdentity();
                                frameInNeighbor.setOrigin(neighbor->getCenterOfMassPosition());
                                btGeneric6DofConstraint* pGen6DOF = new btGeneric6DofConstraint(*rbBox, *neighbor, frameInNeighbor, frameInCurrent, true);
                                pGen6DOF->setLimit(0, btScalar(0.0f), btScalar(0.0f));
                                pGen6DOF->setLimit(1, btScalar(0.0f), btScalar(0.0f));
                                pGen6DOF->setLimit(2, btScalar(0.0f), btScalar(0.0f));
                                pGen6DOF->setLimit(3, btScalar(0.0f), btScalar(0.0f));
                                pGen6DOF->setLimit(4, btScalar(0.0f), btScalar(0.0f));
                                pGen6DOF->setLimit(5, btScalar(0.0f), btScalar(0.0f));
                                pGen6DOF->setLinearLowerLimit(btVector3(0.0f, 0.0f, 0.0f));
                                pGen6DOF->setLinearUpperLimit(btVector3(0.0f, 0.0f, 0.0f));
                                pGen6DOF->setAngularLowerLimit(btVector3(0.0f, 0.0f, 0.0f));
                                pGen6DOF->setAngularUpperLimit(btVector3(0.0f, 0.0f, 0.0f));
                                m_dynamicsWorld->addConstraint(pGen6DOF, false);
                                pGen6DOF->setDbgDrawSize(btScalar(5.f));
Any help would be greatly appreciated! Thanks :)