Files
Ghostship/lib/src/guRotateF.c
T
20674529ab [WIP] Implemented GeoLayout loading and moved to otr every actor (#53)
* Fixed GeoLayout loading and implemented mario loading from otr

* Ported bobomb and coins

* Ported cannon barrel

* Ported blue_coin_switch

* Fixed collision loading

* Ported checkerboard_platform

* Ported most of common0 to otr

* Fixed amp on jp

* Fixed some wrong yamls

* Fixed faulty snow interpolation

* Bump LUS

* Extracted 99.99999% actors to be loaded from otr

* Removed unnessesary print and added o2r mod support

* Fixed headers

* Added us support into geolayout parser

* Fixed conflicts

* Removed done indicators

* Remove duplicated headers

* Added bbh, bitdw, bitfs, bits, bob and lll loaded from otr

* Bump torch

* Fixed linux compilation

* Pushed header generation

* Got compiling on Linux working. (#59)

* Added more data and hopefully fix more issues

* Updated libultraship

* bin dls and vtxs (#60)

* Fixed master volume

* Updated torch

* Renamed otr files

* Renamed otr en cmakelists

* Updated libultraship and torch

* Removed actors code

* [WIP] The big one that removes almost all hardcoded assets from levels and actors

* Updating cmake to match Starship

* Updated more references

* Updated cmake to add more targets

* Updated o2r name

* Removed unnecesary dma call

* Updated gitmodules

* Bump LUS, fixed cmake and fixed audio on windows

* Update torch and wdw

* Fixed some corrupted ptrs, cleaned up jp support and fixed bully

* Added USE_GBI_TRACE

* Fixed packaging.cmake and audio fixes

* Removed old LUS

* Updated torch and readded LUS

* More compilation issues

* Removed interpolation to use on the future the new system

* Bump libs

* Reimplemented skybox, and added synthesis overflow fix

* Removed prints to use SPDLOG

* This should had been on another branch but fuck it

* Added more interpolation stuff

* Fixed interpolation, fixed some random things and ported from GameInteractor to Lwyx's EventSystem

* Removed some FrameInterpolation changes

* Fixed gitignore and implemented PortEnhancements

* Fixed interpolation crashes, WIP implemented reset among other fixes

* Bump torch to fix paintings

* Moved log to be a trace

* Readded some frame tagging

* Fixed rumble

* Fixed skybox crashes

* Bump LUS

* Moved skybox and floats to float for better precision

* Moved to health change and created lives change event

* Fixed bubbles being broken

* Fixed lives event not being registered

* Fixed skybox crashes

* Initialized mixer variables

* Fixed some memory leaks

* Fixed trajectory being exported incorrectly

* Hopefully fixed us yamls

* Fixed remaining us issues

* Implemented o2r generation among some other things

---------

Co-authored-by: KiritoDv <KiritoDv>
Co-authored-by: sitton76 <58642183+sitton76@users.noreply.github.com>
Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com>
2026-01-07 01:37:43 -06:00

45 lines
1.0 KiB
C

#include "libultra_internal.h"
#include "port/interpolation/FrameInterpolation.h"
void guRotateF(float m[4][4], float a, float x, float y, float z) {
float sin_a;
float cos_a;
float sp2c;
float sp28;
float sp24;
float xx, yy, zz;
static float D_80365D70 = GU_PI / 180;
guNormalize(&x, &y, &z);
a = a * D_80365D70;
sin_a = sinf(a);
cos_a = cosf(a);
sp2c = x * y * (1 - cos_a);
sp28 = y * z * (1 - cos_a);
sp24 = z * x * (1 - cos_a);
guMtxIdentF(m);
xx = x * x;
m[0][0] = (1 - xx) * cos_a + xx;
m[2][1] = sp28 - x * sin_a;
m[1][2] = sp28 + x * sin_a;
yy = y * y;
m[1][1] = (1 - yy) * cos_a + yy;
m[2][0] = sp24 + y * sin_a;
m[0][2] = sp24 - y * sin_a;
zz = z * z;
m[2][2] = (1 - zz) * cos_a + zz;
m[1][0] = sp2c - z * sin_a;
m[0][1] = sp2c + z * sin_a;
}
void guRotate(Mtx *m, float a, float x, float y, float z) {
float mf[4][4];
guRotateF(mf, a, x, y, z);
FrameInterpolation_RecordMatrixMtxFToMtx((MtxF*)mf, m);
guMtxF2L(mf, m);
}