diff options
Diffstat (limited to 'thirdparty/bullet/BulletDynamics/Featherstone/btMultiBody.cpp')
-rw-r--r-- | thirdparty/bullet/BulletDynamics/Featherstone/btMultiBody.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/thirdparty/bullet/BulletDynamics/Featherstone/btMultiBody.cpp b/thirdparty/bullet/BulletDynamics/Featherstone/btMultiBody.cpp index 53fc48d4b9..3e210d7520 100644 --- a/thirdparty/bullet/BulletDynamics/Featherstone/btMultiBody.cpp +++ b/thirdparty/bullet/BulletDynamics/Featherstone/btMultiBody.cpp @@ -106,6 +106,7 @@ btMultiBody::btMultiBody(int n_links, m_fixedBase(fixedBase), m_awake(true), m_canSleep(canSleep), + m_canWakeup(true), m_sleepTimer(0), m_userObjectPointer(0), m_userIndex2(-1), @@ -343,6 +344,7 @@ void btMultiBody::finalizeMultiDof() m_deltaV.resize(6 + m_dofCount); m_realBuf.resize(6 + m_dofCount + m_dofCount * m_dofCount + 6 + m_dofCount); //m_dofCount for joint-space vels + m_dofCount^2 for "D" matrices + delta-pos vector (6 base "vels" + joint "vels") m_vectorBuf.resize(2 * m_dofCount); //two 3-vectors (i.e. one six-vector) for each system dof ("h" matrices) + m_matrixBuf.resize(m_links.size() + 1); for (int i = 0; i < m_vectorBuf.size(); i++) { m_vectorBuf[i].setValue(0, 0, 0); @@ -350,9 +352,9 @@ void btMultiBody::finalizeMultiDof() updateLinksDofOffsets(); } -int btMultiBody::getParent(int i) const +int btMultiBody::getParent(int link_num) const { - return m_links[i].m_parent; + return m_links[link_num].m_parent; } btScalar btMultiBody::getLinkMass(int i) const @@ -1882,6 +1884,8 @@ void btMultiBody::checkMotionAndSleepIfRequired(btScalar timestep) return; } + + // motion is computed as omega^2 + v^2 + (sum of squares of joint velocities) btScalar motion = 0; { @@ -1900,8 +1904,11 @@ void btMultiBody::checkMotionAndSleepIfRequired(btScalar timestep) else { m_sleepTimer = 0; - if (!m_awake) - wakeUp(); + if (m_canWakeup) + { + if (!m_awake) + wakeUp(); + } } } |