GenericCollisionCallbacks<T> mixin

The GenericCollisionCallbacks mixin can be used to get callbacks from the collision detection system, potentially without using the Flame component system. The default implementation used with FCS is CollisionCallbacks. The generic type T here is the type of the object that has the hitboxes are attached to, for example it is PositionComponent in the StandardCollisionDetection.

Mixin Applications

Properties

activeCollisions Set<T>
The objects that the object is currently colliding with.
no setter
hashCode int
The hash code for this object.
no setterinherited
isColliding bool
Whether the object is currently colliding or not.
no setter
onCollisionCallback CollisionCallback<T>?
Assign your own CollisionCallback if you want a callback when this shape collides with another T.
getter/setter pair
onCollisionEndCallback CollisionEndCallback<T>?
Assign your own CollisionEndCallback if you want a callback when this shape stops colliding with another T.
getter/setter pair
onCollisionStartCallback CollisionCallback<T>?
Assign your own CollisionCallback if you want a callback when this shape starts to collide with another T.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

collidingWith(T other) bool
Whether the object is colliding with other or not.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onCollision(Set<Vector2> intersectionPoints, T other) → void
onCollision is called in every tick when this object is colliding with other.
onCollisionEnd(T other) → void
onCollisionEnd is called once when this object has stopped colliding with other.
onCollisionStart(Set<Vector2> intersectionPoints, T other) → void
onCollisionStart is called in the first tick when this object starts colliding with other.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited