Packagesandy.bounds
Classpublic final class BSphere

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 Properties
 PropertyDefined by
  center : Vector
BSphere
  position : Vector
BSphere
  radius : Number = 1
BSphere
  uptodate : Boolean = false
Specify if this object is up to date or not.
BSphere
Public Methods
 MethodDefined by
  

Create a new BSphere instance.

BSphere
  
compute(p_aVertices:Array):void
Performs the actual computing of the bounding sphere's center and radius
BSphere
  
create(p_aVertices:Array):BSphere
[static] Creates a bounding sphere that encloses a 3D object.
BSphere
  
distance(p_oPoint:Vector):Number
Returns the distance of a point from the surface.
BSphere
  
toString():String
Returns a String represntation of the BSphere.
BSphere
  
transform(p_oMatrix:Matrix4):void
Applies the transformation that is specified in the Matrix4 parameter.
BSphere
Property detail
centerproperty
public var center:Vector
positionproperty 
public var position:Vector
radiusproperty 
public var radius:Number = 1
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
BSphere()constructor
public function BSphere()

Create a new BSphere instance.

Method detail
compute()method
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
create()method 
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
BSphere — A BSphere instance
distance()method 
public function distance(p_oPoint:Vector):Number

Returns the distance of a point from the surface.

Parameters
p_oPoint:Vector

Returns
Number — >0 if position is outside the sphere, <0 if inside, =0 if on the surface of the sphere
toString()method 
public function toString():String

Returns a String represntation of the BSphere.

Returns
String — A String representing the bounding sphere
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