QuadTreeBroadphase class
Performs Quad Tree broadphase check.
See HasQuadTreeCollisionDetection.initializeCollisionDetection for a detailed description of its initialization parameters.
- Inheritance
-
- Object
- Broadphase<
ShapeHitbox> - QuadTreeBroadphase
Constructors
- QuadTreeBroadphase({required Rect mainBoxSize, required ExternalBroadphaseCheck broadphaseCheck, required ExternalMinDistanceCheck minimumDistanceCheck, int maxObjects = 25, int maxDepth = 10})
Properties
-
activeHitboxes
→ HashSet<
ShapeHitbox> -
final
- broadphaseCheck ↔ ExternalBroadphaseCheck
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
-
items
→ List<
ShapeHitbox> -
Returns a flat List of items regardless of what data structure is used to
store collision information.
no setteroverride
- minimumDistanceCheck ↔ ExternalMinDistanceCheck
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
tree
→ QuadTree<
ShapeHitbox> -
final
Methods
-
add(
ShapeHitbox item) → void -
Adds an item to the broadphase. Should be called in a
CollisionDetection class while adding a hitbox into its collision
detection system.
override
-
addAll(
Iterable< ShapeHitbox> items) → void -
inherited
-
clear(
) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
query(
) → Iterable< CollisionProspect< ShapeHitbox> > -
Returns the potential hitbox collisions
override
-
remove(
ShapeHitbox item) → void -
Removes an item from the broadphase. Should be called in a
CollisionDetection class while removing a hitbox from its collision
detection system.
override
-
removeAll(
Iterable< ShapeHitbox> items) → void -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
) → void -
This method can be used if there are things that needs to be prepared in
each tick.
inherited
-
updateTransform(
ShapeHitbox item) → void
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited