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 "game/system/RaceConfig.hh"
10#include <egg/math/Math.hh>
14KartModel::KartModel() {
15 m_somethingLeft =
false;
16 m_somethingRight =
false;
24KartModel::~KartModel() =
default;
27void KartModel::vf_1c() {
28 const auto &status = KartObjectProxy::status();
33 f32 pitch = move()->burnout().pitch();
34 f32 fVar2 = pitch + 75.0f * (pitch - _2e8);
35 f32 fVar4 = std::min(0.2f, 0.04f * EGG::Mathf::abs(fVar2));
36 fVar4 = fVar2 > 0.0f ? fVar4 : -fVar4;
46 System::RaceConfig::Instance()->raceScenario().course == Course::N64_Sherbet_Land &&
47 status.
onBit(Kart::eStatus::InRespawn, Kart::eStatus::AfterRespawn);
48 f32 xStick = frozenInIce ? 0.0f : inputs()->currentState().stick.x;
49 bool isInCannon = status.
onBit(Kart::eStatus::InCannon);
50 f32 fVar2 = isInCannon ? 0.02f : 0.1f;
61 xStick = EGG::Mathf::abs(xStick);
68 _54 += fVar2 * (xStick - _54);
70 if (local_f31 < -_54 || _54 < local_f31) {
78 }
else if (-_54 <= _58) {
79 _58 = std::min(_54, _58);
87 if (state()->isDrifting()) {
88 dVar13 = m_isInsideDrift ? 5.0f : 20.0f;
100 dVar12 = -_58 * dVar13;
102 if (m_somethingLeft) {
103 dVar12 += m_isInsideDrift ? 5.0f : 10.0f;
104 }
else if (m_somethingRight) {
105 dVar12 -= m_isInsideDrift ? 5.0f : 10.0f;
108 if (!m_somethingLeft && m_somethingRight) {
117 _5c = std::max(_5c, dVar12);
120 _5c = std::min(_5c, dVar12);
123 body()->setAngle(_5c);
127void KartModel::init() {
134void KartModel::calc() {
141 m_somethingRight =
false;
142 m_somethingLeft =
false;
143 auto &status = KartObjectProxy::status();
147 if (move()->hopStickX() == 1) {
148 m_somethingLeft =
true;
150 if (move()->hopStickX() == -1) {
151 m_somethingRight =
true;
153 m_somethingRight =
true;
155 m_somethingLeft =
true;
172 param()->stats().driftType == Kart::KartParam::Stats::DriftType::Inside_Drift_Bike;
176KartModelKart::KartModelKart() =
default;
179KartModelKart::~KartModelKart() =
default;
182KartModelBike::KartModelBike() =
default;
185KartModelBike::~KartModelBike() =
default;
constexpr bool offBit(Es... es) const
Checks if all of the corresponding bits for the provided enum values are off.
constexpr bool onBit(Es... es) const
Checks if any of the corresponding bits for the provided enum values are on.
void FUN_807C7828(u8 playerIdx, bool isBike)
@ StickLeft
Set on left stick input. Mutually exclusive to m_bStickRight.
@ StickRight
Set on right stick input. Mutually exclusive to m_bStickLeft.
@ ChargingSSMT
Tracks whether we are charging a stand-still mini-turbo.
@ Burnout
Set during a burnout on race start.
Pertains to rendering the kart model.