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

The trail of the scratch freestyle, the ribbon a scratching ship draws as its needle sweeps across the track. More...

#include <tnlsabretrail.h>

Collaboration diagram for TnlSabreTrail:

Public Types

enum  State { kStateHidden = 0 , kStateDrawing = 1 , kStateShown = 2 }
 The values of mState. More...

Public Member Functions

 TnlSabreTrail (int nPlayer, Ship *pShip)
 Take the scratch ribbon of a ship and the colours of its points.
 ~TnlSabreTrail ()
 Destroy the trail.
void LoadConfig (DataArray *pConfig, DataArray *pDefaults)
 Load the settings of the ribbon and of the sweeps of the needle, and make the ribbon blank.
void AddSegment (const Vector3 *pPos)
 Start the next segment of the ribbon, wrapping back to the first one past the last.
void Start ()
 Start drawing segments.
void Stop (bool bForce)
 Stop drawing segments, or wait for the sample in progress to end.
void Clear ()
 Move every point of the ribbon to the origin.
void SetShowing (bool bShowing)
 Show or hide the ribbon.
void Scratch (float flTick, float flDuration)
 Sweep the needle to the other side for a note of a scratch, unless a sample sweeps it.
void StartSample ()
 Start a sample, sweeps of the needle to random places for sSampleDuration ticks.
float UpdateSample ()
 Advance the sample, starting the next sweep when one ends.
void Update (float flBlend, const Transform &xfm, const Vector3 *pAxis)
 Place the needle at the ship and draw the segment the needle is in.
RndLine * GetRibbon () const

Static Public Member Functions

static float SweepTarget (float flFrom, float flSweep)
 Report the place a sweep ends at, the other side from the place it starts at.
static float Wobble (float flFrom, float flSweep)
 Report the place a random sweep of a sample ends at, on the other side from where it starts.

Static Public Attributes

static constexpr int kFirstSegmentPoint = 2
 The first point of the segments, after the two points of the needle.
static constexpr int kNoHead = -4
 The value of mHead while no segment is drawn.
static float sSampleFrequency
 The angle per tick of the envelope of a sample, sample_envelope_frequency.
static float sSampleDuration
 The ticks of a sample, sample_duration.
static Vector2 sSampleSweepTicks
 The shortest and the longest ticks of a sweep of a sample, sample_sweep_duration.

Detailed Description

The trail of the scratch freestyle, the ribbon a scratching ship draws as its needle sweeps across the track.

The class is not polymorphic, and the name is inferred. The object is 0xb0 bytes. The ribbon is the scratch ribbon of the ship, and its points come in pairs that the needle fills one segment at a time.

Member Enumeration Documentation

◆ State

The values of mState.

Enumerator
kStateHidden 

The ribbon is hidden.

kStateDrawing 

The needle draws new segments.

kStateShown 

The ribbon shows the segments it has.

Constructor & Destructor Documentation

◆ TnlSabreTrail()

TnlSabreTrail::TnlSabreTrail ( int nPlayer,
Ship * pShip )

Take the scratch ribbon of a ship and the colours of its points.

Parameters
nPlayerThe player, whose colour the trail takes.
pShipThe ship.
Ghidra address:
NTSC-U/C: 0x001e6998
Ghidra address:
PAL: 0x001ef738

◆ ~TnlSabreTrail()

TnlSabreTrail::~TnlSabreTrail ( )

Destroy the trail.

Ghidra address:
NTSC-U/C: 0x001e6b90
Ghidra address:
PAL: 0x001ef930

Member Function Documentation

◆ LoadConfig()

void TnlSabreTrail::LoadConfig ( DataArray * pConfig,
DataArray * pDefaults )

Load the settings of the ribbon and of the sweeps of the needle, and make the ribbon blank.

Parameters
pConfigThe configuration.
pDefaultsThe defaults of the configuration.
Ghidra address:
NTSC-U/C: 0x001e6bc0
Ghidra address:
PAL: 0x001ef960

◆ AddSegment()

void TnlSabreTrail::AddSegment ( const Vector3 * pPos)

Start the next segment of the ribbon, wrapping back to the first one past the last.

Parameters
pPosThe position the new segment starts at, or null for the end of the last segment.
Ghidra address:
NTSC-U/C: 0x001e6db0
Ghidra address:
PAL: 0x001efb50

◆ Start()

void TnlSabreTrail::Start ( )

Start drawing segments.

Ghidra address:
NTSC-U/C: 0x001e6e90
Ghidra address:
PAL: 0x001efc30

◆ Stop()

void TnlSabreTrail::Stop ( bool bForce)

Stop drawing segments, or wait for the sample in progress to end.

Parameters
bForceWhether to stop during a sample.
Ghidra address:
NTSC-U/C: 0x001e6ee0
Ghidra address:
PAL: 0x001efc80

◆ Clear()

void TnlSabreTrail::Clear ( )

Move every point of the ribbon to the origin.

Ghidra address:
NTSC-U/C: 0x001e6f60
Ghidra address:
PAL: 0x001efd00

◆ SetShowing()

void TnlSabreTrail::SetShowing ( bool bShowing)

Show or hide the ribbon.

Parameters
bShowingWhether the ribbon is shown.
Ghidra address:
NTSC-U/C: 0x001e6fc8
Ghidra address:
PAL: 0x001efd68

◆ Scratch()

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

Sweep the needle to the other side for a note of a scratch, unless a sample sweeps it.

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

◆ StartSample()

void TnlSabreTrail::StartSample ( )

Start a sample, sweeps of the needle to random places for sSampleDuration ticks.

Ghidra address:
NTSC-U/C: 0x001e7100
Ghidra address:
PAL: 0x001efea0

◆ UpdateSample()

float TnlSabreTrail::UpdateSample ( )

Advance the sample, starting the next sweep when one ends.

Returns
The place of the needle across the track.
Ghidra address:
NTSC-U/C: 0x001e71f0
Ghidra address:
PAL: 0x001eff90

◆ Update()

void TnlSabreTrail::Update ( float flBlend,
const Transform & xfm,
const Vector3 * pAxis )

Place the needle at the ship and draw the segment the needle is in.

Parameters
flBlendThe colour across the stick, from -1 to 1.
xfmThe world transform of the ship.
pAxisThe first axis of the path, which the trail does not read.
Ghidra address:
NTSC-U/C: 0x001e72e8
Ghidra address:
PAL: 0x001f0088

◆ SweepTarget()

float TnlSabreTrail::SweepTarget ( float flFrom,
float flSweep )
static

Report the place a sweep ends at, the other side from the place it starts at.

Parameters
flFromThe place the sweep starts at.
flSweepThe width of a sweep.
Returns
The place.
Ghidra address:
NTSC-U/C: 0x001e68e0
Ghidra address:
PAL: 0x001ef680

◆ Wobble()

float TnlSabreTrail::Wobble ( float flFrom,
float flSweep )
static

Report the place a random sweep of a sample ends at, on the other side from where it starts.

Parameters
flFromThe place the sweep starts at.
flSweepThe width of a sweep.
Returns
The place.
Ghidra address:
NTSC-U/C: 0x001e6900
Ghidra address:
PAL: 0x001ef6a0

◆ GetRibbon()

RndLine * TnlSabreTrail::GetRibbon ( ) const
inline
Returns
The scratch ribbon of the ship.

Member Data Documentation

◆ kFirstSegmentPoint

int TnlSabreTrail::kFirstSegmentPoint = 2
staticconstexpr

The first point of the segments, after the two points of the needle.

◆ kNoHead

int TnlSabreTrail::kNoHead = -4
staticconstexpr

The value of mHead while no segment is drawn.

◆ sSampleFrequency

float TnlSabreTrail::sSampleFrequency
static

The angle per tick of the envelope of a sample, sample_envelope_frequency.

Ghidra address:
NTSC-U/C: 0x003afabc
Ghidra address:
PAL: 0x0042e954

◆ sSampleDuration

float TnlSabreTrail::sSampleDuration
static

The ticks of a sample, sample_duration.

Ghidra address:
NTSC-U/C: 0x003afac0
Ghidra address:
PAL: 0x0042e958

◆ sSampleSweepTicks

Vector2 TnlSabreTrail::sSampleSweepTicks
static

The shortest and the longest ticks of a sweep of a sample, sample_sweep_duration.

Ghidra address:
NTSC-U/C: 0x0043b570

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