A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
KartMove.hh
1#pragma once
2
3#include "game/kart/KartBoost.hh"
4#include "game/kart/KartBurnout.hh"
5#include "game/kart/KartHalfPipe.hh"
6#include "game/kart/KartObjectProxy.hh"
7#include "game/kart/KartReject.hh"
8#include "game/kart/KartState.hh"
9
10#include "game/field/CourseColMgr.hh"
11
12#include <egg/core/BitFlag.hh>
13
14namespace Kart {
15
18class KartMove : protected KartObjectProxy {
19public:
20 enum class ePadType {
21 BoostPanel = 0,
22 BoostRamp = 1,
23 JumpPad = 2,
24 };
25
27
28 KartMove();
29 virtual ~KartMove();
30
31 virtual void createSubsystems();
32 virtual void calcTurn();
33 virtual void calcWheelie() {}
34 virtual void setTurnParams();
35 virtual void init(bool b1, bool b2);
36 virtual void clear();
37
39 [[nodiscard]] virtual f32 leanRot() const {
40 return 0.0f;
41 }
42
43 void setInitialPhysicsValues(const EGG::Vector3f &position, const EGG::Vector3f &angles);
44 void resetDriftManual();
45
46 void calc();
47 void calcRespawnStart();
48 void calcInRespawn();
49 void calcRespawnBoost();
50 void calcTop();
51 void calcAirtimeTop();
52 void calcSpecialFloor();
53 void calcDirs();
54 void calcStickyRoad();
55 void calcOffroad();
56 void calcBoost();
57 void calcRampBoost();
59 void calcSsmt();
60 bool calcPreDrift();
61 void calcAutoDrift();
62 void calcManualDrift();
63 void startManualDrift();
64 void clearDrift();
65 void clearJumpPad();
66 void clearRampBoost();
67 void clearZipperBoost();
68 void clearBoost();
69 void clearSsmt();
70 void clearOffroadInvincibility();
71 void clearRejectRoad();
72 void releaseMt();
74 void calcRotation();
75 void calcVehicleSpeed();
76 void calcDeceleration();
77 [[nodiscard]] f32 calcVehicleAcceleration() const;
78 void calcAcceleration();
79 [[nodiscard]] f32 calcWallCollisionSpeedFactor(f32 &f1);
80 void calcWallCollisionStart(f32 param_2);
82 void calcDive();
83 void calcSsmtStart();
84 void calcHopPhysics();
85 void calcRejectRoad();
86 bool calcZipperCollision(f32 radius, f32 scale, EGG::Vector3f &pos, EGG::Vector3f &upLocal,
87 const EGG::Vector3f &prevPos, Field::CollisionInfo *colInfo,
88 Field::KCLTypeMask *maskOut, Field::KCLTypeMask flags) const;
89 f32 calcSlerpRate(f32 scale, const EGG::Quatf &from, const EGG::Quatf &to) const;
90 virtual void calcVehicleRotation(f32 turn);
91 virtual void hop();
92 virtual void onHop() {}
93 virtual void onWallCollision() {}
94 virtual void calcMtCharge();
95 virtual void initOob();
96
100 [[nodiscard]] virtual f32 getWheelieSoftSpeedLimitBonus() const {
101 return 0.0f;
102 }
103
105 virtual bool canWheelie() const {
106 return false;
107 }
108
110 virtual bool canHop() const {
111 if (!state()->isHopStart() || !state()->isTouchingGround()) {
112 return false;
113 }
114
115 if (state()->isInAction()) {
116 return false;
117 }
118
119 return true;
120 }
121
123 bool canStartDrift() const {
124 constexpr f32 MINIMUM_DRIFT_THRESOLD = 0.55f;
125
126 return m_speed >= MINIMUM_DRIFT_THRESOLD * m_baseSpeed;
127 }
128
129 void tryStartBoostPanel();
130 void tryStartBoostRamp();
131 void tryStartJumpPad();
132 void tryEndJumpPad();
133 void cancelJumpPad();
134
135 void activateBoost(KartBoost::Type type, s16 frames);
136 void applyStartBoost(s16 frames);
137 void activateMushroom();
138 void activateZipperBoost();
139 void setOffroadInvincibility(s16 timer);
141 void calcMushroomBoost();
142 void calcZipperBoost();
143 void landTrick();
144 void activateCrush(u16 timer);
145 void calcCrushed();
146 void calcScale();
147
148 void enterCannon();
149 void calcCannon();
150 void calcRotCannon(const EGG::Vector3f &forward);
151 void exitCannon();
152
153 void triggerRespawn();
154
156 void setSpeed(f32 val) {
157 m_speed = val;
158 }
159
160 void setSmoothedUp(const EGG::Vector3f &v) {
161 m_smoothedUp = v;
162 }
163
164 void setUp(const EGG::Vector3f &v) {
165 m_up = v;
166 }
167
168 void setDir(const EGG::Vector3f &v) {
169 m_dir = v;
170 }
171
172 void setVel1Dir(const EGG::Vector3f &v) {
173 m_vel1Dir = v;
174 }
175
176 void setFloorCollisionCount(u16 count) {
177 m_floorCollisionCount = count;
178 }
179
180 void setKCLWheelSpeedFactor(f32 val) {
182 }
183
184 void setKCLWheelRotFactor(f32 val) {
186 }
187
189 void setKartSpeedLimit() {
190 constexpr f32 LIMIT = 120.0f;
191 m_hardSpeedLimit = LIMIT;
192 }
193
195 void setScale(const EGG::Vector3f &v) {
196 m_scale = v;
197 }
198
199 void setPadType(PadType type) {
200 m_padType = type;
201 }
203
205
209 [[nodiscard]] s32 getAppliedHopStickX() const {
210 return canStartDrift() ? m_hopStickX : 0;
211 }
212
213 [[nodiscard]] f32 softSpeedLimit() const {
214 return m_softSpeedLimit;
215 }
216
217 [[nodiscard]] f32 speed() const {
218 return m_speed;
219 }
220
221 [[nodiscard]] f32 acceleration() const {
222 return m_acceleration;
223 }
224
225 [[nodiscard]] const EGG::Vector3f &scale() const {
226 return m_scale;
227 }
228
229 [[nodiscard]] f32 hardSpeedLimit() const {
230 return m_hardSpeedLimit;
231 }
232
233 [[nodiscard]] const EGG::Vector3f &smoothedUp() const {
234 return m_smoothedUp;
235 }
236
237 [[nodiscard]] const EGG::Vector3f &up() const {
238 return m_up;
239 }
240
241 [[nodiscard]] f32 totalScale() const {
242 return m_totalScale;
243 }
244
245 [[nodiscard]] f32 hitboxScale() const {
246 return m_hitboxScale;
247 }
248
249 [[nodiscard]] const EGG::Vector3f &dir() const {
250 return m_dir;
251 }
252
253 [[nodiscard]] const EGG::Vector3f &lastDir() const {
254 return m_lastDir;
255 }
256
257 [[nodiscard]] const EGG::Vector3f &vel1Dir() const {
258 return m_vel1Dir;
259 }
260
261 [[nodiscard]] f32 speedRatioCapped() const {
262 return m_speedRatioCapped;
263 }
264
265 [[nodiscard]] f32 speedRatio() const {
266 return m_speedRatio;
267 }
268
269 [[nodiscard]] u16 floorCollisionCount() const {
271 }
272
273 [[nodiscard]] s32 hopStickX() const {
274 return m_hopStickX;
275 }
276
277 [[nodiscard]] f32 hopPosY() const {
278 return m_hopPosY;
279 }
280
281 [[nodiscard]] s16 respawnTimer() const {
282 return m_respawnTimer;
283 }
284
285 [[nodiscard]] s16 respawnPostLandTimer() const {
287 }
288
289 [[nodiscard]] PadType &padType() {
290 return m_padType;
291 }
292
293 [[nodiscard]] KartJump *jump() const {
294 return m_jump;
295 }
296
297 [[nodiscard]] KartHalfPipe *halfPipe() const {
298 return m_halfPipe;
299 }
300
301 [[nodiscard]] KartScale *kartScale() const {
302 return m_kartScale;
303 }
304
305 [[nodiscard]] KartBurnout &burnout() {
306 return m_burnout;
307 }
309
310protected:
311 enum class eFlags {
312 Respawned = 0,
313 DriftReset = 1,
314 SsmtCharged = 2,
315 LaunchBoost = 4,
316 SsmtLeeway = 5,
317 TrickableSurface = 6,
318 WallBounce = 8,
319 };
320 typedef EGG::TBitFlag<u16, eFlags> Flags;
321
322 enum class DriftState {
323 NotDrifting = 0,
324 ChargingMt = 1,
325 ChargedMt = 2,
326 ChargingSmt = 2,
327 ChargedSmt = 3,
328 };
329
331 enum class DrivingDirection {
332 Forwards = 0,
333 Braking = 1,
335 Backwards = 3,
336 };
337
339 f32 minSpeed;
340 f32 maxSpeed;
341 f32 velY;
342 };
343
346 f32 hopVelY;
347 f32 stabilizationFactor;
348 f32 _8;
349 f32 boostRotFactor;
350 };
351
362 EGG::Vector3f m_landingDir;
363 EGG::Vector3f m_dir;
365 EGG::Vector3f m_vel1Dir;
366 EGG::Vector3f m_dirDiff;
367 bool m_hasLandingDir;
369 f32 m_landingAngle;
383 f32 m_standStillBoostRot;
384 DriftState m_driftState;
388 KartBoost m_boost;
389 s16 m_zipperBoostTimer;
390 s16 m_zipperBoostMax;
391 KartReject m_reject;
400 f32 m_hitboxScale;
403 u32 m_nonZipperAirtime;
405 f32 m_jumpPadMaxSpeed;
406 f32 m_jumpPadBoostMultiplier;
407 f32 m_jumpPadSoftSpeedLimit;
408 const JumpPadProperties *m_jumpPadProperties;
409 u16 m_rampBoost;
410 f32 m_autoDriftAngle;
411 s16 m_autoDriftStartFrameCounter;
412 f32 m_cannonEntryOfsLength;
413 EGG::Vector3f m_cannonEntryPos;
414 EGG::Vector3f m_cannonEntryOfs;
415 EGG::Vector3f m_cannonOrthog;
416 EGG::Vector3f m_cannonProgress;
423 s16 m_respawnTimer;
426 PadType m_padType;
427 Flags m_flags;
428 KartJump *m_jump;
434};
435
440class KartMoveBike : public KartMove {
441public:
444 f32 leanRotShallowFactor;
445 f32 leanRotIncRace;
446 f32 leanRotCapRace;
447 f32 driftStickXFactor;
448 f32 leanRotMaxDrift;
449 f32 leanRotMinDrift;
450 f32 leanRotIncCountdown;
451 f32 leanRotCapCountdown;
452 f32 leanRotIncSSMT;
453 f32 leanRotCapSSMT;
454 f32 leanRotDecayFactor;
455 u16 maxWheelieFrames;
456 };
457
458 KartMoveBike();
460
461 virtual void startWheelie();
462 virtual void cancelWheelie();
463
464 void createSubsystems() override;
465 void calcVehicleRotation(f32 /*turn*/) override;
466 void calcWheelie() override;
467 void onHop() override;
468 void onWallCollision() override;
469 void calcMtCharge() override;
470 void initOob() override;
471 void setTurnParams() override;
472 void init(bool b1, bool b2) override;
473 void clear() override;
474
478 [[nodiscard]] f32 getWheelieSoftSpeedLimitBonus() const override {
479 constexpr f32 WHEELIE_SPEED_BONUS = 0.15f;
480 return state()->isWheelie() ? WHEELIE_SPEED_BONUS : 0.0f;
481 }
482
484 [[nodiscard]] f32 wheelieRotFactor() const {
485 constexpr f32 WHEELIE_ROTATION_FACTOR = 0.2f;
486
487 return state()->isWheelie() ? WHEELIE_ROTATION_FACTOR : 1.0f;
488 }
489
490 void tryStartWheelie();
491
494 [[nodiscard]] f32 leanRot() const override {
495 return m_leanRot;
496 }
497
500 [[nodiscard]] bool canWheelie() const override {
501 constexpr f32 WHEELIE_THRESHOLD = 0.3f;
502
503 return m_speedRatioCapped >= WHEELIE_THRESHOLD && m_speed >= 0.0f;
504 }
505
507
508private:
517 s16 m_autoHardStickXFrames;
519};
520
521} // namespace Kart
State management for boosts (start boost, mushrooms, mini-turbos)
Definition KartBoost.hh:9
Calculates the duration of burnout and rotation induced when holding acceleration too long during the...
Handles the physics and boosts associated with zippers.
Manages trick inputs and state.
Definition KartJump.hh:30
Responsible for reacting to player inputs and moving the bike.
Definition KartMove.hh:440
f32 m_leanRot
Z-axis rotation of the bike from leaning.
Definition KartMove.hh:509
f32 m_leanRotCap
The maximum leaning rotation.
Definition KartMove.hh:510
void calcWheelie() override
STAGE 1+ - Every frame, checks player input for wheelies and computes wheelie rotation.
Definition KartMove.cc:2447
void calcMtCharge() override
Every frame during a drift, calculates MT charge based on player input.
Definition KartMove.cc:2523
virtual void startWheelie()
STAGE 1+ - Sets the wheelie bit flag and some wheelie-related variables.
Definition KartMove.cc:2262
f32 m_wheelieRotDec
The wheelie rotation decrementor, used after a wheelie has ended.
Definition KartMove.hh:516
u32 m_wheelieFrames
Tracks wheelie duration and cancels the wheelie after 180 frames.
Definition KartMove.hh:514
f32 m_wheelieRot
X-axis rotation from wheeling.
Definition KartMove.hh:512
const TurningParameters * m_turningParams
Inside/outside drifting bike turn info.
Definition KartMove.hh:518
void setTurnParams() override
On init, sets the bike's lean rotation cap and increment.In addition to setting the lean rotation cap...
Definition KartMove.cc:2402
f32 m_maxWheelieRot
The maximum wheelie rotation.
Definition KartMove.hh:513
void tryStartWheelie()
STAGE 1+ - Every frame, checks player input to see if we should start or stop a wheelie.
Definition KartMove.cc:2558
void onWallCollision() override
Called when you collide with a wall. All it does for bikes is cancel wheelies.
Definition KartMove.cc:2516
void onHop() override
Virtual function that just cancels wheelies when you hop.
Definition KartMove.cc:2506
f32 getWheelieSoftSpeedLimitBonus() const override
Returns what % to raise the speed cap when wheeling.
Definition KartMove.hh:478
bool canWheelie() const override
Checks if the kart is going fast enough to wheelie.
Definition KartMove.hh:500
void calcVehicleRotation(f32) override
Every frame, calculates rotation, EV, and angular velocity for the bike.
Definition KartMove.cc:2293
s16 m_wheelieCooldown
The number of frames before another wheelie can start.
Definition KartMove.hh:515
f32 m_leanRotInc
The incrementor for leaning rotation.
Definition KartMove.hh:511
virtual void cancelWheelie()
Clears the wheelie bit flag and resets the rotation decrement.
Definition KartMove.cc:2277
Responsible for reacting to player inputs and moving the kart.
Definition KartMove.hh:18
f32 m_baseSpeed
The speed associated with the current character/vehicle stats.
Definition KartMove.hh:352
void calcRotation()
Every frame, calculates kart rotation based on player input.
Definition KartMove.cc:1104
s16 m_ssmtLeewayTimer
Frames to forgive letting go of A before clearing SSMT charge.
Definition KartMove.hh:394
s32 m_hopFrame
A timer that can prevent subsequent hops until reset.
Definition KartMove.hh:379
void calcDisableBackwardsAccel()
Computes the current cooldown duration between braking and reversing.
Definition KartMove.cc:690
EGG::Vector3f m_hopUp
The up vector when hopping.
Definition KartMove.hh:380
u16 m_mushroomBoostTimer
Number of frames until the mushroom boost runs out.
Definition KartMove.hh:401
void calcSpecialFloor()
Every frame, calculates any boost resulting from a boost panel.
Definition KartMove.cc:492
void calcWallCollisionStart(f32 param_2)
If we started to collide with a wall this frame, applies rotation.
Definition KartMove.cc:1499
KartHalfPipe * m_halfPipe
Pertains to zipper physics.
Definition KartMove.hh:429
f32 m_kclRotFactor
Float between 0-1 that scales the player's turning radius on offroad.
Definition KartMove.hh:374
f32 m_outsideDriftBonus
Added to angular velocity when outside drifting.
Definition KartMove.hh:387
void tryStartBoostRamp()
Sets offroad invincibility and and enables the ramp boost bitfield flag.
Definition KartMove.cc:1855
void calcDeceleration()
Definition KartMove.cc:1279
u16 m_smtCharge
A value between 0 and 300 representing current SMT charge.
Definition KartMove.hh:386
f32 m_speedRatio
The ratio between current speed and the player's base speed stat.
Definition KartMove.hh:372
@ DriftReset
Set when a wall bonk should cancel your drift.
@ SsmtCharged
Set after holding a stand-still mini-turbo for 75 frames.
@ TrickableSurface
Set when driving on a trickable surface.
@ SsmtLeeway
If set, activates SSMT when not pressing A or B.
@ WallBounce
Set when our speed loss from wall collision is > 30.0f.
@ Respawned
Set when Lakitu lets go of the player, cleared when landing.
void tryStartJumpPad()
Applies calculations to start interacting with a jump pad.
Definition KartMove.cc:1871
f32 m_jumpPadMinSpeed
Snaps the player to a minimum speed when first touching a jump pad.
Definition KartMove.hh:404
f32 m_hopPosY
Relative position as the result of a hop. Starts at 0.
Definition KartMove.hh:418
DrivingDirection m_drivingDirection
Current state of driver's direction.
Definition KartMove.hh:424
u16 m_crushTimer
Number of frames until player will be uncrushed.
Definition KartMove.hh:402
bool calcPreDrift()
Each frame, checks for hop or slipdrift. Computes drift direction based on player input.
Definition KartMove.cc:760
f32 m_speed
Current speed, restricted to the soft speed limit.
Definition KartMove.hh:354
s16 m_offroadInvincibility
How many frames until the player is affected by offroad.
Definition KartMove.hh:392
void calcAirtimeTop()
Calculates rotation of the bike due to excessive airtime.
Definition KartMove.cc:469
void startManualDrift()
Called when the player lands from a drift hop, or to start a slipdrift.
Definition KartMove.cc:1004
void controlOutsideDriftAngle()
Every frame, handles mini-turbo charging and outside drifting bike rotation.
Definition KartMove.cc:1071
f32 m_softSpeedLimit
Base speed + boosts + wheelies, restricted to the hard speed limit.
Definition KartMove.hh:353
virtual void hop()
Initializes hop information, resets upwards EV and clears upwards force.
Definition KartMove.cc:1814
void calcStandstillBoostRot()
STAGE Computes the x-component of angular velocity based on the kart's speed.
Definition KartMove.cc:1558
EGG::Vector3f m_outsideDriftLastDir
Used to compute the next m_outsideDriftAngle.
Definition KartMove.hh:370
void calcManualDrift()
Each frame, handles hopping, drifting, and mini-turbos.
Definition KartMove.cc:928
virtual void calcMtCharge()
Every frame during a drift, calculates MT/SMT charge based on player input.
Definition KartMove.cc:1749
void calcSsmt()
Calculates standstill mini-turbo components, if applicable.
Definition KartMove.cc:705
void calcAcceleration()
Every frame, applies acceleration to the kart's internal velocity.
Definition KartMove.cc:1327
f32 m_processedSpeed
Offset 0x28. It's only ever just a copy of m_speed.
Definition KartMove.hh:356
void releaseMt()
Stops charging a mini-turbo, and applies boost if charged.
Definition KartMove.cc:1047
f32 m_kclSpeedFactor
Float between 0-1 that scales the player's speed on offroad.
Definition KartMove.hh:373
f32 m_weightedTurn
Magnitude+direction of stick input, factoring in the kart's stats.
Definition KartMove.hh:397
void calcVehicleSpeed()
Every frame, computes speed based on acceleration and any active boosts.
Definition KartMove.cc:1200
f32 m_lastSpeed
Last frame's speed, cached to calculate angular velocity.
Definition KartMove.hh:355
s16 m_ssmtDisableAccelTimer
Counter that tracks delay before starting to reverse.
Definition KartMove.hh:395
void calcOffroadInvincibility()
Checks a timer to see if we are still ignoring offroad slowdown.
Definition KartMove.cc:2024
KartBurnout m_burnout
Manages the state of start boost burnout.
Definition KartMove.hh:431
f32 calcVehicleAcceleration() const
Every frame, computes acceleration based off the character/vehicle stats.
Definition KartMove.cc:1293
void calcAutoDrift()
Each frame, handles automatic transmission drifting.
Definition KartMove.cc:876
f32 m_realTurn
The "true" turn magnitude. Equal to m_weightedTurn unless drifting.
Definition KartMove.hh:396
const DriftingParameters * m_driftingParams
Drift-type-specific parameters.
Definition KartMove.hh:432
void clearDrift()
Definition KartMove.cc:812
void calc()
Each frame, calculates the kart's movement.
Definition KartMove.cc:276
EGG::Vector3f m_up
Vector perpendicular to the floor, pointing upwards.
Definition KartMove.hh:361
s16 m_ssmtCharge
Increments every frame up to 75 when charging stand-still MT.
Definition KartMove.hh:393
f32 m_speedDragMultiplier
After 5 frames of airtime, this causes speed to slowly decay.
Definition KartMove.hh:359
u16 m_mtCharge
A value between 0 and 270 representing current MT charge.
Definition KartMove.hh:385
void calcSsmtStart()
Calculates whether we are starting a standstill mini-turbo.
Definition KartMove.cc:1655
s16 m_respawnPostLandTimer
Counts up to 4 if not accelerating after respawn landing.
Definition KartMove.hh:422
virtual f32 getWheelieSoftSpeedLimitBonus() const
Returns the % speed boost from wheelies. For karts, this is always 0.
Definition KartMove.hh:100
f32 m_kclWheelRotFactor
The slowest rotation multiplier of each wheel's floor collision.
Definition KartMove.hh:376
void resetDriftManual()
Clears drift state. Called when touching ground and drift is canceled.
Definition KartMove.cc:800
f32 m_totalScale
[Unused] Always 1.0f
Definition KartMove.hh:399
f32 m_acceleration
Captures the acceleration from player input and boosts.
Definition KartMove.hh:358
virtual void calcVehicleRotation(f32 turn)
Every frame, calculates rotation, EV, and angular velocity for the kart.
Definition KartMove.cc:1703
s16 m_respawnPreLandTimer
Counts down from 4 when pressing A before landing from respawn.
Definition KartMove.hh:421
virtual void calcTurn()
Each frame, looks at player input and kart stats. Saves turn-related info.
Definition KartMove.cc:67
f32 m_divingRot
Induces x-axis angular velocity based on up/down stick input.
Definition KartMove.hh:382
f32 m_outsideDriftAngle
The facing angle of an outward-drifting vehicle.
Definition KartMove.hh:368
EGG::Vector3f m_lastDir
m_speed from the previous frame but with signed magnitude.
Definition KartMove.hh:364
EGG::Vector3f m_smoothedUp
A smoothed up vector, mostly used after significant airtime.
Definition KartMove.hh:360
s32 getAppliedHopStickX() const
Factors in vehicle speed to retrieve our hop direction and magnitude.
Definition KartMove.hh:209
u16 m_floorCollisionCount
The number of tires colliding with the floor.
Definition KartMove.hh:377
void calcDive()
Responds to player input to handle up/down kart tilt mid-air.
Definition KartMove.cc:1596
void calcOffroad()
Each frame, computes rotation and speed scalars from the floor KCL.
Definition KartMove.cc:635
KartScale * m_kartScale
Manages scaling due to TF stompers and MH cars.
Definition KartMove.hh:430
DrivingDirection
The direction the player is currently driving in.
Definition KartMove.hh:331
@ WaitingForBackwards
Holding reverse but waiting on a 15 frame delay.
s16 m_timeInRespawn
The number of frames elapsed after position snap from respawn.
Definition KartMove.hh:420
s32 m_hopStickX
A ternary for the direction of our hop, 0 if still neutral hopping.
Definition KartMove.hh:378
s16 m_backwardsAllowCounter
Tracks the 15f delay before reversing.
Definition KartMove.hh:425
f32 calcWallCollisionSpeedFactor(f32 &f1)
Every frame, computes a speed scalar if we are colliding with a wall.
Definition KartMove.cc:1468
void calcMushroomBoost()
Checks a timer to see if we are still boosting from a mushroom.
Definition KartMove.cc:2038
f32 m_hopGravity
Always main gravity (-1.3f).
Definition KartMove.hh:419
f32 m_hopVelY
Relative velocity due to a hop. Starts at 10 and decreases with gravity.
Definition KartMove.hh:417
f32 m_hardSpeedLimit
Absolute speed cap. It's 120, unless you're in a bullet (140).
Definition KartMove.hh:357
void setInitialPhysicsValues(const EGG::Vector3f &position, const EGG::Vector3f &angles)
Initializes the kart's position and rotation. Calls tire suspension initializers.
Definition KartMove.cc:239
f32 m_rawTurn
Float in range [-1, 1]. Represents stick magnitude + direction.
Definition KartMove.hh:433
void setOffroadInvincibility(s16 timer)
Ignores offroad KCL collision for a set amount of time.
Definition KartMove.cc:2013
f32 m_speedRatioCapped
m_speedRatio but capped at 1.0f.
Definition KartMove.hh:371
EGG::Vector3f m_scale
Normally the unit vector, but may vary due to crush animations.
Definition KartMove.hh:398
f32 m_kclWheelSpeedFactor
The slowest speed multiplier of each wheel's floor collision.
Definition KartMove.hh:375
EGG::Vector3f m_hopDir
Used for outward drift. Tracks the forward vector of our rotation.
Definition KartMove.hh:381
Base class for most kart-related objects.
Pertains to handling reject road.
Definition KartReject.hh:8
Mainly responsible for calculating scaling for the squish/unsquish animation.
Definition KartScale.hh:8
Pertains to kart-related functionality.
A quaternion, used to represent 3D rotation.
Definition Quat.hh:12
Wrapper around an integral type with an enum corresponding to its bits.
Definition BitFlag.hh:16
A 3D float vector.
Definition Vector.hh:87
Represents turning information which differs only between inside/outside drift.
Definition KartMove.hh:443
Houses parameters that vary between the drift type (inward bike, outward bike, kart).
Definition KartMove.hh:345