A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
ObjectKuribo.hh
1#pragma once
2
3#include "game/field/StateManager.hh"
4#include "game/field/obj/ObjectCollidable.hh"
5
6namespace Field {
7
8class ObjectKuribo;
9
10template <>
11class StateManager<ObjectKuribo> : public StateManagerBase<ObjectKuribo> {
12public:
14 ~StateManager() override;
15
16private:
17 static const std::array<StateManagerEntry<ObjectKuribo>, 4> STATE_ENTRIES;
18};
19
20class ObjectKuribo : public ObjectCollidable, public StateManager<ObjectKuribo> {
22
23public:
25 ~ObjectKuribo() override;
26
27 void init() override;
28 void calc() override;
29
31 [[nodiscard]] u32 loadFlags() const override {
32 return 3;
33 }
34
35 void loadAnims() override;
36
37private:
38 void enterStateStub();
39 void calcStateStub();
40 void calcStateReroute();
41 void calcStateWalk();
42
43 void calcAnim();
44 void calcRot();
45 void checkSphereFull();
46 EGG::Vector3f interpolate(f32 scale, const EGG::Vector3f &v0, const EGG::Vector3f &v1) const;
47
48 f32 m_speedStep;
49 f32 m_animStep;
50 EGG::Vector3f m_origin;
51 f32 m_maxAnimTimer;
52 u32 m_frameCount;
53 f32 m_currSpeed;
54 EGG::Vector3f m_rot;
55 EGG::Vector3f m_floorNrm;
56 f32 m_animTimer;
57};
58
59} // namespace Field
void calcStateReroute()
Called when the Goomba is changing direction.
void calcStateWalk()
Called when Goomba is walking along the rail.
Pertains to collision.
A 3D float vector.
Definition Vector.hh:83