wavelength 1.0.0
Loading...
Searching...
No Matches
tnlseeker.h
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4#include <vector>
5
6#include "gfx/gfxtunnel.h"
7#include "gfx/tnlgeom.h"
8#include "gfx/tnltrackrange.h"
9#include "math/interpolator.h"
10#include "rnd/rndmat.h"
11#include "rnd/rndmesh.h"
12#include "script/dataarray.h"
13
22class TnlSeeker {
23public:
33 TnlSeeker(TnlGeom *pGeom, int nPlayer, const char *pszColor);
34
42
54 void LoadConfig(DataArray *pConfig, DataArray *pDefaults, GfxTunnel *pTunnel, int nOption);
55
67 void SetTarget(char nTrack, float flStartTick, float flEndTick);
68
76 void StartMultiplier(float flEndTick);
77
85
95 void SetWindow(char nTrack, float flStartTick, float flEndTick);
96
104 void OnRangeChanged(const TnlTrackRange *pRange);
105
116 void Poll(float flDelta, float flAlpha);
117
126 static float sFadeSpeed;
127
128private:
129 TnlGeom *mGeom;
130 std::unique_ptr<RndMesh> mMesh;
131 std::unique_ptr<InvExpInterpolator> mTrackCurve;
132 std::unique_ptr<InvExpInterpolator> mDepthCurve;
133 float mFromTrack;
134 float mTrack;
135 char mTargetTrack;
136 float mDrawnTrack;
137 float mFromStartTick;
138 float mStartTick;
139 float mTargetStartTick;
140 float mDrawnStartTick;
141 float mFromEndTick;
142 float mEndTick;
143 float mTargetEndTick;
144 float mDrawnEndTick;
145 int mSectionVerts;
146 int mNumQuads;
147 int mDirty;
148 RndMat *mMat;
149 RndMat *mMultiplierMat;
150 int mMultiplier;
151 float mMultiplierStartTime;
152 LinearInterpolator mMultiplierFade;
153
169 static void AddStrip(std::vector<RndMesh::Face> &faces,
170 int nRowA,
171 int nRowB,
172 int nStepA,
173 int nStepB,
174 int nCount,
175 bool bFlip);
176
191 void SetTexCoords(std::vector<RndMesh::Vert> &verts,
192 int nIndex,
193 float flInnerU,
194 float flInnerV,
195 float flOuterU,
196 float flOuterV);
197
213 void SetSection(std::vector<RndMesh::Vert> &verts,
214 int nIndex,
215 float flTrack,
216 float flLateral,
217 float flTick,
218 float flHeight);
219
232 void
233 Layout(std::vector<RndMesh::Vert> &verts, float flTrack, float flStartTick, float flEndTick);
234};
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
Straight-line interpolator.
Definition interpolator.h:99
Surface description: blending, lighting colours, culling, and a list of texture stages.
Definition rndmat.h:20
The geometry of the tracks of the tunnel, which places a cell of a track in the world.
Definition tnlgeom.h:32
void SetWindow(char nTrack, float flStartTick, float flEndTick)
Receive the window the cursor fades in on.
void SetTarget(char nTrack, float flStartTick, float flEndTick)
Start the glide to a new track and window.
void LoadConfig(DataArray *pConfig, DataArray *pDefaults, GfxTunnel *pTunnel, int nOption)
Load the shape of the frame from the seeker_frame section and build the mesh.
void StopMultiplier()
Return to the normal material.
static float sFadeSpeed
The fade speed of the cursor, seeker_fade_speed over 1000.
Definition tnlseeker.h:126
void StartMultiplier(float flEndTick)
Draw with the multiplier material, shrinking the frame until a tick.
~TnlSeeker()
Delete the mesh and the curves.
void Poll(float flDelta, float flAlpha)
Advance the glide and rebuild the mesh when the frame moves.
void OnRangeChanged(const TnlTrackRange *pRange)
Mark the mesh for rebuilding when the tunnel changes a range that overlaps the frame.
TnlSeeker(TnlGeom *pGeom, int nPlayer, const char *pszColor)
Find the materials and create the mesh of a player's frame.
A run of tracks over a span of ticks, which the tunnel reports when the region changes.
Definition tnltrackrange.h:8