Hitbox<T extends Hitbox<T>> class abstract

The Hitbox is the default building block to determine whether two objects have collided with each other. ShapeHitbox is the default implementation used in FCS.

Implemented types
Implementers

Constructors

Hitbox()

Properties

aabb Aabb2
The axis-aligned bounding box of the Hitbox, this is used to make a rough estimation of whether two hitboxes can possibly collide or not.
no setter
activeCollisions Set<T>
The objects that the object is currently colliding with.
no setterinherited
collisionType CollisionType
Whether the hitbox should:
no setter
hashCode int
The hash code for this object.
no setterinherited
isColliding bool
Whether the object is currently colliding or not.
no setterinherited
onCollisionCallback CollisionCallback<T>?
Assign your own CollisionCallback if you want a callback when this shape collides with another T.
getter/setter pairinherited
onCollisionEndCallback CollisionEndCallback<T>?
Assign your own CollisionEndCallback if you want a callback when this shape stops colliding with another T.
getter/setter pairinherited
onCollisionStartCallback CollisionCallback<T>?
Assign your own CollisionCallback if you want a callback when this shape starts to collide with another T.
getter/setter pairinherited
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.
inherited
containsPoint(Vector2 point) bool
Checks whether the Hitbox contains the point.
intersections(T other) Set<Vector2>
Where this Hitbox has intersection points with another Hitbox.
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.
inherited
onCollisionEnd(T other) → void
onCollisionEnd is called once when this object has stopped colliding with other.
inherited
onCollisionStart(Set<Vector2> intersectionPoints, T other) → void
onCollisionStart is called in the first tick when this object starts colliding with other.
inherited
possiblyIntersects(T other) bool
This should be a cheaper calculation than comparing the exact boundaries if the exact calculation is expensive. This method could for example check two Rects or Aabb2s against each other.
toString() String
A string representation of this object.
inherited

Operators

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