wavelength 1.0.0
Loading...
Searching...
No Matches
tnlconnectorbeam.h
Go to the documentation of this file.
1#pragma once
2
3#include <list>
4
5#include "gfx/gfxtunnel.h"
6#include "gfx/tnlgem.h"
7#include "gfx/tnlgems.h"
8#include "gfx/tnltrackrange.h"
9#include "gfx/tnlwave.h"
10#include "math/vector3.h"
11#include "rnd/rndline.h"
12#include "rnd/rndmat.h"
13#include "rnd/rndparticlesys.h"
14#include "script/dataarray.h"
15
25public:
27 struct Gem {
30 float mTick;
31 float mLateral;
32 };
33
48
61 int nPlayer,
62 const char *pszColor,
63 char nExcludedType,
64 char nOtherExcludedType);
65
73
83 void LoadConfig(DataArray *pConfig, DataArray *pDefaults, GfxTunnel *pTunnel);
84
91 void Reset();
92
106 void SetWindow(char nTrack, TnlGems *pGems, float flStartTick, float flEndTick);
107
115 void OnRangeChanged(const TnlTrackRange *pRange);
116
127 void OnGemAdded(char nTrack, char nType, TnlGems *pGems, float flTick);
128
139 void OnTicksChanged(char nTrack, TnlGems *pGems, float flStartTick, float flEndTick);
140
148 void OnGemRemoved(const TnlGem *pGem);
149
159 void Pulse(float flTick);
160
170 void SetEnergy(float flEnergy);
171
180 void StartMultiplier(TnlGems *pGems, float flEndTick);
181
189
199 void Poll(bool bCaptured, float flDelta, float flAlpha);
200
201private:
202 TnlWave mSway;
203 TnlWave mBeat;
204 float mDecayRate;
205 float mMinFrequency;
206 float mMaxFrequency;
207 std::list<Gem> mGems;
208 std::list<Span> mSpans;
209 unsigned char mNumSpans;
210 GfxTunnel *mTunnel;
211 RndLine *mLine;
212 RndMat *mLineMat;
213 char mExcludedType;
214 char mOtherExcludedType;
215 char mTrack;
216 float mStartTick;
217 float mEndTick;
218 float mInvWindowLength;
219 float mPulseTick;
220 float mLineEndTick;
221 float mGlowSize;
222 float mGlowBoost;
223 float mEnergyLevel;
224 float mEnergy;
225 RndParticleSys *mGlow;
226 RndMat *mMultiplierMat;
227 int mMultiplier;
228 float mMultiplierEndTick;
229
239 void AddGem(float flTick, float flLateral, Particle *pParticle);
240
247 void RebuildSpans();
248};
Reference-counted array of script data nodes.
Definition dataarray.h:20
Tunnel of tracks the players fly down, with the gems, the cameras of the players, and the effects dra...
Definition gfxtunnel.h:58
Line through points, drawn as a ribbon of constant screen width that faces the camera.
Definition rndline.h:26
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
void SetEnergy(float flEnergy)
Set the energy level from the energy model.
void OnGemRemoved(const TnlGem *pGem)
Detach the particle of a gem that leaves the tunnel from the linked gems.
void OnGemAdded(char nTrack, char nType, TnlGems *pGems, float flTick)
Relink the gems when a gem the beam may link appears inside the window.
void LoadConfig(DataArray *pConfig, DataArray *pDefaults, GfxTunnel *pTunnel)
Load the shared settings from the connector_beam section.
void Reset()
Forget the last pulse and the end of the window, and drop the multiplier colouring.
void OnTicksChanged(char nTrack, TnlGems *pGems, float flStartTick, float flEndTick)
Relink the gems when a span of ticks that overlaps the window changes on the track.
void StartMultiplier(TnlGems *pGems, float flEndTick)
Colour the glows with the multiplier until a tick and relink the gems.
~TnlConnectorBeam()
Release the gems and the spans.
void Poll(bool bCaptured, float flDelta, float flAlpha)
Advance the glows and the energy, and lay the line through the spans.
void OnRangeChanged(const TnlTrackRange *pRange)
Rebuild the spans when the tunnel changes a range that overlaps the window.
void SetWindow(char nTrack, TnlGems *pGems, float flStartTick, float flEndTick)
Move the window onto a track and link its gems.
void StopMultiplier()
Drop the multiplier colouring and return the glows to white.
void Pulse(float flTick)
Pulse the beam on a beat inside the window.
TnlConnectorBeam(GfxTunnel *pTunnel, int nPlayer, const char *pszColor, char nExcludedType, char nOtherExcludedType)
Find the line, the glow particles, and the material of a player's beam.
One gem on a track of the tunnel, 0x24 bytes.
Definition tnlgem.h:22
The gems of the tunnel, with the groups that draw them.
Definition tnlgems.h:25
A run of tracks over a span of ticks, which the tunnel reports when the region changes.
Definition tnltrackrange.h:8
A sine wave the connector beam of a player's cursor sways and pulses with.
Definition tnlwave.h:11
One particle of a RndParticleSys pool.
Definition rndparticlesys.h:27
A gem the beam links, 0x10 bytes.
Definition tnlconnectorbeam.h:27
int mOwnParticle
Definition tnlconnectorbeam.h:29
float mLateral
Definition tnlconnectorbeam.h:31
float mTick
Definition tnlconnectorbeam.h:30
Particle * mParticle
Definition tnlconnectorbeam.h:28
A straight piece of the beam between two points, 0x50 bytes.
Definition tnlconnectorbeam.h:35
float mArchPhase
Definition tnlconnectorbeam.h:42
Vector3 mStart
Definition tnlconnectorbeam.h:44
float mPhaseLength
Definition tnlconnectorbeam.h:39
Vector3 mSwayAxis
Definition tnlconnectorbeam.h:46
float mReserved1c
Definition tnlconnectorbeam.h:43
float mTickLength
Definition tnlconnectorbeam.h:37
float mTick
Definition tnlconnectorbeam.h:36
float mGemPhaseGap
Definition tnlconnectorbeam.h:41
float mPhase
Definition tnlconnectorbeam.h:38
Vector3 mDirection
Definition tnlconnectorbeam.h:45
float mGemPhase
Definition tnlconnectorbeam.h:40
Three-component vector, padded to a PlayStation 2 quadword.
Definition vector3.h:14