Packagesandy.bounds
Classpublic class BBox

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 Properties
 PropertyDefined by
  aCorners : Array
BBox
  aTCorners : Array
BBox
  max : Vector
Max vector, representing the upper point of the cube volume
BBox
  min : Vector
Min vector, representing the lower point of the cube volume.
BBox
  tmax : Vector
BBox
  tmin : Vector
BBox
  uptodate : Boolean = false
Specify if this object is up to date or not.
BBox
Public Methods
 MethodDefined by
  
BBox(p_min:Vector = null, p_max:Vector = null)
Creates a new BBox instance by passing the min and the max Vector.
BBox
  
Clones the current bounding box.
BBox
  
create(p_aVertices:Array):BBox
[static] Creates a bounding sphere that encloses a 3D object.
BBox
  
Returns the center of the Bounding Box volume in the form of a 3D vector.
BBox
  
Return the size of the Bounding Box.
BBox
  
toString():String
Returns a String representation of the BBox.
BBox
  
transform(p_oMatrix:Matrix4):void
Applies the transformation that is specified in the Matrix4 parameter.
BBox
Property detail
aCornersproperty
public var aCorners:Array
aTCornersproperty 
public var aTCorners:Array
maxproperty 
public var max:Vector

Max vector, representing the upper point of the cube volume

minproperty 
public var min:Vector

Min vector, representing the lower point of the cube volume.

tmaxproperty 
public var tmax:Vector
tminproperty 
public var tmin:Vector
uptodateproperty 
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.

Constructor detail
BBox()constructor
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
Method detail
clone()method
public function clone():BBox

Clones the current bounding box.

Returns
BBox — A cloned BBox instance
create()method 
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
BBox — A BBox instance
getCenter()method 
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
getSize()method 
public function getSize():Vector

Return the size of the Bounding Box.

Returns
Vector — A Vector representing the size of the volume in three dimensions.
toString()method 
public function toString():String

Returns a String representation of the BBox.

Returns
String — A String representing the bounding box
transform()method 
public function transform(p_oMatrix:Matrix4):void

Applies the transformation that is specified in the Matrix4 parameter.

Parameters
p_oMatrix:Matrix4 — The transformation matrix