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

#include <KartSub.hh>

Description

Hosts a few classes and the high level per-frame calc functions.

Definition at line 11 of file KartSub.hh.

Inheritance diagram for Kart::KartSub:

Public Member Functions

void createSubsystems (bool isBike)
 
void copyPointers (KartAccessor &pointers)
 Called during static construction of KartObject to synchronize the pointers.
 
void init ()
 
void initAABB (KartAccessor &accessor, KartObject *object)
 
void initPhysicsValues ()
 
void resetPhysics ()
 
void calcPass0 ()
 The first phase of physics computations on each frame.
 
void calcPass1 ()
 The second phase of physics computations on each frame.Handles the second-half of physics calculations. This mainly includes collision detection, as well as suspension physics.
 
void resizeAABB (f32 radiusScale)
 
void addFloor (const CollisionData &, bool)
 
void updateSuspOvertravel (const EGG::Vector3f &suspOvertravel)
 
void tryEndHWG ()
 

Getters

f32 someScale ()
 

Private Attributes

KartMovem_move
 
KartActionm_action
 
KartCollidem_collide
 
KartStatem_state
 
EGG::Vector3f m_maxSuspOvertravel
 
EGG::Vector3f m_minSuspOvertravel
 
u16 m_floorCollisionCount
 
s16 m_sideCollisionTimer
 Number of frames to apply movement from wall collision.
 
f32 m_colPerpendicularity
 Dot product between floor and colliding wall normals.
 
f32 m_someScale
 

Static Private Attributes

static constexpr f32 DT = 1.0f
 Delta time.
 

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

◆ ~KartSub()

Kart::KartSub::~KartSub ( )
0x80598AC8

Definition at line 23 of file KartSub.cc.

Member Function Documentation

◆ addFloor()

void Kart::KartSub::addFloor ( const CollisionData & ,
bool  )
0x805980D8

Definition at line 333 of file KartSub.cc.

◆ calcPass0()

void Kart::KartSub::calcPass0 ( )
0x80596480

The first phase of physics computations on each frame.

Stage: All

Handles the first-half of physics calculations. This includes input processing, subsequent position/speed updates, as well as responding to last frame's collisions.

Definition at line 100 of file KartSub.cc.

◆ calcPass1()

void Kart::KartSub::calcPass1 ( )
0x80596CFC

The second phase of physics computations on each frame.Handles the second-half of physics calculations. This mainly includes collision detection, as well as suspension physics.

Stage: All

Definition at line 171 of file KartSub.cc.

◆ copyPointers()

void Kart::KartSub::copyPointers ( KartAccessor & pointers)
0x80596454

Called during static construction of KartObject to synchronize the pointers.

Definition at line 41 of file KartSub.cc.

◆ createSubsystems()

void Kart::KartSub::createSubsystems ( bool isBike)
0x80595D48

Definition at line 31 of file KartSub.cc.

◆ init()

void Kart::KartSub::init ( )
0x80595F78

Definition at line 49 of file KartSub.cc.

◆ initAABB()

void Kart::KartSub::initAABB ( KartAccessor & accessor,
KartObject * object )
0x8059828C

Definition at line 59 of file KartSub.cc.

◆ initPhysicsValues()

void Kart::KartSub::initPhysicsValues ( )
0x80597934

Definition at line 68 of file KartSub.cc.

◆ resetPhysics()

void Kart::KartSub::resetPhysics ( )
0x8059617C

Definition at line 74 of file KartSub.cc.

◆ resizeAABB()

void Kart::KartSub::resizeAABB ( f32 radiusScale)
0x80598338

Definition at line 327 of file KartSub.cc.

◆ someScale()

f32 Kart::KartSub::someScale ( )
inlinenodiscard

Definition at line 32 of file KartSub.hh.

◆ tryEndHWG()

void Kart::KartSub::tryEndHWG ( )
0x80598744

Definition at line 344 of file KartSub.cc.

◆ updateSuspOvertravel()

void Kart::KartSub::updateSuspOvertravel ( const EGG::Vector3f & suspOvertravel)
0x805979EC

Definition at line 338 of file KartSub.cc.

Member Data Documentation

◆ DT

f32 Kart::KartSub::DT = 1.0f
staticconstexprprivate

Delta time.

Note
This object is labeled as having a poor name. It should be renamed to better represent its purpose.

Definition at line 49 of file KartSub.hh.

◆ m_action

KartAction* Kart::KartSub::m_action
private

Definition at line 39 of file KartSub.hh.

◆ m_collide

KartCollide* Kart::KartSub::m_collide
private

Definition at line 40 of file KartSub.hh.

◆ m_colPerpendicularity

f32 Kart::KartSub::m_colPerpendicularity
private

Dot product between floor and colliding wall normals.

Definition at line 46 of file KartSub.hh.

◆ m_floorCollisionCount

u16 Kart::KartSub::m_floorCollisionCount
private

Definition at line 44 of file KartSub.hh.

◆ m_maxSuspOvertravel

EGG::Vector3f Kart::KartSub::m_maxSuspOvertravel
private

Definition at line 42 of file KartSub.hh.

◆ m_minSuspOvertravel

EGG::Vector3f Kart::KartSub::m_minSuspOvertravel
private

Definition at line 43 of file KartSub.hh.

◆ m_move

KartMove* Kart::KartSub::m_move
private

Definition at line 38 of file KartSub.hh.

◆ m_sideCollisionTimer

s16 Kart::KartSub::m_sideCollisionTimer
private

Number of frames to apply movement from wall collision.

Definition at line 45 of file KartSub.hh.

◆ m_someScale

f32 Kart::KartSub::m_someScale
private

Definition at line 47 of file KartSub.hh.

◆ m_state

KartState* Kart::KartSub::m_state
private

Definition at line 41 of file KartSub.hh.