resonance 1.0.1
Loading...
Searching...
No Matches
tunnelseeker.h
Go to the documentation of this file.
1#pragma once
2
3#include "math/color.h"
4#include "math/transform.h"
6
7namespace Rnd {
8
9class Mat;
10class Mesh;
11class Object;
12class Stream;
13class Transformable;
14class Tunnel;
15
34public:
44
54
66 void SetTunnel(Tunnel *pTunnel, int nIndex);
67
75 void SetTrans(Transformable *pTrans);
76
84 void SetTargetRing(int nRing);
85
93 void SetMesh(Mesh *pMesh);
94
102 void SetMeshFrameOffset(float flOffset);
103
111 void SetTransFrameOffset(float flOffset);
112
120 void SetLookFrameOffset(float flOffset);
121
131 void SetRange(int nFirstSlice, int nSliceCount, int nRing);
132
140 void SetColor(const Color &color);
141
149 void SetMat(Mat *pMat);
150
151 // The five accessors below are inline. Each has an out-of-line copy without callers.
152
160 int GetFirstSlice() const {
161 return mStrip.mFirstSlice;
162 }
163
171 int GetSliceCount() const {
172 return mStrip.mSliceCount;
173 }
174
182 int GetRing() const {
183 return mStrip.mRing;
184 }
185
193 Color GetColor() const {
194 return mStrip.mColor;
195 }
196
204 Mat *GetMat() const {
205 return mStrip.mMat;
206 }
207
216 void DrawSection(int nSlice, float flScreenSize);
217
224 void DrawMesh();
225
238 float UpdateLane();
239
247 void SetTransXfm(const Transform &xfm);
248
256 void SetMeshXfm(const Transform &xfm);
257
267 void Replace(Object *pFrom, Object *pTo, Object *pReferrer);
268
279 void Save(Stream &stream) const;
280
291 void Load(Stream &stream);
292
304 float mLane;
305 float mFrame;
306};
307
308} // namespace Rnd
Surface description a Rnd::Mesh draws with.
Definition mat.h:36
Indexed triangle mesh with one material.
Definition mesh.h:46
Base of every object the renderer can load, resolve by name, and serialise.
Definition object.h:43
Byte stream that every renderer object serialises itself through.
Definition stream.h:31
Mix-in for an object with a local and a world transform.
Definition transformable.h:38
Run of consecutive tunnel slices a Rnd::TunnelSeeker highlights on one ring.
Definition tunnelseekstrip.h:30
void Replace(Object *pFrom, Object *pTo, Object *pReferrer)
Replace the transformable, mesh, and material references.
void SetTransFrameOffset(float flOffset)
Set the path frame offset used to place the transformable.
float mTransFrameOffset
Definition tunnelseeker.h:300
void SetTrans(Transformable *pTrans)
Replace the transformable the seeker drives.
TunnelSeeker()
Construct a seeker with no tunnel.
float mFrame
Definition tunnelseeker.h:305
void SetTargetRing(int nRing)
Set the ring the lane moves towards.
void SetMeshXfm(const Transform &xfm)
Install a transform as the local transform of mMesh and recompose its world transform.
void SetTunnel(Tunnel *pTunnel, int nIndex)
Attach the seeker to a tunnel.
float mLane
Definition tunnelseeker.h:304
Color GetColor() const
Report the colour of the strip.
Definition tunnelseeker.h:193
int GetRing() const
Report the ring of the strip.
Definition tunnelseeker.h:182
Mat * GetMat() const
Report the material of the strip.
Definition tunnelseeker.h:204
Mesh * mMesh
Definition tunnelseeker.h:302
void SetColor(const Color &color)
Set the colour of the strip.
void DrawSection(int nSlice, float flScreenSize)
Draw the strip section placed on one slice.
Tunnel * mTunnel
Definition tunnelseeker.h:303
void Save(Stream &stream) const
Write the seeker.
void SetMat(Mat *pMat)
Set the material of the strip.
int mTargetRing
Definition tunnelseeker.h:298
void ReleaseRefs()
Release the transformable and mesh references and clear the strip.
void Load(Stream &stream)
Read the seeker in the order Save() writes it.
void SetMeshFrameOffset(float flOffset)
Set the path frame offset used to place the mesh.
int GetSliceCount() const
Report the slice count of the strip.
Definition tunnelseeker.h:171
void DrawMesh()
Draw the mesh, when there is one.
void SetTransXfm(const Transform &xfm)
Install a transform as the local transform of mTrans and mark it dirty.
void SetLookFrameOffset(float flOffset)
Set the path frame offset the transformable is oriented towards.
Transformable * mTrans
Definition tunnelseeker.h:294
void SetRange(int nFirstSlice, int nSliceCount, int nRing)
Place the strip on a run of slices.
int mSavedFlag
Definition tunnelseeker.h:297
float UpdateLane()
Move the lane towards the target ring and return it.
float mMeshFrameOffset
Definition tunnelseeker.h:299
void SetMesh(Mesh *pMesh)
Replace the mesh the seeker draws.
TunnelSeekStrip mStrip
Definition tunnelseeker.h:293
float mLookFrameOffset
Definition tunnelseeker.h:301
int GetFirstSlice() const
Report the first slice of the strip.
Definition tunnelseeker.h:160
Procedural tunnel the game flies the player through.
Definition tunnel.h:72
The rendering engine.
Definition animhelper.h:3
Linear colour with four float components.
Definition color.h:10
Affine transform stored as three basis rows and a translation row.
Definition transform.h:14