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

Procedural tunnel the game flies the player through. More...

#include <tunnel.h>

Inheritance diagram for Rnd::Tunnel:
Collaboration diagram for Rnd::Tunnel:

Public Member Functions

 Tunnel (const HxStr &name)
 Construct a tunnel with no sections.
virtual ~Tunnel ()
virtual void DumpText (Dbg &sink)
 Write the tunnel to the engine text sink.
virtual void Save (Stream &stream)
 Serialise the tunnel.
virtual void Replace (Object *pFrom, Object *pTo)
 Replace one object reference with another.
virtual const HxStr & ClassName () const
 Return the registered class name, "Tunnel".
virtual void Copy (const Object *pSource, unsigned nFlags)
 Copy another tunnel over this one.
virtual void Load (Stream &stream)
 Load the tunnel.
virtual void FindCollisions (const Segment &ray, std::list< Collision > &collisions)
 Test a ray against the tunnel and append what it strikes to sink.
void Update ()
 Regenerate the geometry that the current state calls for.
Mesh * GetRingSection (int nSlice)
 Report the first mesh of one slice.
Mesh * GetRingSection (int nRing, int nSlice)
 Report the first mesh of one ring of one slice.
void LerpRingSectionTangent (int nRing, Vector3 *pOut, float flWeight)
 Blend the translation of one ring transform towards the next.
void GetRingXfm (int nRing, Transform *pOut, float flFrame, float flBlend)
 Build the frame of a point on one ring at a path frame.
void ProjectSectionToCameraSpace (int nRing, Transform *pOut, float flAnimFrame, float flRingBlend, float flTangentScale)
 Build the frame of a point on one ring at a path frame, with the ring pushed outwards.
void ScrollRings ()
 Bring every slice of the current window up to the advanced slice.
void AdvanceRing (int nSlice)
 Advance one slice and refresh the section frames.
void ApplyMeshLodScreenSizes (const std::vector< float > &screenSizes)
 Replace the level of detail thresholds and apply them to every generated mesh.
void AddEvent (Drawable *pObject, float flFrame, int nId, int nUser)
 Schedule a drawable at a frame.
int MoveEvent (int nId, float flFrame)
 Move the first event with an identifier to a new frame.
int RemoveEvent (int nId)
 Remove the first event with an identifier and drop its reference.
int RemoveEventsInRange (float flFrom, float flTo)
 Remove every event whose frame lies in a half open range, dropping each reference.
void ForEachEvent (void(*pfnVisit)(Drawable *pObject, float flFrame, int nId, void *pUser), void *pUser)
 Call a function once for every event, in frame order.
void SetPath (TransAnim *pPath)
 Replace the path the tunnel follows.
void GetPathXfm (Transform *pOut, float flFrame)
 Evaluate the path at a frame.
void SetLaneChangeFrames (float flFrames)
 Set mLaneChangeFrames.
TunnelSeeker * GetSeeker (unsigned nIndex)
 Report one seeker.
void ResizeSeekers (unsigned nCount)
 Set the number of seekers and attach each one to this tunnel.
void Configure (float flRingRadius, int nRingCount, int nSliceCount, int nLodCount, float flFloorPull, float flLaneEdgeGap, float flFloorEdgeWeight, float flCellEdgeBlendPerStep)
 Set the shape parameters and rebuild the geometry.
int FrameToSlice (float flFrame)
 Convert a frame to a slice.
void SetLaneDividerColor (int nRing, int nSlice, const Color &color)
 Colour the wall between one lane and the next on one slice.
void SetLaneFloorColor (const Color &color)
 Colour the floor and the second end cap of every lane on every slice.
Public Member Functions inherited from Rnd::Drawable
 Drawable ()
 Construct a visible drawable with no children.
virtual ~Drawable ()
 Drop this object's references on its children.
void Draw ()
 Draw this object followed by each of its children.
Drawable * Parent ()
 Report the drawable that draws this one.
void AddDraw (Drawable *pDraw, Drawable *pBefore)
 Insert pDraw into mDraws in front of pBefore.
void AddDraw (Drawable *pDraw)
 Insert pDraw at the front of mDraws.
void RemoveDraw (Drawable *pDraw)
 Erase pDraw from mDraws.
void RemoveAllDraws ()
 Empty mDraws, dropping this object's reference on every entry.
void MoveDraw (Drawable *pDraw, int nSteps)
 Move pDraw nSteps places later in mDraws, or earlier for a negative count.
virtual void SetShowing (int nShowing)
 Set whether this object draws at all.
void SetShowingRecursive (int nShowing)
 Set whether this object and every drawable beneath it in mDraws draw at all.
virtual void SetHighlight (int nHighlight)
 Set whether this object draws with its highlight treatment.
int GetHighlight () const
 Report the highlight flag.
int GetShowing () const
 Report the showing flag.
std::list< Drawable * > & GetDraws ()
 Report the child list.
Public Member Functions inherited from Rnd::Object
 Object ()
 Construct an unnamed object.
 Object (const HxStr &name)
 Construct an object and register it under name.
virtual ~Object ()
 Erase the registry entry and release the name buffer.
void SetName (const HxStr &name)
 Re-register this object under a different name.
void AddRef (Object *pReferrer)
 Register pReferrer as a store of a pointer to this object.
void RemoveRef (Object *pReferrer)
 Drop one registration made by AddRef().
Public Member Functions inherited from Rnd::Animatable
 Animatable ()
 Construct an animatable with no children, no filters, and a zero frame.
virtual ~Animatable ()
 Drop this object's references on its children and delete its filters.
Animatable * Parent ()
 Report the animatable that animates this one.
void AddAnim (Animatable *pAnim)
 Append pAnim to mAnims.
void RemoveAnim (Animatable *pAnim)
 Erase pAnim from mAnims.
void SetFrame (float flFrame)
 Drive this object and its whole subtree to a frame.
float UnfilterFrame (float flValue)
 Map a value back through mFilters.
void AddFilter (Filter *pFilter)
 Append an already-built filter to mFilters.
void AddScaleOffset (float flScale, float flOffset)
 Append a new ScaleOffset stage to mFilters.
void AddMinMaxLoop (float flMin, float flMax, int nLoop)
 Append a new MinMaxLoop stage to mFilters.
void AddZeroOrder (float flLevel, float flMaxDelta)
 Append a new ZeroOrder stage to mFilters.
void AddFirstOrder (float flLevel, float flRatio)
 Append a new FirstOrder stage to mFilters.
void AddSecondOrder (float flLevel, float flSpring, float flDamper)
 Append a new SecondOrder stage to mFilters.
void RemoveFilter (int nIndex)
 Delete and erase the filter at one position in mFilters.
Filter * FilterAt (int nIndex)
 Return the filter at one position in mFilters.
void SetRate (float flRate)
 Change the multiplier of the ScaleOffset stage at the front of mFilters.
void SetOffset (float flOffset)
 Change the addend of the ScaleOffset stage at the front of mFilters.
void SetLoopRange (float flMin, float flMax)
 Change both ends of the MinMaxLoop stage at the back of mFilters.
virtual float FilteredFrameEnd ()
 Report the last frame this object's subtree animates to.
virtual void StartAnim ()
 Restart the animation of this object and its whole subtree.
void RemoveAllAnims ()
 Drop this object's reference on every mAnims entry and then empty mAnims.
Public Member Functions inherited from Rnd::Collideable
 Collideable ()
 Construct a collideable with no children.
virtual ~Collideable ()
 Drop this object's references on its children.
Collideable * Parent ()
 Report the collideable that hit-tests this one.
void AddCollide (Collideable *pCollide)
 Append pCollide to mCollides.
void RemoveCollide (Collideable *pCollide)
 Erase pCollide from mCollides.
virtual void FindCollisions (const Vector2 &point, std::list< Collision > &collisions)
 Test a screen point against this object and append what it strikes to collisions.

Static Public Member Functions

static void * operator new (size_t nSize)
 Allocate a tunnel under the tag "Rnd::Tunnel".
static void operator delete (void *pBlock)
 Release a tunnel under the tag "Rnd::Tunnel".
Static Public Member Functions inherited from Rnd::Drawable
static Drawable * Find (const HxStr &name)
 Resolve a registry key to a drawable.
Static Public Member Functions inherited from Rnd::Animatable
static Filter * NewFilter (int nType)
 Build one default-constructed filter for a type tag.

Public Attributes

int mRingCount
int mSliceCount
TransAnim * mPath
int mCulledFarSlices
std::vector< float > mLodScreenSizes
int mDrawLattice
int mDrawPanels
Public Attributes inherited from Rnd::Drawable
int mShowing
Public Attributes inherited from Rnd::Object
HxStr mName
int mInternal
Public Attributes inherited from Rnd::Animatable
float mFilteredFrame
 The frame SetFrame() last received, after the filter chain.

Protected Member Functions

virtual int DrawShowing ()
 Draw the tunnel.
virtual void SetFrameSelf (float flFrame)
 Advance the tunnel to a frame.
Protected Member Functions inherited from Rnd::Drawable
void ReleaseDrawsRefs ()
 Drop this object's reference on every mDraws entry without emptying the list.
Protected Member Functions inherited from Rnd::Object
void ReleaseAllRefs ()
 Tell every referrer to drop its pointer to this object.
Protected Member Functions inherited from Rnd::Collideable
void ReleaseCollidesRefs ()
 Drop this object's reference on every mCollides entry without emptying the list.

Friends

class TunnelSeekSection
class TunnelSeekStrip
class TunnelSeeker

Additional Inherited Members

Public Types inherited from Rnd::Animatable
enum  FilterType {
  kFilterScaleOffset = 0 , kFilterMinMaxLoop = 1 , kFilterZeroOrder = 2 , kFilterFirstOrder = 3 ,
  kFilterSecondOrder = 4
}
 Value a filter reports from Filter::Type() and a .rnd file stores in front of its payload. More...
Protected Attributes inherited from Rnd::Object
std::list< Object * > mRefs

Detailed Description

Procedural tunnel the game flies the player through.

Its RTTI descriptor is at 0x008efdb0. It has three public non-virtual bases: Rnd::Drawable at +0x00, Rnd::Animatable at +0x14, and Rnd::Collideable at +0x2c. All three derive virtually from Rnd::Object. One shared Object subobject sits at +0xe8. The creator allocates exactly 0x104 bytes, 0xe8 plus the 0x1c-byte Object subobject with no surplus, and the three base sizes of 0x14, 0x18, and 0xc account for everything ahead of +0x38. The members of the class itself therefore occupy +0x38 through +0xe7.

This is the only render tunnel in the build. The four other Tnl-prefixed classes, TnlArena, TnlTrigger, TnlPanelFXDelay, and AppTunnel, all derive from MsgSink and belong to the game rather than the renderer.

Four vtables belong to the class, each identified by its own GetTypeInfo slot addressing 0x004761b0 and by an adjustment matching its subobject offset. The Object subobject table at 0x0081d4f0 adjusts by -0xe8, the Collideable table at 0x0081d480 by -0x2c, the Animatable table at 0x0081d4a0 by -0x14, and the Drawable table at 0x0081d4c8 by zero.

Beyond the seven Object virtuals the class overrides exactly three, one in each mix-in: FindCollisions() at Collideable slot 1, SetFrameSelf() at Animatable slot 3, and DrawShowing() at Drawable slot 3. Both remaining Animatable slots and both remaining Drawable slots still address the base implementations.

DumpText() is a stub the original author never finished. It emits the three base dumps and then the two literals "[Tunnel]\n" and "TODO\n", and writes no member at all. No member of this class has a name anywhere in the image, because the text dump is the only routine that would have supplied one. Member titles follow the role their routines give them.

Load() accepts a bounded version range rather than an upper bound alone, which is the only class in the renderer that does. It reports "Can't load new Tunnel" above the range and "Can't load old Tunnel" below it.

The geometry is a ring of mRingCount lanes, each a three-segment trough (LaneProfile), swept along the path mPath one slice of mSliceFrames frames at a time. Each slice owns one chain of lane meshes, "[<name>_lat<slice>.<level>]", and each lane of each slice one chain of cell meshes, "[<name>_pan<cell>.<level>]", that fill the gap to the next lane. The ring advance places one column of every slice mesh per step, and DrawShowing() draws the slices of the visible window. The seekers add "[<name>_seek<index>.<section>]" meshes over the lanes they highlight.

The record the vector at +0xdc stores is Rnd::TunnelSeeker. The routines at 0x00477830 and 0x0046e830 are members of the seeker and of its strip rather than of this class, and the three seek records read private members of this class directly.

Constructor & Destructor Documentation

◆ Tunnel()

Rnd::Tunnel::Tunnel ( const HxStr & name)

Construct a tunnel with no sections.

The body is not reconstructed. It writes the initial values recorded on the members below and allocates the sentinel node of each list member.

Parameters
nameThe object name, passed to the Rnd::Object constructor.
Ghidra address:
NTSC-U/C: 0x00466620
Ghidra address:
PAL: 0x004a4050

◆ ~Tunnel()

virtual Rnd::Tunnel::~Tunnel ( )
virtual
Ghidra address:
NTSC-U/C: 0x004676b0
Ghidra address:
PAL: 0x004a50e0

Member Function Documentation

◆ operator new()

void * Rnd::Tunnel::operator new ( size_t nSize)
static

Allocate a tunnel under the tag "Rnd::Tunnel".

Parameters
nSizeThe object size the compiler supplies.
Returns
The block.
Ghidra address:
NTSC-U/C: 0x00476218
Ghidra address:
PAL: 0x004b3e90

◆ operator delete()

void Rnd::Tunnel::operator delete ( void * pBlock)
static

Release a tunnel under the tag "Rnd::Tunnel".

Parameters
pBlockThe block.
Ghidra address:
NTSC-U/C: 0x00476238
Ghidra address:
PAL: 0x004b3eb0

◆ DumpText()

virtual void Rnd::Tunnel::DumpText ( Dbg & sink)
virtual

Write the tunnel to the engine text sink.

Emits the Object, Drawable, and Animatable dumps, then the "[Tunnel]" block, which is the literal "TODO" and nothing else. The Collideable dump is not emitted. The block is suppressed while the dump level of the sink is not positive.

Parameters
sinkThe text sink.
Ghidra address:
NTSC-U/C: 0x004768b8
Ghidra address:
PAL: 0x004b4530

Reimplemented from Rnd::Drawable.

◆ Save()

virtual void Rnd::Tunnel::Save ( Stream & stream)
virtual

Serialise the tunnel.

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

Reimplemented from Rnd::Drawable.

◆ Replace()

virtual void Rnd::Tunnel::Replace ( Object * pFrom,
Object * pTo )
virtual

Replace one object reference with another.

Parameters
pFromThe object being replaced.
pToThe object to point at, which may be null.
Ghidra address:
NTSC-U/C: 0x004680e0
Ghidra address:
PAL: 0x004a5b10

Reimplemented from Rnd::Drawable.

◆ ClassName()

virtual const HxStr & Rnd::Tunnel::ClassName ( ) const
virtual

Return the registered class name, "Tunnel".

Returns
The class name.
Ghidra address:
NTSC-U/C: 0x004763b8
Ghidra address:
PAL: 0x004b4030

Implements Rnd::Object.

◆ Copy()

virtual void Rnd::Tunnel::Copy ( const Object * pSource,
unsigned nFlags )
virtual

Copy another tunnel over this one.

Parameters
pSourceThe source object, which has to be a tunnel for the copy to have any effect.
nFlagsThe copy flags.
Ghidra address:
NTSC-U/C: 0x00476788
Ghidra address:
PAL: 0x004b4400

Reimplemented from Rnd::Drawable.

◆ Load()

virtual void Rnd::Tunnel::Load ( Stream & stream)
virtual

Load the tunnel.

Rejects a file outside the version range it accepts, reporting "Can't load new Tunnel" above it and "Can't load old Tunnel" below it.

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

Reimplemented from Rnd::Drawable.

◆ FindCollisions()

virtual void Rnd::Tunnel::FindCollisions ( const Segment & ray,
std::list< Collision > & collisions )
virtual

Test a ray against the tunnel and append what it strikes to sink.

Rnd::Collideable vtable slot 1.

Parameters
rayThe segment to test along.
collisionsThe list to append intersections to.
Ghidra address:
NTSC-U/C: 0x00476a10
Ghidra address:
PAL: 0x004b4688

Reimplemented from Rnd::Collideable.

◆ Update()

void Rnd::Tunnel::Update ( )

Regenerate the geometry that the current state calls for.

Ghidra address:
NTSC-U/C: 0x00467f48
Ghidra address:
PAL: 0x004a5978

◆ GetRingSection() [1/2]

Mesh * Rnd::Tunnel::GetRingSection ( int nSlice)

Report the first mesh of one slice.

The slice index wraps through a signed remainder against mSliceCount, so a negative index addresses from the end.

Parameters
nSliceThe slice index, taken modulo mSliceCount.
Returns
The first mesh of the slice.
Ghidra address:
NTSC-U/C: 0x004773e8
Ghidra address:
PAL: 0x004b5060

◆ GetRingSection() [2/2]

Mesh * Rnd::Tunnel::GetRingSection ( int nRing,
int nSlice )

Report the first mesh of one ring of one slice.

Both indices wrap through a signed remainder, the ring against mRingCount and the slice against mSliceCount.

Parameters
nRingThe ring index, taken modulo mRingCount.
nSliceThe slice index, taken modulo mSliceCount.
Returns
The first mesh of the ring.
Ghidra address:
NTSC-U/C: 0x00477388
Ghidra address:
PAL: 0x004b5000

◆ LerpRingSectionTangent()

void Rnd::Tunnel::LerpRingSectionTangent ( int nRing,
Vector3 * pOut,
float flWeight )

Blend the translation of one ring transform towards the next.

The successor wraps through a signed remainder against mRingCount. Only the three components are blended. The whole quadword is stored, so the padding word of the output receives the padding word of the successor's translation.

Parameters
nRingThe ring index.
pOutThe vector to write the blend into.
flWeightThe weight of the successor, with the complement applied to entry nRing.
Ghidra address:
NTSC-U/C: 0x00477538
Ghidra address:
PAL: 0x004b51b0

◆ GetRingXfm()

void Rnd::Tunnel::GetRingXfm ( int nRing,
Transform * pOut,
float flFrame,
float flBlend )

Build the frame of a point on one ring at a path frame.

Without a path the output is the identity, with the padding words of the three basis rows unwritten. Otherwise the basis rows are those of the ring transform, the translation is blended towards the next ring by LerpRingSectionTangent(), and the result is concatenated with the path transform at flFrame.

Parameters
nRingThe ring.
pOutThe transform to write.
flFrameThe path frame.
flBlendThe weight of the next ring's translation.
Ghidra address:
NTSC-U/C: 0x0046da40
Ghidra address:
PAL: 0x004ab580

◆ ProjectSectionToCameraSpace()

void Rnd::Tunnel::ProjectSectionToCameraSpace ( int nRing,
Transform * pOut,
float flAnimFrame,
float flRingBlend,
float flTangentScale )

Build the frame of a point on one ring at a path frame, with the ring pushed outwards.

A null mPath writes the identity. Otherwise the three basis rows of the ring transform are copied through, the translation row is the blend of that ring's translation and its wrapped successor's, each scaled by flTangentScale, and the result is concatenated with the path transform at flAnimFrame. The AppTunnel helpers (the gem trails, the sabre trail, and the grid markers) call it.

Parameters
nRingThe ring.
pOutThe transform to write.
flAnimFrameThe path frame.
flRingBlendThe weight of the next ring's translation.
flTangentScaleThe scale applied to both translations.
Ghidra address:
NTSC-U/C: 0x0046db80
Ghidra address:
PAL: 0x004ab6c0

◆ ScrollRings()

void Rnd::Tunnel::ScrollRings ( )

Bring every slice of the current window up to the advanced slice.

Walks the mSliceCount slices starting at mWindowStartSlice and calls AdvanceRing() for each one whose mPlacedSlices entry differs from its index.

Ghidra address:
NTSC-U/C: 0x00476f48
Ghidra address:
PAL: 0x004b4bc0

◆ AdvanceRing()

void Rnd::Tunnel::AdvanceRing ( int nSlice)

Advance one slice and refresh the section frames.

A slice that differs from mPlacingSlice retires the previous slice by writing the 99999999 sentinel into its mPlacedSlices entry, then reloads mPlacingFrame and mPlacingColumn. SetRingSectionFrames() runs either way. The step counter then either expires, which records the slice as current, or decrements and accumulates one step into mPlacingFrame.

Parameters
nSliceThe slice to advance to.
Ghidra address:
NTSC-U/C: 0x00476fe0
Ghidra address:
PAL: 0x004b4c58

◆ ApplyMeshLodScreenSizes()

void Rnd::Tunnel::ApplyMeshLodScreenSizes ( const std::vector< float > & screenSizes)

Replace the level of detail thresholds and apply them to every generated mesh.

The argument is assigned over mLodScreenSizes, then both mesh grids are walked. Each mesh takes the threshold whose index matches its position within its own list, and a mesh whose position passes the end of the threshold vector is skipped rather than clamped. The title is inferred from Rnd::Mesh::mMinScreen, the member it writes.

Public because the stage classes between 0x00432000 and 0x00444000 supply nine callers, none of which derives from this class. A friend declaration per calling class fits the image equally well.

Parameters
screenSizesOne threshold per ring, applied in index order.
Ghidra address:
NTSC-U/C: 0x0046d180
Ghidra address:
PAL: 0x004aacc0

◆ AddEvent()

void Rnd::Tunnel::AddEvent ( Drawable * pObject,
float flFrame,
int nId,
int nUser )

Schedule a drawable at a frame.

The event goes before the first one whose frame is not less than flFrame, so equal frames keep the newest first. The tunnel takes a reference on the drawable.

Parameters
pObjectThe drawable, which may be null.
flFrameThe frame to schedule at.
nIdThe identifier MoveEvent() and RemoveEvent() match on.
nUserA word stored with the event.
Ghidra address:
NTSC-U/C: 0x0046d400
Ghidra address:
PAL: 0x004aaf40

◆ MoveEvent()

int Rnd::Tunnel::MoveEvent ( int nId,
float flFrame )

Move the first event with an identifier to a new frame.

The event is unlinked and scheduled again through AddEvent(), which takes a second reference on the drawable without the first being dropped, and its user word is reset to zero. The program lists no caller.

Parameters
nIdThe identifier to match.
flFrameThe new frame.
Returns
One when an event matched, zero otherwise.
Ghidra address:
NTSC-U/C: 0x0046d540
Ghidra address:
PAL: 0x004ab080

◆ RemoveEvent()

int Rnd::Tunnel::RemoveEvent ( int nId)

Remove the first event with an identifier and drop its reference.

The image has no caller.

Parameters
nIdThe identifier to match.
Returns
One when an event matched, zero otherwise.
Ghidra address:
NTSC-U/C: 0x0046d5d8
Ghidra address:
PAL: 0x004ab118

◆ RemoveEventsInRange()

int Rnd::Tunnel::RemoveEventsInRange ( float flFrom,
float flTo )

Remove every event whose frame lies in a half open range, dropping each reference.

Parameters
flFromThe first frame removed.
flToThe frame the range stops before.
Returns
The number of events removed.
Ghidra address:
NTSC-U/C: 0x0046d680
Ghidra address:
PAL: 0x004ab1c0

◆ ForEachEvent()

void Rnd::Tunnel::ForEachEvent ( void(* pfnVisit )(Drawable *pObject, float flFrame, int nId, void *pUser),
void * pUser )

Call a function once for every event, in frame order.

The image has no caller.

Parameters
pfnVisitThe function, given the drawable, the frame, the identifier, and pUser.
pUserPassed through to pfnVisit.
Ghidra address:
NTSC-U/C: 0x00477310
Ghidra address:
PAL: 0x004b4f88

◆ SetPath()

void Rnd::Tunnel::SetPath ( TransAnim * pPath)

Replace the path the tunnel follows.

Moves the reference from the previous path to the new one, calls FilteredFrameEnd() on a non-null path and discards the result, and fills mPlacedSlices with the 99999999 sentinel to force a rebuild of every slice.

Parameters
pPathThe path, or null.
Ghidra address:
NTSC-U/C: 0x004770d0
Ghidra address:
PAL: 0x004b4d48

◆ GetPathXfm()

void Rnd::Tunnel::GetPathXfm ( Transform * pOut,
float flFrame )

Evaluate the path at a frame.

Without a path the three basis rows receive the identity with their padding words unwritten, and the translation row receives (0, 0, 0, 1).

Parameters
pOutThe transform to write.
flFrameThe path frame.
Ghidra address:
NTSC-U/C: 0x004775b0
Ghidra address:
PAL: 0x004b5228

◆ SetLaneChangeFrames()

void Rnd::Tunnel::SetLaneChangeFrames ( float flFrames)

Set mLaneChangeFrames.

Parameters
flFramesThe tunnel frames a seeker takes to move one ring.
Ghidra address:
NTSC-U/C: 0x004772c8
Ghidra address:
PAL: 0x004b4f40

◆ GetSeeker()

TunnelSeeker * Rnd::Tunnel::GetSeeker ( unsigned nIndex)

Report one seeker.

Parameters
nIndexThe seeker index.
Returns
The seeker, or null when nIndex is out of range.
Ghidra address:
NTSC-U/C: 0x00477298
Ghidra address:
PAL: 0x004b4f10

◆ ResizeSeekers()

void Rnd::Tunnel::ResizeSeekers ( unsigned nCount)

Set the number of seekers and attach each one to this tunnel.

Every existing seeker releases its references first. New seekers are default constructed.

Parameters
nCountThe seeker count.
Ghidra address:
NTSC-U/C: 0x0046cfd8
Ghidra address:
PAL: 0x004aab18

◆ Configure()

void Rnd::Tunnel::Configure ( float flRingRadius,
int nRingCount,
int nSliceCount,
int nLodCount,
float flFloorPull,
float flLaneEdgeGap,
float flFloorEdgeWeight,
float flCellEdgeBlendPerStep )

Set the shape parameters and rebuild the geometry.

Every seeker releases its references, BuildMesh() runs, and every seeker is attached again. The image has no caller.

Parameters
flRingRadiusThe value of mRingRadius.
nRingCountThe ring count.
nSliceCountThe slice count.
nLodCountThe value of mLodCount.
flFloorPullThe value of mFloorPull.
flLaneEdgeGapThe value of mLaneEdgeGap.
flFloorEdgeWeightThe value of mFloorEdgeWeight.
flCellEdgeBlendPerStepThe value of mCellEdgeBlendPerStep.
Ghidra address:
NTSC-U/C: 0x00477160
Ghidra address:
PAL: 0x004b4dd8

◆ FrameToSlice()

int Rnd::Tunnel::FrameToSlice ( float flFrame)

Convert a frame to a slice.

The frame is scaled by mSlicesPerFrame and rounded down. The image has no caller.

Parameters
flFrameThe frame.
Returns
The slice.
Ghidra address:
NTSC-U/C: 0x00476540
Ghidra address:
PAL: 0x004b41b8

◆ SetLaneDividerColor()

void Rnd::Tunnel::SetLaneDividerColor ( int nRing,
int nSlice,
const Color & color )

Colour the wall between one lane and the next on one slice.

Colours the right wall of the lane, the left wall of the following lane, and the first end cap of the lane, then reports the colour change. Both indices wrap.

Parameters
nRingThe lane.
nSliceThe slice.
colorThe colour.
Ghidra address:
NTSC-U/C: 0x0046d788
Ghidra address:
PAL: 0x004ab2c8

◆ SetLaneFloorColor()

void Rnd::Tunnel::SetLaneFloorColor ( const Color & color)

Colour the floor and the second end cap of every lane on every slice.

Parameters
colorThe colour.
Ghidra address:
NTSC-U/C: 0x0046d8e8
Ghidra address:
PAL: 0x004ab428

◆ DrawShowing()

virtual int Rnd::Tunnel::DrawShowing ( )
protectedvirtual

Draw the tunnel.

Rnd::Drawable vtable slot 3.

Returns
Non-zero when the children are to be drawn as well.
Ghidra address:
NTSC-U/C: 0x00468850
Ghidra address:
PAL: 0x004a62b0

Reimplemented from Rnd::Drawable.

◆ SetFrameSelf()

virtual void Rnd::Tunnel::SetFrameSelf ( float flFrame)
protectedvirtual

Advance the tunnel to a frame.

Rnd::Animatable vtable slot 3.

Parameters
flFrameThe filtered frame to animate to.
Ghidra address:
NTSC-U/C: 0x00469180
Ghidra address:
PAL: 0x004a6c40

Reimplemented from Rnd::Animatable.

◆ TunnelSeekSection

friend class TunnelSeekSection
friend

◆ TunnelSeekStrip

friend class TunnelSeekStrip
friend

◆ TunnelSeeker

friend class TunnelSeeker
friend

Member Data Documentation

◆ mRingCount

int Rnd::Tunnel::mRingCount

< The ring count, 3 at construction. It is the modulus of the inner index of mCellChains, the modulus of the index of mRingXfms, and the row stride of mCellChains. Public because the Renderer constructor reads it at 0x0042c9c8 and the image has no accessor. The slice count, 0 at construction. It is the modulus of the index of mSliceChains, the modulus of the outer index of mCellChains, and the length of the array mPlacedSlices addresses. Public on the same evidence, read at 0x0042c9d4.

◆ mSliceCount

int Rnd::Tunnel::mSliceCount

◆ mPath

TransAnim* Rnd::Tunnel::mPath

< The path the tunnel follows, 0 at construction, which ProjectSectionToCameraSpace() and GetPathXfm() evaluate through Rnd::TransAnim::EvalFrame(). A null path makes both write the identity. Public because AppTunnel's constructor reads it at 0x004433a4 to hand it back to SetPath(), and the image has no accessor. +0x58

◆ mCulledFarSlices

int Rnd::Tunnel::mCulledFarSlices

< The slices at the far end of the window that DrawShowing() skips, 0 at construction. Save(), Load(), and Copy() carry it. Public because AppTunnel's constructor writes 2, 3, or 4 there by local player count at 0x004433a0, and the image has no accessor. +0x60

◆ mLodScreenSizes

std::vector<float> Rnd::Tunnel::mLodScreenSizes

< One level of detail threshold per chain level, each written into the mMinScreen of the mesh at the matching position of its chain. Copy() assigns it through std::vector<float>::operator=. Public because AppTunnel's constructor copies it at 0x00442fc4 to build the thresholds it passes to ApplyMeshLodScreenSizes(), and the image has no accessor. +0x68

◆ mDrawLattice

int Rnd::Tunnel::mDrawLattice

◆ mDrawPanels

int Rnd::Tunnel::mDrawPanels

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