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
10class ObjectKuribo : public ObjectCollidable, public StateManager<ObjectKuribo> {
12
13public:
15 ~ObjectKuribo() override;
16
17 void init() override;
18 void calc() override;
19
21 [[nodiscard]] u32 loadFlags() const override {
22 return 3;
23 }
24
25 void loadAnims() override;
26
27private:
28 void enterStateStub();
29 void calcStateStub();
30 void calcStateReroute();
31 void calcStateWalk();
32
33 void calcAnim();
34 void calcRot();
35 void checkSphereFull();
36 EGG::Vector3f interpolate(f32 scale, const EGG::Vector3f &v0, const EGG::Vector3f &v1) const;
37
38 f32 m_speedStep;
39 f32 m_animStep;
40 EGG::Vector3f m_origin;
41 f32 m_maxAnimTimer;
42 u32 m_frameCount;
43 f32 m_currSpeed;
44 EGG::Vector3f m_rot;
45 EGG::Vector3f m_floorNrm;
46 f32 m_animTimer;
47
48 static constexpr std::array<StateManagerEntry<ObjectKuribo>, 4> STATE_ENTRIES = {{
49 {0, &ObjectKuribo::enterStateStub, &ObjectKuribo::calcStateReroute},
50 {1, &ObjectKuribo::enterStateStub, &ObjectKuribo::calcStateWalk},
51 {2, &ObjectKuribo::enterStateStub, &ObjectKuribo::calcStateStub},
52 {3, &ObjectKuribo::enterStateStub, &ObjectKuribo::calcStateStub},
53 }};
54};
55
56} // 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:88