Class sandy.core.data.BBox

Description

BoundingBox object used to clip the object faster.

Create a bounding box that contains the whole object

Field Index

max, min, owner

Method Index

new BBox()
compute(), getCenter(), getCorners(), getSize(), toString()

Constructor Detail

BBox

public function BBox(pobj:Object3D, pmin:Vector, pmax:Vector)

Create a new BBox Instance

Parameters

Field Detail

max

public max:Vector
max vector, representing the upper point of the cube volume

min

public min:Vector
min vector, representing the lower point of the cube volume.

owner

public owner:Object3D
the 3D object owning the Bounding Box

Method Detail

compute

public function compute(a:Array):Void

Create a BBox object, representing a Bounding Box volume englobing the 3D object passed in parameters. Verry usefull for clipping and so performance !

Parameters

getCenter

public function getCenter(Void):Vector

Returns the center of the Bounding Box volume as a 3D vector.

Return

A vector representing the center of the Bounding Box

getSize

public function getSize(Void):Vector

Return the size of the Bounding Box.

Return

a Vector representing the size of the volume in three dimensions.

getCorners

public function getCorners(b:Boolean):Array

get all the 8 corners vertex of the bounding Box volume.

Parameters

bBoolean the b is set to true, we will compute the array of vertex once again, otherwise it will return the last compute array.

Return

The array containing 8 Vertex representing the Bounding Box corners.

toString

public function toString(Void):String

Get a String represntation of the BBox.

Return

A String representing the BoundingBox