fix mixed tabbing

This commit is contained in:
Glenn Maynard
2005-01-28 07:31:41 +00:00
parent b61a030ce0
commit 61c2064f49
+37 -37
View File
@@ -206,57 +206,57 @@ public:
LoadIdentity(); LoadIdentity();
} }
// Pops the top of the stack. // Pops the top of the stack.
void Pop() void Pop()
{ {
stack.pop_back(); stack.pop_back();
ASSERT( stack.size() > 0 ); // underflow ASSERT( stack.size() > 0 ); // underflow
} }
// Pushes the stack by one, duplicating the current matrix. // Pushes the stack by one, duplicating the current matrix.
void Push() void Push()
{ {
stack.push_back( stack.back() ); stack.push_back( stack.back() );
ASSERT( stack.size() < 100 ); // overflow ASSERT( stack.size() < 100 ); // overflow
} }
// Loads identity in the current matrix. // Loads identity in the current matrix.
void LoadIdentity() void LoadIdentity()
{ {
RageMatrixIdentity( &stack.back() ); RageMatrixIdentity( &stack.back() );
} }
// Loads the given matrix into the current matrix // Loads the given matrix into the current matrix
void LoadMatrix( const RageMatrix& m ) void LoadMatrix( const RageMatrix& m )
{ {
stack.back() = m; stack.back() = m;
} }
// Right-Multiplies the given matrix to the current matrix. // Right-Multiplies the given matrix to the current matrix.
// (transformation is about the current world origin) // (transformation is about the current world origin)
void MultMatrix( const RageMatrix& m ) void MultMatrix( const RageMatrix& m )
{ {
RageMatrixMultiply( &stack.back(), &m, &stack.back() ); RageMatrixMultiply( &stack.back(), &m, &stack.back() );
} }
// Left-Multiplies the given matrix to the current matrix // Left-Multiplies the given matrix to the current matrix
// (transformation is about the local origin of the object) // (transformation is about the local origin of the object)
void MultMatrixLocal( const RageMatrix& m ) void MultMatrixLocal( const RageMatrix& m )
{ {
RageMatrixMultiply( &stack.back(), &stack.back(), &m ); RageMatrixMultiply( &stack.back(), &stack.back(), &m );
} }
// Right multiply the current matrix with the computed rotation // Right multiply the current matrix with the computed rotation
// matrix, counterclockwise about the given axis with the given angle. // matrix, counterclockwise about the given axis with the given angle.
// (rotation is about the current world origin) // (rotation is about the current world origin)
void RotateX( float degrees ) void RotateX( float degrees )
{ {
RageMatrix m; RageMatrix m;
RageMatrixRotationX( &m, degrees ); RageMatrixRotationX( &m, degrees );
MultMatrix( m ); MultMatrix( m );
} }
void RotateY( float degrees ) void RotateY( float degrees )
{ {
RageMatrix m; RageMatrix m;
RageMatrixRotationY( &m, degrees ); RageMatrixRotationY( &m, degrees );
MultMatrix( m ); MultMatrix( m );
@@ -269,15 +269,15 @@ public:
} }
// Left multiply the current matrix with the computed rotation // Left multiply the current matrix with the computed rotation
// matrix. All angles are counterclockwise. (rotation is about the // matrix. All angles are counterclockwise. (rotation is about the
// local origin of the object) // local origin of the object)
void RotateXLocal( float degrees ) void RotateXLocal( float degrees )
{ {
RageMatrix m; RageMatrix m;
RageMatrixRotationX( &m, degrees ); RageMatrixRotationX( &m, degrees );
MultMatrixLocal( m ); MultMatrixLocal( m );
} }
void RotateYLocal( float degrees ) void RotateYLocal( float degrees )
{ {
RageMatrix m; RageMatrix m;
RageMatrixRotationY( &m, degrees ); RageMatrixRotationY( &m, degrees );
@@ -290,44 +290,44 @@ public:
MultMatrixLocal( m ); MultMatrixLocal( m );
} }
// Right multiply the current matrix with the computed scale // Right multiply the current matrix with the computed scale
// matrix. (transformation is about the current world origin) // matrix. (transformation is about the current world origin)
void Scale( float x, float y, float z) void Scale( float x, float y, float z)
{ {
RageMatrix m; RageMatrix m;
RageMatrixScaling( &m, x, y, z ); RageMatrixScaling( &m, x, y, z );
MultMatrix( m ); MultMatrix( m );
} }
// Left multiply the current matrix with the computed scale // Left multiply the current matrix with the computed scale
// matrix. (transformation is about the local origin of the object) // matrix. (transformation is about the local origin of the object)
void ScaleLocal( float x, float y, float z) void ScaleLocal( float x, float y, float z)
{ {
RageMatrix m; RageMatrix m;
RageMatrixScaling( &m, x, y, z ); RageMatrixScaling( &m, x, y, z );
MultMatrixLocal( m ); MultMatrixLocal( m );
} }
// Right multiply the current matrix with the computed translation // Right multiply the current matrix with the computed translation
// matrix. (transformation is about the current world origin) // matrix. (transformation is about the current world origin)
void Translate( float x, float y, float z) void Translate( float x, float y, float z)
{ {
RageMatrix m; RageMatrix m;
RageMatrixTranslation( &m, x, y, z ); RageMatrixTranslation( &m, x, y, z );
MultMatrix( m ); MultMatrix( m );
} }
// Left multiply the current matrix with the computed translation // Left multiply the current matrix with the computed translation
// matrix. (transformation is about the local origin of the object) // matrix. (transformation is about the local origin of the object)
void TranslateLocal( float x, float y, float z) void TranslateLocal( float x, float y, float z)
{ {
RageMatrix m; RageMatrix m;
RageMatrixTranslation( &m, x, y, z ); RageMatrixTranslation( &m, x, y, z );
MultMatrixLocal( m ); MultMatrixLocal( m );
} }
// Obtain the current matrix at the top of the stack // Obtain the current matrix at the top of the stack
const RageMatrix* GetTop() { return &stack.back(); } const RageMatrix* GetTop() { return &stack.back(); }
}; };