An abstract base class for all bounding volume classes. It should not be instantiated directly.

Constructor

new()

Creates a new BoundingVolumeBase object

Variables

read onlyaabbPoints:Vector<Float>

read onlymax:Vector3D

read onlymin:Vector3D

Methods

clone():BoundingVolumeBase

Clones the current BoundingVolume object

Returns:

An exact duplicate of this object

containsPoint(position:Vector3D):Bool

Method for calculating whether the given position is contained within the bounding volume.

Parameters:

position

The position in local coordinates to be checked.

Returns:

A Boolean value representing the detection of a contained position.

disposeRenderable():Void

Disposes of the bounds renderable object. Used to clear memory after a bounds rendeable is no longer required.

fromExtremes(minX:Float, minY:Float, minZ:Float, maxX:Float, maxY:Float, maxZ:Float):Void

Sets the bounds to the given extrema.

Parameters:

minX

The minimum x value of the bounds

minY

The minimum y value of the bounds

minZ

The minimum z value of the bounds

maxX

The maximum x value of the bounds

maxY

The maximum y value of the bounds

maxZ

The maximum z value of the bounds

fromGeometry(geometry:Geometry):Void

Updates the bounds to fit a Geometry object.

Parameters:

geometry

The Geometry object to be bounded.

fromSphere(center:Vector3D, radius:Float):Void

Sets the bound to fit a given sphere.

Parameters:

center

The center of the sphere to be bounded

radius

The radius of the sphere to be bounded

fromVertices(vertices:Vector<Float>):Void

Updates the bounds to fit a list of vertices

Parameters:

vertices

A Vector.<Number> of vertex data to be bounded.

isInFrustum(planes:Vector<Plane3D>, numPlanes:Int):Bool

Tests if the bounds are in the camera frustum.

Parameters:

mvpMatrix

The model view projection matrix for the object to which this bounding box belongs.

Returns:

True if the bounding box is at least partially inside the frustum

nullify():Void

Sets the bounds to zero size.

overlaps(bounds:BoundingVolumeBase):Bool

Tests if the bounds overlap other bounds, treating both bounds as AABBs.

rayIntersection(position:Vector3D, direction:Vector3D, targetNormal:Vector3D):Float

Method for calculating whether an intersection of the given ray occurs with the bounding volume.

Parameters:

position

The starting position of the casting ray in local coordinates.

direction

A unit vector representing the direction of the casting ray in local coordinates.

targetNormal

The vector to store the bounds' normal at the point of collision

Returns:

A Boolean value representing the detection of an intersection.

transformFrom(bounds:BoundingVolumeBase, matrix:Matrix3D):Void