3#include <egg/core/BitFlag.hh>
4#include <egg/math/Vector.hh>
22class ObjectCollidable;
47 void resize(f32 radius, f32 maxSpeed);
88 void resetIterators();
93 bool alwaysRecalc,
void *userData);
95 bool alwaysRecalc,
void *userData);
102 [[nodiscard]]
bool isSphereInSpatialCache(f32 radius,
const EGG::Vector3f &pos,
106 static void DestroyInstance();
111 void iterate(s32 &iter,
const BoxColFlag &flag);
117 static constexpr size_t MAX_UNIT_COUNT = 0x100;
122 std::array<BoxColUnit *, MAX_UNIT_COUNT>
m_units;
130 s32 m_nextDrivableID;
An interface for ensuring certain structures and classes are destroyed with the heap.
Spatial indexing manager for entities with dynamic collision.
void * getNextImpl(s32 &id, const BoxColFlag &flag)
Helper function since the getters share all code except the flag.
std::array< BoxColUnit *, MAX_UNIT_COUNT > m_units
Units within our search bounds.
std::array< BoxColUnit, MAX_UNIT_COUNT > m_unitPool
Where all the units live.
std::array< BoxColHighPoint, MAX_UNIT_COUNT > m_highPoints
A unit's rightmost Z-axis point.
std::array< BoxColLowPoint, MAX_UNIT_COUNT > m_lowPoints
A unit's leftmost Z-axis point;.
std::array< u32, MAX_UNIT_COUNT > m_unitIDs
Specifies what unit to retrieve from the pool during allocation.
BoxColManager()
Creates two intangible units to represent the spatial bounds.
void calc()
Recalculate the bounds of all active units having PermRecalcAABB or TempRecalcAABB flag,...
Contexts can be used to restore a previous memory state for the current session.
The highest level abstraction for a kart.
eBoxColFlag
A bitfield that represents the state and type of a given BoxColUnit.
@ TempRecalcAABB
Only recalculate once.
@ PermRecalcAABB
Recalculate this unit's spatial indexing every frame.
@ Intangible
Ignore collision with the unit.
Wrapper around an integral type with an enum corresponding to its bits.
A representation of the boundaries of an entity that has dynamic collision.