BoundingBox2D

class BoundingBox2D(centerPoint: Point2D<Double>, width: Double, height: Double, hitBorder: Double)

A 2D bounding box.

Constructors

Link copied to clipboard
constructor(centerPoint: Point2D<Double>, width: Double, height: Double, hitBorder: Double)

Creates a new bounding box with the given center point, width, height and hit border. The hitBorder will be divided by 2 and each half will be applied on each of the sides of this BB.

Functions

Link copied to clipboard
fun contains(screenCoordinate: Point2D<Double>): Boolean

Tests if the give screenCoordinate lays inside the bounding box (in all directions: within half width or height + half of hit border from the center point, inclusive).