CollisionDetection<T extends Hitbox<T> > class
abstract
CollisionDetection is the foundation of the collision detection system in Flame.
If the HasCollisionDetection mixin is added to the game, run is called every tick to check for collisions
- Implementers
Constructors
-
CollisionDetection({required Broadphase<
T> broadphase})
Properties
-
broadphase
→ Broadphase<
T> -
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
items
→ List<
T> -
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
add(
T item) → void -
addAll(
Iterable< T> items) → void -
handleCollision(
Set< Vector2> intersectionPoints, T itemA, T itemB) → void -
handleCollisionEnd(
T itemA, T itemB) → void -
handleCollisionStart(
Set< Vector2> intersectionPoints, T itemA, T itemB) → void -
intersections(
T itemA, T itemB) → Set< Vector2> - Check what the intersection points of two items are, returns an empty list if there are no intersections.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
remove(
T item) → void -
Removes the
item
from the collision detection, if you just want to temporarily inactivate it you can setcollisionType = CollisionType.inactive;
instead. -
removeAll(
Iterable< T> items) → void -
Removes all
items
from the collision detection, see remove. -
run(
) → void - Run collision detection for the current state of items.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited