Kinoko
A reimplementation of Mario Kart Wii's physics engine in C++
Toggle main menu visibility
Loading...
Searching...
No Matches
ObjectSunDS.cc
1
#include "ObjectSunDS.hh"
2
3
#include "game/system/RaceManager.hh"
4
5
namespace
Kinoko::Field
{
6
8
ObjectSunDS::ObjectSunDS(
const
System::MapdataGeoObj ¶ms)
9
:
ObjectProjectileLauncher
(params),
StateManager
(this, STATE_ENTRIES),
10
m_revolutionSpeed(static_cast<f32>(params.setting(0))),
11
m_startFrame(static_cast<s32>(params.setting(1))) {}
12
14
ObjectSunDS::~ObjectSunDS() =
default
;
15
17
void
ObjectSunDS::calc() {
18
if
(System::RaceManager::Instance()->timer() <
static_cast<
u32
>
(m_startFrame)) {
19
return
;
20
}
21
22
if
(m_railInterpolator->calc() == RailInterpolator::Status::SegmentEnd) {
23
m_railInterpolator->setT(0.0f);
24
25
u16 setting = m_railInterpolator->curPoint().setting[0];
26
if
(setting != 0) {
27
m_stillDuration = setting;
28
m_nextStateId = 0;
29
}
30
}
31
32
StateManager::calc();
33
34
setPos(m_railInterpolator->curPos());
35
}
36
38
s16
ObjectSunDS::launchPointIdx
() {
39
constexpr
u16 THROW_DELAY = 30;
40
41
if
(m_currentStateId != 0 || THROW_DELAY != m_currentFrame) {
42
return
-1;
43
}
44
45
return
m_railInterpolator->curPointIdx();
46
}
47
48
}
// namespace Kinoko::Field
Kinoko::Field::ObjectProjectileLauncher
Abstract class that moves along its own rail and throws projectiles.
Definition
ObjectProjectileLauncher.hh:8
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::StateManager
Base class that represents different "states" for an object.
Definition
StateManager.hh:27
Kinoko::Field
Pertains to collision.
Definition
BoxColManager.cc:10
game
field
obj
ObjectSunDS.cc
Made by
Malleo
. Logo by
vabold
. Website generated by
Doxygen
1.17.0