"scale, rotate, translate", not "rotate, scale, translate". It's amazing that this is a day 1 bug.
This commit is contained in:
+27
-10
@@ -418,16 +418,17 @@ void Actor::BeginDraw() // set the world matrix and calculate actor properties
|
||||
|
||||
|
||||
{
|
||||
RageMatrix m;
|
||||
RageMatrixTranslateAndScale( &m,
|
||||
m_pTempState->pos.x,
|
||||
m_pTempState->pos.y,
|
||||
m_pTempState->pos.z,
|
||||
m_pTempState->scale.x * m_baseScale.x,
|
||||
m_pTempState->scale.y * m_baseScale.y,
|
||||
m_pTempState->scale.z * m_baseScale.z );
|
||||
|
||||
DISPLAY->PreMultMatrix( m );
|
||||
if( m_pTempState->pos.x != 0 || m_pTempState->pos.y != 0 || m_pTempState->pos.z != 0 )
|
||||
{
|
||||
RageMatrix m;
|
||||
RageMatrixTranslate(
|
||||
&m,
|
||||
m_pTempState->pos.x,
|
||||
m_pTempState->pos.y,
|
||||
m_pTempState->pos.z
|
||||
);
|
||||
DISPLAY->PreMultMatrix( m );
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
@@ -442,7 +443,23 @@ void Actor::BeginDraw() // set the world matrix and calculate actor properties
|
||||
{
|
||||
RageMatrix m;
|
||||
RageMatrixRotationXYZ( &m, fRotateX, fRotateY, fRotateZ );
|
||||
DISPLAY->PreMultMatrix( m );
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
const float fScaleX = m_pTempState->scale.x * m_baseScale.x;
|
||||
const float fScaleY = m_pTempState->scale.y * m_baseScale.y;
|
||||
const float fScaleZ = m_pTempState->scale.z * m_baseScale.z;
|
||||
|
||||
if( fScaleX != 1 || fScaleY != 1 || fScaleZ != 1 )
|
||||
{
|
||||
RageMatrix m;
|
||||
RageMatrixScale(
|
||||
&m,
|
||||
fScaleX,
|
||||
fScaleY,
|
||||
fScaleZ );
|
||||
DISPLAY->PreMultMatrix( m );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,9 +191,30 @@ void RageMatrixSkewX( RageMatrix* pOut, float fAmount )
|
||||
* RageMatrixScaling( &scale, fScaleX, float fScaleY, float fScaleZ );
|
||||
* RageMatrixMultiply( pOut, &translate, &scale );
|
||||
*/
|
||||
void RageMatrixTranslateAndScale( RageMatrix* pOut,
|
||||
float fTransX, float fTransY, float fTransZ,
|
||||
float fScaleX, float fScaleY, float fScaleZ )
|
||||
void RageMatrixTranslate( RageMatrix* pOut, float fTransX, float fTransY, float fTransZ )
|
||||
{
|
||||
pOut->m00 = 1;
|
||||
pOut->m01 = 0;
|
||||
pOut->m02 = 0;
|
||||
pOut->m03 = 0;
|
||||
|
||||
pOut->m10 = 0;
|
||||
pOut->m11 = 1;
|
||||
pOut->m12 = 0;
|
||||
pOut->m13 = 0;
|
||||
|
||||
pOut->m20 = 0;
|
||||
pOut->m21 = 0;
|
||||
pOut->m22 = 1;
|
||||
pOut->m23 = 0;
|
||||
|
||||
pOut->m30 = fTransX;
|
||||
pOut->m31 = fTransY;
|
||||
pOut->m32 = fTransZ;
|
||||
pOut->m33 = 1;
|
||||
}
|
||||
|
||||
void RageMatrixScale( RageMatrix* pOut, float fScaleX, float fScaleY, float fScaleZ )
|
||||
{
|
||||
pOut->m00 = fScaleX;
|
||||
pOut->m01 = 0;
|
||||
@@ -210,9 +231,9 @@ void RageMatrixTranslateAndScale( RageMatrix* pOut,
|
||||
pOut->m22 = fScaleZ;
|
||||
pOut->m23 = 0;
|
||||
|
||||
pOut->m30 = fTransX;
|
||||
pOut->m31 = fTransY;
|
||||
pOut->m32 = fTransZ;
|
||||
pOut->m30 = 0;
|
||||
pOut->m31 = 0;
|
||||
pOut->m32 = 0;
|
||||
pOut->m33 = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,8 @@ void RageMatrixMultiply( RageMatrix* pOut, const RageMatrix* pA, const RageMatri
|
||||
void RageMatrixTranslation( RageMatrix* pOut, float x, float y, float z );
|
||||
void RageMatrixScaling( RageMatrix* pOut, float x, float y, float z );
|
||||
void RageMatrixSkewX( RageMatrix* pOut, float fAmount );
|
||||
void RageMatrixTranslateAndScale( RageMatrix* pOut, float fTransX, float fTransY, float fTransZ, float fScaleX, float fScaleY, float fScaleZ );
|
||||
void RageMatrixTranslate( RageMatrix* pOut, float fTransX, float fTransY, float fTransZ );
|
||||
void RageMatrixScale( RageMatrix* pOut, float fScaleX, float fScaleY, float fScaleZ );
|
||||
void RageMatrixRotationX( RageMatrix* pOut, float fTheta );
|
||||
void RageMatrixRotationY( RageMatrix* pOut, float fTheta );
|
||||
void RageMatrixRotationZ( RageMatrix* pOut, float fTheta );
|
||||
|
||||
Reference in New Issue
Block a user