wavelength 1.0.0
Loading...
Searching...
No Matches
tnltrackfx.h
Go to the documentation of this file.
1#pragma once
2
3#include <list>
4#include <memory>
5#include <vector>
6
7#include "gfx/gfxtunnel.h"
8#include "gfx/tnlgem.h"
9#include "gfx/tnlgeom.h"
10#include "math/interpolator.h"
11#include "math/vector2.h"
12#include "rnd/rndmat.h"
13#include "rnd/rndparticlesys.h"
14#include "script/dataarray.h"
15
24public:
31
39 explicit TnlTrackFX(char nTrack);
40
48
60 static void
61 LoadConfig(DataArray *pConfig, DataArray *pDefaults, GfxTunnel *pTunnel, int nOption);
62
70 void Enable(GfxTunnel *pTunnel);
71
80 void Capture(GfxTunnel *pTunnel, float flTick);
81
89 void Stop(GfxTunnel *pTunnel);
90
100 bool Poll(GfxTunnel *pTunnel, TnlGeom *pGeom);
101
109 float CaptureEndTime() const;
110
117 static float sEnableTimes[3];
118
126 static float sCaptureTimes[3];
127
134 static float sCaptureHeight;
135
143 static float sEnableHeight;
144
151 static float sCaptureSpewTicks;
152
159 static float sCaptureCamJiggle;
160
167 static float sCaptureBrightness;
168
176
184
191 static float sSpewFrame;
192
194 char GetState() const {
195 return mState;
196 }
197
199 char GetTrack() const {
200 return mTrack;
201 }
202
203private:
204 char mState;
205 char mTrack;
206 char mPhase;
207 float mStartTime;
208 RndMat *mMat;
210 std::unique_ptr<RndMat> mMatCopy;
212 LinearInterpolator mEnableCurve;
213 InvExpInterpolator mDropCurve;
214 ExpInterpolator mFallCurve;
215 float mCaptureTick;
216 std::vector<float> mGemTicks;
217
227 static void SetGlowSizes(std::list<TnlGem> *pGems, char nTrack, float flSize);
228
238 static void RestoreGlowSizes(std::list<TnlGem> *pGems, char nTrack, float flSize);
239};
Reference-counted array of script data nodes.
Definition dataarray.h:20
Interpolator whose output follows a power of the input's position in the range.
Definition interpolator.h:147
Tunnel of tracks the players fly down, with the gems, the cameras of the players, and the effects dra...
Definition gfxtunnel.h:58
Interpolator that mirrors ExpInterpolator, easing out of the start of the range.
Definition interpolator.h:218
Straight-line interpolator.
Definition interpolator.h:99
Surface description: blending, lighting colours, culling, and a list of texture stages.
Definition rndmat.h:20
Emitter that spawns, moves, and fades a population of particles.
Definition rndparticlesys.h:69
The geometry of the tracks of the tunnel, which places a cell of a track in the world.
Definition tnlgeom.h:32
static float sCaptureSpewTicks
The ticks ahead of the song a capture spews from, autocapture_burst_tick.
Definition tnltrackfx.h:151
bool Poll(GfxTunnel *pTunnel, TnlGeom *pGeom)
Advance the effect.
static float sCaptureCamJiggle
The kick a capture gives the camera, autocapture_cam_jiggle.
Definition tnltrackfx.h:159
float CaptureEndTime() const
Report the time the drop of a capture ends.
static Vector2 sFlareSize
The size the gems of a capture flare from and to, autocapture_flare_size times the scroll speed.
Definition tnltrackfx.h:175
void Enable(GfxTunnel *pTunnel)
Start the enable effect.
static float sCaptureHeight
The height a capture raises the track, autocapture_offset_height times the scroll speed.
Definition tnltrackfx.h:134
void Capture(GfxTunnel *pTunnel, float flTick)
Start the capture effect, and spew from the track.
static void LoadConfig(DataArray *pConfig, DataArray *pDefaults, GfxTunnel *pTunnel, int nOption)
Load the settings of the effects of the tracks, the streak arrows, and the cripplers.
TnlTrackFX(char nTrack)
Construct the effects of a track, and for track 0 the shared spew of a capture.
static float sEnableHeight
The depth an enable effect starts the track at, track_enable_offset_height times the scroll speed.
Definition tnltrackfx.h:143
void Stop(GfxTunnel *pTunnel)
Stop the effect at once and put the track back.
static float sEnableTimes[3]
The milliseconds the enable effect rises, holds lit, and fades, track_activate_lengths.
Definition tnltrackfx.h:117
char GetState() const
Definition tnltrackfx.h:194
static float sSpewFrame
The frame of sSpew, which each capture advances.
Definition tnltrackfx.h:191
~TnlTrackFX()
Release the shared spew, and the material of a track other than track 0.
char GetTrack() const
Definition tnltrackfx.h:199
static float sCaptureBrightness
The alpha of the overlay of a capture, autocapture_track_brightness.
Definition tnltrackfx.h:167
static float sCaptureTimes[3]
The milliseconds the capture drops and falls, then an unused length, autocapture_anim_times.
Definition tnltrackfx.h:126
State
The values of mState.
Definition tnltrackfx.h:26
@ kStateCapture
Definition tnltrackfx.h:29
@ kStateEnable
Definition tnltrackfx.h:28
@ kStateIdle
Definition tnltrackfx.h:27
static RndParticleSys * sSpew
The particle system a capture spews from, autocapture spew.part.
Definition tnltrackfx.h:183
Two-component vector, used for texture coordinates.
Definition vector2.h:12