summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsitton76 <58642183+sitton76@users.noreply.github.com>2025-05-23 12:45:07 -0500
committersitton76 <58642183+sitton76@users.noreply.github.com>2025-05-23 12:45:07 -0500
commitaf4535c3c578425a456c8c34c42f10108f94fd1c (patch)
treec63314b26fb8280e90383fb89e94feb941e54761
parent05b752d7b3af73b70bc903871541b014d8082c00 (diff)
changed mtxf_multiplication() to fix vert explosion in Desert & DK parkway.(provided by Coco.)
-rw-r--r--src/racing/math_util.c37
1 files changed, 17 insertions, 20 deletions
diff --git a/src/racing/math_util.c b/src/racing/math_util.c
index 43143fa7d..3682e07d5 100644
--- a/src/racing/math_util.c
+++ b/src/racing/math_util.c
@@ -804,43 +804,40 @@ void func_802B6D58(Mat4 arg0, Vec3f arg1, Vec3f arg2) {
}
void mtxf_multiplication(Mat4 dest, Mat4 mat1, Mat4 mat2) {
- Mat4 product;
+ FrameInterpolation_RecordMatrixMult(dest, dest, 0);
- FrameInterpolation_RecordMatrixMult(dest, product, 0);
-
- product[0][0] =
+ dest[0][0] =
(mat1[0][0] * mat2[0][0]) + (mat1[0][1] * mat2[1][0]) + (mat1[0][2] * mat2[2][0]) + (mat1[0][3] * mat2[3][0]);
- product[0][1] =
+ dest[0][1] =
(mat1[0][0] * mat2[0][1]) + (mat1[0][1] * mat2[1][1]) + (mat1[0][2] * mat2[2][1]) + (mat1[0][3] * mat2[3][1]);
- product[0][2] =
+ dest[0][2] =
(mat1[0][0] * mat2[0][2]) + (mat1[0][1] * mat2[1][2]) + (mat1[0][2] * mat2[2][2]) + (mat1[0][3] * mat2[3][2]);
- product[0][3] =
+ dest[0][3] =
(mat1[0][0] * mat2[0][3]) + (mat1[0][1] * mat2[1][3]) + (mat1[0][2] * mat2[2][3]) + (mat1[0][3] * mat2[3][3]);
- product[1][0] =
+ dest[1][0] =
(mat1[1][0] * mat2[0][0]) + (mat1[1][1] * mat2[1][0]) + (mat1[1][2] * mat2[2][0]) + (mat1[1][3] * mat2[3][0]);
- product[1][1] =
+ dest[1][1] =
(mat1[1][0] * mat2[0][1]) + (mat1[1][1] * mat2[1][1]) + (mat1[1][2] * mat2[2][1]) + (mat1[1][3] * mat2[3][1]);
- product[1][2] =
+ dest[1][2] =
(mat1[1][0] * mat2[0][2]) + (mat1[1][1] * mat2[1][2]) + (mat1[1][2] * mat2[2][2]) + (mat1[1][3] * mat2[3][2]);
- product[1][3] =
+ dest[1][3] =
(mat1[1][0] * mat2[0][3]) + (mat1[1][1] * mat2[1][3]) + (mat1[1][2] * mat2[2][3]) + (mat1[1][3] * mat2[3][3]);
- product[2][0] =
+ dest[2][0] =
(mat1[2][0] * mat2[0][0]) + (mat1[2][1] * mat2[1][0]) + (mat1[2][2] * mat2[2][0]) + (mat1[2][3] * mat2[3][0]);
- product[2][1] =
+ dest[2][1] =
(mat1[2][0] * mat2[0][1]) + (mat1[2][1] * mat2[1][1]) + (mat1[2][2] * mat2[2][1]) + (mat1[2][3] * mat2[3][1]);
- product[2][2] =
+ dest[2][2] =
(mat1[2][0] * mat2[0][2]) + (mat1[2][1] * mat2[1][2]) + (mat1[2][2] * mat2[2][2]) + (mat1[2][3] * mat2[3][2]);
- product[2][3] =
+ dest[2][3] =
(mat1[2][0] * mat2[0][3]) + (mat1[2][1] * mat2[1][3]) + (mat1[2][2] * mat2[2][3]) + (mat1[2][3] * mat2[3][3]);
- product[3][0] =
+ dest[3][0] =
(mat1[3][0] * mat2[0][0]) + (mat1[3][1] * mat2[1][0]) + (mat1[3][2] * mat2[2][0]) + (mat1[3][3] * mat2[3][0]);
- product[3][1] =
+ dest[3][1] =
(mat1[3][0] * mat2[0][1]) + (mat1[3][1] * mat2[1][1]) + (mat1[3][2] * mat2[2][1]) + (mat1[3][3] * mat2[3][1]);
- product[3][2] =
+ dest[3][2] =
(mat1[3][0] * mat2[0][2]) + (mat1[3][1] * mat2[1][2]) + (mat1[3][2] * mat2[2][2]) + (mat1[3][3] * mat2[3][2]);
- product[3][3] =
+ dest[3][3] =
(mat1[3][0] * mat2[0][3]) + (mat1[3][1] * mat2[1][3]) + (mat1[3][2] * mat2[2][3]) + (mat1[3][3] * mat2[3][3]);
- mtxf_copy_n_element((s32*) dest, (s32*) product, 16);
}
/**