remove old unused methods from btMultiBody.

This commit is contained in:
Erwin Coumans 2020-04-10 09:16:30 -07:00
parent 196d0645b1
commit dd5d0a1094
2 changed files with 0 additions and 53 deletions

View File

@ -583,52 +583,6 @@ void btMultiBody::compTreeLinkVelocities(btVector3 *omega, btVector3 *vel) const
}
}
btScalar btMultiBody::getKineticEnergy() const
{
int num_links = getNumLinks();
// TODO: would be better not to allocate memory here
btAlignedObjectArray<btVector3> omega;
omega.resize(num_links + 1);
btAlignedObjectArray<btVector3> vel;
vel.resize(num_links + 1);
compTreeLinkVelocities(&omega[0], &vel[0]);
// we will do the factor of 0.5 at the end
btScalar result = m_baseMass * vel[0].dot(vel[0]);
result += omega[0].dot(m_baseInertia * omega[0]);
for (int i = 0; i < num_links; ++i)
{
result += m_links[i].m_mass * vel[i + 1].dot(vel[i + 1]);
result += omega[i + 1].dot(m_links[i].m_inertiaLocal * omega[i + 1]);
}
return 0.5f * result;
}
btVector3 btMultiBody::getAngularMomentum() const
{
int num_links = getNumLinks();
// TODO: would be better not to allocate memory here
btAlignedObjectArray<btVector3> omega;
omega.resize(num_links + 1);
btAlignedObjectArray<btVector3> vel;
vel.resize(num_links + 1);
btAlignedObjectArray<btQuaternion> rot_from_world;
rot_from_world.resize(num_links + 1);
compTreeLinkVelocities(&omega[0], &vel[0]);
rot_from_world[0] = m_baseQuat;
btVector3 result = quatRotate(rot_from_world[0].inverse(), (m_baseInertia * omega[0]));
for (int i = 0; i < num_links; ++i)
{
rot_from_world[i + 1] = m_links[i].m_cachedRotParentToThis * rot_from_world[m_links[i].m_parent + 1];
result += (quatRotate(rot_from_world[i + 1].inverse(), (m_links[i].m_inertiaLocal * omega[i + 1])));
}
return result;
}
void btMultiBody::clearConstraintForces()
{

View File

@ -307,13 +307,6 @@ public:
//
btMatrix3x3 localFrameToWorld(int i, const btMatrix3x3 &local_frame) const;
//
// calculate kinetic energy and angular momentum
// useful for debugging.
//
btScalar getKineticEnergy() const;
btVector3 getAngularMomentum() const;
//
// set external forces and torques. Note all external forces/torques are given in the WORLD frame.