resonance 1.0.1
Loading...
Searching...
No Matches
TnlSnake Class Reference

Glowing ribbon with a head mesh that snakes along one lane of the tunnel. More...

#include <tnlsnake.h>

Public Member Functions

 TnlSnake ()
 Build the ribbon and the head.
 ~TnlSnake ()
 Take the ribbon out of "tnl transparent" and delete the ribbon and the head.
void Start (float flFrame, int nRing, const Color &color, float flPhase, float flAmplitude)
 Show the ribbon on a lane for 11520 song frames from flFrame.
void Update (float flFrame)
 Move the ribbon to the song frame.

Friends

class AppTunnel

Detailed Description

Glowing ribbon with a head mesh that snakes along one lane of the tunnel.

The class is not polymorphic and emits no RTTI, and no allocation tag or file path identifies it. The name is inferred from the objects it uses, "snake.mat" and "snake head.mesh".

The ribbon is a private Rnd::String of 16 points in "tnl transparent", and the head is a private copy of "snake head.mesh" drawn by the ribbon. Point i trails the head by 100 * i song frames, and each point sits on the lane at its frame, swinging on a sine of the frame. Random pulses of glow run down the ribbon and fade by 0.15 per update.

AppTunnel allocates three, 0x50 bytes each, and stores them in its vector at +0x54.

Constructor & Destructor Documentation

◆ TnlSnake()

TnlSnake::TnlSnake ( )

Build the ribbon and the head.

The ribbon and the head are named with NextAppTunnelName(). The ribbon draws with "snake.mat" at width 0.2 and starts hidden.

Ghidra address:
NTSC-U/C: 0x0043e6a0
Ghidra address:
PAL: 0x0047af90

◆ ~TnlSnake()

TnlSnake::~TnlSnake ( )

Take the ribbon out of "tnl transparent" and delete the ribbon and the head.

Ghidra address:
NTSC-U/C: 0x0043ed50
Ghidra address:
PAL: 0x0047b6d8

Member Function Documentation

◆ Start()

void TnlSnake::Start ( float flFrame,
int nRing,
const Color & color,
float flPhase,
float flAmplitude )

Show the ribbon on a lane for 11520 song frames from flFrame.

AppTunnel inlines this, and the out-of-line copy has no caller.

Parameters
flFrameThe start frame.
nRingThe lane.
colorThe ribbon colour.
flPhaseThe phase of the swing, in radians.
flAmplitudeThe amplitude of the swing.
Ghidra address:
NTSC-U/C: 0x00456960
Ghidra address:
PAL: 0x00493e90

◆ Update()

void TnlSnake::Update ( float flFrame)

Move the ribbon to the song frame.

Returns at once while idle or when flFrame repeats the previous call. The head runs at four times the song speed from the start frame, and the ribbon hides once the head passes the end frame. Each point is placed at its frame, coloured with its glow added to mColor, and its glow decays. The head mesh moves to the first point. With probability 0.2 a new pulse lands on four neighbouring points.

Parameters
flFrameThe song frame.
Ghidra address:
NTSC-U/C: 0x0043eec0
Ghidra address:
PAL: 0x0047b848

◆ AppTunnel

friend class AppTunnel
friend

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