AABB class

Constructors

AABB()
AABB.clone(AABB a)
AABB.collapsed(Vec2D point)
AABB.empty()
AABB.expand(AABB from, double amount)
factory
AABB.fromCoordinates({required double x, required double y, required double width, required double height})
AABB.fromLTRB(double l, double t, double r, double b)
AABB.fromLTWH(double l, double t, double w, double h)
AABB.fromMinMax(Vec2D min, Vec2D max)
AABB.fromPoints(Iterable<Vec2D> points, {Mat2D? transform, double expand = 0})
Compute an AABB from a set of points with an optional transform to apply before computing.
factory
AABB.fromValues(double l, double t, double r, double b)
AABB.pad(AABB from, double amount)
factory

Properties

area → double
no setter
bottom ↔ double
getter/setter pair
bottomCenter → Vec2D
no setter
bottomLeft → Vec2D
no setter
bottomRight → Vec2D
no setter
centerX → double
no setter
centerY → double
no setter
hashCode → int
The hash code for this object.
no setterinherited
height → double
no setter
isEmpty → bool
no setter
left ↔ double
getter/setter pair
leftCenter → Vec2D
no setter
maximum → Vec2D
no setter
maxX → double
no setter
maxY → double
no setter
minimum → Vec2D
no setter
minX → double
no setter
minY → double
no setter
rect → Rect
no setter
getter/setter pair
rightCenter → Vec2D
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
top ↔ double
getter/setter pair
topCenter → Vec2D
no setter
topLeft → Vec2D
no setter
topRight → Vec2D
no setter
width → double
no setter

Methods

center() → Vec2D
contains(Vec2D point) → bool
containsBounds(AABB b) → bool
expandToPoint(Vec2D point) → void
factorFrom(Vec2D point) → Vec2D
includePoint(Vec2D point, Mat2D? transform) → Vec2D
inset(double dx, double dy) → AABB
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
offset(double dx, double dy) → AABB
pointAt(double xf, double yf) → Vec2D
Get the point at x/y factor (where 0, 0 is center, -1, 0 is left center, 1, 0 is right center).
round() → IAABB
toString() → String
A string representation of this object.
override
transform(Mat2D matrix) → AABB
translate(Vec2D vec) → AABB

Operators

operator *(double v) → AABB
operator /(double v) → AABB
operator ==(Object other) → bool
The equality operator.
inherited
operator [](int idx) → double
operator []=(int idx, double v) → void

Static Methods

areEqual(AABB a, AABB b) → bool
combine(AABB out, AABB a, AABB b) → AABB
copy(AABB out, AABB a) → AABB
extents(Vec2D out, AABB a) → Vec2D
isValid(AABB a) → bool
perimeter(AABB a) → double
size(Vec2D out, AABB a) → Vec2D
testOverlap(AABB a, AABB b) → bool