-------------------------------------------------------------------------------------- Description: Supposedly interpolates between two keys. This function doesn't actually do that, though. If there is no skinned object or bone, it returns the identity matrix. If there is a skinned object, this multiplies the bone transform for the cached joint by the skinned object's world transform. Arguments:
| 121 | // The matrix result of the 'interpolation' |
| 122 | // -------------------------------------------------------------------------------------- |
| 123 | Matrix* Tr2BoneMatrixCurve::Interpolate( Matrix* out, Tr2MatrixKey* /*startKey*/, Tr2MatrixKey* /*endKey*/ ) |
| 124 | { |
| 125 | if( !m_skinnedObject || m_bone.empty() ) |
| 126 | { |
| 127 | *out = XMMatrixIdentity(); |
| 128 | return out; |
| 129 | } |
| 130 | |
| 131 | if( m_skeletonTag != m_skinnedObject->GetSkeletonTag() ) |
| 132 | { |
| 133 | m_cachedJoint = m_skinnedObject->GetBoneIndex( m_bone ); |
| 134 | if( m_cachedJoint != ~0u ) |
| 135 | { |
| 136 | m_skeletonTag = m_skinnedObject->GetSkeletonTag(); |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | const Matrix* m = m_skinnedObject->GetBoneTransform( m_cachedJoint ); |
| 141 | if( m ) |
| 142 | { |
| 143 | // We've got the bone in local space, now we need to multiply it |
| 144 | // by our skinned object's world transform. |
| 145 | *out = XMMatrixMultiply( XMMatrixMultiply( m_transform, *m ), m_skinnedObject->GetTransform() ); |
| 146 | } |
| 147 | else |
| 148 | { |
| 149 | *out = XMMatrixIdentity(); |
| 150 | } |
| 151 | return out; |
| 152 | } |
nothing calls this directly
no test coverage detected