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

#include <KartSuspensionPhysics.hh>

Description

Manages wheel physics and collision checks.

Definition at line 13 of file KartSuspensionPhysics.hh.

Inheritance diagram for Kart::WheelPhysics:

Public Member Functions

 WheelPhysics (u16 wheelIdx, u16 bspWheelIdx)
 
void init ()
 
void initBsp ()
 
void reset ()
 
void realign (const EGG::Vector3f &bottom, const EGG::Vector3f &vehicleMovement)
 
void updateCollision (const EGG::Vector3f &bottom, const EGG::Vector3f &topmostPos)
 

Setters

void setSuspTravel (f32 suspTravel)
 
void setPos (const EGG::Vector3f &pos)
 
void setLastPos (const EGG::Vector3f &pos)
 
void setLastPosDiff (const EGG::Vector3f &pos)
 
void setWheelEdgePos (const EGG::Vector3f &pos)
 
void setColVel (const EGG::Vector3f &vec)
 

Getters

const EGG::Vector3fpos () const
 
const EGG::Vector3flastPosDiff () const
 
f32 suspTravel ()
 
const EGG::Vector3ftopmostPos () const
 
CollisionGrouphitboxGroup ()
 
const CollisionGrouphitboxGroup () const
 
const EGG::Vector3fspeed () const
 
f32 effectiveRadius () const
 
f32 _74 () const
 

Private Attributes

u16 m_wheelIdx
 
u16 m_bspWheelIdx
 
const BSP::Wheelm_bspWheel
 
CollisionGroupm_hitboxGroup
 
EGG::Vector3f m_pos
 
EGG::Vector3f m_lastPos
 
EGG::Vector3f m_lastPosDiff
 
f32 m_suspTravel
 
EGG::Vector3f m_colVel
 
EGG::Vector3f m_speed
 
EGG::Vector3f m_wheelEdgePos
 
f32 m_effectiveRadius
 
f32 m_targetEffectiveRadius
 
f32 m_74
 
EGG::Vector3f m_topmostPos
 

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 ()
 

Constructor & Destructor Documentation

◆ WheelPhysics()

Kart::WheelPhysics::WheelPhysics ( u16 wheelIdx,
u16 bspWheelIdx )
0x8059940C

Definition at line 15 of file KartSuspensionPhysics.cc.

◆ ~WheelPhysics()

Kart::WheelPhysics::~WheelPhysics ( )
0x8059A9C4

Definition at line 19 of file KartSuspensionPhysics.cc.

Member Function Documentation

◆ _74()

f32 Kart::WheelPhysics::_74 ( ) const
inlinenodiscard

Definition at line 85 of file KartSuspensionPhysics.hh.

◆ effectiveRadius()

f32 Kart::WheelPhysics::effectiveRadius ( ) const
inlinenodiscard

Definition at line 81 of file KartSuspensionPhysics.hh.

◆ hitboxGroup() [1/2]

CollisionGroup * Kart::WheelPhysics::hitboxGroup ( )
inlinenodiscard

Definition at line 69 of file KartSuspensionPhysics.hh.

◆ hitboxGroup() [2/2]

const CollisionGroup * Kart::WheelPhysics::hitboxGroup ( ) const
inlinenodiscard

Definition at line 73 of file KartSuspensionPhysics.hh.

◆ init()

void Kart::WheelPhysics::init ( )
0x80599470

Definition at line 24 of file KartSuspensionPhysics.cc.

◆ initBsp()

void Kart::WheelPhysics::initBsp ( )
0x805994D4

Definition at line 30 of file KartSuspensionPhysics.cc.

◆ lastPosDiff()

const EGG::Vector3f & Kart::WheelPhysics::lastPosDiff ( ) const
inlinenodiscard

Definition at line 57 of file KartSuspensionPhysics.hh.

◆ pos()

const EGG::Vector3f & Kart::WheelPhysics::pos ( ) const
inlinenodiscard

Definition at line 53 of file KartSuspensionPhysics.hh.

◆ realign()

void Kart::WheelPhysics::realign ( const EGG::Vector3f & bottom,
const EGG::Vector3f & vehicleMovement )
0x80599AD0

Definition at line 55 of file KartSuspensionPhysics.cc.

◆ reset()

void Kart::WheelPhysics::reset ( )
0x80599508

Definition at line 35 of file KartSuspensionPhysics.cc.

◆ setColVel()

void Kart::WheelPhysics::setColVel ( const EGG::Vector3f & vec)
inline

Definition at line 47 of file KartSuspensionPhysics.hh.

◆ setLastPos()

void Kart::WheelPhysics::setLastPos ( const EGG::Vector3f & pos)
inline

Definition at line 35 of file KartSuspensionPhysics.hh.

◆ setLastPosDiff()

void Kart::WheelPhysics::setLastPosDiff ( const EGG::Vector3f & pos)
inline

Definition at line 39 of file KartSuspensionPhysics.hh.

◆ setPos()

void Kart::WheelPhysics::setPos ( const EGG::Vector3f & pos)
inline

Definition at line 31 of file KartSuspensionPhysics.hh.

◆ setSuspTravel()

void Kart::WheelPhysics::setSuspTravel ( f32 suspTravel)
inline

Definition at line 27 of file KartSuspensionPhysics.hh.

◆ setWheelEdgePos()

void Kart::WheelPhysics::setWheelEdgePos ( const EGG::Vector3f & pos)
inline

Definition at line 43 of file KartSuspensionPhysics.hh.

◆ speed()

const EGG::Vector3f & Kart::WheelPhysics::speed ( ) const
inlinenodiscard

Definition at line 77 of file KartSuspensionPhysics.hh.

◆ suspTravel()

f32 Kart::WheelPhysics::suspTravel ( )
inlinenodiscard

Definition at line 61 of file KartSuspensionPhysics.hh.

◆ topmostPos()

const EGG::Vector3f & Kart::WheelPhysics::topmostPos ( ) const
inlinenodiscard

Definition at line 65 of file KartSuspensionPhysics.hh.

◆ updateCollision()

void Kart::WheelPhysics::updateCollision ( const EGG::Vector3f & bottom,
const EGG::Vector3f & topmostPos )
0x80599690

Definition at line 71 of file KartSuspensionPhysics.cc.

Member Data Documentation

◆ m_74

f32 Kart::WheelPhysics::m_74
private

Definition at line 104 of file KartSuspensionPhysics.hh.

◆ m_bspWheel

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

Definition at line 93 of file KartSuspensionPhysics.hh.

◆ m_bspWheelIdx

u16 Kart::WheelPhysics::m_bspWheelIdx
private

Definition at line 92 of file KartSuspensionPhysics.hh.

◆ m_colVel

EGG::Vector3f Kart::WheelPhysics::m_colVel
private

Definition at line 99 of file KartSuspensionPhysics.hh.

◆ m_effectiveRadius

f32 Kart::WheelPhysics::m_effectiveRadius
private

Definition at line 102 of file KartSuspensionPhysics.hh.

◆ m_hitboxGroup

CollisionGroup* Kart::WheelPhysics::m_hitboxGroup
private

Definition at line 94 of file KartSuspensionPhysics.hh.

◆ m_lastPos

EGG::Vector3f Kart::WheelPhysics::m_lastPos
private

Definition at line 96 of file KartSuspensionPhysics.hh.

◆ m_lastPosDiff

EGG::Vector3f Kart::WheelPhysics::m_lastPosDiff
private

Definition at line 97 of file KartSuspensionPhysics.hh.

◆ m_pos

EGG::Vector3f Kart::WheelPhysics::m_pos
private

Definition at line 95 of file KartSuspensionPhysics.hh.

◆ m_speed

EGG::Vector3f Kart::WheelPhysics::m_speed
private

Definition at line 100 of file KartSuspensionPhysics.hh.

◆ m_suspTravel

f32 Kart::WheelPhysics::m_suspTravel
private

Definition at line 98 of file KartSuspensionPhysics.hh.

◆ m_targetEffectiveRadius

f32 Kart::WheelPhysics::m_targetEffectiveRadius
private

Definition at line 103 of file KartSuspensionPhysics.hh.

◆ m_topmostPos

EGG::Vector3f Kart::WheelPhysics::m_topmostPos
private

Definition at line 105 of file KartSuspensionPhysics.hh.

◆ m_wheelEdgePos

EGG::Vector3f Kart::WheelPhysics::m_wheelEdgePos
private

Definition at line 101 of file KartSuspensionPhysics.hh.

◆ m_wheelIdx

u16 Kart::WheelPhysics::m_wheelIdx
private

Definition at line 91 of file KartSuspensionPhysics.hh.