Kinoko
A reimplementation of Mario Kart Wii's physics engine in C++
Toggle main menu visibility
Loading...
Searching...
No Matches
ObjectSniper.cc
1
#include "ObjectSniper.hh"
2
3
#include "game/field/RailManager.hh"
4
5
namespace
Kinoko::Field
{
6
8
ObjectSniper::ObjectSniper()
9
:
ObjectCollidable
(
"MapObjSniper"
, EGG::Vector3f::zero, EGG::Vector3f::ez,
10
EGG::Vector3f::unit) {}
11
13
ObjectSniper::~ObjectSniper() =
default
;
14
16
void
ObjectSniper::init() {
17
const
auto
*launcherRailInterp = m_launcher->railInterpolator();
18
19
for
(
auto
&point : m_pointIdxs) {
20
point = -1;
21
}
22
23
auto
*launcherRail = RailManager::Instance()->rail(launcherRailInterp->railIdx());
24
25
for
(
size_t
i = 0; i < m_projectiles.size(); ++i) {
26
auto
*obj = m_projectiles[i];
27
m_pointIdxs[obj->idx()] = i;
28
obj->initProjectile(launcherRail->pointPos(obj->idx()));
29
}
30
}
31
33
void
ObjectSniper::calc() {
34
s32 idx = m_launcher->launchPointIdx();
35
36
if
(idx != -1) {
37
m_projectiles[m_pointIdxs[idx]]->onLaunch();
38
}
39
}
40
41
}
// namespace Kinoko::Field
Kinoko::Field::ObjectCollidable
Definition
ObjectCollidable.hh:18
Kinoko::Field
Pertains to collision.
Definition
BoxColManager.cc:10
game
field
obj
ObjectSniper.cc
Made by
Malleo
. Logo by
vabold
. Website generated by
Doxygen
1.17.0