wavelength 1.0.0
Loading...
Searching...
No Matches
tnldivider.h
Go to the documentation of this file.
1#pragma once
2
3#include <list>
4
5#include "app/rampanimator.h"
6#include "gfx/gfxtunnel.h"
7#include "gfx/tnlgeom.h"
8#include "math/interpolator.h"
9#include "math/vector2.h"
10#include "math/vector3.h"
11#include "rnd/rndanimatable.h"
12#include "rnd/rndmesh.h"
13#include "rnd/rndparticlesys.h"
14#include "rnd/rndtext.h"
16#include "rnd/rndview.h"
17
26public:
28 struct Section {
35 bool operator<(const Section &other) const {
36 return mTick < other.mTick;
37 }
38
39 float mTick;
40 float mTextScale;
41 const char *mLabel;
42 };
43
51
59 void ScaleParticles(float flScale);
60
67 void Reset();
68
80 void AddSection(float flTick, const char *pszLabel, float flTextScale);
81
90 float TicksSinceSection(float flTick) const;
91
99
108 void Poll(float flDelta, GfxTunnel *pTunnel);
109
116 void Draw();
117
126 static void SetLayout(const Vector3 *pScale, const Vector3 *pOffset);
127
134 static float sFlashTime;
135
142
149
151 void SetConditionFrame(float flConditionFrame) {
152 mConditionFrame = flConditionFrame;
153 }
154
156 void SetEnabled(int nEnabled) {
157 mEnabled = nEnabled;
158 }
159
160private:
161 RndView *mView;
162 RndView *mTransparentView;
163 RndView *mTopView;
164 RndView *mTextScaleView;
165 RndView *mConditionView;
166 RndAnimatable *mMessageAnim;
167 RndParticleSys *mParticles[2];
168 Vector2 mEmitRates[2];
169 Vector2 mSizes[2];
170 RndText *mText;
171 RndMesh *mFlashMesh;
172 RampAnimator mFlash;
173 float mConditionFrame;
174 LinearInterpolator mParticleFade;
175 int mFlashing;
176 std::list<Section> mSections;
177 std::list<Section>::iterator mCurrent;
178 int mStarted;
179 int mEnabled;
180
188 void UpdateText(std::list<Section>::iterator section);
189
199 static void PlaceOnPath(RndTransformable *pTrans, TnlGeom *pGeom, float flTick);
200};
Tunnel of tracks the players fly down, with the gems, the cameras of the players, and the effects dra...
Definition gfxtunnel.h:58
Straight-line interpolator.
Definition interpolator.h:99
Value that moves toward a target along an interpolator, and poses an animation on the value.
Definition rampanimator.h:14
Mix-in for an object driven by a frame.
Definition rndanimatable.h:16
Triangle mesh with a material.
Definition rndmesh.h:31
Emitter that spawns, moves, and fades a population of particles.
Definition rndparticlesys.h:69
Text drawn with a bitmap font as a mesh of one quad per character.
Definition rndtext.h:27
Mix-in for an object with a local transform and a world transform derived from its parent's.
Definition rndtransformable.h:17
View that shows the children of another view, its children owner, under its own transform and frame.
Definition rndview.h:27
static void SetLayout(const Vector3 *pScale, const Vector3 *pOffset)
Set the scale and the offset every boundary is built with.
TnlDivider()
Construct the boundary from its objects and fit them to the layout.
void Poll(float flDelta, GfxTunnel *pTunnel)
Move the boundary to the current section and animate it.
void ClearSections()
Remove every boundary.
void SetEnabled(int nEnabled)
Definition tnldivider.h:156
void AddSection(float flTick, const char *pszLabel, float flTextScale)
Add a boundary, dropping those more than a bar behind the song.
void SetConditionFrame(float flConditionFrame)
Definition tnldivider.h:151
static float sFlashTime
The milliseconds of the flash.
Definition tnldivider.h:134
void Reset()
Remove every boundary.
float TicksSinceSection(float flTick) const
Report the ticks since the last boundary at or before a tick.
static Vector3 sScale
The scale every boundary is built with.
Definition tnldivider.h:141
void Draw()
Draw the boundary, then the current environment.
void ScaleParticles(float flScale)
Scale the emission rates of the particles of the boundary.
static Vector3 sOffset
The offset every boundary is built with.
Definition tnldivider.h:148
The geometry of the tracks of the tunnel, which places a cell of a track in the world.
Definition tnlgeom.h:32
One boundary, 0xc bytes.
Definition tnldivider.h:28
const char * mLabel
Definition tnldivider.h:41
float mTick
Definition tnldivider.h:39
float mTextScale
Definition tnldivider.h:40
bool operator<(const Section &other) const
Order sections by tick.
Definition tnldivider.h:35
Two-component vector, used for texture coordinates.
Definition vector2.h:12
Three-component vector, padded to a PlayStation 2 quadword.
Definition vector3.h:14