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/KartParam.hh"
8#include "game/kart/KartReject.hh"
9#include "game/kart/KartState.hh"
10
11#include "game/field/CourseColMgr.hh"
12
13#include <egg/core/BitFlag.hh>
14
15namespace Kart {
16
19class KartMove : protected KartObjectProxy {
20public:
21 enum class ePadType {
22 BoostPanel = 0,
23 BoostRamp = 1,
24 JumpPad = 2,
25 };
26
28
29 KartMove();
30 virtual ~KartMove();
31
32 virtual void createSubsystems(const KartParam::Stats &stats);
33 virtual void calcTurn();
34 virtual void calcWheelie() {}
35 virtual void setTurnParams();
36 virtual void init(bool b1, bool b2);
37 virtual void clear();
38
40 [[nodiscard]] virtual f32 leanRot() const {
41 return 0.0f;
42 }
43
44 void setInitialPhysicsValues(const EGG::Vector3f &position, const EGG::Vector3f &angles);
45 void resetDriftManual();
46
47 void calc();
48 void calcRespawnStart();
49 void calcInRespawn();
50 void calcRespawnBoost();
51 void calcTop();
52 void calcAirtimeTop();
53 void calcSpecialFloor();
54 void calcDirs();
55 void calcStickyRoad();
56 void calcOffroad();
57 void calcRisingWater();
58 void calcBoost();
59 void calcRampBoost();
61 void calcSsmt();
62 bool calcPreDrift();
63 void calcAutoDrift();
64 void calcManualDrift();
65 void startManualDrift();
66 void clearDrift();
67 void clearJumpPad();
68 void clearRampBoost();
69 void clearZipperBoost();
70 void clearBoost();
71 void clearSsmt();
72 void clearOffroadInvincibility();
73 void clearRejectRoad();
74 void releaseMt();
76 void calcRotation();
77 void calcVehicleSpeed();
78 void calcDeceleration();
79 [[nodiscard]] f32 calcVehicleAcceleration() const;
80 void calcAcceleration();
81 [[nodiscard]] f32 calcWallCollisionSpeedFactor(f32 &f1);
82 void calcWallCollisionStart(f32 param_2);
84 void calcDive();
85 void calcSsmtStart();
86 void calcHopPhysics();
87 void calcRejectRoad();
88 bool calcZipperCollision(f32 radius, f32 scale, EGG::Vector3f &pos, EGG::Vector3f &upLocal,
89 const EGG::Vector3f &prevPos, Field::CollisionInfo *colInfo,
90 Field::KCLTypeMask *maskOut, Field::KCLTypeMask flags) const;
91 f32 calcSlerpRate(f32 scale, const EGG::Quatf &from, const EGG::Quatf &to) const;
92 void applyForce(f32 force, const EGG::Vector3f &hitDir, bool stop);
93 virtual void calcVehicleRotation(f32 turn);
94 virtual void hop();
95 virtual void onHop() {}
96 virtual void onWallCollision() {}
97 virtual void calcMtCharge();
98 virtual void initOob();
99
103 [[nodiscard]] virtual f32 getWheelieSoftSpeedLimitBonus() const {
104 return 0.0f;
105 }
106
108 virtual bool canWheelie() const {
109 return false;
110 }
111
113 virtual bool canHop() const {
114 const auto &status = KartObjectProxy::status();
115
117 return false;
118 }
119
120 if (status.onBit(eStatus::InAction)) {
121 return false;
122 }
123
124 return true;
125 }
126
131 bool canStartDrift() const {
132 return m_speed >= MINIMUM_DRIFT_THRESOLD * m_baseSpeed;
133 }
134
135 void tryStartBoostPanel();
136 void tryStartBoostRamp();
137 void tryStartJumpPad();
138 void tryEndJumpPad();
139 void cancelJumpPad();
140
141 void activateBoost(KartBoost::Type type, s16 frames);
142 void applyStartBoost(s16 frames);
143 void activateMushroom();
144 void activateZipperBoost();
145 void setOffroadInvincibility(s16 timer);
147 void calcMushroomBoost();
148 void calcZipperBoost();
149 void landTrick();
150 void activateCrush(u16 timer);
151 void calcCrushed();
152 void calcScale();
153
155 void activateShrink() {
156 applyShrink(300);
157 }
158
159 void applyShrink(u16 timer);
160 void calcShock();
161 void deactivateShock(bool resetSpeed);
162
163 void enterCannon();
164 void calcCannon();
165 void calcRotCannon(const EGG::Vector3f &forward);
166 void exitCannon();
167
168 void triggerRespawn();
169
171 void setSpeed(f32 val) {
172 m_speed = val;
173 }
174
175 void setSmoothedUp(const EGG::Vector3f &v) {
176 m_smoothedUp = v;
177 }
178
179 void setUp(const EGG::Vector3f &v) {
180 m_up = v;
181 }
182
183 void setDir(const EGG::Vector3f &v) {
184 m_dir = v;
185 }
186
187 void setVel1Dir(const EGG::Vector3f &v) {
188 m_vel1Dir = v;
189 }
190
191 void setFloorCollisionCount(u16 count) {
192 m_floorCollisionCount = count;
193 }
194
195 void setKCLWheelSpeedFactor(f32 val) {
197 }
198
199 void setKCLWheelRotFactor(f32 val) {
201 }
202
204 void setKartSpeedLimit() {
205 constexpr f32 LIMIT = 120.0f;
206 m_hardSpeedLimit = LIMIT;
207 }
208
210 void setScale(const EGG::Vector3f &v) {
211 m_scale = v;
212 }
213
214 void setPadType(PadType type) {
215 m_padType = type;
216 }
218
220
224 [[nodiscard]] s32 getAppliedHopStickX() const {
225 return canStartDrift() ? m_hopStickX : 0;
226 }
227
228 [[nodiscard]] f32 softSpeedLimit() const {
229 return m_softSpeedLimit;
230 }
231
232 [[nodiscard]] f32 speed() const {
233 return m_speed;
234 }
235
236 [[nodiscard]] f32 acceleration() const {
237 return m_acceleration;
238 }
239
240 [[nodiscard]] const EGG::Vector3f &scale() const {
241 return m_scale;
242 }
243
244 [[nodiscard]] f32 hardSpeedLimit() const {
245 return m_hardSpeedLimit;
246 }
247
248 [[nodiscard]] const EGG::Vector3f &smoothedUp() const {
249 return m_smoothedUp;
250 }
251
252 [[nodiscard]] const EGG::Vector3f &up() const {
253 return m_up;
254 }
255
256 [[nodiscard]] f32 totalScale() const {
257 return m_totalScale;
258 }
259
260 [[nodiscard]] f32 hitboxScale() const {
261 return m_hitboxScale;
262 }
263
264 [[nodiscard]] const EGG::Vector3f &dir() const {
265 return m_dir;
266 }
267
268 [[nodiscard]] const EGG::Vector3f &lastDir() const {
269 return m_lastDir;
270 }
271
272 [[nodiscard]] const EGG::Vector3f &vel1Dir() const {
273 return m_vel1Dir;
274 }
275
276 [[nodiscard]] f32 speedRatioCapped() const {
277 return m_speedRatioCapped;
278 }
279
280 [[nodiscard]] f32 speedRatio() const {
281 return m_speedRatio;
282 }
283
284 [[nodiscard]] u16 floorCollisionCount() const {
286 }
287
288 [[nodiscard]] s32 hopStickX() const {
289 return m_hopStickX;
290 }
291
292 [[nodiscard]] f32 hopPosY() const {
293 return m_hopPosY;
294 }
295
296 [[nodiscard]] s16 respawnTimer() const {
297 return m_respawnTimer;
298 }
299
300 [[nodiscard]] s16 respawnPostLandTimer() const {
302 }
303
304 [[nodiscard]] PadType &padType() {
305 return m_padType;
306 }
307
308 [[nodiscard]] KartJump *jump() const {
309 return m_jump;
310 }
311
312 [[nodiscard]] KartHalfPipe *halfPipe() const {
313 return m_halfPipe;
314 }
315
316 [[nodiscard]] KartScale *kartScale() const {
317 return m_kartScale;
318 }
319
320 [[nodiscard]] KartBurnout &burnout() {
321 return m_burnout;
322 }
324
325protected:
326 enum class eFlags {
327 Respawned = 0,
328 DriftReset = 1,
329 SsmtCharged = 2,
330 LaunchBoost = 4,
331 SsmtLeeway = 5,
332 TrickableSurface = 6,
333 WallBounce = 8,
334 };
335 typedef EGG::TBitFlag<u16, eFlags> Flags;
336
337 enum class DriftState {
338 NotDrifting = 0,
339 ChargingMt = 1,
340 ChargedMt = 2,
341 ChargingSmt = 2,
342 ChargedSmt = 3,
343 };
344
346 enum class DrivingDirection {
347 Forwards = 0,
348 Braking = 1,
350 Backwards = 3,
351 };
352
354 f32 minSpeed;
355 f32 maxSpeed;
356 f32 velY;
357 };
358
361 f32 hopVelY;
362 f32 stabilizationFactor;
363 f32 _8;
364 f32 boostRotFactor;
365 };
366
377 EGG::Vector3f m_landingDir;
378 EGG::Vector3f m_dir;
380 EGG::Vector3f m_vel1Dir;
381 EGG::Vector3f m_dirDiff;
382 bool m_hasLandingDir;
384 f32 m_landingAngle;
398 f32 m_standStillBoostRot;
399 DriftState m_driftState;
403 KartBoost m_boost;
404 s16 m_zipperBoostTimer;
405 s16 m_zipperBoostMax;
406 KartReject m_reject;
415 f32 m_hitboxScale;
416 f32 m_shockSpeedMultiplier;
418 f32 m_invScale;
419 u16 m_shockTimer;
421 u32 m_nonZipperAirtime;
423 f32 m_jumpPadMaxSpeed;
424 f32 m_jumpPadBoostMultiplier;
425 f32 m_jumpPadSoftSpeedLimit;
426 const JumpPadProperties *m_jumpPadProperties;
427 u16 m_rampBoost;
428 f32 m_autoDriftAngle;
429 s16 m_autoDriftStartFrameCounter;
430 f32 m_cannonEntryOfsLength;
431 EGG::Vector3f m_cannonEntryPos;
432 EGG::Vector3f m_cannonEntryOfs;
433 EGG::Vector3f m_cannonOrthog;
434 EGG::Vector3f m_cannonProgress;
441 s16 m_respawnTimer;
445 PadType m_padType;
446 Flags m_flags;
447 KartJump *m_jump;
453
454 static constexpr f32 MINIMUM_DRIFT_THRESOLD = 0.55f;
455};
456
461class KartMoveBike : public KartMove {
462public:
465 f32 leanRotShallowFactor;
466 f32 leanRotIncRace;
467 f32 leanRotCapRace;
468 f32 driftStickXFactor;
469 f32 leanRotMaxDrift;
470 f32 leanRotMinDrift;
471 f32 leanRotIncCountdown;
472 f32 leanRotCapCountdown;
473 f32 leanRotIncSSMT;
474 f32 leanRotCapSSMT;
475 f32 leanRotDecayFactor;
476 u16 maxWheelieFrames;
477 };
478
479 KartMoveBike();
481
482 virtual void startWheelie();
483 virtual void cancelWheelie();
484
485 void createSubsystems(const KartParam::Stats &stats) override;
486 void calcVehicleRotation(f32 /*turn*/) override;
487 void calcWheelie() override;
488 void onHop() override;
489 void onWallCollision() override;
490 void calcMtCharge() override;
491 void initOob() override;
492 void setTurnParams() override;
493 void init(bool b1, bool b2) override;
494 void clear() override;
495
499 [[nodiscard]] f32 getWheelieSoftSpeedLimitBonus() const override {
500 constexpr f32 WHEELIE_SPEED_BONUS = 0.15f;
501 return status().onBit(eStatus::Wheelie) ? WHEELIE_SPEED_BONUS : 0.0f;
502 }
503
505 [[nodiscard]] f32 wheelieRotFactor() const {
506 constexpr f32 WHEELIE_ROTATION_FACTOR = 0.2f;
507
508 return status().onBit(eStatus::Wheelie) ? WHEELIE_ROTATION_FACTOR : 1.0f;
509 }
510
511 void tryStartWheelie();
512
515 [[nodiscard]] f32 leanRot() const override {
516 return m_leanRot;
517 }
518
521 [[nodiscard]] bool canWheelie() const override {
522 constexpr f32 WHEELIE_THRESHOLD = 0.3f;
523
524 return m_speedRatioCapped >= WHEELIE_THRESHOLD && m_speed >= 0.0f;
525 }
526
528
529private:
538 s16 m_autoHardStickXFrames;
540};
541
542} // 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:461
f32 m_leanRot
Z-axis rotation of the bike from leaning.
Definition KartMove.hh:530
f32 m_leanRotCap
The maximum leaning rotation.
Definition KartMove.hh:531
void calcWheelie() override
STAGE 1+ - Every frame, checks player input for wheelies and computes wheelie rotation.
Definition KartMove.cc:2657
void calcMtCharge() override
Every frame during a drift, calculates MT charge based on player input.
Definition KartMove.cc:2735
virtual void startWheelie()
STAGE 1+ - Sets the wheelie bit flag and some wheelie-related variables.
Definition KartMove.cc:2471
f32 m_wheelieRotDec
The wheelie rotation decrementor, used after a wheelie has ended.
Definition KartMove.hh:537
u32 m_wheelieFrames
Tracks wheelie duration and cancels the wheelie after 180 frames.
Definition KartMove.hh:535
f32 m_wheelieRot
X-axis rotation from wheeling.
Definition KartMove.hh:533
const TurningParameters * m_turningParams
Inside/outside drifting bike turn info.
Definition KartMove.hh:539
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:2612
f32 m_maxWheelieRot
The maximum wheelie rotation.
Definition KartMove.hh:534
void tryStartWheelie()
STAGE 1+ - Every frame, checks player input to see if we should start or stop a wheelie.
Definition KartMove.cc:2770
void onWallCollision() override
Called when you collide with a wall. All it does for bikes is cancel wheelies.
Definition KartMove.cc:2728
void onHop() override
Virtual function that just cancels wheelies when you hop.
Definition KartMove.cc:2718
f32 getWheelieSoftSpeedLimitBonus() const override
Returns what % to raise the speed cap when wheeling.
Definition KartMove.hh:499
bool canWheelie() const override
Checks if the kart is going fast enough to wheelie.
Definition KartMove.hh:521
void calcVehicleRotation(f32) override
Every frame, calculates rotation, EV, and angular velocity for the bike.
Definition KartMove.cc:2502
s16 m_wheelieCooldown
The number of frames before another wheelie can start.
Definition KartMove.hh:536
f32 m_leanRotInc
The incrementor for leaning rotation.
Definition KartMove.hh:532
virtual void cancelWheelie()
Clears the wheelie bit flag and resets the rotation decrement.
Definition KartMove.cc:2486
Responsible for reacting to player inputs and moving the kart.
Definition KartMove.hh:19
f32 m_baseSpeed
The speed associated with the current character/vehicle stats.
Definition KartMove.hh:367
void calcRotation()
Every frame, calculates kart rotation based on player input.
Definition KartMove.cc:1184
s16 m_ssmtLeewayTimer
Frames to forgive letting go of A before clearing SSMT charge.
Definition KartMove.hh:409
s32 m_hopFrame
A timer that can prevent subsequent hops until reset.
Definition KartMove.hh:394
void calcDisableBackwardsAccel()
Computes the current cooldown duration between braking and reversing.
Definition KartMove.cc:758
EGG::Vector3f m_hopUp
The up vector when hopping.
Definition KartMove.hh:395
u16 m_mushroomBoostTimer
Number of frames until the mushroom boost runs out.
Definition KartMove.hh:417
void calcSpecialFloor()
Every frame, calculates any boost resulting from a boost panel.
Definition KartMove.cc:513
void calcWallCollisionStart(f32 param_2)
If we started to collide with a wall this frame, applies rotation.
Definition KartMove.cc:1606
KartHalfPipe * m_halfPipe
Pertains to zipper physics.
Definition KartMove.hh:448
f32 m_kclRotFactor
Float between 0-1 that scales the player's turning radius on offroad.
Definition KartMove.hh:389
f32 m_outsideDriftBonus
Added to angular velocity when outside drifting.
Definition KartMove.hh:402
void tryStartBoostRamp()
Sets offroad invincibility and enables the ramp boost bitfield flag.
Definition KartMove.cc:1993
void calcDeceleration()
Definition KartMove.cc:1373
u16 m_smtCharge
A value between 0 and 300 representing current SMT charge.
Definition KartMove.hh:401
f32 m_speedRatio
The ratio between current speed and the player's base speed stat.
Definition KartMove.hh:387
@ 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:2011
f32 m_jumpPadMinSpeed
Snaps the player to a minimum speed when first touching a jump pad.
Definition KartMove.hh:422
f32 m_hopPosY
Relative position as the result of a hop. Starts at 0.
Definition KartMove.hh:436
DrivingDirection m_drivingDirection
Current state of driver's direction.
Definition KartMove.hh:443
u16 m_crushTimer
Number of frames until player will be uncrushed.
Definition KartMove.hh:420
bool calcPreDrift()
Each frame, checks for hop or slipdrift. Computes drift direction based on player input.
Definition KartMove.cc:832
f32 m_speed
Current speed, restricted to the soft speed limit.
Definition KartMove.hh:369
s16 m_offroadInvincibility
How many frames until the player is affected by offroad.
Definition KartMove.hh:407
void calcAirtimeTop()
Calculates rotation of the bike due to excessive airtime.
Definition KartMove.cc:488
void startManualDrift()
Called when the player lands from a drift hop, or to start a slipdrift.
Definition KartMove.cc:1083
void controlOutsideDriftAngle()
Every frame, handles mini-turbo charging and outside drifting bike rotation.
Definition KartMove.cc:1151
f32 m_softSpeedLimit
Base speed + boosts + wheelies, restricted to the hard speed limit.
Definition KartMove.hh:368
virtual void hop()
Initializes hop information, resets upwards EV and clears upwards force.
Definition KartMove.cc:1953
void calcStandstillBoostRot()
STAGE Computes the x-component of angular velocity based on the kart's speed.
Definition KartMove.cc:1672
EGG::Vector3f m_outsideDriftLastDir
Used to compute the next m_outsideDriftAngle.
Definition KartMove.hh:385
void calcManualDrift()
Each frame, handles hopping, drifting, and mini-turbos.
Definition KartMove.cc:1001
virtual void calcMtCharge()
Every frame during a drift, calculates MT/SMT charge based on player input.
Definition KartMove.cc:1888
void calcSsmt()
Calculates standstill mini-turbo components, if applicable.
Definition KartMove.cc:775
void calcAcceleration()
Every frame, applies acceleration to the kart's internal velocity.
Definition KartMove.cc:1421
f32 m_processedSpeed
Offset 0x28. It's only ever just a copy of m_speed.
Definition KartMove.hh:371
void releaseMt()
Stops charging a mini-turbo, and applies boost if charged.
Definition KartMove.cc:1125
f32 m_kclSpeedFactor
Float between 0-1 that scales the player's speed on offroad.
Definition KartMove.hh:388
f32 m_weightedTurn
Magnitude+direction of stick input, factoring in the kart's stats.
Definition KartMove.hh:412
void calcVehicleSpeed()
Every frame, computes speed based on acceleration and any active boosts.
Definition KartMove.cc:1281
f32 m_lastSpeed
Last frame's speed, cached to calculate angular velocity.
Definition KartMove.hh:370
s16 m_ssmtDisableAccelTimer
Counter that tracks delay before starting to reverse.
Definition KartMove.hh:410
void calcOffroadInvincibility()
Checks a timer to see if we are still ignoring offroad slowdown.
Definition KartMove.cc:2171
KartBurnout m_burnout
Manages the state of start boost burnout.
Definition KartMove.hh:450
f32 calcVehicleAcceleration() const
Every frame, computes acceleration based off the character/vehicle stats.
Definition KartMove.cc:1387
void calcAutoDrift()
Each frame, handles automatic transmission drifting.
Definition KartMove.cc:946
f32 m_realTurn
The "true" turn magnitude. Equal to m_weightedTurn unless drifting.
Definition KartMove.hh:411
const DriftingParameters * m_driftingParams
Drift-type-specific parameters.
Definition KartMove.hh:451
void clearDrift()
Definition KartMove.cc:885
void calc()
Each frame, calculates the kart's movement.
Definition KartMove.cc:287
EGG::Vector3f m_up
Vector perpendicular to the floor, pointing upwards.
Definition KartMove.hh:376
s16 m_ssmtCharge
Increments every frame up to 75 when charging stand-still MT.
Definition KartMove.hh:408
f32 m_speedDragMultiplier
After 5 frames of airtime, this causes speed to slowly decay.
Definition KartMove.hh:374
u16 m_mtCharge
A value between 0 and 270 representing current MT charge.
Definition KartMove.hh:400
void calcSsmtStart()
Calculates whether we are starting a standstill mini-turbo.
Definition KartMove.cc:1773
s16 m_respawnPostLandTimer
Counts up to 4 if not accelerating after respawn landing.
Definition KartMove.hh:440
virtual f32 getWheelieSoftSpeedLimitBonus() const
Returns the % speed boost from wheelies. For karts, this is always 0.
Definition KartMove.hh:103
f32 m_kclWheelRotFactor
The slowest rotation multiplier of each wheel's floor collision.
Definition KartMove.hh:391
void resetDriftManual()
Clears drift state. Called when touching ground and drift is canceled.
Definition KartMove.cc:874
f32 m_totalScale
[Unused] Always 1.0f
Definition KartMove.hh:414
f32 m_acceleration
Captures the acceleration from player input and boosts.
Definition KartMove.hh:373
virtual void calcVehicleRotation(f32 turn)
Every frame, calculates rotation, EV, and angular velocity for the kart.
Definition KartMove.cc:1839
s16 m_respawnPreLandTimer
Counts down from 4 when pressing A before landing from respawn.
Definition KartMove.hh:439
virtual void calcTurn()
Each frame, looks at player input and kart stats. Saves turn-related info.
Definition KartMove.cc:70
f32 m_divingRot
Induces x-axis angular velocity based on up/down stick input.
Definition KartMove.hh:397
f32 m_outsideDriftAngle
The facing angle of an outward-drifting vehicle.
Definition KartMove.hh:383
EGG::Vector3f m_lastDir
m_speed from the previous frame but with signed magnitude.
Definition KartMove.hh:379
EGG::Vector3f m_smoothedUp
A smoothed up vector, mostly used after significant airtime.
Definition KartMove.hh:375
bool canStartDrift() const
Definition KartMove.hh:131
s32 getAppliedHopStickX() const
Factors in vehicle speed to retrieve our hop direction and magnitude.
Definition KartMove.hh:224
u16 m_floorCollisionCount
The number of tires colliding with the floor.
Definition KartMove.hh:392
void calcDive()
Responds to player input to handle up/down kart tilt mid-air.
Definition KartMove.cc:1712
void calcOffroad()
Each frame, computes rotation and speed scalars from the floor KCL.
Definition KartMove.cc:667
s16 m_bumpTimer
Set when a Reaction::SmallBump collision occurs.
Definition KartMove.hh:442
KartScale * m_kartScale
Manages scaling due to TF stompers and MH cars.
Definition KartMove.hh:449
DrivingDirection
The direction the player is currently driving in.
Definition KartMove.hh:346
@ 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:438
s32 m_hopStickX
A ternary for the direction of our hop, 0 if still neutral hopping.
Definition KartMove.hh:393
s16 m_backwardsAllowCounter
Tracks the 15f delay before reversing.
Definition KartMove.hh:444
f32 calcWallCollisionSpeedFactor(f32 &f1)
Every frame, computes a speed scalar if we are colliding with a wall.
Definition KartMove.cc:1573
void calcMushroomBoost()
Checks a timer to see if we are still boosting from a mushroom.
Definition KartMove.cc:2187
f32 m_hopGravity
Always main gravity (-1.3f).
Definition KartMove.hh:437
f32 m_hopVelY
Relative velocity due to a hop. Starts at 10 and decreases with gravity.
Definition KartMove.hh:435
f32 m_hardSpeedLimit
Absolute speed cap. It's 120, unless you're in a bullet (140).
Definition KartMove.hh:372
void setInitialPhysicsValues(const EGG::Vector3f &position, const EGG::Vector3f &angles)
Initializes the kart's position and rotation. Calls tire suspension initializers.
Definition KartMove.cc:250
f32 m_rawTurn
Float in range [-1, 1]. Represents stick magnitude + direction.
Definition KartMove.hh:452
void setOffroadInvincibility(s16 timer)
Ignores offroad KCL collision for a set amount of time.
Definition KartMove.cc:2160
f32 m_speedRatioCapped
m_speedRatio but capped at 1.0f.
Definition KartMove.hh:386
EGG::Vector3f m_scale
Normally the unit vector, but may vary due to crush animations.
Definition KartMove.hh:413
f32 m_kclWheelSpeedFactor
The slowest speed multiplier of each wheel's floor collision.
Definition KartMove.hh:390
EGG::Vector3f m_hopDir
Used for outward drift. Tracks the forward vector of our rotation.
Definition KartMove.hh:396
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:9
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:464
Houses parameters that vary between the drift type (inward bike, outward bike, kart).
Definition KartMove.hh:360
Various character/vehicle-related handling and speed stats.
Definition KartParam.hh:67