3#include "game/kart/KartBody.hh"
4#include "game/kart/KartMove.hh"
5#include "game/kart/KartParam.hh"
6#include "game/kart/KartState.hh"
8#include <egg/math/Math.hh>
12KartModel::KartModel() {
13 m_somethingLeft =
false;
14 m_somethingRight =
false;
22KartModel::~KartModel() =
default;
25void KartModel::vf_1c() {
26 if (state()->isBurnout()) {
29 f32 pitch = move()->burnout().pitch();
30 f32 fVar2 = pitch + 75.0f * (pitch - _2e8);
31 f32 fVar4 = std::min(0.2f, 0.04f * EGG::Mathf::abs(fVar2));
32 fVar4 = fVar2 > 0.0f ? fVar4 : -fVar4;
41 f32 xStick = inputs()->currentState().stick.x;
42 bool isInCannon = state()->isInCannon();
43 f32 fVar2 = isInCannon ? 0.02f : 0.1f;
54 xStick = EGG::Mathf::abs(xStick);
61 _54 += fVar2 * (xStick - _54);
63 if (local_f31 < -_54 || _54 < local_f31) {
71 }
else if (-_54 <= _58) {
72 _58 = std::min(_54, _58);
80 if (state()->isDrifting()) {
81 dVar13 = m_isInsideDrift ? 5.0f : 20.0f;
93 dVar12 = -_58 * dVar13;
95 if (m_somethingLeft) {
96 dVar12 += m_isInsideDrift ? 5.0f : 10.0f;
97 }
else if (m_somethingRight) {
98 dVar12 -= m_isInsideDrift ? 5.0f : 10.0f;
101 if (!m_somethingLeft && m_somethingRight) {
110 _5c = std::max(_5c, dVar12);
113 _5c = std::min(_5c, dVar12);
116 body()->setAngle(_5c);
120void KartModel::init() {
127void KartModel::calc() {
134 m_somethingRight =
false;
135 m_somethingLeft =
false;
137 bool turnInput = state()->isStickLeft() || state()->isStickRight();
138 if (state()->isDrifting() || (state()->isChargingSsmt() && turnInput)) {
139 if (move()->hopStickX() == 1) {
140 m_somethingLeft =
true;
142 if (move()->hopStickX() == -1) {
143 m_somethingRight =
true;
144 }
else if (!state()->isStickLeft()) {
145 m_somethingRight =
true;
147 m_somethingLeft =
true;
164 param()->stats().driftType == Kart::KartParam::Stats::DriftType::Inside_Drift_Bike;
168KartModelKart::KartModelKart() =
default;
171KartModelKart::~KartModelKart() =
default;
174KartModelBike::KartModelBike() =
default;
177KartModelBike::~KartModelBike() =
default;
void FUN_807C7828(u8 playerIdx, bool isBike)
Pertains to rendering the kart model.