wavelength 1.0.0
Loading...
Searching...
No Matches
TnlFire Class Reference

The fire of a captured track, flames that burn along the track and chunks of its panels that fly off. More...

#include <tnlfire.h>

Collaboration diagram for TnlFire:

Classes

class  Emitter
 The flames of one particle system, scaled, coloured, and turned on and off by the fire. More...
class  ChunkModel
 A kind of chunk, a mesh and the animation it tumbles by, drawn as many instances. More...
class  Chunk
 A chunk flying off the track, an instance of the mesh of a model. More...

Public Types

enum  Range { kRangeMin = 0 , kRangeMax = 1 , kRangeCount }
 The ends of the ranges of sCaptureVelocity and sAutoCaptureVelocity. More...

Public Member Functions

 TnlFire (const char *pszName, int nPlayer, GfxTunnel *pTunnel, bool bChunks)
 Find the view and particle systems of a fire by name and, when asked, load the models and fill the pools of chunks.
bool Start (int nPlayer, int nTrack, int bAuto, const Color *pInnerColor, const Color *pOuterColor, const Color *pTrackColor, const std::vector< float > *pGemTicks, float flTick, float flStartTick, float flEndTick)
 Start the fire on a track, unless it burns or another fire's chunks still fly.
void Reset (bool bClearChunks)
 Stop the flames and the fire.
float StartTick (int nPlayer) const
 Report the first tick of the fire of a player.
void Update (float flTicks, float flTime)
 Move the chunks, move the head of the fire, throw the chunks of the gems it passes, and stop the fire at its end.
void Draw ()
 Draw the flying chunks in the colour of the track.

Static Public Member Functions

static void Disable (const char *pszName, RndView *pParent)
 Take the view of an unused fire out of a view and empty its particle system.

Static Public Attributes

static constexpr int kChunkPlayer = -1
 The value of mPlayer of the fire that throws chunks.
static float sCaptureSpeed
 The ticks the head moves for each tick of a capture, track_capture_speed.
static float sAutoCaptureSpeed
 The ticks the head moves for each tick of an automatic capture, track_autocapture_speed.
static float sPanelSize
 The size of a panel, the scale of the flames.
static int sMaxChunks
 The chunks of a fire, capture_max_chunks.
static float sChunkYDisplace
 The height above the cell a chunk starts at, capture_chunk_y_displace.
static int sChunksLit
 Whether the chunks are lit, capture_chunks_lit.
static std::vector< Vector3 > sChunkScales
 The scale of the basis of a chunk on each track.
static Vector2 sCaptureInterval
 The shortest and the longest ticks between chunks of a capture, capture_chunk_interval.
static Vector2 sAutoCaptureInterval
 The shortest and the longest ticks between chunks of an automatic capture, autocapture_chunk_interval.
static Vector3 sChunkForce
 The change of velocity of a chunk per tick, capture_chunk_world_force.
static Vector3 sCaptureVelocity [kRangeCount]
 The range of the velocity of a chunk of a capture, in the basis of the cell, capture_chunk_initial_velocity_min and capture_chunk_initial_velocity_max.
static Vector3 sAutoCaptureVelocity [kRangeCount]
 The range of the velocity of a chunk of an automatic capture, in the basis of the cell, autocapture_chunk_initial_velocity_min and autocapture_chunk_initial_velocity_max.
static Vector2 sChunkLifespan
 The shortest and the longest ticks a chunk flies, capture_chunk_lifespan.

Detailed Description

The fire of a captured track, flames that burn along the track and chunks of its panels that fly off.

The class is not polymorphic. RTTI identifies it and its nested Chunk and ChunkModel. The object is 0xe0 bytes. A capture starts the fire at a tick, and the head of the fire then moves along the track until the end of the capture or of the built bars. The view of the fire follows the head, and a chunk of a randomly chosen model flies off the track at the gems the head passes.

Member Enumeration Documentation

◆ Range

The ends of the ranges of sCaptureVelocity and sAutoCaptureVelocity.

Enumerator
kRangeMin 

The low end.

kRangeMax 

The high end.

kRangeCount 

The number of ends.

Constructor & Destructor Documentation

◆ TnlFire()

TnlFire::TnlFire ( const char * pszName,
int nPlayer,
GfxTunnel * pTunnel,
bool bChunks )

Find the view and particle systems of a fire by name and, when asked, load the models and fill the pools of chunks.

Parameters
pszNameThe name of the fire. The objects are <name>.view, <name>.ps, and <name>a.ps.
nPlayerThe player of the fire. Only a fire of kChunkPlayer has outer flames and throws chunks.
pTunnelThe tunnel.
bChunksWhether to load the models in capture_chunks and fill the pools.
Ghidra address:
NTSC-U/C: 0x001d4a88
Ghidra address:
PAL: 0x001dd828

Member Function Documentation

◆ Disable()

void TnlFire::Disable ( const char * pszName,
RndView * pParent )
static

Take the view of an unused fire out of a view and empty its particle system.

Parameters
pszNameThe name of the fire.
pParentThe view that draws the view of the fire.
Ghidra address:
NTSC-U/C: 0x001d5190
Ghidra address:
PAL: 0x001ddf30

◆ Start()

bool TnlFire::Start ( int nPlayer,
int nTrack,
int bAuto,
const Color * pInnerColor,
const Color * pOuterColor,
const Color * pTrackColor,
const std::vector< float > * pGemTicks,
float flTick,
float flStartTick,
float flEndTick )

Start the fire on a track, unless it burns or another fire's chunks still fly.

A capture that is not automatic also colours the flames, turns their force upright, and starts them.

Parameters
nPlayerThe player, who has to be the player of the fire.
nTrackThe track.
bAutoWhether the capture is automatic.
pInnerColorThe colour of the inner flames.
pOuterColorThe colour of the outer flames.
pTrackColorThe colour of the track.
pGemTicksThe ticks of the gems the fire burns, or null to collect them.
flTickThe tick of the capture.
flStartTickThe first tick of the fire.
flEndTickThe last tick of the fire.
Returns
Whether the fire started.
Ghidra address:
NTSC-U/C: 0x001d52d0
Ghidra address:
PAL: 0x001de070

◆ Reset()

void TnlFire::Reset ( bool bClearChunks)

Stop the flames and the fire.

Parameters
bClearChunksWhether to give every flying chunk back to the pool.
Ghidra address:
NTSC-U/C: 0x001d5520
Ghidra address:
PAL: 0x001de2c0

◆ StartTick()

float TnlFire::StartTick ( int nPlayer) const

Report the first tick of the fire of a player.

Parameters
nPlayerThe player.
Returns
The tick, or 1e9 when the fire is of another player.
Ghidra address:
NTSC-U/C: 0x001d55f0
Ghidra address:
PAL: 0x001de390

◆ Update()

void TnlFire::Update ( float flTicks,
float flTime )

Move the chunks, move the head of the fire, throw the chunks of the gems it passes, and stop the fire at its end.

Parameters
flTicksThe ticks since the last poll.
flTimeThe time since the last poll. The fire does not read it.
Ghidra address:
NTSC-U/C: 0x001d5610
Ghidra address:
PAL: 0x001de3b0

◆ Draw()

void TnlFire::Draw ( )

Draw the flying chunks in the colour of the track.

A fire with no flying chunk draws nothing.

Ghidra address:
NTSC-U/C: 0x001d5a18
Ghidra address:
PAL: 0x001de7b8

Member Data Documentation

◆ kChunkPlayer

int TnlFire::kChunkPlayer = -1
staticconstexpr

The value of mPlayer of the fire that throws chunks.

◆ sCaptureSpeed

float TnlFire::sCaptureSpeed
static

The ticks the head moves for each tick of a capture, track_capture_speed.

Ghidra address:
NTSC-U/C: 0x003afa58
Ghidra address:
PAL: 0x0042e8f0

◆ sAutoCaptureSpeed

float TnlFire::sAutoCaptureSpeed
static

The ticks the head moves for each tick of an automatic capture, track_autocapture_speed.

Ghidra address:
NTSC-U/C: 0x003afa5c
Ghidra address:
PAL: 0x0042e8f4

◆ sPanelSize

float TnlFire::sPanelSize
static

The size of a panel, the scale of the flames.

The tunnel sets it when it builds its panels.

Ghidra address:
NTSC-U/C: 0x003afa74
Ghidra address:
PAL: 0x0042e90c

◆ sMaxChunks

int TnlFire::sMaxChunks
static

The chunks of a fire, capture_max_chunks.

Ghidra address:
NTSC-U/C: 0x003afa7c
Ghidra address:
PAL: 0x0042e914

◆ sChunkYDisplace

float TnlFire::sChunkYDisplace
static

The height above the cell a chunk starts at, capture_chunk_y_displace.

Ghidra address:
NTSC-U/C: 0x003afa80
Ghidra address:
PAL: 0x0042e918

◆ sChunksLit

int TnlFire::sChunksLit
static

Whether the chunks are lit, capture_chunks_lit.

GfxTunnel::LoadConfig() writes it and the flag is never read.

Ghidra address:
NTSC-U/C: 0x003afa84
Ghidra address:
PAL: 0x0042e91c

◆ sChunkScales

std::vector<Vector3> TnlFire::sChunkScales
static

The scale of the basis of a chunk on each track.

The tunnel sets it when it builds its panels.

Ghidra address:
NTSC-U/C: 0x0043b3a8

◆ sCaptureInterval

Vector2 TnlFire::sCaptureInterval
static

The shortest and the longest ticks between chunks of a capture, capture_chunk_interval.

Ghidra address:
NTSC-U/C: 0x0043b410

◆ sAutoCaptureInterval

Vector2 TnlFire::sAutoCaptureInterval
static

The shortest and the longest ticks between chunks of an automatic capture, autocapture_chunk_interval.

Ghidra address:
NTSC-U/C: 0x0043b418

◆ sChunkForce

Vector3 TnlFire::sChunkForce
static

The change of velocity of a chunk per tick, capture_chunk_world_force.

Ghidra address:
NTSC-U/C: 0x0043b420

◆ sCaptureVelocity

Vector3 TnlFire::sCaptureVelocity[kRangeCount]
static

The range of the velocity of a chunk of a capture, in the basis of the cell, capture_chunk_initial_velocity_min and capture_chunk_initial_velocity_max.

Ghidra address:
NTSC-U/C: 0x0043b430

◆ sAutoCaptureVelocity

Vector3 TnlFire::sAutoCaptureVelocity[kRangeCount]
static

The range of the velocity of a chunk of an automatic capture, in the basis of the cell, autocapture_chunk_initial_velocity_min and autocapture_chunk_initial_velocity_max.

Ghidra address:
NTSC-U/C: 0x0043b450

◆ sChunkLifespan

Vector2 TnlFire::sChunkLifespan
static

The shortest and the longest ticks a chunk flies, capture_chunk_lifespan.

Ghidra address:
NTSC-U/C: 0x0043b470

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