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

#include <KartScale.hh>

Description

Mainly responsible for calculating scaling for the squish/unsquish animation.

Definition at line 9 of file KartScale.hh.

Inheritance diagram for Kinoko::Kart::KartScale:

Public Member Functions

 KartScale (const KartParam::Stats &stats)
void reset ()
void calc ()
void startCrush ()
void endCrush ()
void startShrink (s32 unk)
void endShrink (s32 unk)
const EGG::Vector3fsizeScale () const
const EGG::Vector3fpressScale () const

Private Types

enum class  CrushState {
  None = -1 ,
  Crush = 0 ,
  Uncrush = 1
}

Private Member Functions

void calcCrush ()
EGG::Vector3f getAnmScale (f32 frame) const

Private Attributes

s32 m_type
EGG::Vector3f m_scaleTransformOffset
EGG::Vector3f m_scaleTransformSlope
EGG::Vector3f m_sizeScale
bool m_scaleAnmActive
f32 m_anmFrame
std::array< f32, 4 > m_scaleTarget
CrushState m_crushState
 Specifies the current crush/uncrush state.
bool m_calcCrush
 Set while crush scaling is occurring.
f32 m_uncrushAnmFrame
 Current frame of the unsquish animation.
EGG::Vector3f m_pressScale

Static Private Attributes

static constexpr f32 CRUSH_SCALE = 0.3f
static constexpr std::array< f32, 4 > s_baseScaleStart
static constexpr std::array< f32, 4 > s_baseScaleTarget

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)
KartActionaction ()
const KartActionaction () const
KartBodybody ()
const KartBodybody () const
KartCollidecollide ()
const KartCollidecollide () const
CollisionGroupcollisionGroup ()
const CollisionGroupcollisionGroup () const
KartMovemove ()
const KartMovemove () const
KartHalfPipehalfPipe ()
const KartHalfPipehalfPipe () const
KartScalekartScale ()
const KartScalekartScale () 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
Field::KCLTypeMask wallKclType () const
u32 wallKclVariant () const
Status & status ()
const Status & status () const
const EGG::Vector3fwheelPos (u16 idx) const
const EGG::Vector3fwheelEdgePos (u16 idx) const
f32 cameraDistY () const
s32 hopStickX () const
KartParam::Stats::DriftType vehicleType () const
static std::list< KartObjectProxy *, EGG::Allocator< KartObjectProxy * > > & proxyList ()

Member Enumeration Documentation

◆ CrushState

enum class Kinoko::Kart::KartScale::CrushState
strongprivate

Definition at line 31 of file KartScale.hh.

Constructor & Destructor Documentation

◆ KartScale()

Kinoko::Kart::KartScale::KartScale ( const KartParam::Stats & stats)
0x8056AD44

Definition at line 8 of file KartScale.cc.

◆ ~KartScale()

Kinoko::Kart::KartScale::~KartScale ( )
default0x8056B5A8

Member Function Documentation

◆ calc()

void Kinoko::Kart::KartScale::calc ( )
0x8056B218

Definition at line 45 of file KartScale.cc.

◆ calcCrush()

void Kinoko::Kart::KartScale::calcCrush ( )
private0x8056B45C

Definition at line 111 of file KartScale.cc.

◆ endCrush()

void Kinoko::Kart::KartScale::endCrush ( )
0x8056B094

Definition at line 81 of file KartScale.cc.

◆ endShrink()

void Kinoko::Kart::KartScale::endShrink ( s32 unk)
0x8056B168

Definition at line 100 of file KartScale.cc.

◆ getAnmScale()

EGG::Vector3f Kinoko::Kart::KartScale::getAnmScale ( f32 frame) const
nodiscardprivate0x8056ACF4

Definition at line 137 of file KartScale.cc.

◆ pressScale()

const EGG::Vector3f & Kinoko::Kart::KartScale::pressScale ( ) const
inlinenodiscard

Definition at line 26 of file KartScale.hh.

◆ reset()

void Kinoko::Kart::KartScale::reset ( )
0x8056AF10

Definition at line 31 of file KartScale.cc.

◆ sizeScale()

const EGG::Vector3f & Kinoko::Kart::KartScale::sizeScale ( ) const
inlinenodiscard

Definition at line 22 of file KartScale.hh.

◆ startCrush()

void Kinoko::Kart::KartScale::startCrush ( )
0x8056B060

Definition at line 73 of file KartScale.cc.

◆ startShrink()

void Kinoko::Kart::KartScale::startShrink ( s32 unk)
0x8056AFB4

Definition at line 89 of file KartScale.cc.

Member Data Documentation

◆ CRUSH_SCALE

f32 Kinoko::Kart::KartScale::CRUSH_SCALE = 0.3f
staticconstexprprivate

Definition at line 53 of file KartScale.hh.

◆ m_anmFrame

f32 Kinoko::Kart::KartScale::m_anmFrame
private

Definition at line 46 of file KartScale.hh.

◆ m_calcCrush

bool Kinoko::Kart::KartScale::m_calcCrush
private

Set while crush scaling is occurring.

Definition at line 49 of file KartScale.hh.

◆ m_crushState

CrushState Kinoko::Kart::KartScale::m_crushState
private

Specifies the current crush/uncrush state.

Definition at line 48 of file KartScale.hh.

◆ m_pressScale

EGG::Vector3f Kinoko::Kart::KartScale::m_pressScale
private

Definition at line 51 of file KartScale.hh.

◆ m_scaleAnmActive

bool Kinoko::Kart::KartScale::m_scaleAnmActive
private

Definition at line 45 of file KartScale.hh.

◆ m_scaleTarget

std::array<f32, 4> Kinoko::Kart::KartScale::m_scaleTarget
private

Definition at line 47 of file KartScale.hh.

◆ m_scaleTransformOffset

EGG::Vector3f Kinoko::Kart::KartScale::m_scaleTransformOffset
private

Definition at line 42 of file KartScale.hh.

◆ m_scaleTransformSlope

EGG::Vector3f Kinoko::Kart::KartScale::m_scaleTransformSlope
private

Definition at line 43 of file KartScale.hh.

◆ m_sizeScale

EGG::Vector3f Kinoko::Kart::KartScale::m_sizeScale
private

Definition at line 44 of file KartScale.hh.

◆ m_type

s32 Kinoko::Kart::KartScale::m_type
private

Definition at line 41 of file KartScale.hh.

◆ m_uncrushAnmFrame

f32 Kinoko::Kart::KartScale::m_uncrushAnmFrame
private

Current frame of the unsquish animation.

Definition at line 50 of file KartScale.hh.

◆ s_baseScaleStart

std::array<f32, 4> Kinoko::Kart::KartScale::s_baseScaleStart
staticconstexprprivate
Initial value:
= {{
0.5f,
1.0f,
1.0f,
2.0f,
}}

Definition at line 55 of file KartScale.hh.

◆ s_baseScaleTarget

std::array<f32, 4> Kinoko::Kart::KartScale::s_baseScaleTarget
staticconstexprprivate
Initial value:
= {{
1.0f,
0.5f,
2.0f,
1.0f,
}}

Definition at line 62 of file KartScale.hh.