2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 19:04:56 +00:00

MP2/3 RigInverter

This commit is contained in:
Jack Andersen
2016-04-08 21:10:09 -10:00
parent 6d13a4b257
commit 68c1ac8978
7 changed files with 90 additions and 26 deletions

View File

@@ -56,7 +56,7 @@ RigInverter<CINFType>::Bone::Bone(const CINFType& cinf, const typename CINFType:
}
}
m_tail /= float(actualChildren);
if (m_tail.magSquared() < 0.001f)
if ((m_tail - boneOrigin).magSquared() < 0.001f)
m_tail = naturalTail;
if (isLCTR)
@@ -65,8 +65,8 @@ RigInverter<CINFType>::Bone::Bone(const CINFType& cinf, const typename CINFType:
else if (parentIdx != -1)
{
/* Extrapolate by delta with parent */
m_tail = zeus::CVector3f(origBone.origin) + m_parentDelta;
if (m_tail.magSquared() < 0.001f)
m_tail = boneOrigin + m_parentDelta;
if (m_parentDelta.magSquared() < 0.001f)
m_tail = naturalTail;
float deltaMag = m_parentDelta.magnitude();