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

The freestyle of a player, in which the ship turns into the freestylus and the stick moves it about the track. More...

#include <tnlfreestyle.h>

Collaboration diagram for TnlFreestyle:

Public Member Functions

 TnlFreestyle (int nPlayer, int nType, Ship *pShip, TnlActivator *pActivator, GfxTunnel *pTunnel)
 Create the trail, the curves, and the shared freestylus of the first freestyle.
 ~TnlFreestyle ()
 Delete the shared freestylus, the trail, and the curves.
void LoadConfig (DataArray *pConfig, DataArray *pDefaults, GfxTunnel *pTunnel, int nOption, int bFreestyle)
 Load the settings of the trail, of the freestyle of the kind, and of the lanes.
void Reset ()
 End the freestyle at once, keeping an assembled freestylus.
void SetActive (bool bActive, int bVictory, bool bQuick)
 Assemble the freestylus, or take it apart.
void SetPlaying (bool bPlaying, int nColumn)
 Record whether the player plays, which grows the beams and draws the trail.
void Sample ()
 Start a sample on the freestylus and on the trail.
void SetStick (const Vector3 &stick)
 Set the position of the stick.
void Scratch (float flTick, float flDuration)
 Sweep the needle of a scratch freestyle for a note.
void Poll (float flTicks, float flTime)
 Advance the assembly, the curves, and the freestylus, and place the ship and the camera.
void UpdateTrail ()
 Draw the needle of a scratch freestyle at the ship.
void Draw ()
 Draw the freestylus, and the trail of a scratch freestyle.
void ComputeXfms (bool bCam, RndTransAnim *pAnim, const Vector3 *pStick, float(*pShipXfm)[kTransformRowFloatCount], Transform *pCamXfm, float flTime, float flTicks, float flElapsed)
 Work out the transforms of the ship and of the camera from the stick.
void BeginPass ()
 Hand the ship and the camera to the freestyle.
void EndPass ()
 Give the ship and the camera back.
void OnAssembled ()
 Handle the end of the assembly.
void OnDisassemble ()
 Handle the start of the disassembly.
int GetTrack ()
 Report the track the ship of the freestyle is over.
void GetPassFlags (int *pbCam, int *pbShip, int *pbShowShip)
 Report what the freestyle takes over.

Static Public Attributes

static float sEnterDelay
 The delay of the assembly in ticks, enter_delay.
static float sExitDelay
 The delay of the disassembly in ticks, exit_delay.
static float sMaxChangePerMs
 The greatest speed of the position, max_change_per_ms.
static float sCamMaxChangePerMs
 The greatest speed of the camera, cam_max_change_per_ms.
static float sLaneScale
 The scale of a stick towards the lanes ahead, 1 for several players on this console and 2 otherwise.
static float sInvLaneScale
 The reciprocal of sLaneScale.
static std::unique_ptr< Freestylus > sFreestylus
 The freestylus the freestyles share, or null.
static Vector2 sRange
 The reach of the stick across and along the track, range.
static Vector2 sInvRange
 The reciprocals of sRange.
static Vector3 sCenter
 The place of the freestyle, center.
static Vector3 sConstrainedCenter
 The place of a constrained freestyle, constrained_center.
static Vector3 sCamOffset
 The offset of the camera, cam_offset.
static Vector3 sCamLookOffset
 The offset the camera looks at, cam_look_offset.
static Vector3 sCamWinOffset
 The offset of the camera of a victory, cam_win_offset.
static Vector3 sCamWinLookOffset
 The offset the camera of a victory looks at, cam_win_look_offset.
static Vector2 sCamRange
 The reach of the camera, cam_range.
static Vector2 sConstrainedCamRange
 The reach of the camera of a constrained freestyle, constrained_cam_range.
static Vector3 sChangeFunc
 The curve of the position, change_func.
static Vector3 sTumbleChangeFunc
 The curve of the tumble, tumble_change_func.
static Vector3 sCamChangeFunc
 The curve of the camera, cam_change_func.
static Vector3 sConstraintChangeFunc
 The curve of the constraint, constraint_change_func.

Detailed Description

The freestyle of a player, in which the ship turns into the freestylus and the stick moves it about the track.

The class is not polymorphic, and the name is inferred. The object is 0xfc bytes. The ship assembles into the freestylus over the enter delay, and the camera of the player slides to follow it. The position, the tumble, and the camera follow the stick through quadratic approaches whose curves come from the freestyle configuration.

Constructor & Destructor Documentation

◆ TnlFreestyle()

TnlFreestyle::TnlFreestyle ( int nPlayer,
int nType,
Ship * pShip,
TnlActivator * pActivator,
GfxTunnel * pTunnel )

Create the trail, the curves, and the shared freestylus of the first freestyle.

Parameters
nPlayerThe player.
nTypeThe kind of freestyle, one of Freestylus::Type.
pShipThe ship of the player.
pActivatorThe activator of the player.
pTunnelThe tunnel.
Ghidra address:
NTSC-U/C: 0x001e8928
Ghidra address:
PAL: 0x001f16c8

◆ ~TnlFreestyle()

TnlFreestyle::~TnlFreestyle ( )

Delete the shared freestylus, the trail, and the curves.

Ghidra address:
NTSC-U/C: 0x001e8b38
Ghidra address:
PAL: 0x001f18d8

Member Function Documentation

◆ LoadConfig()

void TnlFreestyle::LoadConfig ( DataArray * pConfig,
DataArray * pDefaults,
GfxTunnel * pTunnel,
int nOption,
int bFreestyle )

Load the settings of the trail, of the freestyle of the kind, and of the lanes.

Parameters
pConfigThe configuration.
pDefaultsThe defaults of the configuration.
pTunnelThe tunnel, which the freestyle does not read.
nOptionThe fourth argument every loader of a player's tunnel graphics receives. A non-zero value leaves the scale of the freestylus.
bFreestyleWhether the freestyle settings load.
Ghidra address:
NTSC-U/C: 0x001e83c8
Ghidra address:
PAL: 0x001f1168

◆ Reset()

void TnlFreestyle::Reset ( )

End the freestyle at once, keeping an assembled freestylus.

Ghidra address:
NTSC-U/C: 0x001e8c40
Ghidra address:
PAL: 0x001f19e0

◆ SetActive()

void TnlFreestyle::SetActive ( bool bActive,
int bVictory,
bool bQuick )

Assemble the freestylus, or take it apart.

Parameters
bActiveWhether the freestyle starts.
bVictoryWhether the freestyle rewards a won song.
bQuickWhether the change takes 4 ticks instead of the configured delay.
Ghidra address:
NTSC-U/C: 0x001e8cd0
Ghidra address:
PAL: 0x001f1a70

◆ SetPlaying()

void TnlFreestyle::SetPlaying ( bool bPlaying,
int nColumn )

Record whether the player plays, which grows the beams and draws the trail.

Parameters
bPlayingWhether the player plays.
nColumnThe column of the freestyle. The routine does not read it.
Ghidra address:
NTSC-U/C: 0x001e8f98
Ghidra address:
PAL: 0x001f1d38

◆ Sample()

void TnlFreestyle::Sample ( )

Start a sample on the freestylus and on the trail.

Ghidra address:
NTSC-U/C: 0x001e9038
Ghidra address:
PAL: 0x001f1dd8

◆ SetStick()

void TnlFreestyle::SetStick ( const Vector3 & stick)

Set the position of the stick.

Parameters
stickThe position.
Ghidra address:
NTSC-U/C: 0x001e9098
Ghidra address:
PAL: 0x001f1e38

◆ Scratch()

void TnlFreestyle::Scratch ( float flTick,
float flDuration )

Sweep the needle of a scratch freestyle for a note.

Parameters
flTickThe tick of the note.
flDurationThe length of the note in ticks.
Ghidra address:
NTSC-U/C: 0x001e90a8
Ghidra address:
PAL: 0x001f1e48

◆ Poll()

void TnlFreestyle::Poll ( float flTicks,
float flTime )

Advance the assembly, the curves, and the freestylus, and place the ship and the camera.

Parameters
flTicksThe ticks since the last poll.
flTimeThe time since the last poll.
Ghidra address:
NTSC-U/C: 0x001e90d8
Ghidra address:
PAL: 0x001f1e78

◆ UpdateTrail()

void TnlFreestyle::UpdateTrail ( )

Draw the needle of a scratch freestyle at the ship.

Ghidra address:
NTSC-U/C: 0x001e9450
Ghidra address:
PAL: 0x001f21f0

◆ Draw()

void TnlFreestyle::Draw ( )

Draw the freestylus, and the trail of a scratch freestyle.

Ghidra address:
NTSC-U/C: 0x001e94f8
Ghidra address:
PAL: 0x001f2298

◆ ComputeXfms()

void TnlFreestyle::ComputeXfms ( bool bCam,
RndTransAnim * pAnim,
const Vector3 * pStick,
float(*) pShipXfm[kTransformRowFloatCount],
Transform * pCamXfm,
float flTime,
float flTicks,
float flElapsed )

Work out the transforms of the ship and of the camera from the stick.

Parameters
bCamWhether the camera follows the freestyle.
pAnimThe animation the ship plays, or null.
pStickThe position of the stick.
pShipXfmReceives the rows of the transform of the ship.
pCamXfmReceives the transform of the camera.
flTimeThe time since the last poll.
flTicksThe ticks since the last poll, which the routine does not read.
flElapsedThe ticks since the freestyle started.
Ghidra address:
NTSC-U/C: 0x001e9570
Ghidra address:
PAL: 0x001f2310

◆ BeginPass()

void TnlFreestyle::BeginPass ( )

Hand the ship and the camera to the freestyle.

Ghidra address:
NTSC-U/C: 0x001e9b20
Ghidra address:
PAL: 0x001f28c0

◆ EndPass()

void TnlFreestyle::EndPass ( )

Give the ship and the camera back.

Ghidra address:
NTSC-U/C: 0x001e9bb0
Ghidra address:
PAL: 0x001f2950

◆ OnAssembled()

void TnlFreestyle::OnAssembled ( )

Handle the end of the assembly.

The body is empty.

Ghidra address:
NTSC-U/C: 0x001e9c48
Ghidra address:
PAL: 0x001f29e8

◆ OnDisassemble()

void TnlFreestyle::OnDisassemble ( )

Handle the start of the disassembly.

The body is empty.

Ghidra address:
NTSC-U/C: 0x001e9c50
Ghidra address:
PAL: 0x001f29f0

◆ GetTrack()

int TnlFreestyle::GetTrack ( )

Report the track the ship of the freestyle is over.

Returns
The last track whose left edge is at or left of the ship, or 0.
Ghidra address:
NTSC-U/C: 0x001e9c58
Ghidra address:
PAL: 0x001f29f8

◆ GetPassFlags()

void TnlFreestyle::GetPassFlags ( int * pbCam,
int * pbShip,
int * pbShowShip )

Report what the freestyle takes over.

Parameters
pbCamReceives whether the camera follows the freestyle.
pbShipReceives whether the freestyle places the ship.
pbShowShipReceives whether the ship stays shown.
Ghidra address:
NTSC-U/C: 0x001e9cb0
Ghidra address:
PAL: 0x001f2a50

Member Data Documentation

◆ sEnterDelay

float TnlFreestyle::sEnterDelay
static

The delay of the assembly in ticks, enter_delay.

Ghidra address:
NTSC-U/C: 0x003afaa0
Ghidra address:
PAL: 0x0042e938

◆ sExitDelay

float TnlFreestyle::sExitDelay
static

The delay of the disassembly in ticks, exit_delay.

Ghidra address:
NTSC-U/C: 0x003afaa4
Ghidra address:
PAL: 0x0042e93c

◆ sMaxChangePerMs

float TnlFreestyle::sMaxChangePerMs
static

The greatest speed of the position, max_change_per_ms.

Ghidra address:
NTSC-U/C: 0x003afaa8
Ghidra address:
PAL: 0x0042e940

◆ sCamMaxChangePerMs

float TnlFreestyle::sCamMaxChangePerMs
static

The greatest speed of the camera, cam_max_change_per_ms.

Ghidra address:
NTSC-U/C: 0x003afaac
Ghidra address:
PAL: 0x0042e944

◆ sLaneScale

float TnlFreestyle::sLaneScale
static

The scale of a stick towards the lanes ahead, 1 for several players on this console and 2 otherwise.

Ghidra address:
NTSC-U/C: 0x003afab4
Ghidra address:
PAL: 0x0042e94c

◆ sInvLaneScale

float TnlFreestyle::sInvLaneScale
static

The reciprocal of sLaneScale.

Ghidra address:
NTSC-U/C: 0x003afab8
Ghidra address:
PAL: 0x0042e950

◆ sFreestylus

std::unique_ptr<Freestylus> TnlFreestyle::sFreestylus
static

The freestylus the freestyles share, or null.

Ghidra address:
NTSC-U/C: 0x003afac4
Ghidra address:
PAL: 0x0042e95c

◆ sRange

Vector2 TnlFreestyle::sRange
static

The reach of the stick across and along the track, range.

Ghidra address:
NTSC-U/C: 0x0043b4b0

◆ sInvRange

Vector2 TnlFreestyle::sInvRange
static

The reciprocals of sRange.

Ghidra address:
NTSC-U/C: 0x0043b4b8

◆ sCenter

Vector3 TnlFreestyle::sCenter
static

The place of the freestyle, center.

Ghidra address:
NTSC-U/C: 0x0043b4c0

◆ sConstrainedCenter

Vector3 TnlFreestyle::sConstrainedCenter
static

The place of a constrained freestyle, constrained_center.

Ghidra address:
NTSC-U/C: 0x0043b4d0

◆ sCamOffset

Vector3 TnlFreestyle::sCamOffset
static

The offset of the camera, cam_offset.

Ghidra address:
NTSC-U/C: 0x0043b4e0

◆ sCamLookOffset

Vector3 TnlFreestyle::sCamLookOffset
static

The offset the camera looks at, cam_look_offset.

Ghidra address:
NTSC-U/C: 0x0043b4f0

◆ sCamWinOffset

Vector3 TnlFreestyle::sCamWinOffset
static

The offset of the camera of a victory, cam_win_offset.

Ghidra address:
NTSC-U/C: 0x0043b500

◆ sCamWinLookOffset

Vector3 TnlFreestyle::sCamWinLookOffset
static

The offset the camera of a victory looks at, cam_win_look_offset.

Ghidra address:
NTSC-U/C: 0x0043b510

◆ sCamRange

Vector2 TnlFreestyle::sCamRange
static

The reach of the camera, cam_range.

Ghidra address:
NTSC-U/C: 0x0043b520

◆ sConstrainedCamRange

Vector2 TnlFreestyle::sConstrainedCamRange
static

The reach of the camera of a constrained freestyle, constrained_cam_range.

Ghidra address:
NTSC-U/C: 0x0043b528

◆ sChangeFunc

Vector3 TnlFreestyle::sChangeFunc
static

The curve of the position, change_func.

Ghidra address:
NTSC-U/C: 0x0043b530

◆ sTumbleChangeFunc

Vector3 TnlFreestyle::sTumbleChangeFunc
static

The curve of the tumble, tumble_change_func.

Ghidra address:
NTSC-U/C: 0x0043b540

◆ sCamChangeFunc

Vector3 TnlFreestyle::sCamChangeFunc
static

The curve of the camera, cam_change_func.

Ghidra address:
NTSC-U/C: 0x0043b550

◆ sConstraintChangeFunc

Vector3 TnlFreestyle::sConstraintChangeFunc
static

The curve of the constraint, constraint_change_func.

Ghidra address:
NTSC-U/C: 0x0043b560

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