summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMegaMech <inkstudios1@hotmail.com>2025-05-17 15:52:29 -0600
committerMegaMech <inkstudios1@hotmail.com>2025-05-17 15:52:29 -0600
commit6bcd9897dc2571c6267d2dad84abaed63eb1e4c4 (patch)
treeb84c3a0cf795d02c86d690c4fe09699ba261d40c /src
parent1229a69f2c90385eb10f4743554cda8a3fd990da (diff)
set_transform_matrix compiles
Diffstat (limited to 'src')
-rw-r--r--src/math_util_2.c2
-rw-r--r--src/port/interpolation/FrameInterpolation.cpp12
-rw-r--r--src/port/interpolation/FrameInterpolation.h3
3 files changed, 12 insertions, 5 deletions
diff --git a/src/math_util_2.c b/src/math_util_2.c
index 091bf9215..174d9095e 100644
--- a/src/math_util_2.c
+++ b/src/math_util_2.c
@@ -919,6 +919,8 @@ void set_transform_matrix(Mat4 dest, Vec3f orientationVector, Vec3f positionVect
Vec3f sp38;
Vec3f sp2C;
+ FrameInterpolation_Record_set_transform_matrix(dest, orientationVector, positionVector, rotationAngle, scaleFactor);
+
vec3f_set_xyz(sp44, sins(rotationAngle), 0.0f, coss(rotationAngle));
vec3f_normalize(orientationVector);
vec3f_cross_product(sp38, orientationVector, sp44);
diff --git a/src/port/interpolation/FrameInterpolation.cpp b/src/port/interpolation/FrameInterpolation.cpp
index 70a7ccf01..65de693a4 100644
--- a/src/port/interpolation/FrameInterpolation.cpp
+++ b/src/port/interpolation/FrameInterpolation.cpp
@@ -5,11 +5,13 @@
#include <unordered_map>
#include <math.h>
#include "port/Engine.h"
-#include <math_util.h>
-#include "math_util_2.h"
#include "FrameInterpolation.h"
#include "matrix.h"
+extern "C" {
+#include "math_util.h"
+#include "math_util_2.h"
+}
/*
Frame interpolation.
@@ -162,7 +164,7 @@ union Data {
} matrix_rotate_axis;
struct {
- Mat4 dest;
+ Mat4* dest;
Vec3f orientationVector;
Vec3f positionVector;
u16 rotationAngle;
@@ -606,11 +608,11 @@ void FrameInterpolation_RecordMatrixMultVec3fNoTranslate(Mat4* matrix, Vec3f src
// append(Op::MatrixMultVec3fNoTranslate).matrix_vec_no_translate = { matrix, src, dest };
}
-void FrameInterpolation_Record_set_transform_matrix(Mat4 dest, Vec3f orientationVector, Vec3f positionVector, u16 rotationAngle,
+void FrameInterpolation_Record_set_transform_matrix(Mat4* dest, Vec3f orientationVector, Vec3f positionVector, u16 rotationAngle,
f32 scaleFactor) {
if (!is_recording)
return;
- append(Op::SetTransformMatrix).set_transform_matrix_data = { dest[0][0], orientationVector[0], positionVector[0], rotationAngle, scaleFactor};
+ append(Op::SetTransformMatrix).set_transform_matrix_data = { dest, orientationVector[0], positionVector[0], (f32)rotationAngle, scaleFactor};
}
// Make a template for deref
diff --git a/src/port/interpolation/FrameInterpolation.h b/src/port/interpolation/FrameInterpolation.h
index d2a9a5fe3..a70f3e7b0 100644
--- a/src/port/interpolation/FrameInterpolation.h
+++ b/src/port/interpolation/FrameInterpolation.h
@@ -67,6 +67,9 @@ void FrameInterpolation_RecordSkinMatrixMtxFToMtx(MtxF* src, Mtx* dest);
//void FrameInterpolation_RecordMatrixMultVec3fNoTranslate(Matrix* matrix, Vec3f src, Vec3f dest);
+void FrameInterpolation_Record_set_transform_matrix(Mat4* dest, Vec3f orientationVector, Vec3f positionVector, u16 rotationAngle,
+ f32 scaleFactor);
+
#ifdef __cplusplus
}
#endif