This commit is contained in:
MegaMech 2025-05-16 21:43:05 -06:00
parent 7473382f06
commit 1a810d74cc
8 changed files with 20 additions and 6 deletions

View File

@ -1,6 +1,7 @@
#include <actors.h>
#include <main.h>
#include <macros.h>
#include "port/interpolation/FrameInterpolation.h"
/**
* @brief Renders the item box actor.
@ -28,6 +29,11 @@ void render_actor_item_box(Camera* camera, struct ItemBox* item_box) {
temp_f0 = is_within_render_distance(camera->pos, item_box->pos, camera->rot[1], 0.0f, gCameraZoom[camera - camera1],
4000000.0f);
FrameInterpolation_RecordMatrixPush(someMatrix1);
FrameInterpolation_RecordMatrixPush(someMatrix2);
if (CVarGetInteger("gNoCulling", 0) == 1) {
temp_f0 = CLAMP(temp_f0, 0.0f, 600000.0f);
}

View File

@ -33,7 +33,7 @@ void render_actor_mario_sign(Camera* arg0, UNUSED Mat4 arg1, struct Actor* arg2)
if (render_set_position(mtx, 0) != 0) {
gSPDisplayList(gDisplayListHead++, d_course_mario_raceway_dl_sign);
}
FrameInterpolation_RecordMatrixPop(mtx);
//FrameInterpolation_RecordMatrixPop(mtx);
}
}

View File

@ -62,7 +62,7 @@ void render_actor_yoshi_egg(Camera* arg0, Mat4 arg1, struct YoshiValleyEgg* egg,
gSPSetGeometryMode(gDisplayListHead++, G_LIGHTING);
gSPDisplayList(gDisplayListHead++, d_course_yoshi_valley_dl_16D70);
FrameInterpolation_RecordMatrixPop(sp60);
// FrameInterpolation_RecordMatrixPop(sp60);
} else {
arg1[3][0] = egg->pos[0];
arg1[3][1] = egg->pos[1];
@ -74,6 +74,6 @@ void render_actor_yoshi_egg(Camera* arg0, Mat4 arg1, struct YoshiValleyEgg* egg,
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
gSPDisplayList(gDisplayListHead++, d_course_yoshi_valley_dl_egg_lod0);
}
FrameInterpolation_RecordMatrixPop(arg1);
//FrameInterpolation_RecordMatrixPop(arg1);
}
}

View File

@ -108,7 +108,7 @@ void render_limb_or_add_mtx(Armature* arg0, s16* arg1, AnimationLimbVector arg2,
model = (virtualModel);
gSPDisplayList(gDisplayListHead++, model);
}
FrameInterpolation_RecordMatrixPop(modelMatrix);
//FrameInterpolation_RecordMatrixPop(modelMatrix);
}
void render_armature(Armature* animation, Animation* arg1, s16 timeCycle) {

View File

@ -11,10 +11,12 @@ extern "C" {
void AddMatrix(std::vector<Mtx>& stack, Mat4 mtx, s32 flags) {
// Push a new matrix to the stack
//FrameInterpolation_RecordMatrixPush((Mat4*) &mtx);
stack.emplace_back();
// Convert to a fixed-point matrix
FrameInterpolation_RecordMatrixMtxFToMtx((MtxF*)mtx, &stack.back());
guMtxF2L(mtx, &stack.back());
// Load the matrix

View File

@ -520,6 +520,10 @@ void FrameInterpolation_RecordActorPosRotMatrix(void) {
}
void FrameInterpolation_RecordMatrixPush(Mat4* matrix) {
if (is_recording) {
append(Op::MatrixPop).matrix_ptr = { (Mat4**)matrix };
}
if (!is_recording)
return;

View File

@ -35,7 +35,7 @@ void FrameInterpolation_RecordActorPosRotMatrix(void);
void FrameInterpolation_RecordMatrixPosRotXYZ(Mat4 out, Vec3f pos, Vec3s orientation);
void FrameInterpolation_RecordMatrixPush(Mat4* mtx);
void FrameInterpolation_RecordMatrixPush(Mat4* matrix);
void FrameInterpolation_RecordMatrixPop(Mat4* mtx);

View File

@ -190,6 +190,8 @@ void mtxf_identity(Mat4 mtx) {
// Add a translation vector to a matrix, mat is the matrix to add, dest is the destination matrix, pos is the
// translation vector
void add_translate_mat4_vec3f(Mat4 mat, Mat4 dest, Vec3f pos) {
FrameInterpolation_RecordMatrixTranslate(dest, pos);
dest[3][0] = mat[3][0] + pos[0];
dest[3][1] = mat[3][1] + pos[1];
dest[3][2] = mat[3][2] + pos[2];