PhysicsProbe class
#include <Jazz2/Tests/PhysicsProbe.h>
Drives the first player through a fixed matrix of movement scenarios and logs its trajectory.
The counterpart of the JJ2+ AngelScript probe in Tests/Level/_pt.j2as, which does the same thing to the original game. Both drive the player from scripted input keyed on a scenario index and a tick within it, both log one CSV row per tick, and both name their scenarios identically - so a run of one can be lined up against a run of the other row for row, and the engine's movement can be compared to the original's rather than to somebody's memory of it. Tests/Results holds a captured run of each.
Nothing here depends on a human playing, so two runs of the same build agree to about a hundredth of a pixel - not bit for bit, because the settle before each scenario ends on real-time frame pacing and leaves the player a few hundredths of a pixel apart from run to run. The matrix deliberately covers each input on its own and in combination - held throughout, released early, released late, released and re-pressed, reversed, reversed and released, reversed and reversed back - on the ground and in the air, with and without Run, which is what makes the whole movement model recoverable from the traces rather than just the few constants one manoeuvre happens to expose.
The tick counter runs at the original game's measured 70.021 Hz rather than this engine's 60, so every scenario reaches each of its steps at the same real time here as it does there, whatever this build's frame rate is set to. That is what makes a 24 FPS run comparable to a 144 FPS one.
Enabled at build time with WITH_PHYSICS_PROBE and at run time with /physics-probe; see PreferencesCache::Tests/README.md for how to capture and compare a run.
Constructors, destructors, conversion operators
- PhysicsProbe(LevelHandler* levelHandler)
Public functions
- void OnUpdate(float timeMult)
- Advances the probe by one frame.
Function documentation
void Jazz2:: Tests:: PhysicsProbe:: OnUpdate(float timeMult)
Advances the probe by one frame.
Called before the actors update, so the input it puts in applies to this tick and the state it logs is what the previous tick left behind - the same point in the tick the original game's probe logs at. Does nothing once every scenario has run.