resonance 1.0.1
Loading...
Searching...
No Matches
Rnd::TunnelSeeker Class Reference

Marker that travels around the tunnel rings towards a target ring. More...

#include <tunnelseeker.h>

Collaboration diagram for Rnd::TunnelSeeker:

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

Detailed Description

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().

Constructor & Destructor Documentation

◆ TunnelSeeker()

Rnd::TunnelSeeker::TunnelSeeker ( )

Construct a seeker with no tunnel.

mTransFrameOffset starts at -500. mSavedFlag is not set.

Ghidra address:
NTSC-U/C: 0x00477768
Ghidra address:
PAL: 0x004b53e0

Member Function Documentation

◆ ReleaseRefs()

void Rnd::TunnelSeeker::ReleaseRefs ( )

Release the transformable and mesh references and clear the strip.

The two pointers are not cleared.

Ghidra address:
NTSC-U/C: 0x004777c0
Ghidra address:
PAL: 0x004b5438

◆ SetTunnel()

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.

Parameters
pTunnelThe tunnel.
nIndexThe index of the seeker in the tunnel.
Ghidra address:
NTSC-U/C: 0x00477830
Ghidra address:
PAL: 0x004b54a8

◆ SetTrans()

void Rnd::TunnelSeeker::SetTrans ( Transformable * pTrans)

Replace the transformable the seeker drives.

Parameters
pTransThe transformable, or null.
Ghidra address:
NTSC-U/C: 0x00477a48
Ghidra address:
PAL: 0x004b56c0

◆ SetTargetRing()

void Rnd::TunnelSeeker::SetTargetRing ( int nRing)

Set the ring the lane moves towards.

Parameters
nRingThe ring.
Ghidra address:
NTSC-U/C: 0x00477ab8
Ghidra address:
PAL: 0x004b5730

◆ SetMesh()

void Rnd::TunnelSeeker::SetMesh ( Mesh * pMesh)

Replace the mesh the seeker draws.

Parameters
pMeshThe mesh, or null.
Ghidra address:
NTSC-U/C: 0x00477ac0
Ghidra address:
PAL: 0x004b5738

◆ SetMeshFrameOffset()

void Rnd::TunnelSeeker::SetMeshFrameOffset ( float flOffset)

Set the path frame offset used to place the mesh.

Parameters
flOffsetThe offset from the tunnel frame.
Ghidra address:
NTSC-U/C: 0x00477b30
Ghidra address:
PAL: 0x004b57a8

◆ SetTransFrameOffset()

void Rnd::TunnelSeeker::SetTransFrameOffset ( float flOffset)

Set the path frame offset used to place the transformable.

Parameters
flOffsetThe offset from the tunnel frame.
Ghidra address:
NTSC-U/C: 0x00477b38
Ghidra address:
PAL: 0x004b57b0

◆ SetLookFrameOffset()

void Rnd::TunnelSeeker::SetLookFrameOffset ( float flOffset)

Set the path frame offset the transformable is oriented towards.

Parameters
flOffsetThe offset from the tunnel frame.
Ghidra address:
NTSC-U/C: 0x00477b40
Ghidra address:
PAL: 0x004b57b8

◆ SetRange()

void Rnd::TunnelSeeker::SetRange ( int nFirstSlice,
int nSliceCount,
int nRing )

Place the strip on a run of slices.

Parameters
nFirstSliceThe first slice of the run.
nSliceCountThe number of slices.
nRingThe ring.
Ghidra address:
NTSC-U/C: 0x00477b48
Ghidra address:
PAL: 0x004b57c0

◆ SetColor()

void Rnd::TunnelSeeker::SetColor ( const Color & color)

Set the colour of the strip.

Parameters
colorThe colour.
Ghidra address:
NTSC-U/C: 0x00477b68
Ghidra address:
PAL: 0x004b57e0

◆ SetMat()

void Rnd::TunnelSeeker::SetMat ( Mat * pMat)

Set the material of the strip.

Parameters
pMatThe material, or null.
Ghidra address:
NTSC-U/C: 0x00477b88
Ghidra address:
PAL: 0x004b5800

◆ GetFirstSlice()

int Rnd::TunnelSeeker::GetFirstSlice ( ) const
inline

Report the first slice of the strip.

Returns
The first slice.
Ghidra address:
NTSC-U/C: 0x00477ba8
Ghidra address:
PAL: 0x004b5820

◆ GetSliceCount()

int Rnd::TunnelSeeker::GetSliceCount ( ) const
inline

Report the slice count of the strip.

Returns
The number of slices.
Ghidra address:
NTSC-U/C: 0x00477bb0
Ghidra address:
PAL: 0x004b5828

◆ GetRing()

int Rnd::TunnelSeeker::GetRing ( ) const
inline

Report the ring of the strip.

Returns
The ring.
Ghidra address:
NTSC-U/C: 0x00477bb8
Ghidra address:
PAL: 0x004b5830

◆ GetColor()

Color Rnd::TunnelSeeker::GetColor ( ) const
inline

Report the colour of the strip.

Returns
The colour, by value.
Ghidra address:
NTSC-U/C: 0x00477bc0
Ghidra address:
PAL: 0x004b5838

◆ GetMat()

Mat * Rnd::TunnelSeeker::GetMat ( ) const
inline

Report the material of the strip.

Returns
The material, or null.
Ghidra address:
NTSC-U/C: 0x00477bd0
Ghidra address:
PAL: 0x004b5848

◆ DrawSection()

void Rnd::TunnelSeeker::DrawSection ( int nSlice,
float flScreenSize )

Draw the strip section placed on one slice.

Parameters
nSliceThe slice being drawn.
flScreenSizeThe screen size used to pick the level of detail.
Ghidra address:
NTSC-U/C: 0x00477bd8
Ghidra address:
PAL: 0x004b5850

◆ DrawMesh()

void Rnd::TunnelSeeker::DrawMesh ( )

Draw the mesh, when there is one.

Ghidra address:
NTSC-U/C: 0x00477bf8
Ghidra address:
PAL: 0x004b5870

◆ UpdateLane()

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.

Returns
The new lane.
Ghidra address:
NTSC-U/C: 0x0046e6a0
Ghidra address:
PAL: 0x004ac280

◆ SetTransXfm()

void Rnd::TunnelSeeker::SetTransXfm ( const Transform & xfm)

Install a transform as the local transform of mTrans and mark it dirty.

Parameters
xfmThe transform.
Ghidra address:
NTSC-U/C: 0x00477c20
Ghidra address:
PAL: 0x004b5898

◆ SetMeshXfm()

void Rnd::TunnelSeeker::SetMeshXfm ( const Transform & xfm)

Install a transform as the local transform of mMesh and recompose its world transform.

Parameters
xfmThe transform.
Ghidra address:
NTSC-U/C: 0x00477c58
Ghidra address:
PAL: 0x004b58d0

◆ Replace()

void Rnd::TunnelSeeker::Replace ( Object * pFrom,
Object * pTo,
Object * pReferrer )

Replace the transformable, mesh, and material references.

Parameters
pFromThe object being replaced.
pToThe replacement.
pReferrerThe object the references are held on behalf of.
Ghidra address:
NTSC-U/C: 0x004778c0
Ghidra address:
PAL: 0x004b5538

◆ Save()

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.

Parameters
streamThe stream to write to.
Ghidra address:
NTSC-U/C: 0x0046df88
Ghidra address:
PAL: 0x004abaf8

◆ Load()

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.

Parameters
streamThe stream to read from.
Ghidra address:
NTSC-U/C: 0x0046e2d8
Ghidra address:
PAL: 0x004abe48

Member Data Documentation

◆ mStrip

TunnelSeekStrip Rnd::TunnelSeeker::mStrip

The highlighted run of slices.

◆ mTrans

Transformable* Rnd::TunnelSeeker::mTrans

The transformable the seeker drives. A flag Save() and Load() move as one byte and the copy assignment copies. No other routine reads it. +0x54

◆ mSavedFlag

int Rnd::TunnelSeeker::mSavedFlag

◆ mTargetRing

int Rnd::TunnelSeeker::mTargetRing

The ring the lane moves towards.

◆ mMeshFrameOffset

float Rnd::TunnelSeeker::mMeshFrameOffset

The path frame offset of the mesh.

◆ mTransFrameOffset

float Rnd::TunnelSeeker::mTransFrameOffset

The path frame offset of the transformable.

◆ mLookFrameOffset

float Rnd::TunnelSeeker::mLookFrameOffset

The path frame offset the transformable faces.

◆ mMesh

Mesh* Rnd::TunnelSeeker::mMesh

The mesh the seeker draws.

◆ mTunnel

Tunnel* Rnd::TunnelSeeker::mTunnel

The tunnel, which holds the references.

◆ mLane

float Rnd::TunnelSeeker::mLane

The current ring position, fractional while moving.

◆ mFrame

float Rnd::TunnelSeeker::mFrame

The tunnel frame of the last UpdateLane().


The documentation for this class was generated from the following file: