#include <KartState.hh>
Houses various flags and other variables to preserve the kart's state.
Most notably, this class is the direct observer of the input state, and sets the appropriate flags for KartMove to act upon the input state. This class also is responsible for managing calculations of the start boost duration.
Definition at line 13 of file KartState.hh.
Public Member Functions | |
| void | init () |
| void | reset () |
| void | calcInput () |
| Each frame, read input and save related bit flags. Also handles start boosts. | |
| void | calc () |
| Every frame, resets the input state and saves collision-related bit flags. | |
| void | resetFlags () |
| void | calcCollisions () |
| Each frame, checks for collision and saves relevant bit flags. | |
| void | calcStartBoost () |
| STAGE 1 - Each frame, calculates the start boost charge. | |
| void | calcHandleStartBoost () |
| On countdown end, calculates and applies our start boost charge. | |
| void | handleStartBoost (size_t idx) |
| Applies the relevant start boost duration. | |
| void | resetEjection () |
| Resets certain bitfields pertaining to ejections (reject road, half pipe zippers, etc.) | |
Static Public Attributes | |
| static constexpr std::array< StartBoostEntry, 6 > | START_BOOST_ENTRIES |
Setters | |
| void | setCannonPointId (u16 val) |
| void | setBoostRampType (s32 val) |
| void | setJumpPadVariant (s32 val) |
| void | setHalfPipeInvisibilityTimer (s16 val) |
| void | setTrickableTimer (s16 val) |
Getters | |
| bool | isDrifting () const |
| u16 | cannonPointId () const |
| s32 | boostRampType () const |
| s32 | jumpPadVariant () const |
| f32 | stickX () const |
| f32 | stickY () const |
| u32 | airtime () const |
| const EGG::Vector3f & | top () const |
| const EGG::Vector3f & | softWallSpeed () const |
| f32 | startBoostCharge () const |
| s16 | wallBonkTimer () const |
| s16 | trickableTimer () const |
| Status & | status () |
| const Status & | status () const |
Private Attributes | |
| Status | m_status |
| u32 | m_airtime |
| EGG::Vector3f | m_top |
| EGG::Vector3f | m_softWallSpeed |
| s32 | m_hwgTimer |
| u16 | m_cannonPointId |
| s32 | m_boostRampType |
| s32 | m_jumpPadVariant |
| s16 | m_halfPipeInvisibilityTimer |
| f32 | m_stickX |
| One of 15 discrete stick values from [-1.0, 1.0]. | |
| f32 | m_stickY |
| One of 15 discrete stick values from [-1.0, 1.0]. | |
| f32 | m_startBoostCharge |
| 0-1 representation of start boost charge. Burnout if >0.95f. | |
| size_t | m_startBoostIdx |
| Used to map m_startBoostCharge to a start boost duration. | |
| s16 | m_wallBonkTimer |
| 2f counter that stunts your speed after hitting a wall. | |
| s16 | m_trickableTimer |
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) |
| 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 |
| void | apply (size_t idx) |
Static Private Member Functions inherited from Kart::KartObjectProxy | |
| static std::list< KartObjectProxy * > & | proxyList () |
|
0x805943B4 |
Definition at line 30 of file KartState.cc.
|
inlinenodiscard |
Definition at line 76 of file KartState.hh.
|
inlinenodiscard |
Definition at line 60 of file KartState.hh.
|
0x8059474C |
Every frame, resets the input state and saves collision-related bit flags.
Definition at line 115 of file KartState.cc.
|
0x80594BD4 |
Each frame, checks for collision and saves relevant bit flags.
Iterates each tire to check for collision. If any tire is colliding with the floor, the "Any Wheel Collision" bit is set. If all tires are colliding with the floor, the "All Wheels Collision" bit is set. Tracks airtime and computes the appropriate top vector, given the floor normals of all colliding floor KCLs.
Definition at line 143 of file KartState.cc.
|
0x805959D4 |
On countdown end, calculates and applies our start boost charge.
Definition at line 370 of file KartState.cc.
|
0x8059487C |
Each frame, read input and save related bit flags. Also handles start boosts.
Definition at line 66 of file KartState.cc.
|
0x80595918 |
STAGE 1 - Each frame, calculates the start boost charge.
If the player is holding accelerate, the start boost charge increases using exponential decay. If the player is not holding accelerate, the start boost charge decays by 4% each frame.
Definition at line 352 of file KartState.cc.
|
inlinenodiscard |
Definition at line 56 of file KartState.hh.
|
0x80595AF8 |
Applies the relevant start boost duration.
| idx | The index into the start boost entries array. |
Definition at line 401 of file KartState.cc.
|
0x8059455C |
Definition at line 41 of file KartState.cc.
|
inlinenodiscard |
Definition at line 52 of file KartState.hh.
|
inlinenodiscard |
Definition at line 64 of file KartState.hh.
|
0x80594594 |
Definition at line 46 of file KartState.cc.
|
0x805958F0 |
Resets certain bitfields pertaining to ejections (reject road, half pipe zippers, etc.)
Definition at line 411 of file KartState.cc.
|
0x80594704 |
Definition at line 125 of file KartState.cc.
|
inline |
Definition at line 34 of file KartState.hh.
|
inline |
Definition at line 30 of file KartState.hh.
|
inline |
Definition at line 42 of file KartState.hh.
|
inline |
Definition at line 38 of file KartState.hh.
|
inline |
Definition at line 46 of file KartState.hh.
|
inlinenodiscard |
Definition at line 84 of file KartState.hh.
|
inlinenodiscard |
Definition at line 88 of file KartState.hh.
|
inlinenodiscard |
Definition at line 100 of file KartState.hh.
|
inlinenodiscard |
Definition at line 104 of file KartState.hh.
|
inlinenodiscard |
Definition at line 68 of file KartState.hh.
|
inlinenodiscard |
Definition at line 72 of file KartState.hh.
|
inlinenodiscard |
Definition at line 80 of file KartState.hh.
|
inlinenodiscard |
Definition at line 96 of file KartState.hh.
|
inlinenodiscard |
Definition at line 92 of file KartState.hh.
|
private |
Definition at line 112 of file KartState.hh.
|
private |
Definition at line 117 of file KartState.hh.
|
private |
Definition at line 116 of file KartState.hh.
|
private |
Definition at line 119 of file KartState.hh.
|
private |
Definition at line 115 of file KartState.hh.
|
private |
Definition at line 118 of file KartState.hh.
|
private |
Definition at line 114 of file KartState.hh.
|
private |
0-1 representation of start boost charge. Burnout if >0.95f.
Definition at line 122 of file KartState.hh.
|
private |
Used to map m_startBoostCharge to a start boost duration.
Definition at line 123 of file KartState.hh.
|
private |
Definition at line 111 of file KartState.hh.
|
private |
One of 15 discrete stick values from [-1.0, 1.0].
Definition at line 120 of file KartState.hh.
|
private |
One of 15 discrete stick values from [-1.0, 1.0].
Definition at line 121 of file KartState.hh.
|
private |
Definition at line 113 of file KartState.hh.
|
private |
Definition at line 125 of file KartState.hh.
|
private |
2f counter that stunts your speed after hitting a wall.
Definition at line 124 of file KartState.hh.
|
staticconstexpr0x808B64F8 |
Definition at line 20 of file KartState.cc.