resonance 1.0.1
Loading...
Searching...
No Matches
TnlBumpFX Class Reference

Burst of generated instances that sweeps along a short stretch of the tunnel. More...

#include <tnlbumpfx.h>

Public Member Functions

 TnlBumpFX (int nIndex)
 Resolve the objects of one burst slot and silence its generator.
 ~TnlBumpFX ()
 Give the generator back both rate bounds at the recorded low rate.
void Start (int nStep, const HxStr &colorName, int nForward, float flPathOffset)
 Start a burst that sweeps towards one lane in one player's colour.
bool IsIdle () const
 Report whether the burst waits for Start().
void SetFrame (float flFrame)
 Advance the burst.

Detailed Description

Burst of generated instances that sweeps along a short stretch of the tunnel.

The class is not polymorphic and emits no RTTI, and no allocation tag or file path identifies it. The name is inferred from the three objects it drives, "bumpfx<n>.mgen", "bumpfx<n>.mat", and "bumpfx<n>.tnm".

A burst runs in two timed phases once it is started. For the first 500 frames the generator spawns with its authored rate while its path window follows the song, 800 frames long and running forward or backward. The spawn rate then drops to one instance per 1e9 frames, and 1500 frames after the start the generator hides.

AppTunnel allocates these in a loop, 0x20 bytes each, with the loop index as nIndex.

Constructor & Destructor Documentation

◆ TnlBumpFX()

TnlBumpFX::TnlBumpFX ( int nIndex)
explicit

Resolve the objects of one burst slot and silence its generator.

The generator's low spawn rate is recorded before both rate bounds are set to 1e9, and the generator is hidden.

Parameters
nIndexThe burst slot.
Ghidra address:
NTSC-U/C: 0x0043dc20
Ghidra address:
PAL: 0x0047a450

◆ ~TnlBumpFX()

TnlBumpFX::~TnlBumpFX ( )

Give the generator back both rate bounds at the recorded low rate.

Ghidra address:
NTSC-U/C: 0x00456690
Ghidra address:
PAL: 0x00493bc0

Member Function Documentation

◆ Start()

void TnlBumpFX::Start ( int nStep,
const HxStr & colorName,
int nForward,
float flPathOffset )

Start a burst that sweeps towards one lane in one player's colour.

The generator gets its authored spawn rate back, and its spawn clock restarts. The first rotation key of the path's frame owner becomes a turn about Y of (1 - nStep / 8) turns, the rotation keys are sorted, and every rotation tangent is rebuilt. The material's emissive colour becomes the player's colour, and the generator shows.

Parameters
nStepThe lane, in eighths of a turn.
colorNameThe player's colour name. The callers pass a copy, and the name reaches TnlColorFromName() with no further copy.
nForwardNon-zero runs the path window forward.
flPathOffsetThe distance from the song frame to the path window.
Ghidra address:
NTSC-U/C: 0x0043dea8
Ghidra address:
PAL: 0x0047a738

◆ IsIdle()

bool TnlBumpFX::IsIdle ( ) const
inline

Report whether the burst waits for Start().

AppTunnel's routine at 0x00457828 tests the state inline to find a free burst, and no out-of-line copy exists.

Returns
True while idle.

◆ SetFrame()

void TnlBumpFX::SetFrame ( float flFrame)

Advance the burst.

While idle the routine only records flFrame. Otherwise the generator is driven to the time since the start. During the first phase the path window is reset to begin at flFrame + mPathOffset and to end 800 frames later, or earlier when mForward is clear.

Parameters
flFrameThe current frame.
Ghidra address:
NTSC-U/C: 0x004566c8
Ghidra address:
PAL: 0x00493bf8

The documentation for this class was generated from the following file: