mirror of
https://gitlab.com/skmp/dca3-game.git
synced 2025-08-31 02:20:04 +02:00
Addressed review feedback.
This commit is contained in:
@@ -2170,15 +2170,18 @@ CCollision::ProcessColModels(const CMatrix &matrixA, CColModel &modelA,
|
|||||||
|
|
||||||
// From model A space to model B space
|
// From model A space to model B space
|
||||||
matAB = Invert(matrixB, matAB);
|
matAB = Invert(matrixB, matAB);
|
||||||
|
#ifndef DC_SH4
|
||||||
matAB *= matrixA;
|
matAB *= matrixA;
|
||||||
|
#else
|
||||||
|
mat_load(reinterpret_cast<const matrix_t*>(&matAB));
|
||||||
|
mat_apply(reinterpret_cast<const matrix_t*>(&matrixA));
|
||||||
|
#endif
|
||||||
|
|
||||||
CColSphere bsphereAB; // bounding sphere of A in B space
|
CColSphere bsphereAB; // bounding sphere of A in B space
|
||||||
bsphereAB.radius = modelA.boundingSphere.radius;
|
bsphereAB.radius = modelA.boundingSphere.radius;
|
||||||
#ifndef DC_SH4
|
#ifndef DC_SH4
|
||||||
bsphereAB.center = matAB * modelA.boundingSphere.center;
|
bsphereAB.center = matAB * modelA.boundingSphere.center;
|
||||||
#else
|
#else
|
||||||
/* No need to reload the matrix, since it's already banked.
|
|
||||||
mat_load(reinterpret_cast<const matrix_t *>(&matAB)); */
|
|
||||||
mat_trans_single3_nodiv_nomod(modelA.boundingSphere.center.x,
|
mat_trans_single3_nodiv_nomod(modelA.boundingSphere.center.x,
|
||||||
modelA.boundingSphere.center.y,
|
modelA.boundingSphere.center.y,
|
||||||
modelA.boundingSphere.center.z,
|
modelA.boundingSphere.center.z,
|
||||||
@@ -2240,10 +2243,11 @@ CCollision::ProcessColModels(const CMatrix &matrixA, CColModel &modelA,
|
|||||||
int numTrianglesB = 0;
|
int numTrianglesB = 0;
|
||||||
// B to A space
|
// B to A space
|
||||||
matBA = Invert(matrixA, matBA);
|
matBA = Invert(matrixA, matBA);
|
||||||
|
#ifndef DC_SH4
|
||||||
matBA *= matrixB;
|
matBA *= matrixB;
|
||||||
#ifdef DC_SH4
|
#else
|
||||||
/* No need to reload the matrix, since it's already banked.
|
mat_load(reinterpret_cast<const matrix_t*>(&matBA));
|
||||||
mat_load(reinterpret_cast<const matrix_t *>(&matBA)); */
|
mat_apply(reinterpret_cast<const matrix_t*>(&matrixB));
|
||||||
#endif
|
#endif
|
||||||
for(i = 0; i < modelB.numSpheres; i++){
|
for(i = 0; i < modelB.numSpheres; i++){
|
||||||
s.radius = modelB.spheres[i].radius;
|
s.radius = modelB.spheres[i].radius;
|
||||||
|
@@ -2024,15 +2024,18 @@ CCollision::ProcessColModels(const CMatrix &matrixA, CColModel &modelA,
|
|||||||
|
|
||||||
// From model A space to model B space
|
// From model A space to model B space
|
||||||
matAB = Invert(matrixB, matAB);
|
matAB = Invert(matrixB, matAB);
|
||||||
|
#ifndef DC_SH4
|
||||||
matAB *= matrixA;
|
matAB *= matrixA;
|
||||||
|
#else
|
||||||
|
mat_load(reinterpret_cast<const matrix_t*>(&matAB));
|
||||||
|
mat_apply(reinterpret_cast<const matrix_t*>(&matrixA));
|
||||||
|
#endif
|
||||||
|
|
||||||
CColSphere bsphereAB; // bounding sphere of A in B space
|
CColSphere bsphereAB; // bounding sphere of A in B space
|
||||||
bsphereAB.radius = modelA.boundingSphere.radius;
|
bsphereAB.radius = modelA.boundingSphere.radius;
|
||||||
#ifndef DC_SH4
|
#ifndef DC_SH4
|
||||||
bsphereAB.center = matAB * modelA.boundingSphere.center;
|
bsphereAB.center = matAB * modelA.boundingSphere.center;
|
||||||
#else
|
#else
|
||||||
/* No need to reload the matrix, since it's already banked.
|
|
||||||
mat_load(reinterpret_cast<const matrix_t *>(&matAB)); */
|
|
||||||
mat_trans_single3_nodiv_nomod(modelA.boundingSphere.center.x,
|
mat_trans_single3_nodiv_nomod(modelA.boundingSphere.center.x,
|
||||||
modelA.boundingSphere.center.y,
|
modelA.boundingSphere.center.y,
|
||||||
modelA.boundingSphere.center.z,
|
modelA.boundingSphere.center.z,
|
||||||
@@ -2046,7 +2049,7 @@ CCollision::ProcessColModels(const CMatrix &matrixA, CColModel &modelA,
|
|||||||
// transform modelA's spheres and lines to B space
|
// transform modelA's spheres and lines to B space
|
||||||
for(i = 0; i < modelA.numSpheres; i++){
|
for(i = 0; i < modelA.numSpheres; i++){
|
||||||
CColSphere &s = modelA.spheres[i];
|
CColSphere &s = modelA.spheres[i];
|
||||||
#ifndef DC_SH4
|
#ifndef DC_SH4
|
||||||
aSpheresA[i].Set(s.radius, matAB * s.center, s.surface, s.piece);
|
aSpheresA[i].Set(s.radius, matAB * s.center, s.surface, s.piece);
|
||||||
#else
|
#else
|
||||||
auto &d = aSpheresA[i];
|
auto &d = aSpheresA[i];
|
||||||
@@ -2093,10 +2096,11 @@ CCollision::ProcessColModels(const CMatrix &matrixA, CColModel &modelA,
|
|||||||
int numTrianglesB = 0;
|
int numTrianglesB = 0;
|
||||||
// B to A space
|
// B to A space
|
||||||
matBA = Invert(matrixA, matBA);
|
matBA = Invert(matrixA, matBA);
|
||||||
|
#ifndef DC_SH4
|
||||||
matBA *= matrixB;
|
matBA *= matrixB;
|
||||||
#ifdef DC_SH4
|
#else
|
||||||
/* No need to reload the matrix, since it's already banked.
|
mat_load(reinterpret_cast<const matrix_t*>(&matBA));
|
||||||
mat_load(reinterpret_cast<const matrix_t *>(&matBA)); */
|
mat_apply(reinterpret_cast<const matrix_t*>(&matrixB));
|
||||||
#endif
|
#endif
|
||||||
for(i = 0; i < modelB.numSpheres; i++){
|
for(i = 0; i < modelB.numSpheres; i++){
|
||||||
s.radius = modelB.spheres[i].radius;
|
s.radius = modelB.spheres[i].radius;
|
||||||
|
Reference in New Issue
Block a user