|
resonance 1.0.1
|
Marker that travels around the tunnel rings towards a target ring. More...
#include <tunnelseeker.h>

Public Member Functions | |
| TunnelSeeker () | |
| Construct a seeker with no tunnel. | |
| void | ReleaseRefs () |
| Release the transformable and mesh references and clear the strip. | |
| void | SetTunnel (Tunnel *pTunnel, int nIndex) |
| Attach the seeker to a tunnel. | |
| void | SetTrans (Transformable *pTrans) |
| Replace the transformable the seeker drives. | |
| void | SetTargetRing (int nRing) |
| Set the ring the lane moves towards. | |
| void | SetMesh (Mesh *pMesh) |
| Replace the mesh the seeker draws. | |
| void | SetMeshFrameOffset (float flOffset) |
| Set the path frame offset used to place the mesh. | |
| void | SetTransFrameOffset (float flOffset) |
| Set the path frame offset used to place the transformable. | |
| void | SetLookFrameOffset (float flOffset) |
| Set the path frame offset the transformable is oriented towards. | |
| void | SetRange (int nFirstSlice, int nSliceCount, int nRing) |
| Place the strip on a run of slices. | |
| void | SetColor (const Color &color) |
| Set the colour of the strip. | |
| void | SetMat (Mat *pMat) |
| Set the material of the strip. | |
| int | GetFirstSlice () const |
| Report the first slice of the strip. | |
| int | GetSliceCount () const |
| Report the slice count of the strip. | |
| int | GetRing () const |
| Report the ring of the strip. | |
| Color | GetColor () const |
| Report the colour of the strip. | |
| Mat * | GetMat () const |
| Report the material of the strip. | |
| void | DrawSection (int nSlice, float flScreenSize) |
| Draw the strip section placed on one slice. | |
| void | DrawMesh () |
| Draw the mesh, when there is one. | |
| float | UpdateLane () |
| Move the lane towards the target ring and return it. | |
| void | SetTransXfm (const Transform &xfm) |
| Install a transform as the local transform of mTrans and mark it dirty. | |
| void | SetMeshXfm (const Transform &xfm) |
| Install a transform as the local transform of mMesh and recompose its world transform. | |
| void | Replace (Object *pFrom, Object *pTo, Object *pReferrer) |
| Replace the transformable, mesh, and material references. | |
| void | Save (Stream &stream) const |
| Write the seeker. | |
| void | Load (Stream &stream) |
| Read the seeker in the order Save() writes it. | |
Public Attributes | |
| TunnelSeekStrip | mStrip |
| Transformable * | mTrans |
| int | mSavedFlag |
| int | mTargetRing |
| float | mMeshFrameOffset |
| float | mTransFrameOffset |
| float | mLookFrameOffset |
| Mesh * | mMesh |
| Tunnel * | mTunnel |
| float | mLane |
| float | mFrame |
Marker that travels around the tunnel rings towards a target ring.
The record is not polymorphic and has no RTTI. The name is inferred from the "_seek" titles of the meshes its strip generates and from UpdateLane(), which moves the lane a bounded step towards mTargetRing on every frame.
The record is 0x80 bytes, the element size of the seeker vector of Rnd::Tunnel. Its destructor is the implicit one at 0x00477cc0, and the copy constructor at 0x004720c0 is compiler-generated. It runs the implicit copy constructor of mStrip at 0x00471e90 and then copies the remaining words. The tunnel holds every reference the record takes, so each reference is released on behalf of mTunnel.
Every frame Rnd::Tunnel::SetFrameSelf() evaluates the tunnel path at three offsets from the current frame. The position and look offsets orient the transform handed to SetTransXfm(), and the mesh offset places the transform handed to SetMeshXfm().
| Rnd::TunnelSeeker::TunnelSeeker | ( | ) |
Construct a seeker with no tunnel.
mTransFrameOffset starts at -500. mSavedFlag is not set.
| void Rnd::TunnelSeeker::ReleaseRefs | ( | ) |
Release the transformable and mesh references and clear the strip.
The two pointers are not cleared.
| void Rnd::TunnelSeeker::SetTunnel | ( | Tunnel * | pTunnel, |
| int | nIndex ) |
Attach the seeker to a tunnel.
Takes the tunnel's filtered frame as mFrame, takes references on mTrans and mMesh on behalf of the tunnel, and builds the strip.
| pTunnel | The tunnel. |
| nIndex | The index of the seeker in the tunnel. |
| void Rnd::TunnelSeeker::SetTrans | ( | Transformable * | pTrans | ) |
Replace the transformable the seeker drives.
| pTrans | The transformable, or null. |
| void Rnd::TunnelSeeker::SetTargetRing | ( | int | nRing | ) |
Set the ring the lane moves towards.
| nRing | The ring. |
| void Rnd::TunnelSeeker::SetMesh | ( | Mesh * | pMesh | ) |
Replace the mesh the seeker draws.
| pMesh | The mesh, or null. |
| void Rnd::TunnelSeeker::SetMeshFrameOffset | ( | float | flOffset | ) |
Set the path frame offset used to place the mesh.
| flOffset | The offset from the tunnel frame. |
| void Rnd::TunnelSeeker::SetTransFrameOffset | ( | float | flOffset | ) |
Set the path frame offset used to place the transformable.
| flOffset | The offset from the tunnel frame. |
| void Rnd::TunnelSeeker::SetLookFrameOffset | ( | float | flOffset | ) |
Set the path frame offset the transformable is oriented towards.
| flOffset | The offset from the tunnel frame. |
| void Rnd::TunnelSeeker::SetRange | ( | int | nFirstSlice, |
| int | nSliceCount, | ||
| int | nRing ) |
Place the strip on a run of slices.
| nFirstSlice | The first slice of the run. |
| nSliceCount | The number of slices. |
| nRing | The ring. |
| void Rnd::TunnelSeeker::SetColor | ( | const Color & | color | ) |
Set the colour of the strip.
| color | The colour. |
| void Rnd::TunnelSeeker::SetMat | ( | Mat * | pMat | ) |
Set the material of the strip.
| pMat | The material, or null. |
|
inline |
Report the first slice of the strip.
|
inline |
Report the slice count of the strip.
|
inline |
Report the ring of the strip.
|
inline |
Report the colour of the strip.
|
inline |
Report the material of the strip.
| void Rnd::TunnelSeeker::DrawSection | ( | int | nSlice, |
| float | flScreenSize ) |
Draw the strip section placed on one slice.
| nSlice | The slice being drawn. |
| flScreenSize | The screen size used to pick the level of detail. |
| void Rnd::TunnelSeeker::DrawMesh | ( | ) |
Draw the mesh, when there is one.
| float Rnd::TunnelSeeker::UpdateLane | ( | ) |
Move the lane towards the target ring and return it.
The ring distance is wrapped into half the tunnel ring count either way. The step is the number of tunnel frames since the last call, divided by Rnd::Tunnel::mLaneChangeFrames and scaled by the ring distance when the distance exceeds one. A lane within one step of the target snaps onto it.
| void Rnd::TunnelSeeker::SetTransXfm | ( | const Transform & | xfm | ) |
Install a transform as the local transform of mTrans and mark it dirty.
| xfm | The transform. |
| void Rnd::TunnelSeeker::SetMeshXfm | ( | const Transform & | xfm | ) |
Install a transform as the local transform of mMesh and recompose its world transform.
| xfm | The transform. |
Replace the transformable, mesh, and material references.
| pFrom | The object being replaced. |
| pTo | The replacement. |
| pReferrer | The object the references are held on behalf of. |
| void Rnd::TunnelSeeker::Save | ( | Stream & | stream | ) | const |
Write the seeker.
The order is mTrans by name, mTargetRing, mMesh by name, mSavedFlag as one byte, mLane, the three frame offsets, the strip run, the strip material by name, and the strip colour.
| stream | The stream to write to. |
| void Rnd::TunnelSeeker::Load | ( | Stream & | stream | ) |
Read the seeker in the order Save() writes it.
The frame offsets are read only from a Rnd::Tunnel stream revision of 34 or later. No reference is taken on the objects read by name.
| stream | The stream to read from. |
| TunnelSeekStrip Rnd::TunnelSeeker::mStrip |
The highlighted run of slices.
| Transformable* Rnd::TunnelSeeker::mTrans |
| int Rnd::TunnelSeeker::mSavedFlag |
| int Rnd::TunnelSeeker::mTargetRing |
The ring the lane moves towards.
| float Rnd::TunnelSeeker::mMeshFrameOffset |
The path frame offset of the mesh.
| float Rnd::TunnelSeeker::mTransFrameOffset |
The path frame offset of the transformable.
| float Rnd::TunnelSeeker::mLookFrameOffset |
The path frame offset the transformable faces.
| Mesh* Rnd::TunnelSeeker::mMesh |
The mesh the seeker draws.
| Tunnel* Rnd::TunnelSeeker::mTunnel |
The tunnel, which holds the references.
| float Rnd::TunnelSeeker::mLane |
The current ring position, fractional while moving.
| float Rnd::TunnelSeeker::mFrame |
The tunnel frame of the last UpdateLane().