16#include "../../Physics/Utils/BoundingBox2D.h"
92 void Expand(uint16_t newCount);
Defines the Triangle2D class for representing and manipulating 2D triangles.
Represents a 2D axis-aligned bounding box.
Represents a node in a quadtree structure for spatial partitioning.
BoundingBox2D * GetBBox()
Retrieves the bounding box of the node.
void Expand(uint16_t newCount)
Expands the node's capacity to accommodate more entities.
bool ShouldSubdivide(uint16_t childEntitySum)
Determines whether the node should be subdivided.
Triangle2D ** GetEntities()
Retrieves the entities contained in this node.
Triangle2D ** entities
Array of entities (triangles) contained in the node.
uint16_t capacity
Capacity of entities allocated in the node.
static const uint8_t maxDepth
Maximum depth of the quadtree.
~Node()
Destructor for the Node class.
BoundingBox2D bbox
Bounding box defining the spatial area of this node.
bool IsLeaf()
Checks if the node is a leaf node (i.e., has no child nodes).
uint16_t GetCount()
Retrieves the current count of entities in the node.
bool Insert(Triangle2D *triangle)
Inserts a triangle entity into the node.
void Subdivide(uint8_t depth=0)
Subdivides the node into child nodes if needed.
Node * childNodes
Pointer to the child nodes of this node.
uint16_t DistributeEntities()
Distributes entities to child nodes after subdivision.
static const uint16_t maxEntities
Maximum number of entities a node can hold before subdividing.
void CreateChildNodes()
Creates child nodes for this node.
uint16_t count
Current number of entities in the node.
Node * GetChildNodes()
Retrieves the child nodes of this node.
Represents a 2D triangle with support for UV mapping, depth, and intersection testing.
Represents a 2D vector (X, Y) and provides methods for vector arithmetic.