JubeatPlus 3.9.11
Loading...
Searching...
No Matches
neEngineBridge.h File Reference

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.

Detailed Description

Free functions and globals shared across the game engine.

Reconstructed from Ghidra program Jubeat (image base 0x100000000). All

Ghidra address:
values are offsets relative to that image base.

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.

Function Documentation

◆ InterpolateFloatByFrame()

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.

Parameters
flFromThe value at nStartFrame.
flToThe value at nEndFrame.
nCurrentFrameWhere in the range to sample.
nStartFrameThe range's first frame.
nEndFrameThe range's last frame.
Returns
The interpolated value.
Ghidra address:
0x125548

◆ InterpolateFloatByPosition()

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

((flCurrent - flStart) * flTo + (flEnd - flCurrent) * flFrom) / (flEnd - flStart)

which is exact at both endpoints without a separate clamp.

Parameters
flCurrentWhere in the window to sample.
flStartThe window's lower bound.
flEndThe window's upper bound.
flFromThe value at flStart, and the result when flCurrent is below the window.
flToThe value at flEnd, and the result when flCurrent is above the window.
Returns
The interpolated value.
Ghidra address:
0x125584