diff --git a/src/liberty/collision/Collision.cpp b/src/liberty/collision/Collision.cpp index 0cf3d14c..a901a9a5 100644 --- a/src/liberty/collision/Collision.cpp +++ b/src/liberty/collision/Collision.cpp @@ -2170,15 +2170,18 @@ CCollision::ProcessColModels(const CMatrix &matrixA, CColModel &modelA, // From model A space to model B space matAB = Invert(matrixB, matAB); +#ifndef DC_SH4 matAB *= matrixA; +#else + mat_load(reinterpret_cast(&matAB)); + mat_apply(reinterpret_cast(&matrixA)); +#endif CColSphere bsphereAB; // bounding sphere of A in B space bsphereAB.radius = modelA.boundingSphere.radius; #ifndef DC_SH4 bsphereAB.center = matAB * modelA.boundingSphere.center; #else - /* No need to reload the matrix, since it's already banked. - mat_load(reinterpret_cast(&matAB)); */ mat_trans_single3_nodiv_nomod(modelA.boundingSphere.center.x, modelA.boundingSphere.center.y, modelA.boundingSphere.center.z, @@ -2240,10 +2243,11 @@ CCollision::ProcessColModels(const CMatrix &matrixA, CColModel &modelA, int numTrianglesB = 0; // B to A space matBA = Invert(matrixA, matBA); +#ifndef DC_SH4 matBA *= matrixB; -#ifdef DC_SH4 - /* No need to reload the matrix, since it's already banked. - mat_load(reinterpret_cast(&matBA)); */ +#else + mat_load(reinterpret_cast(&matBA)); + mat_apply(reinterpret_cast(&matrixB)); #endif for(i = 0; i < modelB.numSpheres; i++){ s.radius = modelB.spheres[i].radius; diff --git a/src/miami/collision/Collision.cpp b/src/miami/collision/Collision.cpp index c9151969..6b56360e 100644 --- a/src/miami/collision/Collision.cpp +++ b/src/miami/collision/Collision.cpp @@ -2024,15 +2024,18 @@ CCollision::ProcessColModels(const CMatrix &matrixA, CColModel &modelA, // From model A space to model B space matAB = Invert(matrixB, matAB); +#ifndef DC_SH4 matAB *= matrixA; +#else + mat_load(reinterpret_cast(&matAB)); + mat_apply(reinterpret_cast(&matrixA)); +#endif CColSphere bsphereAB; // bounding sphere of A in B space bsphereAB.radius = modelA.boundingSphere.radius; #ifndef DC_SH4 bsphereAB.center = matAB * modelA.boundingSphere.center; #else - /* No need to reload the matrix, since it's already banked. - mat_load(reinterpret_cast(&matAB)); */ mat_trans_single3_nodiv_nomod(modelA.boundingSphere.center.x, modelA.boundingSphere.center.y, modelA.boundingSphere.center.z, @@ -2046,7 +2049,7 @@ CCollision::ProcessColModels(const CMatrix &matrixA, CColModel &modelA, // transform modelA's spheres and lines to B space for(i = 0; i < modelA.numSpheres; i++){ CColSphere &s = modelA.spheres[i]; - #ifndef DC_SH4 +#ifndef DC_SH4 aSpheresA[i].Set(s.radius, matAB * s.center, s.surface, s.piece); #else auto &d = aSpheresA[i]; @@ -2093,10 +2096,11 @@ CCollision::ProcessColModels(const CMatrix &matrixA, CColModel &modelA, int numTrianglesB = 0; // B to A space matBA = Invert(matrixA, matBA); +#ifndef DC_SH4 matBA *= matrixB; -#ifdef DC_SH4 - /* No need to reload the matrix, since it's already banked. - mat_load(reinterpret_cast(&matBA)); */ +#else + mat_load(reinterpret_cast(&matBA)); + mat_apply(reinterpret_cast(&matrixB)); #endif for(i = 0; i < modelB.numSpheres; i++){ s.radius = modelB.spheres[i].radius;