Kinoko
A reimplementation of Mario Kart Wii's physics engine in C++
Toggle main menu visibility
Loading...
Searching...
No Matches
ObjectDossunTsuibiHolder.hh
1
#pragma once
2
3
#include "game/field/obj/ObjectCollidable.hh"
4
5
#include <array>
6
7
namespace
Kinoko::Field
{
8
9
class
ObjectDossunTsuibi
;
10
12
class
ObjectDossunTsuibiHolder final :
public
ObjectCollidable {
13
public
:
14
ObjectDossunTsuibiHolder(
const
System::MapdataGeoObj
¶ms);
15
~ObjectDossunTsuibiHolder()
override
;
16
17
void
init()
override
;
18
void
calc()
override
;
19
21
void
calcModel()
override
{}
22
24
[[nodiscard]] u32 loadFlags()
const override
{
25
return
1;
26
}
27
29
void
loadGraphics()
override
{}
30
32
void
createCollision()
override
{}
33
34
void
startStill() {
35
m_state =
State::Backward
;
36
m_railInterpolator->setCurrVel(m_vel);
37
}
38
39
private
:
41
void
calcStill() {
42
if
(--m_stillTimer == 0) {
43
m_state =
State::Forward
;
44
m_movingSideways
=
false
;
45
}
46
}
47
48
void
calcForward();
49
void
calcStartStomp();
50
void
calcStomp();
51
void
calcBackwards();
52
54
void
calcStillRotating() {
55
updatePos(
EGG::Vector3f
(pos().x, pos().y, pos().z -
m_resetZVel
));
56
}
57
58
void
calcRot();
59
void
calcForwardRail();
60
void
calcForwardOscillation();
61
62
void
updatePos(
const
EGG::Vector3f
&pos);
63
void
updateRot(f32 yaw);
64
65
enum class
State
{
66
Still = 0,
67
Forward
= 1,
68
StartStomp
= 2,
69
Stomping = 3,
70
Backward
= 4,
71
SillRotating
= 5,
72
};
73
74
std::array<ObjectDossunTsuibi *, 2> m_dossuns;
75
State m_state;
76
EGG::Vector3f
m_initPos;
77
u32 m_stillTimer;
78
bool
m_movingForward;
79
u32 m_forwardTimer;
80
bool
m_movingSideways
;
81
u32
m_flipSideways
;
82
u32 m_sidewaysPhase;
83
bool
m_facingBackwards;
84
f32
m_lastStompZ
;
85
f32
m_resetZVel
;
86
f32 m_vel;
87
f32 m_initRotY;
88
f32
m_resetAngVel
;
89
u32
m_backwardsCounter
;
91
92
// These members are not in the base game but we add them to prevent dereferencing m_mapObj.
93
const
f32
m_forwardVel
;
94
const
u32
m_stillDuration
;
95
97
static
constexpr
u32
HOME_RESET_FRAMES
= 36;
98
static
constexpr
f32 DOSSUN_POS_OFFSET = 500.0f;
99
};
100
101
}
// namespace Kinoko::Field
Kinoko::Field::ObjectDossunTsuibiHolder::m_resetAngVel
f32 m_resetAngVel
Rotational speed of Thwomps after returning home.
Definition
ObjectDossunTsuibiHolder.hh:88
Kinoko::Field::ObjectDossunTsuibiHolder::State
State
Definition
ObjectDossunTsuibiHolder.hh:65
Kinoko::Field::ObjectDossunTsuibiHolder::State::StartStomp
@ StartStomp
One frame in which the holder activates the Thwomp stomp.
Definition
ObjectDossunTsuibiHolder.hh:68
Kinoko::Field::ObjectDossunTsuibiHolder::State::Forward
@ Forward
Moving forward down the hallway.
Definition
ObjectDossunTsuibiHolder.hh:67
Kinoko::Field::ObjectDossunTsuibiHolder::State::Backward
@ Backward
Moving backwards up the hallway.
Definition
ObjectDossunTsuibiHolder.hh:70
Kinoko::Field::ObjectDossunTsuibiHolder::State::SillRotating
@ SillRotating
Returned back to home, but rotating to face hallway.
Definition
ObjectDossunTsuibiHolder.hh:71
Kinoko::Field::ObjectDossunTsuibiHolder::m_backwardsCounter
u32 m_backwardsCounter
Definition
ObjectDossunTsuibiHolder.hh:89
Kinoko::Field::ObjectDossunTsuibiHolder::m_resetZVel
f32 m_resetZVel
Speed required to move from m_lastStompZ to the home's Z in 36 frames.
Definition
ObjectDossunTsuibiHolder.hh:85
Kinoko::Field::ObjectDossunTsuibiHolder::HOME_RESET_FRAMES
static constexpr u32 HOME_RESET_FRAMES
How long Thwomps take to reset after returning to home.
Definition
ObjectDossunTsuibiHolder.hh:97
Kinoko::Field::ObjectDossunTsuibiHolder::m_stillDuration
const u32 m_stillDuration
How long Thwomps remain at their home for.
Definition
ObjectDossunTsuibiHolder.hh:94
Kinoko::Field::ObjectDossunTsuibiHolder::m_lastStompZ
f32 m_lastStompZ
Z-position of the last stomp.
Definition
ObjectDossunTsuibiHolder.hh:84
Kinoko::Field::ObjectDossunTsuibiHolder::m_forwardVel
const f32 m_forwardVel
Rail velocity.
Definition
ObjectDossunTsuibiHolder.hh:93
Kinoko::Field::ObjectDossunTsuibiHolder::m_movingSideways
bool m_movingSideways
Whether the Thwomps should move along the z-axis.
Definition
ObjectDossunTsuibiHolder.hh:80
Kinoko::Field::ObjectDossunTsuibiHolder::m_flipSideways
u32 m_flipSideways
Inverts which direction the thwomps move along the z-axis.
Definition
ObjectDossunTsuibiHolder.hh:81
Kinoko::Field::ObjectDossunTsuibi
Represents one of the two thwomps that oscillate and stomp in the long rBC hallway.
Definition
ObjectDossunTsuibi.hh:8
Kinoko::System::MapdataGeoObj
Definition
MapdataGeoObj.hh:9
Kinoko::Field
Pertains to collision.
Definition
BoxColManager.cc:10
Kinoko::EGG::Vector3f
A 3D float vector.
Definition
Vector.hh:107
game
field
obj
ObjectDossunTsuibiHolder.hh
Made by
Malleo
. Logo by
vabold
. Website generated by
Doxygen
1.17.0