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

Description

Definition at line 110 of file RailInterpolator.hh.

Inheritance diagram for Field::RailSmoothInterpolator:

Public Member Functions

 RailSmoothInterpolator (f32 speed, u32 idx)
 
void init (f32 t, u32 idx) override
 
Status calc () override
 
void setCurrVel (f32 speed) override
 
f32 getCurrVel () override
 
void evalCubicBezierOnPath (f32 t, EGG::Vector3f &currDir, EGG::Vector3f &curTangentDir) override
 
void getPathLocation (f32 t, s16 &idx, f32 &len) override
 
- Public Member Functions inherited from Field::RailInterpolator
 RailInterpolator (f32 speed, u32 idx)
 
void setT (f32 t)
 
const EGG::Vector3ffloorNrm (size_t idx) const
 
f32 railLength () const
 
const System::MapdataPointInfo::PointcurPoint () const
 
const EGG::Vector3fcurPos () const
 
const EGG::Vector3fcurTangentDir () const
 
bool isMovementDirectionForward () const
 

Private Member Functions

void calcCubicBezier (f32 t, u32 currIdx, u32 nextIdx, EGG::Vector3f &pos, EGG::Vector3f &dir) const
 
EGG::Vector3f calcCubicBezierPos (f32 t, const RailSplineTransition &trans) const
 
EGG::Vector3f calcCubicBezierTangentDir (f32 t, const RailSplineTransition &trans) const
 
f32 calcT (f32 t) const
 
void calcNextSegment ()
 

Private Attributes

std::span< RailSplineTransitionm_transitions
 
u32 m_estimatorSampleCount
 
f32 m_estimatorStep
 
std::span< f32 > m_pathPercentages
 
EGG::Vector3f m_prevPos
 
f32 m_velocity
 

Additional Inherited Members

- Public Types inherited from Field::RailInterpolator
enum class  Status {
  InProgress = 0 ,
  SegmentEnd = 1 ,
  ChangingDirection = 2
}
 
- Protected Member Functions inherited from Field::RailInterpolator
void updateVel ()
 
void calcVelocities ()
 
bool shouldChangeDirection () const
 
void calcDirectionChange ()
 
void calcNextIndices ()
 
- Protected Attributes inherited from Field::RailInterpolator
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
 

Constructor & Destructor Documentation

◆ RailSmoothInterpolator()

Field::RailSmoothInterpolator::RailSmoothInterpolator ( f32 speed,
u32 idx )
0x806EE830

Definition at line 244 of file RailInterpolator.cc.

Member Function Documentation

◆ calc()

RailInterpolator::Status Field::RailSmoothInterpolator::calc ( )
overridevirtual0x806EEBEC

Implements Field::RailInterpolator.

Definition at line 286 of file RailInterpolator.cc.

◆ calcCubicBezier()

void Field::RailSmoothInterpolator::calcCubicBezier ( f32 t,
u32 currIdx,
u32 nextIdx,
EGG::Vector3f & pos,
EGG::Vector3f & dir ) const
private0x806EF224

Definition at line 393 of file RailInterpolator.cc.

◆ calcCubicBezierPos()

EGG::Vector3f Field::RailSmoothInterpolator::calcCubicBezierPos ( f32 t,
const RailSplineTransition & trans ) const
nodiscardprivate0x806EF350

Definition at line 402 of file RailInterpolator.cc.

◆ calcCubicBezierTangentDir()

EGG::Vector3f Field::RailSmoothInterpolator::calcCubicBezierTangentDir ( f32 t,
const RailSplineTransition & trans ) const
nodiscardprivate0x806EF454

Definition at line 415 of file RailInterpolator.cc.

◆ calcNextSegment()

void Field::RailSmoothInterpolator::calcNextSegment ( )
private0x806EF664

Definition at line 460 of file RailInterpolator.cc.

◆ calcT()

f32 Field::RailSmoothInterpolator::calcT ( f32 t) const
nodiscardprivate0x806EF0F8

Definition at line 432 of file RailInterpolator.cc.

◆ evalCubicBezierOnPath()

void Field::RailSmoothInterpolator::evalCubicBezierOnPath ( f32 t,
EGG::Vector3f & currDir,
EGG::Vector3f & curTangentDir )
overridevirtual0x806EEEBC

Implements Field::RailInterpolator.

Definition at line 342 of file RailInterpolator.cc.

◆ getCurrVel()

f32 Field::RailSmoothInterpolator::getCurrVel ( )
inlinenodiscardoverridevirtual0x806EF93C

Implements Field::RailInterpolator.

Definition at line 120 of file RailInterpolator.hh.

◆ getPathLocation()

void Field::RailSmoothInterpolator::getPathLocation ( f32 t,
s16 & idx,
f32 & len )
overridevirtual0x806EEFA0

Implements Field::RailInterpolator.

Definition at line 360 of file RailInterpolator.cc.

◆ init()

void Field::RailSmoothInterpolator::init ( f32 t,
u32 idx )
overridevirtual0x806EE924

Implements Field::RailInterpolator.

Definition at line 258 of file RailInterpolator.cc.

◆ setCurrVel()

void Field::RailSmoothInterpolator::setCurrVel ( f32 speed)
overridevirtual0x806EEB94

Implements Field::RailInterpolator.

Definition at line 331 of file RailInterpolator.cc.

Member Data Documentation

◆ m_estimatorSampleCount

u32 Field::RailSmoothInterpolator::m_estimatorSampleCount
private

Definition at line 138 of file RailInterpolator.hh.

◆ m_estimatorStep

f32 Field::RailSmoothInterpolator::m_estimatorStep
private

Definition at line 139 of file RailInterpolator.hh.

◆ m_pathPercentages

std::span<f32> Field::RailSmoothInterpolator::m_pathPercentages
private

Definition at line 140 of file RailInterpolator.hh.

◆ m_prevPos

EGG::Vector3f Field::RailSmoothInterpolator::m_prevPos
private

Definition at line 141 of file RailInterpolator.hh.

◆ m_transitions

std::span<RailSplineTransition> Field::RailSmoothInterpolator::m_transitions
private

Definition at line 137 of file RailInterpolator.hh.

◆ m_velocity

f32 Field::RailSmoothInterpolator::m_velocity
private

Definition at line 142 of file RailInterpolator.hh.