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 void applyBumpForce(f32 speed, const EGG::Vector3f &hitDir, bool resetSpeed);
148
149 void enterCannon();
150 void calcCannon();
151 void calcRotCannon(const EGG::Vector3f &forward);
152 void exitCannon();
153
154 void triggerRespawn();
155
157 void setSpeed(f32 val) {
158 m_speed = val;
159 }
160
161 void setSmoothedUp(const EGG::Vector3f &v) {
162 m_smoothedUp = v;
163 }
164
165 void setUp(const EGG::Vector3f &v) {
166 m_up = v;
167 }
168
169 void setDir(const EGG::Vector3f &v) {
170 m_dir = v;
171 }
172
173 void setVel1Dir(const EGG::Vector3f &v) {
174 m_vel1Dir = v;
175 }
176
177 void setFloorCollisionCount(u16 count) {
178 m_floorCollisionCount = count;
179 }
180
181 void setKCLWheelSpeedFactor(f32 val) {
183 }
184
185 void setKCLWheelRotFactor(f32 val) {
187 }
188
190 void setKartSpeedLimit() {
191 constexpr f32 LIMIT = 120.0f;
192 m_hardSpeedLimit = LIMIT;
193 }
194
196 void setScale(const EGG::Vector3f &v) {
197 m_scale = v;
198 }
199
200 void setPadType(PadType type) {
201 m_padType = type;
202 }
204
206
210 [[nodiscard]] s32 getAppliedHopStickX() const {
211 return canStartDrift() ? m_hopStickX : 0;
212 }
213
214 [[nodiscard]] f32 softSpeedLimit() const {
215 return m_softSpeedLimit;
216 }
217
218 [[nodiscard]] f32 speed() const {
219 return m_speed;
220 }
221
222 [[nodiscard]] f32 acceleration() const {
223 return m_acceleration;
224 }
225
226 [[nodiscard]] const EGG::Vector3f &scale() const {
227 return m_scale;
228 }
229
230 [[nodiscard]] f32 hardSpeedLimit() const {
231 return m_hardSpeedLimit;
232 }
233
234 [[nodiscard]] const EGG::Vector3f &smoothedUp() const {
235 return m_smoothedUp;
236 }
237
238 [[nodiscard]] const EGG::Vector3f &up() const {
239 return m_up;
240 }
241
242 [[nodiscard]] f32 totalScale() const {
243 return m_totalScale;
244 }
245
246 [[nodiscard]] f32 hitboxScale() const {
247 return m_hitboxScale;
248 }
249
250 [[nodiscard]] const EGG::Vector3f &dir() const {
251 return m_dir;
252 }
253
254 [[nodiscard]] const EGG::Vector3f &lastDir() const {
255 return m_lastDir;
256 }
257
258 [[nodiscard]] const EGG::Vector3f &vel1Dir() const {
259 return m_vel1Dir;
260 }
261
262 [[nodiscard]] f32 speedRatioCapped() const {
263 return m_speedRatioCapped;
264 }
265
266 [[nodiscard]] f32 speedRatio() const {
267 return m_speedRatio;
268 }
269
270 [[nodiscard]] u16 floorCollisionCount() const {
272 }
273
274 [[nodiscard]] s32 hopStickX() const {
275 return m_hopStickX;
276 }
277
278 [[nodiscard]] f32 hopPosY() const {
279 return m_hopPosY;
280 }
281
282 [[nodiscard]] s16 respawnTimer() const {
283 return m_respawnTimer;
284 }
285
286 [[nodiscard]] s16 respawnPostLandTimer() const {
288 }
289
290 [[nodiscard]] PadType &padType() {
291 return m_padType;
292 }
293
294 [[nodiscard]] KartJump *jump() const {
295 return m_jump;
296 }
297
298 [[nodiscard]] KartHalfPipe *halfPipe() const {
299 return m_halfPipe;
300 }
301
302 [[nodiscard]] KartScale *kartScale() const {
303 return m_kartScale;
304 }
305
306 [[nodiscard]] KartBurnout &burnout() {
307 return m_burnout;
308 }
310
311protected:
312 enum class eFlags {
313 Respawned = 0,
314 DriftReset = 1,
315 SsmtCharged = 2,
316 LaunchBoost = 4,
317 SsmtLeeway = 5,
318 TrickableSurface = 6,
319 WallBounce = 8,
320 };
321 typedef EGG::TBitFlag<u16, eFlags> Flags;
322
323 enum class DriftState {
324 NotDrifting = 0,
325 ChargingMt = 1,
326 ChargedMt = 2,
327 ChargingSmt = 2,
328 ChargedSmt = 3,
329 };
330
332 enum class DrivingDirection {
333 Forwards = 0,
334 Braking = 1,
336 Backwards = 3,
337 };
338
340 f32 minSpeed;
341 f32 maxSpeed;
342 f32 velY;
343 };
344
347 f32 hopVelY;
348 f32 stabilizationFactor;
349 f32 _8;
350 f32 boostRotFactor;
351 };
352
363 EGG::Vector3f m_landingDir;
364 EGG::Vector3f m_dir;
366 EGG::Vector3f m_vel1Dir;
367 EGG::Vector3f m_dirDiff;
368 bool m_hasLandingDir;
370 f32 m_landingAngle;
384 f32 m_standStillBoostRot;
385 DriftState m_driftState;
389 KartBoost m_boost;
390 s16 m_zipperBoostTimer;
391 s16 m_zipperBoostMax;
392 KartReject m_reject;
401 f32 m_hitboxScale;
404 u32 m_nonZipperAirtime;
406 f32 m_jumpPadMaxSpeed;
407 f32 m_jumpPadBoostMultiplier;
408 f32 m_jumpPadSoftSpeedLimit;
409 const JumpPadProperties *m_jumpPadProperties;
410 u16 m_rampBoost;
411 f32 m_autoDriftAngle;
412 s16 m_autoDriftStartFrameCounter;
413 f32 m_cannonEntryOfsLength;
414 EGG::Vector3f m_cannonEntryPos;
415 EGG::Vector3f m_cannonEntryOfs;
416 EGG::Vector3f m_cannonOrthog;
417 EGG::Vector3f m_cannonProgress;
424 s16 m_respawnTimer;
425 s16 m_bumpTimer;
428 PadType m_padType;
429 Flags m_flags;
430 KartJump *m_jump;
436};
437
442class KartMoveBike : public KartMove {
443public:
446 f32 leanRotShallowFactor;
447 f32 leanRotIncRace;
448 f32 leanRotCapRace;
449 f32 driftStickXFactor;
450 f32 leanRotMaxDrift;
451 f32 leanRotMinDrift;
452 f32 leanRotIncCountdown;
453 f32 leanRotCapCountdown;
454 f32 leanRotIncSSMT;
455 f32 leanRotCapSSMT;
456 f32 leanRotDecayFactor;
457 u16 maxWheelieFrames;
458 };
459
460 KartMoveBike();
462
463 virtual void startWheelie();
464 virtual void cancelWheelie();
465
466 void createSubsystems() override;
467 void calcVehicleRotation(f32 /*turn*/) override;
468 void calcWheelie() override;
469 void onHop() override;
470 void onWallCollision() override;
471 void calcMtCharge() override;
472 void initOob() override;
473 void setTurnParams() override;
474 void init(bool b1, bool b2) override;
475 void clear() override;
476
480 [[nodiscard]] f32 getWheelieSoftSpeedLimitBonus() const override {
481 constexpr f32 WHEELIE_SPEED_BONUS = 0.15f;
482 return state()->isWheelie() ? WHEELIE_SPEED_BONUS : 0.0f;
483 }
484
486 [[nodiscard]] f32 wheelieRotFactor() const {
487 constexpr f32 WHEELIE_ROTATION_FACTOR = 0.2f;
488
489 return state()->isWheelie() ? WHEELIE_ROTATION_FACTOR : 1.0f;
490 }
491
492 void tryStartWheelie();
493
496 [[nodiscard]] f32 leanRot() const override {
497 return m_leanRot;
498 }
499
502 [[nodiscard]] bool canWheelie() const override {
503 constexpr f32 WHEELIE_THRESHOLD = 0.3f;
504
505 return m_speedRatioCapped >= WHEELIE_THRESHOLD && m_speed >= 0.0f;
506 }
507
509
510private:
519 s16 m_autoHardStickXFrames;
521};
522
523} // 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:442
f32 m_leanRot
Z-axis rotation of the bike from leaning.
Definition KartMove.hh:511
f32 m_leanRotCap
The maximum leaning rotation.
Definition KartMove.hh:512
void calcWheelie() override
STAGE 1+ - Every frame, checks player input for wheelies and computes wheelie rotation.
Definition KartMove.cc:2471
void calcMtCharge() override
Every frame during a drift, calculates MT charge based on player input.
Definition KartMove.cc:2547
virtual void startWheelie()
STAGE 1+ - Sets the wheelie bit flag and some wheelie-related variables.
Definition KartMove.cc:2286
f32 m_wheelieRotDec
The wheelie rotation decrementor, used after a wheelie has ended.
Definition KartMove.hh:518
u32 m_wheelieFrames
Tracks wheelie duration and cancels the wheelie after 180 frames.
Definition KartMove.hh:516
f32 m_wheelieRot
X-axis rotation from wheeling.
Definition KartMove.hh:514
const TurningParameters * m_turningParams
Inside/outside drifting bike turn info.
Definition KartMove.hh:520
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:2426
f32 m_maxWheelieRot
The maximum wheelie rotation.
Definition KartMove.hh:515
void tryStartWheelie()
STAGE 1+ - Every frame, checks player input to see if we should start or stop a wheelie.
Definition KartMove.cc:2582
void onWallCollision() override
Called when you collide with a wall. All it does for bikes is cancel wheelies.
Definition KartMove.cc:2540
void onHop() override
Virtual function that just cancels wheelies when you hop.
Definition KartMove.cc:2530
f32 getWheelieSoftSpeedLimitBonus() const override
Returns what % to raise the speed cap when wheeling.
Definition KartMove.hh:480
bool canWheelie() const override
Checks if the kart is going fast enough to wheelie.
Definition KartMove.hh:502
void calcVehicleRotation(f32) override
Every frame, calculates rotation, EV, and angular velocity for the bike.
Definition KartMove.cc:2317
s16 m_wheelieCooldown
The number of frames before another wheelie can start.
Definition KartMove.hh:517
f32 m_leanRotInc
The incrementor for leaning rotation.
Definition KartMove.hh:513
virtual void cancelWheelie()
Clears the wheelie bit flag and resets the rotation decrement.
Definition KartMove.cc:2301
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:353
void calcRotation()
Every frame, calculates kart rotation based on player input.
Definition KartMove.cc:1108
s16 m_ssmtLeewayTimer
Frames to forgive letting go of A before clearing SSMT charge.
Definition KartMove.hh:395
s32 m_hopFrame
A timer that can prevent subsequent hops until reset.
Definition KartMove.hh:380
void calcDisableBackwardsAccel()
Computes the current cooldown duration between braking and reversing.
Definition KartMove.cc:694
EGG::Vector3f m_hopUp
The up vector when hopping.
Definition KartMove.hh:381
u16 m_mushroomBoostTimer
Number of frames until the mushroom boost runs out.
Definition KartMove.hh:402
void calcSpecialFloor()
Every frame, calculates any boost resulting from a boost panel.
Definition KartMove.cc:496
void calcWallCollisionStart(f32 param_2)
If we started to collide with a wall this frame, applies rotation.
Definition KartMove.cc:1505
KartHalfPipe * m_halfPipe
Pertains to zipper physics.
Definition KartMove.hh:431
f32 m_kclRotFactor
Float between 0-1 that scales the player's turning radius on offroad.
Definition KartMove.hh:375
f32 m_outsideDriftBonus
Added to angular velocity when outside drifting.
Definition KartMove.hh:388
void tryStartBoostRamp()
Sets offroad invincibility and and enables the ramp boost bitfield flag.
Definition KartMove.cc:1861
void calcDeceleration()
Definition KartMove.cc:1283
u16 m_smtCharge
A value between 0 and 300 representing current SMT charge.
Definition KartMove.hh:387
f32 m_speedRatio
The ratio between current speed and the player's base speed stat.
Definition KartMove.hh:373
@ 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:1877
f32 m_jumpPadMinSpeed
Snaps the player to a minimum speed when first touching a jump pad.
Definition KartMove.hh:405
f32 m_hopPosY
Relative position as the result of a hop. Starts at 0.
Definition KartMove.hh:419
DrivingDirection m_drivingDirection
Current state of driver's direction.
Definition KartMove.hh:426
u16 m_crushTimer
Number of frames until player will be uncrushed.
Definition KartMove.hh:403
bool calcPreDrift()
Each frame, checks for hop or slipdrift. Computes drift direction based on player input.
Definition KartMove.cc:764
f32 m_speed
Current speed, restricted to the soft speed limit.
Definition KartMove.hh:355
s16 m_offroadInvincibility
How many frames until the player is affected by offroad.
Definition KartMove.hh:393
void calcAirtimeTop()
Calculates rotation of the bike due to excessive airtime.
Definition KartMove.cc:473
void startManualDrift()
Called when the player lands from a drift hop, or to start a slipdrift.
Definition KartMove.cc:1008
void controlOutsideDriftAngle()
Every frame, handles mini-turbo charging and outside drifting bike rotation.
Definition KartMove.cc:1075
f32 m_softSpeedLimit
Base speed + boosts + wheelies, restricted to the hard speed limit.
Definition KartMove.hh:354
virtual void hop()
Initializes hop information, resets upwards EV and clears upwards force.
Definition KartMove.cc:1820
void calcStandstillBoostRot()
STAGE Computes the x-component of angular velocity based on the kart's speed.
Definition KartMove.cc:1564
EGG::Vector3f m_outsideDriftLastDir
Used to compute the next m_outsideDriftAngle.
Definition KartMove.hh:371
void calcManualDrift()
Each frame, handles hopping, drifting, and mini-turbos.
Definition KartMove.cc:932
virtual void calcMtCharge()
Every frame during a drift, calculates MT/SMT charge based on player input.
Definition KartMove.cc:1755
void calcSsmt()
Calculates standstill mini-turbo components, if applicable.
Definition KartMove.cc:709
void calcAcceleration()
Every frame, applies acceleration to the kart's internal velocity.
Definition KartMove.cc:1331
f32 m_processedSpeed
Offset 0x28. It's only ever just a copy of m_speed.
Definition KartMove.hh:357
void releaseMt()
Stops charging a mini-turbo, and applies boost if charged.
Definition KartMove.cc:1051
f32 m_kclSpeedFactor
Float between 0-1 that scales the player's speed on offroad.
Definition KartMove.hh:374
f32 m_weightedTurn
Magnitude+direction of stick input, factoring in the kart's stats.
Definition KartMove.hh:398
void calcVehicleSpeed()
Every frame, computes speed based on acceleration and any active boosts.
Definition KartMove.cc:1204
f32 m_lastSpeed
Last frame's speed, cached to calculate angular velocity.
Definition KartMove.hh:356
s16 m_ssmtDisableAccelTimer
Counter that tracks delay before starting to reverse.
Definition KartMove.hh:396
void calcOffroadInvincibility()
Checks a timer to see if we are still ignoring offroad slowdown.
Definition KartMove.cc:2030
KartBurnout m_burnout
Manages the state of start boost burnout.
Definition KartMove.hh:433
f32 calcVehicleAcceleration() const
Every frame, computes acceleration based off the character/vehicle stats.
Definition KartMove.cc:1297
void calcAutoDrift()
Each frame, handles automatic transmission drifting.
Definition KartMove.cc:880
f32 m_realTurn
The "true" turn magnitude. Equal to m_weightedTurn unless drifting.
Definition KartMove.hh:397
const DriftingParameters * m_driftingParams
Drift-type-specific parameters.
Definition KartMove.hh:434
void clearDrift()
Definition KartMove.cc:816
void calc()
Each frame, calculates the kart's movement.
Definition KartMove.cc:277
EGG::Vector3f m_up
Vector perpendicular to the floor, pointing upwards.
Definition KartMove.hh:362
s16 m_ssmtCharge
Increments every frame up to 75 when charging stand-still MT.
Definition KartMove.hh:394
f32 m_speedDragMultiplier
After 5 frames of airtime, this causes speed to slowly decay.
Definition KartMove.hh:360
u16 m_mtCharge
A value between 0 and 270 representing current MT charge.
Definition KartMove.hh:386
void calcSsmtStart()
Calculates whether we are starting a standstill mini-turbo.
Definition KartMove.cc:1661
s16 m_respawnPostLandTimer
Counts up to 4 if not accelerating after respawn landing.
Definition KartMove.hh:423
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:377
void resetDriftManual()
Clears drift state. Called when touching ground and drift is canceled.
Definition KartMove.cc:804
f32 m_totalScale
[Unused] Always 1.0f
Definition KartMove.hh:400
f32 m_acceleration
Captures the acceleration from player input and boosts.
Definition KartMove.hh:359
virtual void calcVehicleRotation(f32 turn)
Every frame, calculates rotation, EV, and angular velocity for the kart.
Definition KartMove.cc:1709
s16 m_respawnPreLandTimer
Counts down from 4 when pressing A before landing from respawn.
Definition KartMove.hh:422
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:383
f32 m_outsideDriftAngle
The facing angle of an outward-drifting vehicle.
Definition KartMove.hh:369
EGG::Vector3f m_lastDir
m_speed from the previous frame but with signed magnitude.
Definition KartMove.hh:365
EGG::Vector3f m_smoothedUp
A smoothed up vector, mostly used after significant airtime.
Definition KartMove.hh:361
s32 getAppliedHopStickX() const
Factors in vehicle speed to retrieve our hop direction and magnitude.
Definition KartMove.hh:210
u16 m_floorCollisionCount
The number of tires colliding with the floor.
Definition KartMove.hh:378
void calcDive()
Responds to player input to handle up/down kart tilt mid-air.
Definition KartMove.cc:1602
void calcOffroad()
Each frame, computes rotation and speed scalars from the floor KCL.
Definition KartMove.cc:639
KartScale * m_kartScale
Manages scaling due to TF stompers and MH cars.
Definition KartMove.hh:432
DrivingDirection
The direction the player is currently driving in.
Definition KartMove.hh:332
@ 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:421
s32 m_hopStickX
A ternary for the direction of our hop, 0 if still neutral hopping.
Definition KartMove.hh:379
s16 m_backwardsAllowCounter
Tracks the 15f delay before reversing.
Definition KartMove.hh:427
f32 calcWallCollisionSpeedFactor(f32 &f1)
Every frame, computes a speed scalar if we are colliding with a wall.
Definition KartMove.cc:1474
void calcMushroomBoost()
Checks a timer to see if we are still boosting from a mushroom.
Definition KartMove.cc:2044
f32 m_hopGravity
Always main gravity (-1.3f).
Definition KartMove.hh:420
f32 m_hopVelY
Relative velocity due to a hop. Starts at 10 and decreases with gravity.
Definition KartMove.hh:418
f32 m_hardSpeedLimit
Absolute speed cap. It's 120, unless you're in a bullet (140).
Definition KartMove.hh:358
void setInitialPhysicsValues(const EGG::Vector3f &position, const EGG::Vector3f &angles)
Initializes the kart's position and rotation. Calls tire suspension initializers.
Definition KartMove.cc:240
f32 m_rawTurn
Float in range [-1, 1]. Represents stick magnitude + direction.
Definition KartMove.hh:435
void setOffroadInvincibility(s16 timer)
Ignores offroad KCL collision for a set amount of time.
Definition KartMove.cc:2019
f32 m_speedRatioCapped
m_speedRatio but capped at 1.0f.
Definition KartMove.hh:372
EGG::Vector3f m_scale
Normally the unit vector, but may vary due to crush animations.
Definition KartMove.hh:399
f32 m_kclWheelSpeedFactor
The slowest speed multiplier of each wheel's floor collision.
Definition KartMove.hh:376
EGG::Vector3f m_hopDir
Used for outward drift. Tracks the forward vector of our rotation.
Definition KartMove.hh:382
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:445
Houses parameters that vary between the drift type (inward bike, outward bike, kart).
Definition KartMove.hh:346