Kinoko
A reimplementation of Mario Kart Wii's physics engine in C++
Toggle main menu visibility
Loading...
Searching...
No Matches
ObjectKoopaBall.hh
1
#pragma once
2
3
#include "game/field/obj/ObjectCollidable.hh"
4
5
#include "game/render/DrawMdl.hh"
6
7
namespace
Kinoko::Field
{
8
9
class
ObjectKoopaBall final :
public
ObjectCollidable {
10
public
:
11
ObjectKoopaBall(
const
System::MapdataGeoObj
¶ms);
12
~ObjectKoopaBall()
override
;
13
14
void
init()
override
;
15
void
calc()
override
;
16
18
[[nodiscard]] u32 loadFlags()
const override
{
19
return
1;
20
}
21
22
Kart::Reaction onCollision(
Kart::KartObject
*kartObj, Kart::Reaction reactionOnKart,
23
Kart::Reaction reactionOnObj,
EGG::Vector3f
&hitDepth)
override
;
24
26
const
EGG::Vector3f
&getCollisionTranslation()
const override
{
27
return
m_vel;
28
}
29
30
private
:
31
enum class
State {
32
Tangible = 0,
33
Intangible
= 1,
34
Exploding = 2,
35
};
36
37
void
calcTangible();
38
void
calcExploding();
39
void
calcIntangible();
40
41
void
checkSphereFull();
42
43
State m_state;
44
f32
m_initPosY
;
45
EGG::Vector3f
m_vel;
46
f32 m_angSpeed;
47
s32
m_cooldownTimer
;
48
Render::DrawMdl
*m_bombCoreDrawMdl;
49
s32 m_explodeTimer;
50
u32 m_animFramecount;
51
f32 m_angleRad;
52
f32 m_curScale;
53
54
static
constexpr
f32 RADIUS_AABB = 870.0f * 2.0f;
55
static
constexpr
f32 SCALE_INITIAL = RADIUS_AABB / 940.0f * 0.5f;
56
static
constexpr
f32 SCALE_DELTA = SCALE_INITIAL / 25.0f;
57
static
constexpr
f32 INITIAL_VELOCITY = 400.0f;
58
static
constexpr
f32 INITIAL_ANGULAR_SPEED = 3.0f;
59
static
constexpr
f32 INITIAL_Y_VEL = -30.0f;
60
};
61
62
}
// namespace Kinoko::Field
Kinoko::Field::ObjectKoopaBall::m_initPosY
f32 m_initPosY
Starting height.
Definition
ObjectKoopaBall.hh:44
Kinoko::Field::ObjectKoopaBall::m_cooldownTimer
s32 m_cooldownTimer
Frames until koopa will start to shoot the fireball.
Definition
ObjectKoopaBall.hh:47
Kinoko::Kart::KartObject
The highest level abstraction for a kart.
Definition
KartObject.hh:11
Kinoko::Render::DrawMdl
Definition
DrawMdl.hh:7
Kinoko::System::MapdataGeoObj
Definition
MapdataGeoObj.hh:9
Kinoko::Field
Pertains to collision.
Definition
BoxColManager.cc:10
Kinoko::Field::eBoxColFlag::Intangible
@ Intangible
Ignore collision with the unit.
Definition
BoxColManager.hh:33
Kinoko::EGG::Vector3f
A 3D float vector.
Definition
Vector.hh:107
game
field
obj
ObjectKoopaBall.hh
Made by
Malleo
. Logo by
vabold
. Website generated by
Doxygen
1.17.0