Kinoko
A reimplementation of Mario Kart Wii's physics engine in C++
Toggle main menu visibility
Loading...
Searching...
No Matches
ObjectSunDS.hh
1
#pragma once
2
3
#include "game/field/StateManager.hh"
4
#include "game/field/obj/ObjectProjectileLauncher.hh"
5
6
namespace
Kinoko::Field
{
7
8
class
ObjectSunDS :
public
ObjectProjectileLauncher,
public
StateManager {
9
public
:
10
ObjectSunDS(
const
System::MapdataGeoObj
¶ms);
11
~ObjectSunDS()
override
;
12
14
void
init()
override
{
15
m_stillDuration
= 0;
16
}
17
18
void
calc()
override
;
19
21
[[nodiscard]] u32 loadFlags()
const override
{
22
return
1;
23
}
24
25
[[nodiscard]] s16
launchPointIdx
()
override
;
26
27
private
:
29
void
enterStill() {
30
m_railInterpolator->setCurrVel(0.0f);
31
}
32
34
void
enterRevolving() {
35
m_railInterpolator->setCurrVel(
m_revolutionSpeed
);
36
}
37
39
void
calcStill() {
40
if
(m_currentFrame >=
m_stillDuration
) {
41
m_nextStateId = 1;
42
}
43
}
44
46
void
calcRevolving() {}
47
48
const
f32
m_revolutionSpeed
;
49
const
s32
m_startFrame
;
50
u32
m_stillDuration
;
51
52
static
constexpr
std::array<StateManagerEntry, 2> STATE_ENTRIES = {{
53
{StateEntry<ObjectSunDS, &ObjectSunDS::enterStill, &ObjectSunDS::calcStill>(0)},
54
{StateEntry<ObjectSunDS, &ObjectSunDS::enterRevolving, &ObjectSunDS::calcRevolving>(1)},
55
}};
56
};
57
58
}
// namespace Kinoko::Field
Kinoko::Field::ObjectSunDS::launchPointIdx
s16 launchPointIdx() override
Used by ObjectSniper to check which object (if any) should be thrown.
Definition
ObjectSunDS.cc:38
Kinoko::Field::ObjectSunDS::m_stillDuration
u32 m_stillDuration
How long the sun remains stationary for before moving again.
Definition
ObjectSunDS.hh:50
Kinoko::Field::ObjectSunDS::m_startFrame
const s32 m_startFrame
The sun is inactive until this frame.
Definition
ObjectSunDS.hh:49
Kinoko::Field::ObjectSunDS::m_revolutionSpeed
const f32 m_revolutionSpeed
Speed of sun revolving around the course.
Definition
ObjectSunDS.hh:48
Kinoko::System::MapdataGeoObj
Definition
MapdataGeoObj.hh:9
Kinoko::Field
Pertains to collision.
Definition
BoxColManager.cc:10
game
field
obj
ObjectSunDS.hh
Made by
Malleo
. Logo by
vabold
. Website generated by
Doxygen
1.17.0