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

Description

Definition at line 9 of file KartBody.hh.

Inheritance diagram for Kinoko::Kart::KartBody:

Public Member Functions

 KartBody (KartPhysics *physics)
virtual EGG::Matrix34f wheelMatrix (u16)
 Computes a matrix to represent wheel rotation. For Karts, this is wheel-agnostic.
void reset ()
void calcSinkDepth ()
void trySetTargetSinkDepth (f32 val)
void calcTargetSinkDepth ()

Setters

void setAngle (f32 val)

Getters

KartPhysics * physics () const
f32 sinkDepth () const

Protected Attributes

KartPhysics * m_physics
f32 m_anAngle
f32 m_sinkDepth
 Vehicle offset applied downward into collision.
f32 m_targetSinkDepth

Additional Inherited Members

Protected Member Functions inherited from Kinoko::Kart::KartObjectProxy
void apply (size_t idx)
void setPos (const EGG::Vector3f &pos)
void setRot (const EGG::Quatf &q)
void setInertiaScale (const EGG::Vector3f &scale)
KartAction * action ()
const KartAction * action () const
KartBody * body ()
const KartBody * body () const
KartCollide * collide ()
const KartCollide * collide () const
CollisionGroup * collisionGroup ()
const CollisionGroup * collisionGroup () const
KartMove * move ()
const KartMove * move () const
KartHalfPipe * halfPipe ()
const KartHalfPipe * halfPipe () const
KartScale * kartScale ()
const KartScale * kartScale () const
KartJump * jump ()
const KartJump * jump () const
KartParam * param ()
const KartParam * param () const
const BSP & bsp () const
KartPhysics * physics ()
const KartPhysics * physics () const
KartDynamics * dynamics ()
const KartDynamics * dynamics () const
KartState * state ()
const KartState * state () const
KartSub * sub ()
const KartSub * sub () const
KartSuspension * suspension (u16 suspIdx)
const KartSuspension * suspension (u16 suspIdx) const
KartSuspensionPhysics * suspensionPhysics (u16 suspIdx)
const KartSuspensionPhysics * suspensionPhysics (u16 suspIdx) const
KartTire * tire (u16 tireIdx)
const KartTire * tire (u16 tireIdx) const
WheelPhysics * tirePhysics (u16 tireIdx)
const WheelPhysics * tirePhysics (u16 tireIdx) const
CollisionData & collisionData ()
const CollisionData & collisionData () const
CollisionData & collisionData (u16 tireIdx)
const CollisionData & collisionData (u16 tireIdx) const
const System::KPad * inputs () const
Render::KartModel * model ()
const Render::KartModel * model () const
Field::ObjectCollisionKart * objectCollisionKart ()
const Field::ObjectCollisionKart * objectCollisionKart () const
Field::BoxColUnit * boxColUnit ()
const Field::BoxColUnit * boxColUnit () const
const EGG::Vector3f & scale () const
const EGG::Matrix34f & pose () 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::Vector3f & componentXAxis () const
const EGG::Vector3f & componentYAxis () const
const EGG::Vector3f & componentZAxis () const
const EGG::Vector3f & pos () const
const EGG::Vector3f & prevPos () const
const EGG::Quatf & fullRot () const
const EGG::Vector3f & extVel () const
const EGG::Vector3f & intVel () const
const EGG::Vector3f & velocity () const
f32 speed () const
f32 acceleration () const
f32 softSpeedLimit () const
const EGG::Quatf & mainRot () const
const EGG::Vector3f & angVel2 () const
bool isBike () const
u16 suspCount () const
u16 tireCount () const
bool hasFloorCollision (const WheelPhysics *wheelPhysics) const
std::pair< EGG::Vector3f, EGG::Vector3f > getCannonPosRot ()
f32 speedRatio () const
f32 speedRatioCapped () const
bool isInRespawn () const
Field::KCLTypeMask wallKclType () const
u32 wallKclVariant () const
Status & status ()
const Status & status () const
const EGG::Vector3f & wheelPos (u16 idx) const
const EGG::Vector3f & wheelEdgePos (u16 idx) const
f32 cameraDistY () const
s32 hopStickX () const
KartParam::Stats::DriftType vehicleType () const
static std::list< KartObjectProxy *, EGG::Allocator< KartObjectProxy * > > & proxyList ()

Constructor & Destructor Documentation

◆ KartBody()

Kinoko::Kart::KartBody::KartBody ( KartPhysics * physics)
0x8056C394

Definition at line 8 of file KartBody.cc.

◆ ~KartBody()

virtual Kinoko::Kart::KartBody::~KartBody ( )
inlinevirtual

Definition at line 12 of file KartBody.hh.

Member Function Documentation

◆ calcSinkDepth()

void Kinoko::Kart::KartBody::calcSinkDepth ( )
0x8056C9C4

Definition at line 31 of file KartBody.cc.

◆ calcTargetSinkDepth()

void Kinoko::Kart::KartBody::calcTargetSinkDepth ( )
0x8056C964

Definition at line 41 of file KartBody.cc.

◆ physics()

KartPhysics * Kinoko::Kart::KartBody::physics ( ) const
inlinenodiscard

Definition at line 29 of file KartBody.hh.

◆ reset()

void Kinoko::Kart::KartBody::reset ( )
0x8056C4B4

Definition at line 23 of file KartBody.cc.

◆ setAngle()

void Kinoko::Kart::KartBody::setAngle ( f32 val)
inline

Definition at line 23 of file KartBody.hh.

◆ sinkDepth()

f32 Kinoko::Kart::KartBody::sinkDepth ( ) const
inlinenodiscard

Definition at line 33 of file KartBody.hh.

◆ trySetTargetSinkDepth()

void Kinoko::Kart::KartBody::trySetTargetSinkDepth ( f32 val)
0x8056C950

Definition at line 36 of file KartBody.cc.

◆ wheelMatrix()

EGG::Matrix34f Kinoko::Kart::KartBody::wheelMatrix ( u16 )
nodiscardvirtual0x8056C604

Computes a matrix to represent wheel rotation. For Karts, this is wheel-agnostic.

Reimplemented in Kinoko::Kart::KartBodyBike, and Kinoko::Kart::KartBodyQuacker.

Definition at line 16 of file KartBody.cc.

Member Data Documentation

◆ m_anAngle

f32 Kinoko::Kart::KartBody::m_anAngle
protected
Note
This object is labeled as having a poor name. It should be renamed to better represent its purpose.

Definition at line 40 of file KartBody.hh.

◆ m_physics

KartPhysics* Kinoko::Kart::KartBody::m_physics
protected

Definition at line 39 of file KartBody.hh.

◆ m_sinkDepth

f32 Kinoko::Kart::KartBody::m_sinkDepth
protected

Vehicle offset applied downward into collision.

Definition at line 41 of file KartBody.hh.

◆ m_targetSinkDepth

f32 Kinoko::Kart::KartBody::m_targetSinkDepth
protected

Definition at line 42 of file KartBody.hh.