A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
ObjectTownBridge.hh
1#include "game/field/obj/ObjectKCL.hh"
2
3namespace Field {
4
5class ObjectTownBridge final : public ObjectKCL {
6public:
7 enum class State {
8 Raising = 0,
9 Raised = 1,
10 Lowering = 2,
11 Lowered = 3,
12 };
13
15 ~ObjectTownBridge() override;
16
17 void calc() override;
18
20 [[nodiscard]] u32 loadFlags() const override {
21 return 1;
22 }
23
24 void createCollision() override;
25
27 [[nodiscard]] f32 colRadiusAdditionalLength() const override {
28 return 500.0f;
29 }
30
31private:
32 [[nodiscard]] f32 calcBridgeAngle(u32 t) const;
33 [[nodiscard]] State calcState(u32 t) const;
34
41 State m_state;
42 ObjColMgr *m_raisedColMgr;
43 ObjColMgr *m_midColMgr;
44 ObjColMgr *m_flatColMgr;
45};
46
47} // namespace Field
Manager for an object's KCL interactions.
Definition ObjColMgr.hh:9
f32 m_angVel
Speed of the bridge's movement.
u32 m_fullAnimFrames
The full duration of a bridge raise/lower loop.
bool m_rotateUpwards
Normally 1, otherwise the bridge will open downwards.
State calcState(u32 t) const
Helper function which determines the current state of the bridge based on t.
Pertains to collision.