wavelength 1.0.0
Loading...
Searching...
No Matches
TnlGrid Class Reference

The grid lines across the track of a player, instances of the grid.mm multi-mesh. More...

#include <tnlgrid.h>

Collaboration diagram for TnlGrid:

Classes

class  GridLine
 One line of the grid, an instance of the multi-mesh. More...

Public Member Functions

 TnlGrid (GfxTunnel *pTunnel, int nCam)
 Make the grid of a camera.
 ~TnlGrid ()
 Empty the instances of the multi-mesh, the transforms of every other grid included, and destroy the hidden transforms.
void SetTrack (int nTrack)
 Move the grid to a track, placing again every line that is not yet kRecycleTicks behind the song tick, and reconsider every line at the next update.
void SetOrder (int nOrder)
 Show the lines only for the first of the players, and reconsider every line at the next update.
void RefreshTrack (int nTrack, bool bPlace)
 Respond to a change of a track.
void Update ()
 Move the lines that fell behind the song tick, or lie beyond the span after a jump back, to the far end of the span, and show or hide each moved line by the owner of its bar.
int GetTrack () const

Static Public Attributes

static Vector3 sQuarterScale
 The scale of a quarter line, grid_quarter_scale scaled to the tunnel.
static Vector3 sEighthScale
 The scale of an eighth line, grid_eighth_scale scaled to the tunnel.
static constexpr int kNumLines = 32
 The lines of a grid.
static constexpr float kLineTicks = 240.0f
 The ticks between two lines.
static constexpr float kSpanTicks = 7680.0f
 The ticks the lines span, kNumLines times kLineTicks.
static constexpr float kRecycleTicks = 960.0f
 The ticks a line falls behind the song tick before it moves to the far end of the span.

Detailed Description

The grid lines across the track of a player, instances of the grid.mm multi-mesh.

The class is not polymorphic and emits no RTTI, so the name is inferred. RTTI identifies its GridLine. The object is 0x30 bytes and lives inline in the per-player object of the tunnel. The lines lie kLineTicks apart over kSpanTicks, alternating between a quarter and an eighth line. Each update moves a line that has fallen kRecycleTicks behind the song tick to the far end of the span, and a line shows only when the bar under it has an owner.

Constructor & Destructor Documentation

◆ TnlGrid()

TnlGrid::TnlGrid ( GfxTunnel * pTunnel,
int nCam )

Make the grid of a camera.

For a camera number of 0 or less the grid has no mesh and no lines. Camera 1 empties the instances of grid.mm first, and every camera then adds kNumLines lines on track 0 from tick 0.

Parameters
pTunnelThe tunnel.
nCamThe camera index plus one.
Ghidra address:
NTSC-U/C: 0x001d3cc0
Ghidra address:
PAL: 0x001dca60

◆ ~TnlGrid()

TnlGrid::~TnlGrid ( )

Empty the instances of the multi-mesh, the transforms of every other grid included, and destroy the hidden transforms.

Ghidra address:
NTSC-U/C: 0x001d3ef0
Ghidra address:
PAL: 0x001dcc90

Member Function Documentation

◆ SetTrack()

void TnlGrid::SetTrack ( int nTrack)

Move the grid to a track, placing again every line that is not yet kRecycleTicks behind the song tick, and reconsider every line at the next update.

Parameters
nTrackThe track.
Ghidra address:
NTSC-U/C: 0x001d3fb8
Ghidra address:
PAL: 0x001dcd58

◆ SetOrder()

void TnlGrid::SetOrder ( int nOrder)

Show the lines only for the first of the players, and reconsider every line at the next update.

Parameters
nOrderThe place of the player among the players, from 0.
Ghidra address:
NTSC-U/C: 0x001d4078
Ghidra address:
PAL: 0x001dce18

◆ RefreshTrack()

void TnlGrid::RefreshTrack ( int nTrack,
bool bPlace )

Respond to a change of a track.

For the grid's track, place the lines again at once, or reconsider every line at the next update.

Parameters
nTrackThe track that changed.
bPlaceWhether to place the lines at once.
Ghidra address:
NTSC-U/C: 0x001d4090
Ghidra address:
PAL: 0x001dce30

◆ Update()

void TnlGrid::Update ( )

Move the lines that fell behind the song tick, or lie beyond the span after a jump back, to the far end of the span, and show or hide each moved line by the owner of its bar.

With a pending refresh every line is reconsidered.

Ghidra address:
NTSC-U/C: 0x001d40d0
Ghidra address:
PAL: 0x001dce70

◆ GetTrack()

int TnlGrid::GetTrack ( ) const
inline
Returns
The track the lines lie across.

Member Data Documentation

◆ sQuarterScale

Vector3 TnlGrid::sQuarterScale
static

The scale of a quarter line, grid_quarter_scale scaled to the tunnel.

The tunnel sets it when it builds its panels.

Ghidra address:
NTSC-U/C: 0x0043b3e0

◆ sEighthScale

Vector3 TnlGrid::sEighthScale
static

The scale of an eighth line, grid_eighth_scale scaled to the tunnel.

The tunnel sets it when it builds its panels.

Ghidra address:
NTSC-U/C: 0x0043b400

◆ kNumLines

int TnlGrid::kNumLines = 32
staticconstexpr

The lines of a grid.

◆ kLineTicks

float TnlGrid::kLineTicks = 240.0f
staticconstexpr

The ticks between two lines.

◆ kSpanTicks

float TnlGrid::kSpanTicks = 7680.0f
staticconstexpr

The ticks the lines span, kNumLines times kLineTicks.

◆ kRecycleTicks

float TnlGrid::kRecycleTicks = 960.0f
staticconstexpr

The ticks a line falls behind the song tick before it moves to the far end of the span.


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