|
wavelength 1.0.0
|
The grid lines across the track of a player, instances of the grid.mm multi-mesh. More...
#include <tnlgrid.h>

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. | |
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.
| 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.
| pTunnel | The tunnel. |
| nCam | The camera index plus one. |
| TnlGrid::~TnlGrid | ( | ) |
Empty the instances of the multi-mesh, the transforms of every other grid included, and destroy the hidden transforms.
| 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.
| nTrack | The track. |
| void TnlGrid::SetOrder | ( | int | nOrder | ) |
Show the lines only for the first of the players, and reconsider every line at the next update.
| nOrder | The place of the player among the players, from 0. |
| 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.
| nTrack | The track that changed. |
| bPlace | Whether to place the lines at once. |
| 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.
|
inline |
|
static |
The scale of a quarter line, grid_quarter_scale scaled to the tunnel.
The tunnel sets it when it builds its panels.
|
static |
The scale of an eighth line, grid_eighth_scale scaled to the tunnel.
The tunnel sets it when it builds its panels.
|
staticconstexpr |
The lines of a grid.
|
staticconstexpr |
The ticks between two lines.
|
staticconstexpr |
The ticks the lines span, kNumLines times kLineTicks.
|
staticconstexpr |
The ticks a line falls behind the song tick before it moves to the far end of the span.