The
BSphere object is used to clip the object faster.
It Creates a bounding sphere that contains the whole object
Example
This example is taken from the Shape3D class. It is used in
the
updateBoundingVolumes() method:
_oBSphere = BSphere.create( m_oGeometry.aVertex );
public var position:Vector
public var radius:Number = 1
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 BSphere()
Create a new BSphere instance.
public function compute(p_aVertices:Array):void
Performs the actual computing of the bounding sphere's center and radius
Parameters
| p_aVertices:Array — The vertices of the 3D object
|
public static function create(p_aVertices:Array):BSphere
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 distance(p_oPoint:Vector):Number
Returns the distance of a point from the surface.
Parameters
Returns
| Number — >0 if position is outside the sphere, <0 if inside, =0 if on the surface of the sphere
|
public function toString():String
Returns a String represntation of the BSphere.
Returns
| String — A String representing the bounding sphere
|
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