A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
ObjectBulldozer.hh
1#pragma once
2
3#include "game/field/obj/ObjectKCL.hh"
4
5namespace Field {
6
9class ObjectBulldozer final : public ObjectKCL {
10public:
12 ~ObjectBulldozer() override;
13
14 void calc() override;
15
17 [[nodiscard]] u32 loadFlags() const override {
18 return 1;
19 }
20
22 [[nodiscard]] f32 colRadiusAdditionalLength() const override {
23 return static_cast<f32>(m_amplitude);
24 }
25
26 void initCollision() override;
27
28 [[nodiscard]] const EGG::Matrix34f &getUpdatedMatrix(u32 timeOffset) override;
29
30 [[nodiscard]] bool checkCollision(f32 radius, const EGG::Vector3f &pos,
31 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info,
32 KCLTypeMask *maskOut, u32 timeOffset) override;
33 [[nodiscard]] bool checkCollisionCached(f32 radius, const EGG::Vector3f &pos,
34 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info,
35 KCLTypeMask *maskOut, u32 timeOffset) override;
36
37 [[nodiscard]] f32 calcStateAndPosition(u32 timeOffset) const;
38
39 const EGG::Vector3f m_initialPos;
40 const EGG::Vector3f m_initialRot;
41 u16 m_timeOffset;
42 u16 m_periodDenom;
45 u16 m_amplitude;
46 bool m_left;
47 f32 m_period;
48 u16 m_halfPeriod;
50};
51
52} // namespace Field
A 3 x 4 matrix.
Definition Matrix.hh:8
Represents the bulldozers at the end of Toad's Factory.
u16 m_fullPeriod
m_periodDenom + 2 * m_restFrames
bool m_left
Flips the sin wave direction.
EGG::Matrix34f m_rtMat
Exists solely so getUpdatedMatrix can return a reference.
u16 m_restFrames
How long bulldozers stop moving for.
Pertains to collision.
A 3D float vector.
Definition Vector.hh:87