From aceff788bfa7d94f9cae817c53a3227025b5d4aa Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 5 Feb 2005 02:42:33 +0000 Subject: [PATCH] remove wasteful and mostly unused matrix math helpers (pass by reference, don't return by value) --- stepmania/src/DancingCharacters.cpp | 3 ++- stepmania/src/RageMath.cpp | 27 --------------------------- stepmania/src/RageMath.h | 4 ---- 3 files changed, 2 insertions(+), 32 deletions(-) diff --git a/stepmania/src/DancingCharacters.cpp b/stepmania/src/DancingCharacters.cpp index 1e8a9ae166..fee0357ac9 100644 --- a/stepmania/src/DancingCharacters.cpp +++ b/stepmania/src/DancingCharacters.cpp @@ -324,7 +324,8 @@ void DancingCharacters::DrawPrimitives() float fCameraHeight = SCALE( fPercentIntoSweep, 0.f, 1.f, m_fCameraHeightStart, m_fCameraHeightEnd ); RageVector3 m_CameraPoint( 0, fCameraHeight, -m_CameraDistance ); - const RageMatrix CameraRot = RageMatrixRotationY(fCameraPanY); + RageMatrix CameraRot; + RageMatrixRotationY( &CameraRot, fCameraPanY ); RageVec3TransformCoord( &m_CameraPoint, &m_CameraPoint, &CameraRot ); RageVector3 m_LookAt( 0, m_fLookAtHeight, 0 ); diff --git a/stepmania/src/RageMath.cpp b/stepmania/src/RageMath.cpp index 1bd640ee8a..74e68f0334 100644 --- a/stepmania/src/RageMath.cpp +++ b/stepmania/src/RageMath.cpp @@ -187,26 +187,6 @@ void RageMatrixRotationZ( RageMatrix* pOut, float theta ) pOut->m[1][0] = -pOut->m[0][1]; } -RageMatrix RageMatrixRotationX( float theta ) -{ - RageMatrix m; - RageMatrixRotationX( &m, theta ); - return m; -} -RageMatrix RageMatrixRotationY( float theta ) -{ - RageMatrix m; - RageMatrixRotationY( &m, theta ); - return m; -} -RageMatrix RageMatrixRotationZ( float theta ) -{ - RageMatrix m; - RageMatrixRotationZ( &m, theta ); - return m; -} - - /* This is similar in style to Actor::Command. However, Actors don't store * matrix stacks; they only store offsets and scales, and compound them into * a single transformations at once. This makes some things easy, but it's not @@ -490,13 +470,6 @@ RageMatrix RageLookAt( return ret; } -RageMatrix RageMatrixIdentity() -{ - RageMatrix m; - RageMatrixIdentity( &m ); - return m; -} - void RageMatrixAngles( RageMatrix* pOut, const RageVector3 &angles ) { const RageVector3 angles_radians( angles * 2*PI / 360 ); diff --git a/stepmania/src/RageMath.h b/stepmania/src/RageMath.h index a26810c669..1cd03ae685 100644 --- a/stepmania/src/RageMath.h +++ b/stepmania/src/RageMath.h @@ -28,16 +28,12 @@ void RageVec3TransformCoord( RageVector3* pOut, const RageVector3* pV, const Rag void RageVec3TransformNormal( RageVector3* pOut, const RageVector3* pV, const RageMatrix* pM ); void RageVec4TransformCoord( RageVector4* pOut, const RageVector4* pV, const RageMatrix* pM ); void RageMatrixIdentity( RageMatrix* pOut ); -RageMatrix RageMatrixIdentity(); void RageMatrixMultiply( RageMatrix* pOut, const RageMatrix* pA, const RageMatrix* pB ); void RageMatrixTranslation( RageMatrix* pOut, float x, float y, float z ); void RageMatrixScaling( RageMatrix* pOut, float x, float y, float z ); void RageMatrixRotationX( RageMatrix* pOut, float fTheta ); void RageMatrixRotationY( RageMatrix* pOut, float fTheta ); void RageMatrixRotationZ( RageMatrix* pOut, float fTheta ); -RageMatrix RageMatrixRotationX( float fTheta ); -RageMatrix RageMatrixRotationY( float fTheta ); -RageMatrix RageMatrixRotationZ( float fTheta ); void RageMatrixCommand( CString sCommandString, RageMatrix &mat ); void RageQuatFromHPR(RageVector4* pOut, RageVector3 hpr ); void RageQuatFromPRH(RageVector4* pOut, RageVector3 prh );