Kinoko
A reimplementation of Mario Kart Wii's physics engine in C++
Toggle main menu visibility
Loading...
Searching...
No Matches
KartScale.hh
1
#pragma once
2
3
#include "game/kart/KartObjectProxy.hh"
4
#include "game/kart/KartParam.hh"
5
6
namespace
Kinoko::Kart
{
7
9
class
KartScale :
protected
KartObjectProxy {
10
public
:
11
KartScale(
const
KartParam::Stats
&stats);
12
~KartScale();
13
14
void
reset();
15
void
calc();
16
17
void
startCrush();
18
void
endCrush();
19
void
startShrink(s32 unk);
20
void
endShrink(s32 unk);
21
22
[[nodiscard]]
const
EGG::Vector3f
&sizeScale()
const
{
23
return
m_sizeScale;
24
}
25
26
[[nodiscard]]
const
EGG::Vector3f
&pressScale()
const
{
27
return
m_pressScale;
28
}
29
30
private
:
31
enum class
CrushState {
32
None = -1,
33
Crush = 0,
34
Uncrush = 1,
35
};
36
37
void
calcCrush();
38
39
[[nodiscard]]
EGG::Vector3f
getAnmScale(f32 frame)
const
;
40
41
s32 m_type;
42
EGG::Vector3f
m_scaleTransformOffset;
43
EGG::Vector3f
m_scaleTransformSlope;
44
EGG::Vector3f
m_sizeScale;
45
bool
m_scaleAnmActive;
46
f32 m_anmFrame;
47
std::array<f32, 4> m_scaleTarget;
48
CrushState
m_crushState
;
49
bool
m_calcCrush
;
50
f32
m_uncrushAnmFrame
;
51
EGG::Vector3f
m_pressScale;
52
53
static
constexpr
f32 CRUSH_SCALE = 0.3f;
54
55
static
constexpr
std::array<f32, 4> s_baseScaleStart = {{
56
0.5f,
57
1.0f,
58
1.0f,
59
2.0f,
60
}};
61
62
static
constexpr
std::array<f32, 4> s_baseScaleTarget = {{
63
1.0f,
64
0.5f,
65
2.0f,
66
1.0f,
67
}};
68
};
69
70
}
// namespace Kinoko::Kart
Kinoko::Kart::KartScale::m_uncrushAnmFrame
f32 m_uncrushAnmFrame
Current frame of the unsquish animation.
Definition
KartScale.hh:50
Kinoko::Kart::KartScale::m_calcCrush
bool m_calcCrush
Set while crush scaling is occurring.
Definition
KartScale.hh:49
Kinoko::Kart::KartScale::m_crushState
CrushState m_crushState
Specifies the current crush/uncrush state.
Definition
KartScale.hh:48
Kinoko::Kart
Pertains to kart-related functionality.
Definition
BoxColManager.hh:14
Kinoko::EGG::Vector3f
A 3D float vector.
Definition
Vector.hh:107
Kinoko::Kart::KartParam::Stats
Various character/vehicle-related handling and speed stats.
Definition
KartParam.hh:79
game
kart
KartScale.hh
Made by
Malleo
. Logo by
vabold
. Website generated by
Doxygen
1.17.0