3#include "game/field/StateManager.hh"
4#include "game/field/obj/ObjectCollidable.hh"
16 Kart::Reaction onCollision(
Kart::KartObject *kartObj, Kart::Reaction reactionOnKart,
17 Kart::Reaction reactionOnObj,
EGG::Vector3f &hitDepth)
override;
20 virtual void calcFloor();
29 return v0 + (v1 - v0) * t;
57 static const std::array<StateManagerEntry<ObjectCowLeader>, 3> STATE_ENTRIES;
73 [[nodiscard]]
u32 loadFlags()
const override {
84 void calcFloor()
override;
95 bool m_endedRailSegment;
96 AnmType m_state1AnmType;
109 static const std::array<StateManagerEntry<ObjectCowFollower>, 3> STATE_ENTRIES;
121 void init()
override;
122 void calc()
override;
125 [[nodiscard]]
u32 loadFlags()
const override {
130 void loadRail()
override {}
134 void enterFreeRoam();
135 void enterFollowLeader();
139 void calcFollowLeader();
148 static constexpr f32 BASE_TOP_SPEED = 2.0f;
149 static constexpr f32 TOP_SPEED_VARIANCE = 4.0f - 2.0f;
164 void init()
override;
165 void calc()
override;
168 [[nodiscard]]
u32 loadFlags()
const override {
173 void createCollision()
override {}
176 void loadRail()
override {}
182 std::span<ObjectCowFollower *> m_followers;
A cow that follows a leader by sharing the same rail.
u16 m_waitFrames
Number of frames the cow will stand still for.
static constexpr f32 DIST_THRESHOLD
Distance at which a cow is considered close enough to the rail to stop moving.
f32 m_railSegThreshold
The rail segmentT at which a cow will change to state 2.
f32 m_topSpeed
The speed the cow will accelerate up to.
bool m_bStopping
Set when the cow is coming to a stop.
The manager class that controls a group of cows.
void checkCollision()
Prevents cows from walking into each other.
void init() override
Assigns the herd's rail to each child.
A cow who its own rail and whose position is not influenced by the path of the others.
u16 m_eatFrames
Length of the state 1 eat animation.
The base class shared between ObjectCowLeader and ObjectCowFollower.
EGG::Vector3f m_upForce
Used by calcPos to counteract gravity.
u32 m_startFrame
The frame the cow will start moving.
EGG::Vector3f m_state1TargetPos
Calculated in enterState1.
f32 m_xzSpeed
XZ plane length of m_velocity.
The highest level abstraction for a kart.