AABB class

Class representing an axis-aligned bounding box (AABB).

@author {@link https://github.com/Mugen87|Mugen87}

Constructors

AABB([Vector3? min, Vector3? max])
Constructs a new AABB with the given values.

Properties

center → Vector3
final
hashCode → int
The hash code for this object.
no setterinherited
max ↔ Vector3
getter/setter pair
min ↔ Vector3
getter/setter pair
points → List<Vector3>
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
size → Vector3
final
vector → Vector3
final

Methods

applyMatrix4(Matrix4 matrix) → AABB
Transforms this AABB with the given 4x4 transformation matrix.
clampPoint(Vector3 point, Vector3 result) → Vector3
Ensures the given point is inside this AABB and stores the result in the given vector.
clone() → AABB
Creates a new AABB and copies all values from this AABB.
containsPoint(Vector3 point) → bool
Returns true if the given point is inside this AABB.
copy(AABB aabb) → AABB
Copies all values from the given AABB to this AABB.
equals(AABB aabb) → bool
Returns true if the given AABB is deep equal with this AABB.
expand(Vector3 point) → AABB
Expands this AABB by the given point. So after this method call, the given point lies inside the AABB.
fromCenterAndSize(Vector3 center, Vector3 size) → AABB
Sets the values of the AABB from the given center and size vector.
fromJSON(Map<String, dynamic> json) → AABB
Restores this instance from the given JSON object.
fromPoints(List<Vector3> points) → AABB
Computes an AABB that encloses the given set of points.
getCenter(Vector3 result) → Vector3
Computes the center point of this AABB and stores it into the given vector.
getNormalFromSurfacePoint(Vector3 point, Vector3 result) → Vector3
Returns the normal for a given point on this AABB's surface.
getSize(Vector3 result) → Vector3
Computes the size (width, height, depth) of this AABB and stores it into the given vector.
intersectsAABB(AABB aabb) → bool
Returns true if the given AABB intersects this AABB.
intersectsBoundingSphere(BoundingSphere sphere) → bool
Returns true if the given bounding sphere intersects this AABB.
intersectsPlane(Plane plane) → bool
Returns true if the given plane intersects this AABB.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
set(Vector3 min, Vector3 max) → AABB
Sets the given values to this AABB.
toJSON() → Map<String, dynamic>
Transforms this instance into a JSON object.
toString() → String
A string representation of this object.
inherited

Operators

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