cleanup
This commit is contained in:
+13
-13
@@ -95,8 +95,8 @@ void RageVec4TransformCoord( RageVector4* pOut, const RageVector4* pV, const Rag
|
|||||||
cblas_sgemv(CblasRowMajor, CblasTrans, 4, 4, 1, &pM->m00, 4, &pV->x, 1,
|
cblas_sgemv(CblasRowMajor, CblasTrans, 4, 4, 1, &pM->m00, 4, &pV->x, 1,
|
||||||
0, &pOut->x, 1);
|
0, &pOut->x, 1);
|
||||||
#else
|
#else
|
||||||
const RageMatrix &a = *pM;
|
const RageMatrix &a = *pM;
|
||||||
const RageVector4 &v = *pV;
|
const RageVector4 &v = *pV;
|
||||||
*pOut = RageVector4(
|
*pOut = RageVector4(
|
||||||
a.m00*v.x+a.m10*v.y+a.m20*v.z+a.m30*v.w,
|
a.m00*v.x+a.m10*v.y+a.m20*v.z+a.m30*v.w,
|
||||||
a.m01*v.x+a.m11*v.y+a.m21*v.z+a.m31*v.w,
|
a.m01*v.x+a.m11*v.y+a.m21*v.z+a.m31*v.w,
|
||||||
@@ -143,8 +143,8 @@ void RageMatrixMultiply( RageMatrix* pOut, const RageMatrix* pA, const RageMatri
|
|||||||
// // <30 cycles for theirs versus >100 for ours.
|
// // <30 cycles for theirs versus >100 for ours.
|
||||||
// D3DXMatrixMultiply( (D3DMATRIX*)pOut, (D3DMATRIX*)pA, (D3DMATRIX*)pB );
|
// D3DXMatrixMultiply( (D3DMATRIX*)pOut, (D3DMATRIX*)pA, (D3DMATRIX*)pB );
|
||||||
//#else
|
//#else
|
||||||
const RageMatrix &a = *pA;
|
const RageMatrix &a = *pA;
|
||||||
const RageMatrix &b = *pB;
|
const RageMatrix &b = *pB;
|
||||||
|
|
||||||
*pOut = RageMatrix(
|
*pOut = RageMatrix(
|
||||||
b.m00*a.m00+b.m01*a.m10+b.m02*a.m20+b.m03*a.m30,
|
b.m00*a.m00+b.m01*a.m10+b.m02*a.m20+b.m03*a.m30,
|
||||||
@@ -343,7 +343,7 @@ void RageQuatMultiply( RageVector4* pOut, const RageVector4 &pA, const RageVecto
|
|||||||
out.z = pA.w * pB.z + pA.z * pB.w + pA.x * pB.y - pA.y * pB.x;
|
out.z = pA.w * pB.z + pA.z * pB.w + pA.x * pB.y - pA.y * pB.x;
|
||||||
out.w = pA.w * pB.w - pA.x * pB.x - pA.y * pB.y - pA.z * pB.z;
|
out.w = pA.w * pB.w - pA.x * pB.x - pA.y * pB.y - pA.z * pB.z;
|
||||||
|
|
||||||
float dist, square;
|
float dist, square;
|
||||||
|
|
||||||
square = out.x * out.x + out.y * out.y + out.z * out.z + out.w * out.w;
|
square = out.x * out.x + out.y * out.y + out.z * out.z + out.w * out.w;
|
||||||
|
|
||||||
@@ -351,10 +351,10 @@ void RageQuatMultiply( RageVector4* pOut, const RageVector4 &pA, const RageVecto
|
|||||||
dist = 1.0f / sqrtf(square);
|
dist = 1.0f / sqrtf(square);
|
||||||
else dist = 1;
|
else dist = 1;
|
||||||
|
|
||||||
out.x *= dist;
|
out.x *= dist;
|
||||||
out.y *= dist;
|
out.y *= dist;
|
||||||
out.z *= dist;
|
out.z *= dist;
|
||||||
out.w *= dist;
|
out.w *= dist;
|
||||||
|
|
||||||
*pOut = out;
|
*pOut = out;
|
||||||
}
|
}
|
||||||
@@ -531,8 +531,8 @@ RageMatrix RageLookAt(
|
|||||||
|
|
||||||
Y = RageVector3(
|
Y = RageVector3(
|
||||||
Z[1] * X[2] - Z[2] * X[1],
|
Z[1] * X[2] - Z[2] * X[1],
|
||||||
-Z[0] * X[2] + Z[2] * X[0],
|
-Z[0] * X[2] + Z[2] * X[0],
|
||||||
Z[0] * X[1] - Z[1] * X[0] );
|
Z[0] * X[1] - Z[1] * X[0] );
|
||||||
|
|
||||||
RageVec3Normalize(&X, &X);
|
RageVec3Normalize(&X, &X);
|
||||||
RageVec3Normalize(&Y, &Y);
|
RageVec3Normalize(&Y, &Y);
|
||||||
@@ -541,7 +541,7 @@ RageMatrix RageLookAt(
|
|||||||
X[0], Y[0], Z[0], 0,
|
X[0], Y[0], Z[0], 0,
|
||||||
X[1], Y[1], Z[1], 0,
|
X[1], Y[1], Z[1], 0,
|
||||||
X[2], Y[2], Z[2], 0,
|
X[2], Y[2], Z[2], 0,
|
||||||
0, 0, 0, 1 );
|
0, 0, 0, 1 );
|
||||||
|
|
||||||
RageMatrix mat2;
|
RageMatrix mat2;
|
||||||
RageMatrixTranslation(&mat2, -eyex, -eyey, -eyez);
|
RageMatrixTranslation(&mat2, -eyex, -eyey, -eyez);
|
||||||
@@ -615,7 +615,7 @@ float RageFastSin( float x )
|
|||||||
|
|
||||||
float fRemainder = fIndex - iSampleIndex[0];
|
float fRemainder = fIndex - iSampleIndex[0];
|
||||||
for( unsigned i=0; i<ARRAYSIZE(iSampleIndex); i++ )
|
for( unsigned i=0; i<ARRAYSIZE(iSampleIndex); i++ )
|
||||||
iSampleIndex[i] %= ARRAYSIZE(table) * 2;
|
iSampleIndex[i] %= ARRAYSIZE(table) * 2;
|
||||||
|
|
||||||
DEBUG_ASSERT( fRemainder>=0 && fRemainder<=1 );
|
DEBUG_ASSERT( fRemainder>=0 && fRemainder<=1 );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user