A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
Field::RailInterpolator Class Referenceabstract

Description

Definition at line 13 of file RailInterpolator.hh.

Inheritance diagram for Field::RailInterpolator:

Public Types

enum class  Status {
  InProgress = 0 ,
  SegmentEnd = 1 ,
  ChangingDirection = 2
}
 

Public Member Functions

 RailInterpolator (f32 speed, u32 idx)
 
virtual void init (f32 t, u32 idx)=0
 
virtual Status calc ()=0
 
virtual void setCurrVel (f32 speed)=0
 
virtual f32 getCurrVel ()=0
 
virtual void evalCubicBezierOnPath (f32 t, EGG::Vector3f &currDir, EGG::Vector3f &curTangentDir)=0
 
virtual void getPathLocation (f32 t, s16 &idx, f32 &len)=0
 
void setPerPointVelocities (bool isSet)
 
void setT (f32 t)
 
const EGG::Vector3ffloorNrm (size_t idx) const
 
f32 railLength () const
 
const System::MapdataPointInfo::PointcurPoint () const
 
const System::MapdataPointInfo::PointnextPoint () const
 
f32 speed () const
 
const EGG::Vector3fcurPos () const
 
const EGG::Vector3fcurTangentDir () const
 
bool isMovementDirectionForward () const
 
s16 curPointIdx () const
 
s16 nextPointIdx () const
 

Protected Member Functions

void updateVel ()
 
void calcVelocities ()
 
bool shouldChangeDirection () const
 
void calcDirectionChange ()
 
void calcNextIndices ()
 

Protected Attributes

s16 m_railIdx
 
u16 m_pointCount
 
std::span< System::MapdataPointInfo::Pointm_points
 
bool m_isOscillating
 
f32 m_speed
 
bool m_usePerPointVelocities
 
EGG::Vector3f m_curPos
 
EGG::Vector3f m_curTangentDir
 
f32 m_currVel
 
f32 m_prevPointVel
 
f32 m_nextPointVel
 
f32 m_currSegmentVel
 
f32 m_segmentT
 
bool m_movementDirectionForward
 
s16 m_currPointIdx
 
s16 m_nextPointIdx
 
bool m_4a
 

Member Enumeration Documentation

◆ Status

enum class Field::RailInterpolator::Status
strong

Definition at line 15 of file RailInterpolator.hh.

Constructor & Destructor Documentation

◆ RailInterpolator()

Field::RailInterpolator::RailInterpolator ( f32 speed,
u32 idx )
0x806ED160

Definition at line 8 of file RailInterpolator.cc.

Member Function Documentation

◆ calcDirectionChange()

void Field::RailInterpolator::calcDirectionChange ( )
protected0x806F0880

Definition at line 60 of file RailInterpolator.cc.

◆ calcNextIndices()

void Field::RailInterpolator::calcNextIndices ( )
protected

Definition at line 74 of file RailInterpolator.cc.

◆ calcVelocities()

void Field::RailInterpolator::calcVelocities ( )
protected0x806ED34C

Definition at line 37 of file RailInterpolator.cc.

◆ curPoint()

const System::MapdataPointInfo::Point & Field::RailInterpolator::curPoint ( ) const
inlinenodiscard

Definition at line 45 of file RailInterpolator.hh.

◆ curPointIdx()

s16 Field::RailInterpolator::curPointIdx ( ) const
inlinenodiscard

Definition at line 71 of file RailInterpolator.hh.

◆ curPos()

const EGG::Vector3f & Field::RailInterpolator::curPos ( ) const
inlinenodiscard

Definition at line 59 of file RailInterpolator.hh.

◆ curTangentDir()

const EGG::Vector3f & Field::RailInterpolator::curTangentDir ( ) const
inlinenodiscard

Definition at line 63 of file RailInterpolator.hh.

◆ floorNrm()

const EGG::Vector3f & Field::RailInterpolator::floorNrm ( size_t idx) const
nodiscard0806ED24C

Definition at line 21 of file RailInterpolator.cc.

◆ isMovementDirectionForward()

bool Field::RailInterpolator::isMovementDirectionForward ( ) const
inlinenodiscard

Definition at line 67 of file RailInterpolator.hh.

◆ nextPoint()

const System::MapdataPointInfo::Point & Field::RailInterpolator::nextPoint ( ) const
inlinenodiscard

Definition at line 50 of file RailInterpolator.hh.

◆ nextPointIdx()

s16 Field::RailInterpolator::nextPointIdx ( ) const
inlinenodiscard

Definition at line 75 of file RailInterpolator.hh.

◆ railLength()

f32 Field::RailInterpolator::railLength ( ) const
nodiscard0x806ED30C

Definition at line 26 of file RailInterpolator.cc.

◆ setPerPointVelocities()

void Field::RailInterpolator::setPerPointVelocities ( bool isSet)
inline

Definition at line 33 of file RailInterpolator.hh.

◆ setT()

void Field::RailInterpolator::setT ( f32 t)
inline0x806C63A8

Definition at line 38 of file RailInterpolator.hh.

◆ shouldChangeDirection()

bool Field::RailInterpolator::shouldChangeDirection ( ) const
nodiscardprotected0x806F0814

Definition at line 51 of file RailInterpolator.cc.

◆ speed()

f32 Field::RailInterpolator::speed ( ) const
inlinenodiscard

Definition at line 55 of file RailInterpolator.hh.

◆ updateVel()

void Field::RailInterpolator::updateVel ( )
protected0x806ED3E4

Definition at line 31 of file RailInterpolator.cc.

Member Data Documentation

◆ m_4a

bool Field::RailInterpolator::m_4a
protected

Definition at line 102 of file RailInterpolator.hh.

◆ m_curPos

EGG::Vector3f Field::RailInterpolator::m_curPos
protected

Definition at line 92 of file RailInterpolator.hh.

◆ m_currPointIdx

s16 Field::RailInterpolator::m_currPointIdx
protected

Definition at line 100 of file RailInterpolator.hh.

◆ m_currSegmentVel

f32 Field::RailInterpolator::m_currSegmentVel
protected

Definition at line 97 of file RailInterpolator.hh.

◆ m_currVel

f32 Field::RailInterpolator::m_currVel
protected

Definition at line 94 of file RailInterpolator.hh.

◆ m_curTangentDir

EGG::Vector3f Field::RailInterpolator::m_curTangentDir
protected

Definition at line 93 of file RailInterpolator.hh.

◆ m_isOscillating

bool Field::RailInterpolator::m_isOscillating
protected

Definition at line 89 of file RailInterpolator.hh.

◆ m_movementDirectionForward

bool Field::RailInterpolator::m_movementDirectionForward
protected

Definition at line 99 of file RailInterpolator.hh.

◆ m_nextPointIdx

s16 Field::RailInterpolator::m_nextPointIdx
protected

Definition at line 101 of file RailInterpolator.hh.

◆ m_nextPointVel

f32 Field::RailInterpolator::m_nextPointVel
protected

Definition at line 96 of file RailInterpolator.hh.

◆ m_pointCount

u16 Field::RailInterpolator::m_pointCount
protected

Definition at line 87 of file RailInterpolator.hh.

◆ m_points

std::span<System::MapdataPointInfo::Point> Field::RailInterpolator::m_points
protected

Definition at line 88 of file RailInterpolator.hh.

◆ m_prevPointVel

f32 Field::RailInterpolator::m_prevPointVel
protected

Definition at line 95 of file RailInterpolator.hh.

◆ m_railIdx

s16 Field::RailInterpolator::m_railIdx
protected

Definition at line 86 of file RailInterpolator.hh.

◆ m_segmentT

f32 Field::RailInterpolator::m_segmentT
protected

Definition at line 98 of file RailInterpolator.hh.

◆ m_speed

f32 Field::RailInterpolator::m_speed
protected

Definition at line 90 of file RailInterpolator.hh.

◆ m_usePerPointVelocities

bool Field::RailInterpolator::m_usePerPointVelocities
protected

Definition at line 91 of file RailInterpolator.hh.