The
BBox object is used to clip the object faster.
It creates a bounding box that contains the whole object
Example
This example is taken from the Shape3D class. It is used in
the
updateBoundingVolumes() method:
_oBBox = BBox.create( m_oGeometry.aVertex );
public var aCorners:Array
public var aTCorners:Array
public var max:Vector
Max vector, representing the upper point of the cube volume
public var min:Vector
Min vector, representing the lower point of the cube volume.
public var uptodate:Boolean = false
Specify if this object is up to date or not.
If false, you need to call its transform method to get its correct bounds in the desired frame.
public function BBox(p_min:Vector = null, p_max:Vector = null)
Creates a new BBox instance by passing the min and the max Vector.
Parameters
| p_min:Vector (default = null) — Min vector, representing the lower point of the cube volume
|
| |
| p_max:Vector (default = null) — Max vector, representing the upper point of the cube volume
|
public function clone():BBox
Clones the current bounding box.
Returns
| BBox —
A cloned BBox instance
|
public static function create(p_aVertices:Array):BBox
Creates a bounding sphere that encloses a 3D object. This object's vertices are passed
to the create method in the form of an Array. Very useful
for clipping and thus performance!
Parameters
| p_aVertices:Array — The vertices of the 3D object
|
Returns
public function getCenter():Vector
Returns the center of the Bounding Box volume in the form of a 3D vector.
Returns
| Vector —
A Vector representing the center of the Bounding Box
|
public function getSize():Vector
Return the size of the Bounding Box.
Returns
| Vector —
A Vector representing the size of the volume in three dimensions.
|
public function toString():String
Returns a String representation of the BBox.
Returns
| String — A String representing the bounding box
|
public function transform(p_oMatrix:Matrix4):void
Applies the transformation that is specified in the Matrix4 parameter.
Parameters
| p_oMatrix:Matrix4 — The transformation matrix
|
ASDoc: Preliminary documentation for the Sandy 3D Engine, version 3.0.1