A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
KartScale.hh
1#pragma once
2
3#include "game/kart/KartObjectProxy.hh"
4
5namespace Kart {
6
8class KartScale : protected KartObjectProxy {
9public:
10 KartScale();
11 ~KartScale();
12
13 void reset();
14 void calc();
15
16 void startCrush();
17 void startUncrush();
18
19 [[nodiscard]] const EGG::Vector3f &currScale() const {
20 return m_currScale;
21 }
22
23private:
24 enum class CrushState {
25 None = -1,
26 Crush = 0,
27 Uncrush = 1,
28 };
29
30 void calcCrush();
31
32 [[nodiscard]] EGG::Vector3f getAnmScale(f32 frame) const;
33
34 CrushState m_crushState;
38
39 static constexpr f32 CRUSH_SCALE = 0.3f;
40};
41
42} // namespace Kart
Base class for most kart-related objects.
Mainly responsible for calculating scaling for the squish/unsquish animation.
Definition KartScale.hh:8
bool m_calcCrush
Set while crush scaling is occurring.
Definition KartScale.hh:35
EGG::Vector3f m_currScale
The computed scale for the current frame.
Definition KartScale.hh:37
CrushState m_crushState
Specifies the current crush/uncrush state.
Definition KartScale.hh:34
f32 m_uncrushAnmFrame
Current frame of the unsquish animation.
Definition KartScale.hh:36
Pertains to kart-related functionality.
A 3D float vector.
Definition Vector.hh:87