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 Kinoko::Field {
7
8class ObjectKuribo : public ObjectCollidable, public StateManager {
9public:
10 ObjectKuribo(const System::MapdataGeoObj &params);
11 ~ObjectKuribo() override;
12
13 void init() override;
14 void calc() override;
15
17 [[nodiscard]] u32 loadFlags() const override {
18 return 3;
19 }
20
21 void loadAnims() override;
22
23private:
24 void enterStateStub();
25 void calcStateStub();
26 void calcStateReroute();
27 void calcStateWalk();
28
29 void calcAnim();
30 void calcRot();
31 void checkSphereFull();
32
33 f32 m_speedStep;
34 f32 m_animStep;
35 EGG::Vector3f m_origin;
36 f32 m_maxAnimTimer;
37 u32 m_frameCount;
38 f32 m_currSpeed;
39 EGG::Vector3f m_rot;
40 EGG::Vector3f m_floorNrm;
41 f32 m_animTimer;
42
43 static constexpr std::array<StateManagerEntry, 4> STATE_ENTRIES = {{
44 {StateEntry<ObjectKuribo, &ObjectKuribo::enterStateStub,
46 {StateEntry<ObjectKuribo, &ObjectKuribo::enterStateStub, &ObjectKuribo::calcStateWalk>(
47 1)},
48 {StateEntry<ObjectKuribo, &ObjectKuribo::enterStateStub, &ObjectKuribo::calcStateStub>(
49 2)},
50 {StateEntry<ObjectKuribo, &ObjectKuribo::enterStateStub, &ObjectKuribo::calcStateStub>(
51 3)},
52 }};
53};
54
55} // namespace Kinoko::Field
void calcStateWalk()
Called when Goomba is walking along the rail.
void calcStateReroute()
Called when the Goomba is changing direction.
Pertains to collision.
A 3D float vector.
Definition Vector.hh:107