Files
SpaghettiKart/src/math_util_2.h
T
MegaMech 44db9bab77 Add Interpolation (#204)
* initial work

* more work

* progress

* Fixed slow fps

* Add Lywx changes

* Interp Works

* Test default tick/logic update

* Added missing include (#202)

* Added missing include

* More missing includes

---------

Co-authored-by: MegaMech <MegaMech@users.noreply.github.com>

* test

* Revert "test"

This reverts commit 1a810d74cc.

* Interp Item box

* Actually interpolate item box

* fix clouds

* interp player?

* Test 2

* Fix mistake

* tag and fix item boxes

* tag fake item box and whatever func_800696CC is

* these aren't needed

* tag karts

* Slightly better falling rocks(still needs work)

* Tag Smoke and Dust

* Removed unneeded code from falling_rock

* tag whatever func_80051ABC is

* add missing rotate x coord

* GrandPrixBallon/kart shadow

* Green shells tag, and added comments I neglected to add before.

* doesn't compile on win

* Fixes

* Disabled camera interpolation

* Balloons fixes

* progress

* set_transform_matrix compiles

* Compile setTransformMatrix

* More transforms interp

* Add more interps

* matrix

* Matrix multi interp

* Fix interpolation camera bug

* Missing includes needed for Linux.

* Excluded access to HM64 Labs on Switch.

* interpolation tags for various objects

* Bowser castle statue flame interpolated.

* tag hedgehogs

* cloud interpolation

* Interpolated smoke particles from shells

* cloud interpolation refactor

* Interpolated snowflakes

* Interpolated penguins, also added comment tags to places I missed.

* tag Snowman interpolation

* Interpolated player reflection(sherbet land)

* Forgot to uncomment stuff while testing

* better tag

* tag leaves

* Set the default FPS to 30

* tag hud

* Fixed "Match Refresh Rate" option

* adjust draw distance

* remove innecessary rock tag

* rag rocks

* better tag

* Tagged player rank placement in HUD

* Tagged Bat, Boos, and TrashBin(Banshee Boardwalk objects)

* Refactor render_screens and fix editor raycast

* better object interpolation

* shift is not needed here

* fix tag

* fix tags

* mole comments

* comment

* Changed how shell flames are interpolated.

* interpolated ended scene fireworks.

* Tagged star particles in the ending scene

* Shell flames handled better.

* this isn't needed

* Fix multiplayer cameras

* Fixed loading battle maps.

* Tagged battle balloons

* Some fixes for battle mode

* No longer needed changes toAFinishline with the changes mega made.

* Tag finishline

* fix to make it compile with cmake 3.31

* changed mtxf_multiplication() to fix vert explosion in Desert & DK parkway.(provided by Coco.)

* fix memory leaks, avoid invalidate texture (#207)

* Fixed macos

* More stupid fixes

* update with main and update torch and lus and enable action on this branch

* Update FrameInterpolation.h

* Update FrameInterpolation.cpp

* fix some memory leak

* Update torch

* Update torch

* update torch and lus

* reduce texture import

* don't use fork of torch and lus

* Update torch

* Update torch

---------

Co-authored-by: Lywx <kiritodev01@gmail.com>

* Refactor World::Courses to unique_ptr (#211)

* wip course unique ptr

* Track unique_ptr : This probably compiles

* Finish impl Courses as unique_ptr

* Fix error

* Fixes

* More fixes

* Cleanup

* Remove old vars

---------

Co-authored-by: MegaMech <7255464+MegaMech@users.noreply.github.com>

* particle boat and train

* fix player particle interpolation

* add modify interpolation target fps in menu

* fix windows

* Update libultraship

* Fix logo interp

* Interp SetTextMatrix

* Fix freecam camera

* Clarify comment

* Clarify func

* fix linux compilation

* Update Thwomp.cpp

* Update Thwomp.h

* Update render.inc.c

* Update render.inc.c

* Update gbiMacro.c

* interp falling rock shadow

* Revert change that has no explanation

* Update code_80057C60.c

* Update code_80057C60.c

* Update GrandPrixBalloons.cpp

* Update Lakitu.cpp

* Update framebuffer_effects.c

* Update render_courses.c

---------

Co-authored-by: Sonic Dreamcaster <alejandro.asenjo88@gmail.com>
Co-authored-by: KiritoDv <kiritodev01@gmail.com>
Co-authored-by: sitton76 <58642183+sitton76@users.noreply.github.com>
Co-authored-by: MegaMech <7255464+MegaMech@users.noreply.github.com>
Co-authored-by: coco875 <59367621+coco875@users.noreply.github.com>
Co-authored-by: coco875 <pereira.jannin@gmail.com>
2025-06-07 21:38:12 -06:00

89 lines
3.3 KiB
C

#ifndef MATH_UTIL_2_H
#define MATH_UTIL_2_H
#include <libultraship.h>
#include <common_structs.h>
#include "camera.h"
extern Mat4* gInterpolationMatrix;
/* Function Prototypes */
// Unused functions
void operator_or(s32*, s32);
void operator_and_not(s32*, s32);
void operator_xor(s32*, s32);
bool func_80040E84(s32*, s32); // UNUSED
s32 func_80040EA4(s32*, s32);
s32 f32_step_up_towards_alternate(f32*, f32, f32*);
s32 f32_step_down_towards_alternate(f32*, f32, f32*);
s32 s32_step_up_towards_alternate(s32*, s32, s32*);
s32 s32_step_down_towards_alternate(s32*, s32, s32*);
s32 s16_step_up_towards_alternate(s16*, s16, s16*);
s32 s16_step_down_towards_alternate(s16*, s16, s16*);
s32 s32_step_towards(s32*, s32, s32);
s32 is_within_distance_2d(f32, f32, f32, f32, f32);
s32 func_80041680(f32, f32);
s32 func_800416AC(f32, f32);
void func_80041F54(s32, s32);
void func_80042000(u16);
void func_800420A8(f32);
void func_8004214C(u16, f32);
void func_800421FC(s32, s32, f32);
void func_800423F0(Mat4, u16, u16, u16);
void func_8004252C(Mat4, u16, u16);
void mtxf_mult_first_column(Mat4, f32);
void mtxf_mult_second_column(Mat4, f32);
void mtxf_mult_third_column(Mat4, f32);
void vec3f_rotate(Vec3f, Vec3f, Vec3s);
void rsp_set_matrix_diff_translation_scale(Vec3f, Vec3f, f32);
void vec3f_copy(Vec3f, Vec3f);
s32 f32_step_up_towards(f32*, f32, f32);
s32 f32_step_down_towards(f32*, f32, f32);
s32 s32_step_up_towards(s32*, s32, s32);
s32 s32_step_down_towards(s32*, s32, s32);
s32 s16_step_up_towards(s16*, s16, s16);
s32 u16_step_up_towards(u16*, u16, u16);
s32 s16_step_down_towards(s16*, s16, s16);
s32 u16_step_down_towards(u16*, s32, s32);
s32 s16_step_towards(s16*, s16, s16);
s32 f32_step_towards(f32*, f32, f32);
Vec3f* vec3f_set_xyz(Vec3f, f32, f32, f32);
Vec3f* vec3f_normalize(Vec3f dest);
Vec3f* vec3f_cross_product(Vec3f, Vec3f, Vec3f);
s32 func_80041658(f32, f32);
f32 func_800416D8(f32 x, f32 z, u16 angle);
f32 func_80041724(f32, f32, u16);
s32 get_angle_between_xy(f32, f32, f32, f32);
u16 func_800417B4(u16, u16);
s32 func_800418AC(f32, f32, Vec3f);
s32 func_800418E8(f32, f32, Vec3f);
s32 func_80041924(Collision*, Vec3f);
bool is_particle_on_screen(Vec3f, Camera*, u16);
void func_800419F8(void);
void mtfx_translation_x_y(Mat4, s32, s32);
void mtxf_u16_rotate_z(Mat4, u16);
void mtxf_scale_x_y(Mat4, f32);
void mtxf_rotate_z_scale_x_y(Mat4, u16, f32);
void mtxf_translation_x_y_rotate_z_scale_x_y(Mat4, s32, s32, u16, f32);
void func_80041D24(void);
void func_80041D34(void);
void set_matrix_hud_screen(void);
void func_80042330(s32, s32, u16, f32);
void func_80042330_unchanged(s32 x, s32 y, u16 angle, f32 scale);
void func_80042330_portrait(s32, s32, u16, f32, s16);
void func_80042330_wide(s32, s32, u16, f32);
void mtxf_set_matrix_transformation(Mat4, Vec3f, Vec3su, f32);
void mtxf_set_matrix_scale_transl(Mat4, Vec3f, Vec3f, f32);
s32 mtxf_set_matrix_gObjectList(s32, Mat4);
void set_transform_matrix(Mat4 dest, Vec3f orientationVector, Vec3f positionVector, u16 rotationAngle,
f32 scaleFactor);
void vec3f_rotate_x_y(Vec3f, Vec3f, Vec3s);
void rsp_set_matrix_transformation(Vec3f, Vec3su, f32);
void rsp_set_matrix_transformation_inverted_x_y_orientation(Vec3f, Vec3su, f32);
void rsp_set_matrix_transl_rot_scale(Vec3f, Vec3f, f32);
void rsp_set_matrix_gObjectList(s32);
#endif // MATH_UTIL_2_H