wavelength 1.0.0
Loading...
Searching...
No Matches
tnlgeom.h
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4#include <utility>
5#include <vector>
6
7#include "gfx/tnlpath.h"
8#include "math/color.h"
9#include "math/interpolator.h"
10#include "math/plane.h"
11#include "math/quaternion.h"
12#include "math/transform.h"
13#include "math/triangle.h"
14#include "math/vector2.h"
15#include "os/mem.h"
16#include "rnd/rndcollideable.h"
17#include "rnd/rndmat.h"
18#include "rnd/rndmatanim.h"
19#include "rnd/rndmesh.h"
21#include "rnd/rndview.h"
22#include "script/dataarray.h"
23
32class TnlGeom {
33public:
35 static constexpr int kRingMask = 7;
36
38 static constexpr int kNoBar = 100000000;
39
45
57
59 class MeshHolder {
60 public:
62 MeshHolder() = default;
63
65 MeshHolder(MeshHolder &&) = default;
66
69
77
79 RndMesh *GetMesh() const {
80 return mMesh.get();
81 }
82
88 void SetMesh(std::unique_ptr<RndMesh> pMesh) {
89 mMesh = std::move(pMesh);
90 }
91
92 private:
99 static bool sKeepMeshes;
100
101 std::unique_ptr<RndMesh> mMesh;
102 };
103
105 class PanelData {
106 public:
113
115 PanelData(PanelData &&) = default;
116
119
132 void Rebuild(const MeshHolder *pSource, const Vector3 *pOffset, int nRows);
133
141
150 bool Hit(const Segment *pSegment) const;
151
153 std::vector<CrossSectionXfm> &GetBaseSections() {
154 return mBaseSections;
155 }
156
158 const std::vector<CrossSectionXfm> &GetBaseSections() const {
159 return mBaseSections;
160 }
161
163 std::vector<CrossSectionXfm> &GetSections() {
164 return mSections;
165 }
166
168 const std::vector<CrossSectionXfm> &GetSections() const {
169 return mSections;
170 }
171
178 void SetSection(int nSection, const CrossSectionXfm &section) {
179 mSections[nSection] = section;
180 }
181
183 void SetSections(const std::vector<CrossSectionXfm> &sections) {
184 mSections = sections;
185 }
186
188 RndMesh *GetMesh() const {
189 return mMesh.get();
190 }
191
197 void SetMesh(std::unique_ptr<RndMesh> pMesh) {
198 mMesh = std::move(pMesh);
199 }
200
203 return mCheckpointMat;
204 }
205
212 mCheckpointMat = pMat;
213 }
214
217 return mColor;
218 }
219
221 const Color &GetColor() const {
222 return mColor;
223 }
224
230 void SetColor(const Color &color) {
231 mColor = color;
232 }
233
235 char GetHighlighted() const {
236 return mHighlighted;
237 }
238
244 void SetHighlighted(char bHighlighted) {
245 mHighlighted = bHighlighted;
246 }
247
249 int GetDirty() const {
250 return mDirty;
251 }
252
258 void SetDirty(int bDirty) {
259 mDirty = bDirty;
260 }
261
263 int GetPickable() const {
264 return mPickable;
265 }
266
272 void SetPickable(int bPickable) {
273 mPickable = bPickable;
274 }
275
277 char GetTransparent() const {
278 return mTransparent;
279 }
280
286 void SetTransparent(char bTransparent) {
287 mTransparent = bTransparent;
288 }
289
291 char GetStartSection() const {
292 return mStartSection;
293 }
294
300 void SetStartSection(char nSection) {
301 mStartSection = nSection;
302 }
303
304 private:
305 std::vector<CrossSectionXfm> mBaseSections;
306 std::vector<CrossSectionXfm> mSections;
307 std::unique_ptr<RndMesh> mMesh;
308 RndMat *mCheckpointMat;
309 Triangle mTriangles[2];
310 Color mColor;
311 char mHighlighted;
312 int mDirty;
313 int mPickable;
314 char mTransparent;
315 char mStartSection;
316 };
317
319 class TrackData {
320 public:
328
335 void Clear();
336
339 return mOverlayMat;
340 }
341
347 void SetOverlayMat(RndMat *pMat) {
348 mOverlayMat = pMat;
349 }
350
352 int GetOverlayMode() const {
353 return mOverlayMode;
354 }
355
361 void SetOverlayMode(int nMode) {
362 mOverlayMode = nMode;
363 }
364
367 return mColor;
368 }
369
371 const Color &GetColor() const {
372 return mColor;
373 }
374
380 void SetColor(const Color &color) {
381 mColor = color;
382 }
383
385 unsigned char GetPlayers() const {
386 return mPlayers;
387 }
388
394 void SetPlayers(unsigned char nPlayers) {
395 mPlayers = nPlayers;
396 }
397
398 private:
399 RndMat *mOverlayMat;
400 int mOverlayMode;
401 Color mColor;
402 unsigned char mPlayers;
403 };
404
406 class Player {
407 public:
415
417 Player(Player &&) = default;
418
420 Player &operator=(Player &&) = default;
421
429
438 void Init(TnlGeom *pGeom, char nIndex);
439
446 void Reset();
447
457 void Update(float flTick, float flDeltaTicks);
458
467
475 void SetTrack(char nTrack);
476
484
492 void SetActivator(RndView *pView);
493
501 void SetActivatorPosition(float flPosition);
502
510 void PlaceActivator(const Transform *pXfm);
511
514 return mCamSlide;
515 }
516
518 int GetHoldCam() const {
519 return mHoldCam;
520 }
521
527 void SetHoldCam(int bHold) {
528 mHoldCam = bHold;
529 }
530
532 char GetTrack() const {
533 return mTrack;
534 }
535
537 float GetActivatorPosition() const {
538 return mActivatorPosition;
539 }
540
542 float GetTrailTicks() const {
543 return mTrailTicks;
544 }
545
548 return mActivator;
549 }
550
552 float GetPosition() const {
553 return mPosition;
554 }
555
557 float GetVelocity() const {
558 return mVelocity;
559 }
560
562 float GetMoveTime() const {
563 return mMoveTime;
564 }
565
571 void SetMoveTime(float flMoveTime) {
572 mMoveTime = flMoveTime;
573 }
574
576 float GetCamPosition() const {
577 return mCamPosition;
578 }
579
580 private:
581 RndTransformable *mCamSlide;
582 int mHoldCam;
583 char mTrack;
584 char mIndex;
585 float mActivatorPosition;
587 float mTrailTicks;
588 int mReserved14; // +0x14 Cleared, not yet read.
589 RndView *mActivator;
590 TnlGeom *mGeom;
591 float mPosition;
592 float mVelocity;
593 float mMoveTime;
594 float mCamPosition;
595 std::unique_ptr<TableLinInterpolator> mCamCurve;
596 std::unique_ptr<TableLinInterpolator> mMoveCurve;
597 };
598
606
614
621 void *operator new(size_t nSize) {
622 return PoolMemAlloc(static_cast<int>(nSize), "Tunnel", 0);
623 }
624
630 void operator delete(void *pBlock) {
631 PoolMemFree(pBlock);
632 }
633
643 void LoadConfig(DataArray *pConfig, DataArray *pDefaults, int nOption);
644
667 bool Init(const std::vector<std::pair<Vector2, Vector2>> *pEdges,
668 int nNumBars,
669 int nDetail,
670 int nBarsBehind,
671 float flSlabDepth,
672 float flSlabAngle,
673 RndTransAnim *pPath,
674 const std::vector<Color> *pColors,
675 RndMat *pPanelMat,
676 RndMatAnim *pPanelAnim);
677
687 void Poll(float flTick, float flDeltaTicks);
688
705
718
728
738 void BuildBars();
739
752 void BuildBar(int nBar);
753
762
770
778 void SetNumPlayers(int nPlayers);
779
787 void SetMoveLength(float flLength);
788
797 Player *GetPlayer(int nPlayer);
798
808 float MoveLength(float flFrom, float flTo) const;
809
821 void TrackXfm(int nTrack, Transform *pXfm, bool bSmoothBasis, float flTick, float flLateral);
822
835 void
836 BlendTrack(Transform *pXfm, bool bSmoothBasis, float flTrack, float flTick, float flLateral);
837
845 float BuiltEndTick() const;
846
861 void CellXfm(int nTrack,
862 Transform *pXfm,
863 bool bSmoothBasis,
864 bool bTrackOffset,
865 float flTick,
866 float flLateral);
867
883 void PlaceCell(int nTrack,
884 Transform *pXfm,
885 bool bSmoothBasis,
886 bool bTrackOffset,
887 float flTick,
888 float flLateral,
889 float flRaise);
890
904 bool bSmoothBasis,
905 bool bTrackOffset,
906 float flTrack,
907 float flTick,
908 float flLateral);
909
920 void PathXfm(Transform *pXfm, float flTick);
921
932 std::vector<CrossSectionXfm> *GetSections(int nTrack, int nBar, bool bDirty);
933
943 PanelData *GetPanel(int nTrack, int nBar);
944
953 void RestoreSections(int nTrack, int nBar);
954
963 void SetTrackOffset(int nTrack, const Vector3 *pOffset);
964
973 void SetTrackColor(int nTrack, const Color *pColor);
974
983 Color *GetTrackColor(int nTrack);
984
993 void SetBarValue(int nBar, RndMat *pMat);
994
1008 void SetPanelState(int nTrack,
1009 int nBar,
1010 char bTransparent,
1011 RndMat *pCheckpointMat,
1012 int bPickable,
1013 bool bHighlighted,
1014 const Color *pColor);
1015
1026 void SetPanelColor(int nTrack, int nBar, const Color *pColor, bool bHighlighted);
1027
1036 void SetAllPanelColors(const Color *pColor, bool bHighlighted);
1037
1047 Color *GetPanelColor(int nTrack, int nBar);
1048
1058 void SetPanelStartSection(int nTrack, int nBar, char nSection);
1059
1069 void SetTrackOverlay(int nTrack, RndMat *pMat, int nMode);
1070
1079 void SetPanelMat(RndMat *pMat, int nKind);
1080
1096 int bLoop,
1097 int bUseTime,
1098 float flLength,
1099 float flStart,
1100 float flFrame,
1101 float flLoopStart,
1102 float flLoopEnd);
1103
1111 void SetPath(RndTransAnim *pAnim);
1112
1123 bool Pick(const Segment *pSegment, int *pnTrack, int *pnBar);
1124
1126 int GetNumBars() const {
1127 return mNumBars;
1128 }
1129
1131 int GetBarsBehind() const {
1132 return mBarsBehind;
1133 }
1134
1136 int GetShowPanels() const {
1137 return mShowPanels;
1138 }
1139
1145 void SetShowPanels(int bShow) {
1146 mShowPanels = bShow;
1147 }
1148
1150 float GetBarsPerTick() const {
1151 return mBarsPerTick;
1152 }
1153
1155 int GetSectionsPerBar() const {
1156 return mSectionsPerBar;
1157 }
1158
1160 int GetFirstBar() const {
1161 return mFirstBar;
1162 }
1163
1165 int GetMinFirstBar() const {
1166 return mMinFirstBar;
1167 }
1168
1174 void SetMinFirstBar(int nBar) {
1175 mMinFirstBar = nBar;
1176 }
1177
1179 int GetEndBar() const {
1180 return mEndBar;
1181 }
1182
1188 void SetEndBar(int nBar) {
1189 mEndBar = nBar;
1190 }
1191
1193 int GetNumTracks() const {
1194 return mNumTracks;
1195 }
1196
1203 const TrackGeometry &GetTrackGeometry(int nTrack) const {
1204 return mTrackGeometry[nTrack];
1205 }
1206
1207private:
1213 static Transform sIdentity;
1214
1215 int mNumBars;
1216 int mReserved04; // +0x04 Starts at 2, the nDetail of Init(), not yet read.
1217 float mSlabDepth;
1218 float mSlabAngle;
1219 std::unique_ptr<TnlPath> mPath;
1220 int mBarsBehind;
1221 float mMoveLength;
1222 float mCamMoveSpeed;
1223 int mWraps;
1224 int mShowPanels;
1226 int mAnimateMoves;
1227 float mBarsPerTick;
1228 float mTicksPerBar;
1229 int mSectionsPerBar;
1230 int mFirstBar;
1231 int mMinFirstBar;
1232 int mEndBar;
1233 std::vector<int> mBarRing;
1234 std::vector<RndMat *> mBarMats;
1235 std::vector<MeshHolder> mMeshes;
1236 std::vector<PanelData> mPanels;
1237 std::vector<TrackData> mTracks;
1238 std::vector<RndMat *> mBarValues;
1240 std::vector<std::unique_ptr<RndMat>> mPassMats;
1242 std::vector<std::unique_ptr<RndMatAnim>> mPassAnims;
1243 unsigned char mReservedC4[0xc]; // +0xc4 to +0xcf are not yet identified.
1247 Color mPassLightColors[2];
1248 int mBarValuesDirty;
1249 RndMat *mDefaultMat;
1250 std::vector<RndMat *> mPanelMats;
1251 std::vector<Vector3> mTrackOffsets;
1252 std::vector<bool> mTrackOffsetChanged;
1253 std::vector<TrackGeometry> mTrackGeometry;
1254 int mNumTracks;
1255 std::vector<Player> mPlayers;
1256
1258 static constexpr int kDefaultMatThreshold = -16;
1259
1261 enum SourceMesh {
1262 kSourceMeshOpaque = 0,
1263 kSourceMeshTransparent = 1,
1264 kSourceMeshCount = 2,
1265 };
1266
1275 void Clear(bool bClear);
1276
1283 void RebuildPanels();
1284
1291 void BuildMeshes();
1292
1301 void BuildSourceMeshes();
1302
1320 std::unique_ptr<RndMesh>
1321 BuildPanelMesh(float flWidth, int nLevel, Vector3 *pExtent, bool bSolid);
1322
1333 void BuildRing();
1334
1342 void BuildTrackGeometry();
1343
1351 void BuildPanels();
1352
1354 enum PassColor {
1355 kPassColorNone = 0,
1356 kPassColorBase = 1,
1359 kPassColorLit = 2,
1360 };
1361
1373 void DrawBarValues(int nFirstBar, int nEndBar, bool bWriteDepth);
1374
1384 void DrawCheckpoints(int nFirstBar, int nEndBar);
1385
1398 void DrawPass(RndMat *pMat, int nFirstBar, int nEndBar, PassColor nColor);
1399
1409 PanelData *FindPanel(int nTrack, int nBar);
1410};
Reference-counted array of script data nodes.
Definition dataarray.h:20
Rotation quaternion, stored as the vector part followed by the scalar part.
Definition quaternion.h:19
Animation of a material's colours, alpha, and texture stages by keys.
Definition rndmatanim.h:19
Surface description: blending, lighting colours, culling, and a list of texture stages.
Definition rndmat.h:20
Triangle mesh with a material.
Definition rndmesh.h:31
Animation of a transformable's local transform by rotation, translation, and scale keys.
Definition rndtransanim.h:20
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
Owner of a mesh the panels are built from, 4 bytes.
Definition tnlgeom.h:59
MeshHolder & operator=(MeshHolder &&)=default
Take over the mesh of another holder.
RndMesh * GetMesh() const
Definition tnlgeom.h:79
MeshHolder()=default
Construct a holder with no mesh.
~MeshHolder()
Delete the mesh unless sKeepMeshes is set.
MeshHolder(MeshHolder &&)=default
Take over the mesh of another holder.
void SetMesh(std::unique_ptr< RndMesh > pMesh)
Replace the mesh.
Definition tnlgeom.h:88
One built bar of one track, 0xd0 bytes.
Definition tnlgeom.h:105
char GetStartSection() const
Definition tnlgeom.h:291
const std::vector< CrossSectionXfm > & GetBaseSections() const
Definition tnlgeom.h:158
void SetSection(int nSection, const CrossSectionXfm &section)
Replace one section as drawn.
Definition tnlgeom.h:178
Color & GetColor()
Definition tnlgeom.h:216
const Color & GetColor() const
Definition tnlgeom.h:221
RndMesh * GetMesh() const
Definition tnlgeom.h:188
void SetHighlighted(char bHighlighted)
Set whether the panel is drawn highlighted.
Definition tnlgeom.h:244
int GetPickable() const
Definition tnlgeom.h:263
void SetStartSection(char nSection)
Set the first section Rebuild() moves along.
Definition tnlgeom.h:300
void SetTransparent(char bTransparent)
Set whether the panel does not write depth.
Definition tnlgeom.h:286
void UpdateTriangles()
Rebuild the two triangles of the panel that a pick tests.
std::vector< CrossSectionXfm > & GetBaseSections()
Definition tnlgeom.h:153
RndMat * GetCheckpointMat() const
Definition tnlgeom.h:202
void SetCheckpointMat(RndMat *pMat)
Set the checkpoint material of the panel.
Definition tnlgeom.h:211
const std::vector< CrossSectionXfm > & GetSections() const
Definition tnlgeom.h:168
void SetDirty(int bDirty)
Set whether the mesh needs Rebuild().
Definition tnlgeom.h:258
PanelData(PanelData &&)=default
Take over the mesh and the sections of another panel.
void SetMesh(std::unique_ptr< RndMesh > pMesh)
Replace the mesh of the panel.
Definition tnlgeom.h:197
bool Hit(const Segment *pSegment) const
Report whether a segment strikes the panel.
void SetSections(const std::vector< CrossSectionXfm > &sections)
Definition tnlgeom.h:183
std::vector< CrossSectionXfm > & GetSections()
Definition tnlgeom.h:163
PanelData & operator=(PanelData &&)=default
Take over the mesh and the sections of another panel.
void SetPickable(int bPickable)
Set whether Hit() tests the panel.
Definition tnlgeom.h:272
int GetDirty() const
Definition tnlgeom.h:249
char GetHighlighted() const
Definition tnlgeom.h:235
void SetColor(const Color &color)
Set the colour of the panel.
Definition tnlgeom.h:230
PanelData()
Construct a white, transparent, unpickable panel with no mesh that needs a rebuild.
char GetTransparent() const
Definition tnlgeom.h:277
void Rebuild(const MeshHolder *pSource, const Vector3 *pOffset, int nRows)
Rebuild the vertices of the mesh from the sections of the panel and a source mesh.
The place of a player in the tunnel, 0x38 bytes.
Definition tnlgeom.h:406
void PlaceActivator(const Transform *pXfm)
Place the view of the activator, if there is one.
Player(Player &&)=default
Take over the curves of another player.
void SetCamSlide(RndTransformable *pSlide)
Set the transformable the camera of the player slides.
void SetHoldCam(int bHold)
Set whether the camera stops following the player.
Definition tnlgeom.h:527
RndView * GetActivator() const
Definition tnlgeom.h:547
void LeaveTrack()
Take the player off the record of the players of its track.
void Update(float flTick, float flDeltaTicks)
Move the player along its curves.
void SetTrack(char nTrack)
Move the player to a track, along curves when the geometry animates moves.
float GetTrailTicks() const
Definition tnlgeom.h:542
void Init(TnlGeom *pGeom, char nIndex)
Attach the player to the geometry.
void SetMoveTime(float flMoveTime)
Set the multiple of the length of a move.
Definition tnlgeom.h:571
RndTransformable * GetCamSlide() const
Definition tnlgeom.h:513
float GetVelocity() const
Definition tnlgeom.h:557
char GetTrack() const
Definition tnlgeom.h:532
float GetCamPosition() const
Definition tnlgeom.h:576
float GetMoveTime() const
Definition tnlgeom.h:562
void SetActivatorPosition(float flPosition)
Set the position of the activator of the player.
int GetHoldCam() const
Definition tnlgeom.h:518
float GetActivatorPosition() const
Definition tnlgeom.h:537
Player()
Construct a player on track 0.
void Reset()
Put the player at its track at once.
Player & operator=(Player &&)=default
Take over the curves of another player.
float GetPosition() const
Definition tnlgeom.h:552
~Player()
Delete the curves of the player.
void SetActivator(RndView *pView)
Set the view of the activator of the player.
RndMat * GetOverlayMat() const
Definition tnlgeom.h:338
void Clear()
Clear the overlay and the players of the track.
void SetPlayers(unsigned char nPlayers)
Set the players on the track.
Definition tnlgeom.h:394
void SetOverlayMode(int nMode)
Set how the overlay is drawn.
Definition tnlgeom.h:361
int GetOverlayMode() const
Definition tnlgeom.h:352
Color & GetColor()
Definition tnlgeom.h:366
const Color & GetColor() const
Definition tnlgeom.h:371
TrackData()
Construct the state of a track.
void SetColor(const Color &color)
Set the colour of the panels of the track.
Definition tnlgeom.h:380
void SetOverlayMat(RndMat *pMat)
Set the material drawn over the track.
Definition tnlgeom.h:347
unsigned char GetPlayers() const
Definition tnlgeom.h:385
void BlendTrack(Transform *pXfm, bool bSmoothBasis, float flTrack, float flTick, float flLateral)
Work out the transform of a cell at a fractional track, blending the transforms of the two nearest tr...
PanelData * GetPanel(int nTrack, int nBar)
Report a built panel.
void RestoreSections(int nTrack, int nBar)
Put the sections of a built panel back as the bar was built.
~TnlGeom()
Destroy the geometry.
int GetMinFirstBar() const
Definition tnlgeom.h:1165
void SetPanelMat(RndMat *pMat, int nKind)
Set the material of a kind of panel, or the default material.
void DrawPanelsMultiplayer()
Draw as DrawPanels() does, as the tunnel does in a game of several players with the Game rule set.
TnlGeom()
Construct an empty geometry.
float MoveLength(float flFrom, float flTo) const
Report the length of a move between two tracks.
void DrawOverlays()
Draw the bars of the ring before the song with the bar values, the overlays of the tracks,...
void DrawPanels()
Rebuild the dirty panels, then draw the built bars from mBarsBehind before the end of the ring back t...
void SetAllPanelColors(const Color *pColor, bool bHighlighted)
Set the colour of every built panel.
void BuildBars()
Build the bars of the ring that are not built yet.
void SetMinFirstBar(int nBar)
Set the least bar Poll() starts the ring at.
Definition tnlgeom.h:1174
void SetPanelColor(int nTrack, int nBar, const Color *pColor, bool bHighlighted)
Set the colour of a built panel.
int GetNumTracks() const
Definition tnlgeom.h:1193
void CellXfm(int nTrack, Transform *pXfm, bool bSmoothBasis, bool bTrackOffset, float flTick, float flLateral)
Work out the transform of a cell of a track.
int GetNumBars() const
Definition tnlgeom.h:1126
void TrackXfm(int nTrack, Transform *pXfm, bool bSmoothBasis, float flTick, float flLateral)
Work out the transform of a cell of a track without the offset of the track.
const TrackGeometry & GetTrackGeometry(int nTrack) const
Report the flat cross section of a track.
Definition tnlgeom.h:1203
void SetTrackColor(int nTrack, const Color *pColor)
Set the colour of the panels of a track.
static constexpr int kRingMask
Bars of the ring of built panels a bar index selects with its low bits.
Definition tnlgeom.h:35
static constexpr int kNoBar
The bar a slot of the ring holds when no bar is built in it.
Definition tnlgeom.h:38
void PathXfm(Transform *pXfm, float flTick)
Work out the transform of the path of the tunnel at a tick.
void SetTrackOverlay(int nTrack, RndMat *pMat, int nMode)
Set the material drawn over a track.
Player * GetPlayer(int nPlayer)
Report the place of a player.
bool Pick(const Segment *pSegment, int *pnTrack, int *pnBar)
Find the built panel a segment strikes first.
float BuiltEndTick() const
Report the tick a little before the end of the built bars.
int GetBarsBehind() const
Definition tnlgeom.h:1131
void LoadConfig(DataArray *pConfig, DataArray *pDefaults, int nOption)
Load the settings of the geometry.
int GetShowPanels() const
Definition tnlgeom.h:1136
bool Init(const std::vector< std::pair< Vector2, Vector2 > > *pEdges, int nNumBars, int nDetail, int nBarsBehind, float flSlabDepth, float flSlabAngle, RndTransAnim *pPath, const std::vector< Color > *pColors, RndMat *pPanelMat, RndMatAnim *pPanelAnim)
Set up the tracks from the edges of the cross section, and the passes of the standard panel from a ma...
void SetPath(RndTransAnim *pAnim)
Replace the path at once with an animation that starts at frame 0.
void BlendCell(Transform *pXfm, bool bSmoothBasis, bool bTrackOffset, float flTrack, float flTick, float flLateral)
Work out the transform of a cell at a fractional track, blending the two nearest tracks.
void BlendPath(RndTransAnim *pAnim, int bLoop, int bUseTime, float flLength, float flStart, float flFrame, float flLoopStart, float flLoopEnd)
Blend the path to a new animation.
void SetMoveLength(float flLength)
Set the ticks of a move of a player to the next track.
void ResetPanels()
Put every panel back in its first state, white and transparent, and mark every slot of the ring as no...
void SetBarValue(int nBar, RndMat *pMat)
Set the checkpoint material of a built bar in mBarValues.
Color * GetTrackColor(int nTrack)
Report the colour of the panels of a track.
std::vector< CrossSectionXfm > * GetSections(int nTrack, int nBar, bool bDirty)
Report the sections of a built panel.
void SetTrackOffset(int nTrack, const Vector3 *pOffset)
Set the offset of a track, which CellXfm() adds in the basis of the cell.
void PlaceCell(int nTrack, Transform *pXfm, bool bSmoothBasis, bool bTrackOffset, float flTick, float flLateral, float flRaise)
Work out the transform of a cell, sunk below the surface of the track.
void SetPanelStartSection(int nTrack, int nBar, char nSection)
Set the first section of a built panel the mesh moves along.
Color * GetPanelColor(int nTrack, int nBar)
Report the colour of a built panel.
float GetBarsPerTick() const
Definition tnlgeom.h:1150
void BuildBar(int nBar)
Build the cross sections of one bar on every track along the path, and give the slot of the bar its m...
int GetSectionsPerBar() const
Definition tnlgeom.h:1155
void Poll(float flTick, float flDeltaTicks)
Advance the geometry to a tick, building the bars ahead and moving the players and their activators.
void SetEndBar(int nBar)
Set the first bar that is never built.
Definition tnlgeom.h:1188
void SetPanelState(int nTrack, int nBar, char bTransparent, RndMat *pCheckpointMat, int bPickable, bool bHighlighted, const Color *pColor)
Set the state of a built panel.
void ResetPlayers()
Put every player at its track at once.
int GetEndBar() const
Definition tnlgeom.h:1179
int GetFirstBar() const
Definition tnlgeom.h:1160
void SetShowPanels(int bShow)
Set whether the panels show.
Definition tnlgeom.h:1145
void SetNumPlayers(int nPlayers)
Set the number of players, attaching each to the geometry with its index.
void * PoolMemAlloc(int nSize, const char *pszTag, int nAlign)
Allocate a block from the pool heaps and bill it to a tag.
void PoolMemFree(void *pBlock)
Return a block PoolMemAlloc() handed out to the pool heap that owns it.
Linear colour with four float components.
Definition color.h:12
Two points that fix a line or a segment.
Definition plane.h:39
One cross section of a panel, 0x70 bytes.
Definition tnlgeom.h:41
Transform mXfm
Definition tnlgeom.h:42
Vector3 mCellBasis[3]
Definition tnlgeom.h:43
The flat cross section of one track, 0xa0 bytes.
Definition tnlgeom.h:47
float mLeftZ
Definition tnlgeom.h:49
Vector3 mBasis[3]
Definition tnlgeom.h:52
float mRightX
Definition tnlgeom.h:50
Quat mRotation
Definition tnlgeom.h:55
float mLeftX
Definition tnlgeom.h:48
Vector3 mCenter
Definition tnlgeom.h:53
float mRightZ
Definition tnlgeom.h:51
Transform mXfm
Definition tnlgeom.h:54
Affine transform stored as three basis rows and a translation row.
Definition transform.h:18
Triangle stored as a corner, the two edges leaving it, and its normal.
Definition triangle.h:37
Three-component vector, padded to a PlayStation 2 quadword.
Definition vector3.h:14