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
9public:
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 EGG::Vector3f interpolate(f32 scale, const EGG::Vector3f &v0, const EGG::Vector3f &v1) const;
33
34 f32 m_speedStep;
35 f32 m_animStep;
36 EGG::Vector3f m_origin;
37 f32 m_maxAnimTimer;
38 u32 m_frameCount;
39 f32 m_currSpeed;
40 EGG::Vector3f m_rot;
41 EGG::Vector3f m_floorNrm;
42 f32 m_animTimer;
43
44 static constexpr std::array<StateManagerEntry, 4> STATE_ENTRIES = {{
45 {StateEntry<ObjectKuribo, &ObjectKuribo::enterStateStub,
47 {StateEntry<ObjectKuribo, &ObjectKuribo::enterStateStub, &ObjectKuribo::calcStateWalk>(
48 1)},
49 {StateEntry<ObjectKuribo, &ObjectKuribo::enterStateStub, &ObjectKuribo::calcStateStub>(
50 2)},
51 {StateEntry<ObjectKuribo, &ObjectKuribo::enterStateStub, &ObjectKuribo::calcStateStub>(
52 3)},
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.
Base class that represents different "states" for an object.
Pertains to collision.
A 3D float vector.
Definition Vector.hh:88