wavelength 1.0.0
Loading...
Searching...
No Matches
tnlgrid.h
Go to the documentation of this file.
1#pragma once
2
3#include <list>
4#include <vector>
5
6#include "math/transform.h"
7#include "math/vector3.h"
8#include "rnd/rndmultimesh.h"
9
10class GfxTunnel;
11class TnlGeom;
12
22class TnlGrid {
23public:
32 class GridLine {
33 public:
41
49
59 void Attach(const Vector3 *pScale, RndMultiMesh *pMesh);
60
71 void Place(TnlGeom *pGeom, int nTrack, int nTick);
72
83 void SetShowing(bool bShowing, RndMultiMesh *pMesh, std::list<Transform> &hidden);
84
85 const Vector3 *mScale;
87 std::list<Transform>::iterator mInstance;
88 float mTick;
89 };
90
101 TnlGrid(GfxTunnel *pTunnel, int nCam);
102
111
120 void SetTrack(int nTrack);
121
130 void SetOrder(int nOrder);
131
141 void RefreshTrack(int nTrack, bool bPlace);
142
151 void Update();
152
160
168
170 static constexpr int kNumLines = 32;
171
173 static constexpr float kLineTicks = 240.0f;
174
176 static constexpr float kSpanTicks = 7680.0f;
177
179 static constexpr float kRecycleTicks = 960.0f;
180
182 int GetTrack() const {
183 return mTrack;
184 }
185
186private:
187 std::vector<GridLine> mLines;
188 int mTrack;
189 GfxTunnel *mTunnel;
190 RndMultiMesh *mMesh;
191 std::list<Transform> mHidden;
192 int mRefresh;
193 int mShowLines;
194 int mReserved2c; // +0x2c Not set or read by the class.
195};
Tunnel of tracks the players fly down, with the gems, the cameras of the players, and the effects dra...
Definition gfxtunnel.h:58
Mesh drawn once at each of a list of transforms.
Definition rndmultimesh.h:17
The geometry of the tracks of the tunnel, which places a cell of a track in the world.
Definition tnlgeom.h:32
void SetShowing(bool bShowing, RndMultiMesh *pMesh, std::list< Transform > &hidden)
Move the transform to the front of the instances of the multi-mesh to show the line,...
GridLine()
Make a line of no scale.
std::list< Transform >::iterator mInstance
Definition tnlgrid.h:87
int mShowing
Definition tnlgrid.h:86
float mTick
Definition tnlgrid.h:88
const Vector3 * mScale
Definition tnlgrid.h:85
~GridLine()
Destroy the line.
void Attach(const Vector3 *pScale, RndMultiMesh *pMesh)
Add a transform to the front of the instances of a multi-mesh and take it as a shown line.
void Place(TnlGeom *pGeom, int nTrack, int nTick)
Place the line across the middle of a track at a tick, just below the surface, scale its basis rows,...
static constexpr float kLineTicks
The ticks between two lines.
Definition tnlgrid.h:173
static constexpr int kNumLines
The lines of a grid.
Definition tnlgrid.h:170
static constexpr float kRecycleTicks
The ticks a line falls behind the song tick before it moves to the far end of the span.
Definition tnlgrid.h:179
static Vector3 sQuarterScale
The scale of a quarter line, grid_quarter_scale scaled to the tunnel.
Definition tnlgrid.h:159
int GetTrack() const
Definition tnlgrid.h:182
void Update()
Move the lines that fell behind the song tick, or lie beyond the span after a jump back,...
void RefreshTrack(int nTrack, bool bPlace)
Respond to a change of a track.
~TnlGrid()
Empty the instances of the multi-mesh, the transforms of every other grid included,...
void SetOrder(int nOrder)
Show the lines only for the first of the players, and reconsider every line at the next update.
static constexpr float kSpanTicks
The ticks the lines span, kNumLines times kLineTicks.
Definition tnlgrid.h:176
static Vector3 sEighthScale
The scale of an eighth line, grid_eighth_scale scaled to the tunnel.
Definition tnlgrid.h:167
TnlGrid(GfxTunnel *pTunnel, int nCam)
Make the grid of a camera.
void SetTrack(int nTrack)
Move the grid to a track, placing again every line that is not yet kRecycleTicks behind the song tick...
Three-component vector, padded to a PlayStation 2 quadword.
Definition vector3.h:14