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

#include <KartSuspensionPhysics.hh>

Description

Physics for a single wheel's suspension.

Definition at line 109 of file KartSuspensionPhysics.hh.

Inheritance diagram for Kart::KartSuspensionPhysics:

Public Types

enum class  TireType {
  Kart ,
  KartReflected ,
  Bike
}
 Every other kart tire is a mirror of the first. Bikes do not leverage this. More...
 

Public Member Functions

 KartSuspensionPhysics (u16 wheelIdx, TireType TireType, u16 bspWheelIdx)
 
void init ()
 
void reset ()
 
void setInitialState ()
 
void calcCollision (f32 dt, const EGG::Vector3f &gravity, const EGG::Matrix34f &mat)
 
void calcSuspension (const EGG::Vector3f &forward, const EGG::Vector3f &vehicleMovement)
 Calculates linear force and rotation from the kart's suspension.
 

Private Attributes

const BSP::Wheelm_bspWheel
 
WheelPhysicsm_tirePhysics
 
TireType m_tireType
 
u16 m_bspWheelIdx
 
u16 m_wheelIdx
 
EGG::Vector3f m_topmostPos
 
f32 m_maxTravelScaled
 
EGG::Vector3f m_bottomDir
 

Additional Inherited Members

- Private Member Functions inherited from Kart::KartObjectProxy
void setPos (const EGG::Vector3f &pos)
 
void setRot (const EGG::Quatf &q)
 
void setInertiaScale (const EGG::Vector3f &scale)
 
KartActionaction ()
 
const KartActionaction () const
 
KartBodybody ()
 
const KartBodybody () const
 
KartCollidecollide ()
 
const KartCollidecollide () const
 
CollisionGroupcollisionGroup ()
 
const CollisionGroupcollisionGroup () const
 
KartMovemove ()
 
const KartMovemove () const
 
KartHalfPipehalfPipe ()
 
const KartHalfPipehalfPipe () const
 
KartJumpjump ()
 
const KartJumpjump () const
 
KartParamparam ()
 
const KartParamparam () const
 
const BSPbsp () const
 
KartPhysicsphysics ()
 
const KartPhysicsphysics () const
 
KartDynamicsdynamics ()
 
const KartDynamicsdynamics () const
 
KartStatestate ()
 
const KartStatestate () const
 
KartSubsub ()
 
const KartSubsub () const
 
KartSuspensionsuspension (u16 suspIdx)
 
const KartSuspensionsuspension (u16 suspIdx) const
 
KartSuspensionPhysicssuspensionPhysics (u16 suspIdx)
 
const KartSuspensionPhysicssuspensionPhysics (u16 suspIdx) const
 
KartTiretire (u16 tireIdx)
 
const KartTiretire (u16 tireIdx) const
 
WheelPhysicstirePhysics (u16 tireIdx)
 
const WheelPhysicstirePhysics (u16 tireIdx) const
 
CollisionDatacollisionData ()
 
const CollisionDatacollisionData () const
 
CollisionDatacollisionData (u16 tireIdx)
 
const CollisionDatacollisionData (u16 tireIdx) const
 
const System::KPadinputs () const
 
Render::KartModelmodel ()
 
const Render::KartModelmodel () const
 
Field::ObjectCollisionKartobjectCollisionKart ()
 
const Field::ObjectCollisionKartobjectCollisionKart () const
 
Field::BoxColUnitboxColUnit ()
 
const Field::BoxColUnitboxColUnit () const
 
const EGG::Vector3fscale () const
 
const EGG::Matrix34fpose () const
 
EGG::Vector3f bodyFront () const
 Returns the third column of the rotation matrix, which is the facing vector.
 
EGG::Vector3f bodyForward () const
 Returns the first column of the rotation matrix, which is the "right" direction.
 
EGG::Vector3f bodyUp () const
 Returns the second column of the rotation matrix, which is the "up" direction.
 
const EGG::Vector3fcomponentXAxis () const
 
const EGG::Vector3fcomponentYAxis () const
 
const EGG::Vector3fcomponentZAxis () const
 
const EGG::Vector3fpos () const
 
const EGG::Vector3fprevPos () const
 
const EGG::QuatffullRot () const
 
const EGG::Vector3fextVel () const
 
const EGG::Vector3fintVel () const
 
const EGG::Vector3fvelocity () const
 
f32 speed () const
 
f32 acceleration () const
 
f32 softSpeedLimit () const
 
const EGG::QuatfmainRot () const
 
const EGG::Vector3fangVel2 () const
 
bool isBike () const
 
u16 suspCount () const
 
u16 tireCount () const
 
bool hasFloorCollision (const WheelPhysics *wheelPhysics) const
 
std::pair< EGG::Vector3f, EGG::Vector3fgetCannonPosRot ()
 
f32 speedRatio () const
 
f32 speedRatioCapped () const
 
bool isInRespawn () const
 
void apply (size_t idx)
 
- Static Private Member Functions inherited from Kart::KartObjectProxy
static std::list< KartObjectProxy * > & proxyList ()
 

Member Enumeration Documentation

◆ TireType

Every other kart tire is a mirror of the first. Bikes do not leverage this.

Definition at line 112 of file KartSuspensionPhysics.hh.

Constructor & Destructor Documentation

◆ KartSuspensionPhysics()

Kart::KartSuspensionPhysics::KartSuspensionPhysics ( u16 wheelIdx,
TireType TireType,
u16 bspWheelIdx )
0x80599ED4

Definition at line 119 of file KartSuspensionPhysics.cc.

Member Function Documentation

◆ calcCollision()

void Kart::KartSuspensionPhysics::calcCollision ( f32 dt,
const EGG::Vector3f & gravity,
const EGG::Matrix34f & mat )
0x8059A278

Definition at line 160 of file KartSuspensionPhysics.cc.

◆ calcSuspension()

void Kart::KartSuspensionPhysics::calcSuspension ( const EGG::Vector3f & forward,
const EGG::Vector3f & vehicleMovement )
0x8059A574

Calculates linear force and rotation from the kart's suspension.

Stage: All

Definition at line 190 of file KartSuspensionPhysics.cc.

◆ init()

void Kart::KartSuspensionPhysics::init ( )
0x80599FA0

Definition at line 127 of file KartSuspensionPhysics.cc.

◆ reset()

void Kart::KartSuspensionPhysics::reset ( )
0x80599F54

Definition at line 133 of file KartSuspensionPhysics.cc.

◆ setInitialState()

void Kart::KartSuspensionPhysics::setInitialState ( )
0x8059A02C

Definition at line 140 of file KartSuspensionPhysics.cc.

Member Data Documentation

◆ m_bottomDir

EGG::Vector3f Kart::KartSuspensionPhysics::m_bottomDir
private

Definition at line 137 of file KartSuspensionPhysics.hh.

◆ m_bspWheel

const BSP::Wheel* Kart::KartSuspensionPhysics::m_bspWheel
private

Definition at line 130 of file KartSuspensionPhysics.hh.

◆ m_bspWheelIdx

u16 Kart::KartSuspensionPhysics::m_bspWheelIdx
private

Definition at line 133 of file KartSuspensionPhysics.hh.

◆ m_maxTravelScaled

f32 Kart::KartSuspensionPhysics::m_maxTravelScaled
private

Definition at line 136 of file KartSuspensionPhysics.hh.

◆ m_tirePhysics

WheelPhysics* Kart::KartSuspensionPhysics::m_tirePhysics
private

Definition at line 131 of file KartSuspensionPhysics.hh.

◆ m_tireType

TireType Kart::KartSuspensionPhysics::m_tireType
private

Definition at line 132 of file KartSuspensionPhysics.hh.

◆ m_topmostPos

EGG::Vector3f Kart::KartSuspensionPhysics::m_topmostPos
private

Definition at line 135 of file KartSuspensionPhysics.hh.

◆ m_wheelIdx

u16 Kart::KartSuspensionPhysics::m_wheelIdx
private

Definition at line 134 of file KartSuspensionPhysics.hh.