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 void applyForce(f32 force, const EGG::Vector3f &hitDir, bool stop);
91 virtual void calcVehicleRotation(f32 turn);
92 virtual void hop();
93 virtual void onHop() {}
94 virtual void onWallCollision() {}
95 virtual void calcMtCharge();
96 virtual void initOob();
97
101 [[nodiscard]] virtual f32 getWheelieSoftSpeedLimitBonus() const {
102 return 0.0f;
103 }
104
106 virtual bool canWheelie() const {
107 return false;
108 }
109
111 virtual bool canHop() const {
112 const auto &status = KartObjectProxy::status();
113
115 return false;
116 }
117
118 if (status.onBit(eStatus::InAction)) {
119 return false;
120 }
121
122 return true;
123 }
124
129 bool canStartDrift() const {
130 return m_speed >= MINIMUM_DRIFT_THRESOLD * m_baseSpeed;
131 }
132
133 void tryStartBoostPanel();
134 void tryStartBoostRamp();
135 void tryStartJumpPad();
136 void tryEndJumpPad();
137 void cancelJumpPad();
138
139 void activateBoost(KartBoost::Type type, s16 frames);
140 void applyStartBoost(s16 frames);
141 void activateMushroom();
142 void activateZipperBoost();
143 void setOffroadInvincibility(s16 timer);
145 void calcMushroomBoost();
146 void calcZipperBoost();
147 void landTrick();
148 void activateCrush(u16 timer);
149 void calcCrushed();
150 void calcScale();
151 void applyBumpForce(f32 speed, const EGG::Vector3f &hitDir, bool resetSpeed);
152
153 void enterCannon();
154 void calcCannon();
155 void calcRotCannon(const EGG::Vector3f &forward);
156 void exitCannon();
157
158 void triggerRespawn();
159
161 void setSpeed(f32 val) {
162 m_speed = val;
163 }
164
165 void setSmoothedUp(const EGG::Vector3f &v) {
166 m_smoothedUp = v;
167 }
168
169 void setUp(const EGG::Vector3f &v) {
170 m_up = v;
171 }
172
173 void setDir(const EGG::Vector3f &v) {
174 m_dir = v;
175 }
176
177 void setVel1Dir(const EGG::Vector3f &v) {
178 m_vel1Dir = v;
179 }
180
181 void setFloorCollisionCount(u16 count) {
182 m_floorCollisionCount = count;
183 }
184
185 void setKCLWheelSpeedFactor(f32 val) {
187 }
188
189 void setKCLWheelRotFactor(f32 val) {
191 }
192
194 void setKartSpeedLimit() {
195 constexpr f32 LIMIT = 120.0f;
196 m_hardSpeedLimit = LIMIT;
197 }
198
200 void setScale(const EGG::Vector3f &v) {
201 m_scale = v;
202 }
203
204 void setPadType(PadType type) {
205 m_padType = type;
206 }
208
210
214 [[nodiscard]] s32 getAppliedHopStickX() const {
215 return canStartDrift() ? m_hopStickX : 0;
216 }
217
218 [[nodiscard]] f32 softSpeedLimit() const {
219 return m_softSpeedLimit;
220 }
221
222 [[nodiscard]] f32 speed() const {
223 return m_speed;
224 }
225
226 [[nodiscard]] f32 acceleration() const {
227 return m_acceleration;
228 }
229
230 [[nodiscard]] const EGG::Vector3f &scale() const {
231 return m_scale;
232 }
233
234 [[nodiscard]] f32 hardSpeedLimit() const {
235 return m_hardSpeedLimit;
236 }
237
238 [[nodiscard]] const EGG::Vector3f &smoothedUp() const {
239 return m_smoothedUp;
240 }
241
242 [[nodiscard]] const EGG::Vector3f &up() const {
243 return m_up;
244 }
245
246 [[nodiscard]] f32 totalScale() const {
247 return m_totalScale;
248 }
249
250 [[nodiscard]] f32 hitboxScale() const {
251 return m_hitboxScale;
252 }
253
254 [[nodiscard]] const EGG::Vector3f &dir() const {
255 return m_dir;
256 }
257
258 [[nodiscard]] const EGG::Vector3f &lastDir() const {
259 return m_lastDir;
260 }
261
262 [[nodiscard]] const EGG::Vector3f &vel1Dir() const {
263 return m_vel1Dir;
264 }
265
266 [[nodiscard]] f32 speedRatioCapped() const {
267 return m_speedRatioCapped;
268 }
269
270 [[nodiscard]] f32 speedRatio() const {
271 return m_speedRatio;
272 }
273
274 [[nodiscard]] u16 floorCollisionCount() const {
276 }
277
278 [[nodiscard]] s32 hopStickX() const {
279 return m_hopStickX;
280 }
281
282 [[nodiscard]] f32 hopPosY() const {
283 return m_hopPosY;
284 }
285
286 [[nodiscard]] s16 respawnTimer() const {
287 return m_respawnTimer;
288 }
289
290 [[nodiscard]] s16 respawnPostLandTimer() const {
292 }
293
294 [[nodiscard]] PadType &padType() {
295 return m_padType;
296 }
297
298 [[nodiscard]] KartJump *jump() const {
299 return m_jump;
300 }
301
302 [[nodiscard]] KartHalfPipe *halfPipe() const {
303 return m_halfPipe;
304 }
305
306 [[nodiscard]] KartScale *kartScale() const {
307 return m_kartScale;
308 }
309
310 [[nodiscard]] KartBurnout &burnout() {
311 return m_burnout;
312 }
314
315protected:
316 enum class eFlags {
317 Respawned = 0,
318 DriftReset = 1,
319 SsmtCharged = 2,
320 LaunchBoost = 4,
321 SsmtLeeway = 5,
322 TrickableSurface = 6,
323 WallBounce = 8,
324 };
325 typedef EGG::TBitFlag<u16, eFlags> Flags;
326
327 enum class DriftState {
328 NotDrifting = 0,
329 ChargingMt = 1,
330 ChargedMt = 2,
331 ChargingSmt = 2,
332 ChargedSmt = 3,
333 };
334
336 enum class DrivingDirection {
337 Forwards = 0,
338 Braking = 1,
340 Backwards = 3,
341 };
342
344 f32 minSpeed;
345 f32 maxSpeed;
346 f32 velY;
347 };
348
351 f32 hopVelY;
352 f32 stabilizationFactor;
353 f32 _8;
354 f32 boostRotFactor;
355 };
356
367 EGG::Vector3f m_landingDir;
368 EGG::Vector3f m_dir;
370 EGG::Vector3f m_vel1Dir;
371 EGG::Vector3f m_dirDiff;
372 bool m_hasLandingDir;
374 f32 m_landingAngle;
388 f32 m_standStillBoostRot;
389 DriftState m_driftState;
393 KartBoost m_boost;
394 s16 m_zipperBoostTimer;
395 s16 m_zipperBoostMax;
396 KartReject m_reject;
405 f32 m_hitboxScale;
408 u32 m_nonZipperAirtime;
410 f32 m_jumpPadMaxSpeed;
411 f32 m_jumpPadBoostMultiplier;
412 f32 m_jumpPadSoftSpeedLimit;
413 const JumpPadProperties *m_jumpPadProperties;
414 u16 m_rampBoost;
415 f32 m_autoDriftAngle;
416 s16 m_autoDriftStartFrameCounter;
417 f32 m_cannonEntryOfsLength;
418 EGG::Vector3f m_cannonEntryPos;
419 EGG::Vector3f m_cannonEntryOfs;
420 EGG::Vector3f m_cannonOrthog;
421 EGG::Vector3f m_cannonProgress;
428 s16 m_respawnTimer;
432 PadType m_padType;
433 Flags m_flags;
434 KartJump *m_jump;
440
441 static constexpr f32 MINIMUM_DRIFT_THRESOLD = 0.55f;
442};
443
448class KartMoveBike : public KartMove {
449public:
452 f32 leanRotShallowFactor;
453 f32 leanRotIncRace;
454 f32 leanRotCapRace;
455 f32 driftStickXFactor;
456 f32 leanRotMaxDrift;
457 f32 leanRotMinDrift;
458 f32 leanRotIncCountdown;
459 f32 leanRotCapCountdown;
460 f32 leanRotIncSSMT;
461 f32 leanRotCapSSMT;
462 f32 leanRotDecayFactor;
463 u16 maxWheelieFrames;
464 };
465
466 KartMoveBike();
468
469 virtual void startWheelie();
470 virtual void cancelWheelie();
471
472 void createSubsystems() override;
473 void calcVehicleRotation(f32 /*turn*/) override;
474 void calcWheelie() override;
475 void onHop() override;
476 void onWallCollision() override;
477 void calcMtCharge() override;
478 void initOob() override;
479 void setTurnParams() override;
480 void init(bool b1, bool b2) override;
481 void clear() override;
482
486 [[nodiscard]] f32 getWheelieSoftSpeedLimitBonus() const override {
487 constexpr f32 WHEELIE_SPEED_BONUS = 0.15f;
488 return status().onBit(eStatus::Wheelie) ? WHEELIE_SPEED_BONUS : 0.0f;
489 }
490
492 [[nodiscard]] f32 wheelieRotFactor() const {
493 constexpr f32 WHEELIE_ROTATION_FACTOR = 0.2f;
494
495 return status().onBit(eStatus::Wheelie) ? WHEELIE_ROTATION_FACTOR : 1.0f;
496 }
497
498 void tryStartWheelie();
499
502 [[nodiscard]] f32 leanRot() const override {
503 return m_leanRot;
504 }
505
508 [[nodiscard]] bool canWheelie() const override {
509 constexpr f32 WHEELIE_THRESHOLD = 0.3f;
510
511 return m_speedRatioCapped >= WHEELIE_THRESHOLD && m_speed >= 0.0f;
512 }
513
515
516private:
525 s16 m_autoHardStickXFrames;
527};
528
529} // namespace Kart
constexpr bool onBit(Es... es) const
Checks if any of the corresponding bits for the provided enum values are on.
Definition BitFlag.hh:379
constexpr bool offAnyBit(Es... es) const
Checks if any of the corresponding bits for the provided enum values are off.
Definition BitFlag.hh:434
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:448
f32 m_leanRot
Z-axis rotation of the bike from leaning.
Definition KartMove.hh:517
f32 m_leanRotCap
The maximum leaning rotation.
Definition KartMove.hh:518
void calcWheelie() override
STAGE 1+ - Every frame, checks player input for wheelies and computes wheelie rotation.
Definition KartMove.cc:2558
void calcMtCharge() override
Every frame during a drift, calculates MT charge based on player input.
Definition KartMove.cc:2636
virtual void startWheelie()
STAGE 1+ - Sets the wheelie bit flag and some wheelie-related variables.
Definition KartMove.cc:2372
f32 m_wheelieRotDec
The wheelie rotation decrementor, used after a wheelie has ended.
Definition KartMove.hh:524
u32 m_wheelieFrames
Tracks wheelie duration and cancels the wheelie after 180 frames.
Definition KartMove.hh:522
f32 m_wheelieRot
X-axis rotation from wheeling.
Definition KartMove.hh:520
const TurningParameters * m_turningParams
Inside/outside drifting bike turn info.
Definition KartMove.hh:526
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:2513
f32 m_maxWheelieRot
The maximum wheelie rotation.
Definition KartMove.hh:521
void tryStartWheelie()
STAGE 1+ - Every frame, checks player input to see if we should start or stop a wheelie.
Definition KartMove.cc:2671
void onWallCollision() override
Called when you collide with a wall. All it does for bikes is cancel wheelies.
Definition KartMove.cc:2629
void onHop() override
Virtual function that just cancels wheelies when you hop.
Definition KartMove.cc:2619
f32 getWheelieSoftSpeedLimitBonus() const override
Returns what % to raise the speed cap when wheeling.
Definition KartMove.hh:486
bool canWheelie() const override
Checks if the kart is going fast enough to wheelie.
Definition KartMove.hh:508
void calcVehicleRotation(f32) override
Every frame, calculates rotation, EV, and angular velocity for the bike.
Definition KartMove.cc:2403
s16 m_wheelieCooldown
The number of frames before another wheelie can start.
Definition KartMove.hh:523
f32 m_leanRotInc
The incrementor for leaning rotation.
Definition KartMove.hh:519
virtual void cancelWheelie()
Clears the wheelie bit flag and resets the rotation decrement.
Definition KartMove.cc:2387
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:357
void calcRotation()
Every frame, calculates kart rotation based on player input.
Definition KartMove.cc:1140
s16 m_ssmtLeewayTimer
Frames to forgive letting go of A before clearing SSMT charge.
Definition KartMove.hh:399
s32 m_hopFrame
A timer that can prevent subsequent hops until reset.
Definition KartMove.hh:384
void calcDisableBackwardsAccel()
Computes the current cooldown duration between braking and reversing.
Definition KartMove.cc:714
EGG::Vector3f m_hopUp
The up vector when hopping.
Definition KartMove.hh:385
u16 m_mushroomBoostTimer
Number of frames until the mushroom boost runs out.
Definition KartMove.hh:406
void calcSpecialFloor()
Every frame, calculates any boost resulting from a boost panel.
Definition KartMove.cc:506
void calcWallCollisionStart(f32 param_2)
If we started to collide with a wall this frame, applies rotation.
Definition KartMove.cc:1547
KartHalfPipe * m_halfPipe
Pertains to zipper physics.
Definition KartMove.hh:435
f32 m_kclRotFactor
Float between 0-1 that scales the player's turning radius on offroad.
Definition KartMove.hh:379
f32 m_outsideDriftBonus
Added to angular velocity when outside drifting.
Definition KartMove.hh:392
void tryStartBoostRamp()
Sets offroad invincibility and and enables the ramp boost bitfield flag.
Definition KartMove.cc:1931
void calcDeceleration()
Definition KartMove.cc:1320
u16 m_smtCharge
A value between 0 and 300 representing current SMT charge.
Definition KartMove.hh:391
f32 m_speedRatio
The ratio between current speed and the player's base speed stat.
Definition KartMove.hh:377
@ 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:1949
f32 m_jumpPadMinSpeed
Snaps the player to a minimum speed when first touching a jump pad.
Definition KartMove.hh:409
f32 m_hopPosY
Relative position as the result of a hop. Starts at 0.
Definition KartMove.hh:423
DrivingDirection m_drivingDirection
Current state of driver's direction.
Definition KartMove.hh:430
u16 m_crushTimer
Number of frames until player will be uncrushed.
Definition KartMove.hh:407
bool calcPreDrift()
Each frame, checks for hop or slipdrift. Computes drift direction based on player input.
Definition KartMove.cc:788
f32 m_speed
Current speed, restricted to the soft speed limit.
Definition KartMove.hh:359
s16 m_offroadInvincibility
How many frames until the player is affected by offroad.
Definition KartMove.hh:397
void calcAirtimeTop()
Calculates rotation of the bike due to excessive airtime.
Definition KartMove.cc:481
void startManualDrift()
Called when the player lands from a drift hop, or to start a slipdrift.
Definition KartMove.cc:1039
void controlOutsideDriftAngle()
Every frame, handles mini-turbo charging and outside drifting bike rotation.
Definition KartMove.cc:1107
f32 m_softSpeedLimit
Base speed + boosts + wheelies, restricted to the hard speed limit.
Definition KartMove.hh:358
virtual void hop()
Initializes hop information, resets upwards EV and clears upwards force.
Definition KartMove.cc:1891
void calcStandstillBoostRot()
STAGE Computes the x-component of angular velocity based on the kart's speed.
Definition KartMove.cc:1613
EGG::Vector3f m_outsideDriftLastDir
Used to compute the next m_outsideDriftAngle.
Definition KartMove.hh:375
void calcManualDrift()
Each frame, handles hopping, drifting, and mini-turbos.
Definition KartMove.cc:957
virtual void calcMtCharge()
Every frame during a drift, calculates MT/SMT charge based on player input.
Definition KartMove.cc:1826
void calcSsmt()
Calculates standstill mini-turbo components, if applicable.
Definition KartMove.cc:731
void calcAcceleration()
Every frame, applies acceleration to the kart's internal velocity.
Definition KartMove.cc:1368
f32 m_processedSpeed
Offset 0x28. It's only ever just a copy of m_speed.
Definition KartMove.hh:361
void releaseMt()
Stops charging a mini-turbo, and applies boost if charged.
Definition KartMove.cc:1081
f32 m_kclSpeedFactor
Float between 0-1 that scales the player's speed on offroad.
Definition KartMove.hh:378
f32 m_weightedTurn
Magnitude+direction of stick input, factoring in the kart's stats.
Definition KartMove.hh:402
void calcVehicleSpeed()
Every frame, computes speed based on acceleration and any active boosts.
Definition KartMove.cc:1237
f32 m_lastSpeed
Last frame's speed, cached to calculate angular velocity.
Definition KartMove.hh:360
s16 m_ssmtDisableAccelTimer
Counter that tracks delay before starting to reverse.
Definition KartMove.hh:400
void calcOffroadInvincibility()
Checks a timer to see if we are still ignoring offroad slowdown.
Definition KartMove.cc:2108
KartBurnout m_burnout
Manages the state of start boost burnout.
Definition KartMove.hh:437
f32 calcVehicleAcceleration() const
Every frame, computes acceleration based off the character/vehicle stats.
Definition KartMove.cc:1334
void calcAutoDrift()
Each frame, handles automatic transmission drifting.
Definition KartMove.cc:902
f32 m_realTurn
The "true" turn magnitude. Equal to m_weightedTurn unless drifting.
Definition KartMove.hh:401
const DriftingParameters * m_driftingParams
Drift-type-specific parameters.
Definition KartMove.hh:438
void clearDrift()
Definition KartMove.cc:841
void calc()
Each frame, calculates the kart's movement.
Definition KartMove.cc:281
EGG::Vector3f m_up
Vector perpendicular to the floor, pointing upwards.
Definition KartMove.hh:366
s16 m_ssmtCharge
Increments every frame up to 75 when charging stand-still MT.
Definition KartMove.hh:398
f32 m_speedDragMultiplier
After 5 frames of airtime, this causes speed to slowly decay.
Definition KartMove.hh:364
u16 m_mtCharge
A value between 0 and 270 representing current MT charge.
Definition KartMove.hh:390
void calcSsmtStart()
Calculates whether we are starting a standstill mini-turbo.
Definition KartMove.cc:1714
s16 m_respawnPostLandTimer
Counts up to 4 if not accelerating after respawn landing.
Definition KartMove.hh:427
virtual f32 getWheelieSoftSpeedLimitBonus() const
Returns the % speed boost from wheelies. For karts, this is always 0.
Definition KartMove.hh:101
f32 m_kclWheelRotFactor
The slowest rotation multiplier of each wheel's floor collision.
Definition KartMove.hh:381
void resetDriftManual()
Clears drift state. Called when touching ground and drift is canceled.
Definition KartMove.cc:830
f32 m_totalScale
[Unused] Always 1.0f
Definition KartMove.hh:404
f32 m_acceleration
Captures the acceleration from player input and boosts.
Definition KartMove.hh:363
virtual void calcVehicleRotation(f32 turn)
Every frame, calculates rotation, EV, and angular velocity for the kart.
Definition KartMove.cc:1778
s16 m_respawnPreLandTimer
Counts down from 4 when pressing A before landing from respawn.
Definition KartMove.hh:426
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:387
f32 m_outsideDriftAngle
The facing angle of an outward-drifting vehicle.
Definition KartMove.hh:373
EGG::Vector3f m_lastDir
m_speed from the previous frame but with signed magnitude.
Definition KartMove.hh:369
EGG::Vector3f m_smoothedUp
A smoothed up vector, mostly used after significant airtime.
Definition KartMove.hh:365
bool canStartDrift() const
Definition KartMove.hh:129
s32 getAppliedHopStickX() const
Factors in vehicle speed to retrieve our hop direction and magnitude.
Definition KartMove.hh:214
u16 m_floorCollisionCount
The number of tires colliding with the floor.
Definition KartMove.hh:382
void calcDive()
Responds to player input to handle up/down kart tilt mid-air.
Definition KartMove.cc:1653
void calcOffroad()
Each frame, computes rotation and speed scalars from the floor KCL.
Definition KartMove.cc:653
s16 m_bumpTimer
Set when a Reaction::SmallBump collision occurs.
Definition KartMove.hh:429
KartScale * m_kartScale
Manages scaling due to TF stompers and MH cars.
Definition KartMove.hh:436
DrivingDirection
The direction the player is currently driving in.
Definition KartMove.hh:336
@ 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:425
s32 m_hopStickX
A ternary for the direction of our hop, 0 if still neutral hopping.
Definition KartMove.hh:383
s16 m_backwardsAllowCounter
Tracks the 15f delay before reversing.
Definition KartMove.hh:431
f32 calcWallCollisionSpeedFactor(f32 &f1)
Every frame, computes a speed scalar if we are colliding with a wall.
Definition KartMove.cc:1514
void calcMushroomBoost()
Checks a timer to see if we are still boosting from a mushroom.
Definition KartMove.cc:2124
f32 m_hopGravity
Always main gravity (-1.3f).
Definition KartMove.hh:424
f32 m_hopVelY
Relative velocity due to a hop. Starts at 10 and decreases with gravity.
Definition KartMove.hh:422
f32 m_hardSpeedLimit
Absolute speed cap. It's 120, unless you're in a bullet (140).
Definition KartMove.hh:362
void setInitialPhysicsValues(const EGG::Vector3f &position, const EGG::Vector3f &angles)
Initializes the kart's position and rotation. Calls tire suspension initializers.
Definition KartMove.cc:244
f32 m_rawTurn
Float in range [-1, 1]. Represents stick magnitude + direction.
Definition KartMove.hh:439
void setOffroadInvincibility(s16 timer)
Ignores offroad KCL collision for a set amount of time.
Definition KartMove.cc:2097
f32 m_speedRatioCapped
m_speedRatio but capped at 1.0f.
Definition KartMove.hh:376
EGG::Vector3f m_scale
Normally the unit vector, but may vary due to crush animations.
Definition KartMove.hh:403
f32 m_kclWheelSpeedFactor
The slowest speed multiplier of each wheel's floor collision.
Definition KartMove.hh:380
EGG::Vector3f m_hopDir
Used for outward drift. Tracks the forward vector of our rotation.
Definition KartMove.hh:386
Base class for most kart-related objects.
Pertains to handling reject road.
Definition KartReject.hh:12
Mainly responsible for calculating scaling for the squish/unsquish animation.
Definition KartScale.hh:8
Pertains to kart-related functionality.
@ Wheelie
Set while we are in a wheelie (even during the countdown).
@ HopStart
Set if m_bDriftInput was toggled on this frame.
@ TouchingGround
Set when any part of the vehicle is colliding with floor KCL.
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:21
A 3D float vector.
Definition Vector.hh:88
Represents turning information which differs only between inside/outside drift.
Definition KartMove.hh:451
Houses parameters that vary between the drift type (inward bike, outward bike, kart).
Definition KartMove.hh:350