I don't remember what RageMatrixCommand was for. Remove it.
This commit is contained in:
@@ -274,76 +274,6 @@ void RageMatrixRotationXYZ( RageMatrix* pOut, float rX, float rY, float rZ )
|
||||
pOut->m33 = 1;
|
||||
}
|
||||
|
||||
/* 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
|
||||
* convenient for generic 3d transforms. For that, we have this, which has the
|
||||
* small subset of the actor commands that applies to raw matrices, and we apply
|
||||
* commands in the order given. "scale,2;x,1;" is very different from
|
||||
* "x,1;scale,2;". */
|
||||
static CString GetParam( const CStringArray& sParams, int iIndex, int& iMaxIndexAccessed )
|
||||
{
|
||||
iMaxIndexAccessed = max( iIndex, iMaxIndexAccessed );
|
||||
if( iIndex < int(sParams.size()) )
|
||||
return sParams[iIndex];
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
void RageMatrixCommand( CString sCommandString, RageMatrix &mat )
|
||||
{
|
||||
CStringArray asCommands;
|
||||
split( sCommandString, ";", asCommands, true );
|
||||
|
||||
for( unsigned c=0; c<asCommands.size(); c++ )
|
||||
{
|
||||
CStringArray asTokens;
|
||||
split( asCommands[c], ",", asTokens, true );
|
||||
|
||||
int iMaxIndexAccessed = 0;
|
||||
|
||||
#define sArg(i) (GetParam(asTokens,i,iMaxIndexAccessed))
|
||||
#define fArg(i) (strtof(sArg(i),NULL))
|
||||
#define iArg(i) (atoi(sArg(i)))
|
||||
#define bArg(i) (iArg(i)!=0)
|
||||
|
||||
CString& sName = asTokens[0];
|
||||
sName.MakeLower();
|
||||
|
||||
RageMatrix b;
|
||||
// Act on command
|
||||
if( sName=="x" ) RageMatrixTranslation( &b, fArg(1),0,0 );
|
||||
else if( sName=="y" ) RageMatrixTranslation( &b, 0,fArg(1),0 );
|
||||
else if( sName=="z" ) RageMatrixTranslation( &b, 0,0,fArg(1) );
|
||||
else if( sName=="zoomx" ) RageMatrixScaling(&b, fArg(1),1,1 );
|
||||
else if( sName=="zoomy" ) RageMatrixScaling(&b, 1,fArg(1),1 );
|
||||
else if( sName=="zoomz" ) RageMatrixScaling(&b, 1,1,fArg(1) );
|
||||
else if( sName=="rotationx" ) RageMatrixRotationX( &b, fArg(1) );
|
||||
else if( sName=="rotationy" ) RageMatrixRotationY( &b, fArg(1) );
|
||||
else if( sName=="rotationz" ) RageMatrixRotationZ( &b, fArg(1) );
|
||||
else
|
||||
{
|
||||
CString sError = ssprintf( "MatrixCommand: Unrecognized matrix command name '%s' in command string '%s'.", sName.c_str(), sCommandString.c_str() );
|
||||
LOG->Warn( sError );
|
||||
Dialog::OK( sError );
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if( iMaxIndexAccessed != (int)asTokens.size()-1 )
|
||||
{
|
||||
CString sError = ssprintf( "MatrixCommand: Wrong number of parameters in command '%s'. Expected %d but there are %d.", join(",",asTokens).c_str(), iMaxIndexAccessed+1, (int)asTokens.size() );
|
||||
LOG->Warn( sError );
|
||||
Dialog::OK( sError );
|
||||
continue;
|
||||
}
|
||||
|
||||
RageMatrix a(mat);
|
||||
RageMatrixMultiply(&mat, &a, &b);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RageQuatMultiply( RageVector4* pOut, const RageVector4 &pA, const RageVector4 &pB )
|
||||
{
|
||||
RageVector4 out;
|
||||
|
||||
@@ -36,7 +36,6 @@ void RageMatrixRotationX( RageMatrix* pOut, float fTheta );
|
||||
void RageMatrixRotationY( RageMatrix* pOut, float fTheta );
|
||||
void RageMatrixRotationZ( RageMatrix* pOut, float fTheta );
|
||||
void RageMatrixRotationXYZ( RageMatrix* pOut, float rX, float rY, float rZ );
|
||||
void RageMatrixCommand( CString sCommandString, RageMatrix &mat );
|
||||
void RageQuatFromHPR(RageVector4* pOut, RageVector3 hpr );
|
||||
void RageQuatFromPRH(RageVector4* pOut, RageVector3 prh );
|
||||
void RageMatrixFromQuat( RageMatrix* pOut, const RageVector4 q );
|
||||
|
||||
Reference in New Issue
Block a user