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

Detailed Description

Pertains to kart-related functionality.

Classes

struct  BSP
 Houses hitbox and wheel positions, radii, and suspension info. More...
 
struct  CannonParameter
 
struct  CollisionData
 Information about the current collision and its properties. More...
 
class  CollisionGroup
 Houses hitbox and collision info for an object (body or wheel). More...
 
class  Hitbox
 Represents a hitbox for the kart body or a wheel. More...
 
struct  KartAccessor
 Shared between classes who inherit KartObjectProxy so they can access one another. More...
 
class  KartAction
 
class  KartBody
 
class  KartBodyBike
 
class  KartBodyKart
 
class  KartBodyQuacker
 
class  KartBoost
 State management for boosts (start boost, mushrooms, mini-turbos) More...
 
class  KartBurnout
 Calculates the duration of burnout and rotation induced when holding acceleration too long during the race countdown. More...
 
class  KartCollide
 Manages body+wheel collision and its influence on position/velocity/etc. More...
 
class  KartDynamics
 State management for most components of a kart's physics. More...
 
class  KartDynamicsBike
 State management for most components of a bike's physics. More...
 
class  KartHalfPipe
 Handles the physics and boosts associated with zippers. More...
 
class  KartJump
 Manages trick inputs and state. More...
 
class  KartJumpBike
 
class  KartMove
 Responsible for reacting to player inputs and moving the kart. More...
 
class  KartMoveBike
 Responsible for reacting to player inputs and moving the bike. More...
 
class  KartObject
 The highest level abstraction for a kart. More...
 
class  KartObjectBike
 The highest level abstraction for a bike. More...
 
class  KartObjectManager
 Responsible for the lifecycle and calculation of KartObjects. More...
 
class  KartObjectProxy
 Base class for most kart-related objects. More...
 
class  KartParam
 Houses stats regarding a given character/vehicle combo. More...
 
class  KartParamFileManager
 Abstraction for the process of retrieving kart parameters from files. More...
 
class  KartPhysics
 Manages the lifecycle of KartDynamics, handles moving floors and trick rotation. More...
 
class  KartReject
 Pertains to handling reject road. More...
 
class  KartScale
 Mainly responsible for calculating scaling for the squish/unsquish animation. More...
 
class  KartState
 Houses various flags and other variables to preserve the kart's state. More...
 
class  KartSub
 Hosts a few classes and the high level per-frame calc functions. More...
 
class  KartSuspension
 Doesn't do much besides hold a pointer to KartSuspensionPhysics. More...
 
class  KartSuspensionFrontBike
 
class  KartSuspensionPhysics
 Physics for a single wheel's suspension. More...
 
class  KartSuspensionRearBike
 
class  KartTire
 A holder for a wheel's physics data. More...
 
class  KartTireFront
 A holder for a kart's front tire's physics data. More...
 
class  KartTireFrontBike
 A holder for a bike's front tire's physics data. More...
 
class  KartTireRearBike
 A holder for a bike's rear tire's physics data. More...
 
struct  StartBoostEntry
 
class  WheelPhysics
 Manages wheel physics and collision checks. More...
 

Typedefs

typedef EGG::TBitFlagExt< static_cast< size_t >(eStatus::FlagMax), eStatusStatus
 

Enumerations

enum class  Action {
  None = -1 ,
  UNK_0 = 0 ,
  UNK_1 = 1 ,
  UNK_2 = 2 ,
  UNK_3 = 3 ,
  UNK_4 = 4 ,
  UNK_5 = 5 ,
  UNK_6 = 6 ,
  UNK_7 = 7 ,
  UNK_8 = 8 ,
  UNK_9 = 9 ,
  UNK_12 = 12 ,
  UNK_14 = 14 ,
  UNK_16 = 16 ,
  Max = 18
}
 
enum class  Reaction {
  None = 0 ,
  UNK_3 = 3 ,
  UNK_4 = 4 ,
  UNK_5 = 5 ,
  UNK_7 = 7 ,
  WallAllSpeed = 8 ,
  SpinAllSpeed = 9 ,
  SpinSomeSpeed = 10 ,
  FireSpin = 11 ,
  ClipThroughSomeSpeed = 12 ,
  SmallLaunch = 13 ,
  KnockbackSomeSpeedLoseItem = 14 ,
  LaunchSpinLoseItem = 15 ,
  KnockbackBumpLoseItem = 16 ,
  LongCrushLoseItem = 17 ,
  SmallBump = 18 ,
  BigBump = 19 ,
  SpinShrink = 20 ,
  HighLaunchLoseItem = 21 ,
  SpinHitSomeSpeed = 22 ,
  WeakWall = 23 ,
  Wall = 24 ,
  LaunchSpin = 25 ,
  WallSpark = 26 ,
  RubberWall = 27 ,
  Wall2 = 28 ,
  UntrickableJumpPad = 29 ,
  ShortCrushLoseItem = 30 ,
  CrushRespawn = 31 ,
  ExplosionLoseItem = 32
}
 
enum class  SurfaceVariant {
  DoubleFlipTrick = 0 ,
  SingleFlipTrick = 1 ,
  StuntTrick = 2
}
 Determined by the KCL, this represents the variation of the trick that will be performed. More...
 
enum class  TrickType {
  StuntTrickBasic = 0 ,
  BikeFlipTrickNose = 1 ,
  BikeFlipTrickTail = 2 ,
  FlipTrickYLeft = 3 ,
  FlipTrickYRight = 4 ,
  KartFlipTrickZ = 5 ,
  BikeSideStuntTrick = 6
}
 Represents the type of trick that will be performed based on kart and player input. More...
 
enum class  eStatus {
  Accelerate = 0 ,
  Brake = 1 ,
  DriftInput = 2 ,
  DriftManual = 3 ,
  BeforeRespawn = 4 ,
  Wall3Collision = 5 ,
  WallCollision = 6 ,
  HopStart = 7 ,
  AccelerateStart = 8 ,
  GroundStart = 9 ,
  VehicleBodyFloorCollision = 10 ,
  AnyWheelCollision = 11 ,
  AllWheelsCollision = 12 ,
  StickLeft = 13 ,
  WallCollisionStart = 14 ,
  AirtimeOver20 = 15 ,
  StickyRoad = 16 ,
  TouchingGround = 18 ,
  Hop = 19 ,
  Boost = 20 ,
  AirStart = 23 ,
  StickRight = 24 ,
  LargeFlipHit = 25 ,
  MushroomBoost = 26 ,
  SlipdriftCharge = 27 ,
  DriftAuto = 28 ,
  Wheelie = 29 ,
  JumpPad = 30 ,
  RampBoost = 31 ,
  InAction = 32 ,
  TriggerRespawn = 33 ,
  CannonStart = 35 ,
  InCannon = 36 ,
  TrickStart = 37 ,
  InATrick = 38 ,
  BoostOffroadInvincibility = 39 ,
  HalfPipeRamp = 41 ,
  OverZipper = 42 ,
  JumpPadMushroomCollision = 43 ,
  ZipperInvisibleWall = 44 ,
  ZipperBoost = 45 ,
  ZipperStick = 46 ,
  ZipperTrick = 47 ,
  DisableBackwardsAccel = 48 ,
  RespawnKillY = 49 ,
  Burnout = 50 ,
  TrickRot = 54 ,
  JumpPadMushroomVelYInc = 55 ,
  ChargingSSMT = 57 ,
  RejectRoad = 59 ,
  RejectRoadTrigger = 60 ,
  Trickable = 62 ,
  WheelieRot = 68 ,
  SkipWheelCalc = 69 ,
  JumpPadMushroomTrigger = 70 ,
  NoSparkInvisibleWall = 75 ,
  CollidingOffroad = 76 ,
  InRespawn = 77 ,
  AfterRespawn = 78 ,
  Crushed = 80 ,
  JumpPadFixedSpeed = 84 ,
  JumpPadDisableYsusForce = 86 ,
  HalfpipeMidair = 87 ,
  UNK2 = 97 ,
  SomethingWallCollision = 99 ,
  SoftWallDrift = 100 ,
  HWG = 101 ,
  AfterCannon = 102 ,
  ActionMidZipper = 103 ,
  ChargeStartBoost = 104 ,
  EndHalfPipe = 107 ,
  AutoDrift = 133 ,
  FlagMax
}
 This is a union of the 5 bitfields contained within KartState. More...
 

Functions

 STATIC_ASSERT (sizeof(BSP)==0x25c)
 

Variables

static constexpr std::array< CannonParameter, 3 > CANNON_PARAMETERS
 

Typedef Documentation

◆ Status

typedef EGG::TBitFlagExt<static_cast<size_t>(eStatus::FlagMax), eStatus> Kart::Status

Definition at line 92 of file Status.hh.

Enumeration Type Documentation

◆ Action

enum class Kart::Action
strong

Definition at line 7 of file KartAction.hh.

◆ eStatus

enum class Kart::eStatus
strong

This is a union of the 5 bitfields contained within KartState.

Enumerator
Accelerate 

Accel button is pressed.

Brake 

Brake button is pressed.

DriftInput 

A "fake" button, normally set if you meet the speed requirement to hop.

Warning
When playing back a ghost, the game will register a hop regardless of whether or not the acceleration button is pressed. This can lead to "successful" synchronization of ghosts which could not have been created legitimately in the first place.
DriftManual 

Currently in a drift w/ manual.

BeforeRespawn 

Set on respawn collision, cleared on position snap.

Wall3Collision 

Set when colliding with wall KCL COL_TYPE_WALL_2.

WallCollision 

Set if we are colliding with a wall.

HopStart 

Set if m_bDriftInput was toggled on this frame.

AccelerateStart 

Set if m_bAccelerate was toggled on this frame.

GroundStart 

Set first frame landing from airtime.

VehicleBodyFloorCollision 

Set if the vehicle body is colliding with the floor.

AnyWheelCollision 

Set when any wheel is touching floor collision.

AllWheelsCollision 

Set when all wheels are touching floor collision.

StickLeft 

Set on left stick input. Mutually exclusive to m_bStickRight.

WallCollisionStart 

Set if we have just started colliding with a wall.

AirtimeOver20 

Set after 20 frames of airtime, resets on landing.

StickyRoad 

Like the rBC stairs.

TouchingGround 

Set when any part of the vehicle is colliding with floor KCL.

Hop 

Set while we are in a drift hop. Clears when we land.

Boost 

Set while in a boost.

StickRight 

Set on right stick input. Mutually exclusive to m_bStickLeft.

LargeFlipHit 

Set when hitting an exploding object.

MushroomBoost 

Set while we are in a mushroom boost.

SlipdriftCharge 

Currently in a drift w/ automatic.

Wheelie 

Set while we are in a wheelie (even during the countdown).

BoostOffroadInvincibility 

Set if we should ignore offroad slowdown this frame.

HalfPipeRamp 

Set while colliding with zipper KCL.

OverZipper 

Set while mid-air from a zipper.

ZipperInvisibleWall 

Set when colliding with invisible wall above a zipper.

ZipperBoost 

Set when boosting after landing from a zipper.

ZipperStick 

Set while mid-air and still influenced by the zipper.

ZipperTrick 

Set while tricking mid-air from a zipper.

DisableBackwardsAccel 

Enforces a 20f delay when reversing after charging SSMT.

RespawnKillY 

Set while respawning to cap external velocity at 0.

Burnout 

Set during a burnout on race start.

ChargingSSMT 

Tracks whether we are charging a stand-still mini-turbo.

RejectRoad 

Collision which causes a change in the player's pos and rot.

RejectRoadTrigger 

e.g. DK Summit ending, and Maple Treeway side walls.

HWG 

Set when "Horizontal Wall Glitch" is active.

ActionMidZipper 

Set when we enter an action while mid-air from a zipper.

ChargeStartBoost 

Like m_bAccelerate but during countdown.

AutoDrift 

True if auto transmission, false if manual.

FlagMax 

Internal. Total number of bits in the status.

Definition at line 8 of file Status.hh.

◆ Reaction

enum class Kart::Reaction
strong

Definition at line 13 of file KartCollide.hh.

◆ SurfaceVariant

enum class Kart::SurfaceVariant
strong

Determined by the KCL, this represents the variation of the trick that will be performed.

This is also directly used to determine the duration of the trick boost.

Enumerator
DoubleFlipTrick 

RR ramps before figure-8 and last turn.

SingleFlipTrick 

BC starting ramp.

StuntTrick 

Think rMR ramp and pipe, MH after first turn, mushrooms, etc.

Definition at line 10 of file KartJump.hh.

◆ TrickType

enum class Kart::TrickType
strong

Represents the type of trick that will be performed based on kart and player input.

Some of these types are only available for bikes.

Enumerator
StuntTrickBasic 

An up/down StuntTrick with kart/bike.

BikeFlipTrickNose 

An up trick with bike.

BikeFlipTrickTail 

A down trick with bike.

FlipTrickYLeft 

A left trick with kart/bike.

FlipTrickYRight 

A right trick with kart/bike.

KartFlipTrickZ 

An up/down trick with a kart.

BikeSideStuntTrick 

A side StuntTrick with a bike.

Definition at line 18 of file KartJump.hh.

Variable Documentation

◆ CANNON_PARAMETERS

std::array<CannonParameter, 3> Kart::CANNON_PARAMETERS
staticconstexpr
Initial value:
= {{
{500.0f, 0.0f, 6000.0f, -1.0f},
{500.0f, 5000.0f, 6000.0f, -1.0f},
{120.0f, 2000.0f, 1000.0f, 45.0f},
}}

Definition at line 35 of file KartMove.cc.