simplify
This commit is contained in:
+6
-10
@@ -856,19 +856,15 @@ Model::AdvanceFrame (float dt)
|
|||||||
}
|
}
|
||||||
if (pLastRotationKey != 0 && pThisRotationKey != 0)
|
if (pLastRotationKey != 0 && pThisRotationKey != 0)
|
||||||
{
|
{
|
||||||
float d = pThisRotationKey->fTime - pLastRotationKey->fTime;
|
const float s = SCALE( m_fCurrFrame, pLastRotationKey->fTime, pThisRotationKey->fTime, 0, 1 );
|
||||||
float s = (m_fCurrFrame - pLastRotationKey->fTime) / d;
|
|
||||||
|
|
||||||
RageVector4 q1a(0,0,0,1);
|
RageVector4 q1, q2, q;
|
||||||
RageQuatFromHPR( &q1a, RageVector3(pLastRotationKey->Rotation) * (180 / PI) );
|
RageQuatFromHPR( &q1, RageVector3(pLastRotationKey->Rotation) * (180 / PI) );
|
||||||
RageVector4 q2a(0,0,0,1);
|
RageQuatFromHPR( &q2, RageVector3(pThisRotationKey->Rotation) * (180 / PI) );
|
||||||
RageQuatFromHPR( &q2a, RageVector3(pThisRotationKey->Rotation) * (180 / PI) );
|
RageQuatSlerp( &q, q1, q2, s );
|
||||||
RageVector4 qa;
|
|
||||||
RageQuatSlerp( &qa, q1a, q2a, s );
|
|
||||||
|
|
||||||
RageMatrix mm;
|
RageMatrix mm;
|
||||||
RageMatrixFromQuat( &mm, qa );
|
RageMatrixFromQuat( &mm, q );
|
||||||
|
|
||||||
MakeMatrix( m, mm );
|
MakeMatrix( m, mm );
|
||||||
}
|
}
|
||||||
else if (pLastRotationKey == 0)
|
else if (pLastRotationKey == 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user