|
JubeatPlus 3.9.11
|
Free functions and globals shared across the game engine. More...
Go to the source code of this file.
Functions | |
| float | InterpolateFloatByFrame (float flFrom, float flTo, unsigned int nCurrentFrame, unsigned int nStartFrame, unsigned int nEndFrame) |
| Interpolates linearly between two values across a frame range. | |
| float | InterpolateFloatByPosition (float flCurrent, float flStart, float flEnd, float flFrom, float flTo) |
| Interpolates linearly between two values across a float window, clamped at both ends. | |
Free functions and globals shared across the game engine.
Reconstructed from Ghidra program Jubeat (image base 0x100000000). All
Per the project rules this header holds only genuinely free shared engine functions and globals. Anything that turns out to be an instance or class method belongs in its own class's header instead, and should be moved here-out rather than accumulated here.
| float InterpolateFloatByFrame | ( | float | flFrom, |
| float | flTo, | ||
| unsigned int | nCurrentFrame, | ||
| unsigned int | nStartFrame, | ||
| unsigned int | nEndFrame ) |
Interpolates linearly between two values across a frame range.
Fifteen instructions with no calls, so a genuine free function rather than a method whose receiver was optimised away. Single precision throughout.
| flFrom | The value at nStartFrame. |
| flTo | The value at nEndFrame. |
| nCurrentFrame | Where in the range to sample. |
| nStartFrame | The range's first frame. |
| nEndFrame | The range's last frame. |
| float InterpolateFloatByPosition | ( | float | flCurrent, |
| float | flStart, | ||
| float | flEnd, | ||
| float | flFrom, | ||
| float | flTo ) |
Interpolates linearly between two values across a float window, clamped at both ends.
The all-float sibling of InterpolateFloatByFrame: the same weighted-average maths, but the window bounds are floats and the comparisons are genuine floating-point compares, so negative positions behave sensibly. Eleven instructions with no calls, so a genuine free function rather than a method whose receiver was optimised away. Single precision throughout.
The result at a position inside the window is
which is exact at both endpoints without a separate clamp.
| flCurrent | Where in the window to sample. |
| flStart | The window's lower bound. |
| flEnd | The window's upper bound. |
| flFrom | The value at flStart, and the result when flCurrent is below the window. |
| flTo | The value at flEnd, and the result when flCurrent is above the window. |