Scenario A
1) I start with the InvertedPendulumPDControl example.
2) I comment out the m_multiBody->addJointTorque line, so the pendulum isn't being moved.
3) I (theoretically) constrain the pendulum to be pointed to the side with:
Code: Select all
m_dynamicsWorld->addMultiBodyConstraint(new btMultiBodyJointLimitConstraint(m_multiBody, 0, btRadians(80.f), btRadians(90.f)));
Scenario B
I change the base to be floating, but with a btMultiBodyFixedConstraint (so I can move it around later):
Code: Select all
m_multiBody = createInvertedPendulumMultiBody(m_dynamicsWorld, m_guiHelper, baseWorldTrans, false);
m_dynamicsWorld->addMultiBodyConstraint(new btMultiBodyFixedConstraint(m_multiBody, -1, nullptr, btVector3(0, 0, 0), btVector3(1, 2, 3), btMatrix3x3::getIdentity(), btMatrix3x3::getIdentity()));
Code: Select all
m_dynamicsWorld->addMultiBodyConstraint(new btMultiBodyJointLimitConstraint(m_multiBody, 0, btRadians(80.f), btRadians(90.f)));