Oops. smPostMultMatrixf was a pre-multiply.

Rename smPostMultMatrixf to PostMultMatrix; add PreMultMatrix
and alias it to MultMatrix.
This commit is contained in:
Glenn Maynard
2003-04-10 17:58:27 +00:00
parent abc65f828f
commit 753507fce8
3 changed files with 16 additions and 10 deletions
+2 -3
View File
@@ -2,7 +2,6 @@
#include "NoteFieldPositioning.h" #include "NoteFieldPositioning.h"
#include "RageDisplay.h" #include "RageDisplay.h"
#include "RageDisplayInternal.h"
#include "RageUtil.h" #include "RageUtil.h"
#include "RageLog.h" #include "RageLog.h"
#include "RageMath.h" #include "RageMath.h"
@@ -103,12 +102,12 @@ NoteFieldPositioning::Mode::Mode()
void NoteFieldPositioning::Mode::BeginDrawTrack(int tn) const void NoteFieldPositioning::Mode::BeginDrawTrack(int tn) const
{ {
glMultMatrixf((const float *) m_Position[tn]); DISPLAY->MultMatrix((const float *) m_Position[tn]);
if(m_fFov[tn]) if(m_fFov[tn])
DISPLAY->EnterPerspective(m_fFov[tn]); DISPLAY->EnterPerspective(m_fFov[tn]);
glMultMatrixf((const float *) m_PerspPosition[tn]); DISPLAY->MultMatrix((const float *) m_PerspPosition[tn]);
} }
void NoteFieldPositioning::Mode::EndDrawTrack(int tn) const void NoteFieldPositioning::Mode::EndDrawTrack(int tn) const
+11 -6
View File
@@ -648,7 +648,7 @@ void RageDisplay::EnterPerspective(float fov, bool preserve_loc)
mat.m[0][1] = matTop.m[0][1]; mat.m[0][1] = matTop.m[0][1];
mat.m[1][0] = matTop.m[1][0]; mat.m[1][0] = matTop.m[1][0];
mat.m[1][1] = matTop.m[1][1]; mat.m[1][1] = matTop.m[1][1];
glMultMatrixf((float *) mat); this->MultMatrix(mat);
} }
/* We can't cope with perspective matrices or things that touch Z. (We shouldn't /* We can't cope with perspective matrices or things that touch Z. (We shouldn't
@@ -677,8 +677,8 @@ void RageDisplay::ExitPerspective()
DISPLAY->SetViewport(0, 0); DISPLAY->SetViewport(0, 0);
} }
/* gluLookAt. The result is post-multiplied to the matrix (M = L * M) instead of /* gluLookAt. The result is pre-multiplied to the matrix (M = L * M) instead of
* pre-multiplied. */ * post-multiplied. */
void RageDisplay::LookAt(const RageVector3 &Eye, const RageVector3 &At, const RageVector3 &Up) void RageDisplay::LookAt(const RageVector3 &Eye, const RageVector3 &At, const RageVector3 &Up)
{ {
glMatrixMode(GL_MODELVIEW); glMatrixMode(GL_MODELVIEW);
@@ -690,7 +690,7 @@ void RageDisplay::LookAt(const RageVector3 &Eye, const RageVector3 &At, const Ra
glGetFloatv( GL_MODELVIEW_MATRIX, (float*)view ); /* cheesy :) */ glGetFloatv( GL_MODELVIEW_MATRIX, (float*)view ); /* cheesy :) */
glPopMatrix(); glPopMatrix();
smPostMultMatrixf(view); PreMultMatrix(view);
} }
void RageDisplay::Translate( float x, float y, float z ) void RageDisplay::Translate( float x, float y, float z )
@@ -704,7 +704,7 @@ void RageDisplay::TranslateLocal( float x, float y, float z )
RageMatrix matTemp; RageMatrix matTemp;
RageMatrixTranslation( &matTemp, x, y, z ); RageMatrixTranslation( &matTemp, x, y, z );
smPostMultMatrixf(matTemp); PreMultMatrix(matTemp);
} }
void RageDisplay::Scale( float x, float y, float z ) void RageDisplay::Scale( float x, float y, float z )
@@ -730,7 +730,12 @@ void RageDisplay::RotateZ( float r )
glRotatef(r, 0.00001f, 0, 1); glRotatef(r, 0.00001f, 0, 1);
} }
void RageDisplay::smPostMultMatrixf( const RageMatrix &f ) void RageDisplay::PostMultMatrix( const RageMatrix &f )
{
glMultMatrixf((const float *) f);
}
void RageDisplay::PreMultMatrix( const RageMatrix &f )
{ {
RageMatrix m; RageMatrix m;
glGetFloatv( GL_MODELVIEW_MATRIX, (float*)m ); glGetFloatv( GL_MODELVIEW_MATRIX, (float*)m );
+3 -1
View File
@@ -52,7 +52,9 @@ public:
void RotateX( float r ); void RotateX( float r );
void RotateY( float r ); void RotateY( float r );
void RotateZ( float r ); void RotateZ( float r );
void smPostMultMatrixf( const RageMatrix &f ); void MultMatrix( const RageMatrix &f ) { PostMultMatrix(f); } /* alias */
void PostMultMatrix( const RageMatrix &f );
void PreMultMatrix( const RageMatrix &f );
void SetTexture( RageTexture* pTexture ); void SetTexture( RageTexture* pTexture );