This commit is contained in:
Glenn Maynard
2006-09-26 06:56:39 +00:00
parent 0709d5ee4d
commit 5595cd0443
3 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -651,13 +651,13 @@ float RageFastCos( float x )
return RageFastSin( x + 0.5f*PI );
}
float RageQuadradtic::Evaluate( float fT ) const
float RageQuadratic::Evaluate( float fT ) const
{
// optimized (m_fA * fT*fT*fT) + (m_fB * fT*fT) + (m_fC * fT) + m_fD;
return ((m_fA*fT + m_fB)*fT + m_fC)*fT + m_fD;
}
void RageQuadradtic::SetFromBezier( float fX1, float fX2, float fX3, float fX4 )
void RageQuadratic::SetFromBezier( float fX1, float fX2, float fX3, float fX4 )
{
m_fD = fX1;
m_fC = 3.0f * (fX2 - fX1);
@@ -665,7 +665,7 @@ void RageQuadradtic::SetFromBezier( float fX1, float fX2, float fX3, float fX4 )
m_fA = fX4 - fX1 - m_fC - m_fB;
}
void RageQuadradtic::GetBezier( float &fX1, float &fX2, float &fX3, float &fX4 ) const
void RageQuadratic::GetBezier( float &fX1, float &fX2, float &fX3, float &fX4 ) const
{
fX1 = m_fD;
fX2 = m_fD + m_fC/3.0f;
@@ -673,7 +673,7 @@ void RageQuadradtic::GetBezier( float &fX1, float &fX2, float &fX3, float &fX4 )
fX4 = m_fD + m_fC + m_fB + m_fA;
}
float RageQuadradtic::GetSlope( float fT ) const
float RageQuadratic::GetSlope( float fT ) const
{
return 3*m_fA*fT*fT + 2*m_fB*fT + m_fC;
}
+3 -3
View File
@@ -51,7 +51,7 @@ void RageMatrixTranspose( RageMatrix* pOut, const RageMatrix* pIn );
float RageFastSin( float x ) CONST_FUNCTION;
float RageFastCos( float x ) CONST_FUNCTION;
class RageQuadradtic
class RageQuadratic
{
public:
void SetFromBezier( float fC1, float fC2, float fC3, float fC4 );
@@ -78,8 +78,8 @@ public:
float EvaluateYFromX( float fX ) const;
private:
RageQuadradtic m_X;
RageQuadradtic m_Y;
RageQuadratic m_X;
RageQuadratic m_Y;
};
#endif
+1 -1
View File
@@ -55,7 +55,7 @@ struct InterpolateBezier1D: public ITween
float Tween( float f ) const;
ITween *Copy() const { return new InterpolateBezier1D(*this); }
RageQuadradtic m_Bezier;
RageQuadratic m_Bezier;
};
float InterpolateBezier1D::Tween( float f ) const