MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / Spline

Function Spline

TombEngine/Game/spotcam.cpp:832–845  ·  view source on GitHub ↗

Core's version. Proper decompilation by ChocolateFan TODO: Replace with float-based version.

Source from the content-addressed store, hash-verified

830// Core's version. Proper decompilation by ChocolateFan
831// TODO: Replace with float-based version.
832int Spline(int x, int* knots, int nk)
833{
834 int span = x * (nk - 3) >> 16;
835 if (span >= nk - 3)
836 span = nk - 4;
837
838 int* k = &knots[span];
839 x = x * (nk - 3) - span * 65536;
840
841 int c1 = (k[1] >> 1) - (k[2] >> 1) - k[2] + k[1] + (k[3] >> 1) + ((-k[0] - 1) >> 1);
842 int c2 = 2 * k[2] - 2 * k[1] - (k[1] >> 1) - (k[3] >> 1) + k[0];
843
844 return ((__int64)x * (((__int64)x * (((__int64)x * c1 >> 16) + c2) >> 16) + (k[2] >> 1) + ((-k[0] - 1) >> 1)) >> 16) + k[1];
845}
846
847Pose GetCameraTransform(int sequence, float alpha, bool loop)
848{

Callers 2

CalculateSpotCamerasFunction · 0.85
GetCameraTransformFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected