Packageaway3d.bounds
Classpublic class BoundingSphere
InheritanceBoundingSphere Inheritance BoundingVolumeBase Inheritance Object

BoundingSphere represents a spherical bounding volume defined by a center point and a radius. This bounding volume is useful for point lights.



Public Properties
 PropertyDefined By
 InheritedaabbPoints : Vector.<Number>
[read-only] Returns a vector of values representing the concatenated cartesian triplet of the 8 axial extremities of the bounding volume.
BoundingVolumeBase
 InheritedboundingRenderable : WireframePrimitiveBase
[read-only] Returns the bounding renderable object for the bounding volume, in cases where the showBounds property of the entity is set to true.
BoundingVolumeBase
 Inheritedmax : Vector3D
[read-only] The maximum extreme of the bounds
BoundingVolumeBase
 Inheritedmin : Vector3D
[read-only] The minimum extreme of the bounds
BoundingVolumeBase
  radius : Number
[read-only] The radius of the bounding sphere, calculated from the contents of the entity.
BoundingSphere
Protected Properties
 PropertyDefined By
 Inherited_aabbPoints : Vector.<Number>
BoundingVolumeBase
 Inherited_aabbPointsDirty : Boolean = true
BoundingVolumeBase
 Inherited_boundingRenderable : WireframePrimitiveBase
BoundingVolumeBase
 Inherited_max : Vector3D
BoundingVolumeBase
 Inherited_min : Vector3D
BoundingVolumeBase
Public Methods
 MethodDefined By
  
Creates a new BoundingSphere object
BoundingSphere
  
[override] Clones the current BoundingVolume object
BoundingSphere
  
containsPoint(position:Vector3D):Boolean
[override] Method for calculating whether the given position is contained within the bounding volume.
BoundingSphere
 Inherited
Disposes of the bounds renderable object.
BoundingVolumeBase
  
fromExtremes(minX:Number, minY:Number, minZ:Number, maxX:Number, maxY:Number, maxZ:Number):void
[override] Sets the bounds to the given extrema.
BoundingSphere
 Inherited
fromGeometry(geometry:Geometry):void
Updates the bounds to fit a Geometry object.
BoundingVolumeBase
  
fromSphere(center:Vector3D, radius:Number):void
[override] Sets the bound to fit a given sphere.
BoundingSphere
 Inherited
fromVertices(vertices:Vector.<Number>):void
Updates the bounds to fit a list of vertices
BoundingVolumeBase
  
isInFrustum(mvpMatrix:Matrix3D):Boolean
[override] todo: pass planes? Tests if the bounds are in the camera frustum.
BoundingSphere
  
nullify():void
[override] Sets the bounds to zero size.
BoundingSphere
  
rayIntersection(position:Vector3D, direction:Vector3D, targetNormal:Vector3D):Number
[override]
BoundingSphere
Protected Methods
 MethodDefined By
  
[override]
BoundingSphere
 Inherited
BoundingVolumeBase
  
[override]
BoundingSphere
Property Detail
radiusproperty
radius:Number  [read-only]

The radius of the bounding sphere, calculated from the contents of the entity.


Implementation
    public function get radius():Number
Constructor Detail
BoundingSphere()Constructor
public function BoundingSphere()

Creates a new BoundingSphere object

Method Detail
clone()method
override public function clone():BoundingVolumeBase

Clones the current BoundingVolume object

Returns
BoundingVolumeBase — An exact duplicate of this object
containsPoint()method 
override public function containsPoint(position:Vector3D):Boolean

Method for calculating whether the given position is contained within the bounding volume.

Parameters

position:Vector3D — The position in local coordinates to be checked.

Returns
Boolean — A Boolean value representing the detection of a contained position.
createBoundingRenderable()method 
override protected function createBoundingRenderable():WireframePrimitiveBase

Returns
WireframePrimitiveBase
fromExtremes()method 
override public function fromExtremes(minX:Number, minY:Number, minZ:Number, maxX:Number, maxY:Number, maxZ:Number):void

Sets the bounds to the given extrema.

Parameters

minX:Number — The minimum x value of the bounds
 
minY:Number — The minimum y value of the bounds
 
minZ:Number — The minimum z value of the bounds
 
maxX:Number — The maximum x value of the bounds
 
maxY:Number — The maximum y value of the bounds
 
maxZ:Number — The maximum z value of the bounds

fromSphere()method 
override public function fromSphere(center:Vector3D, radius:Number):void

Sets the bound to fit a given sphere.

Parameters

center:Vector3D — The center of the sphere to be bounded
 
radius:Number — The radius of the sphere to be bounded

isInFrustum()method 
override public function isInFrustum(mvpMatrix:Matrix3D):Boolean

todo: pass planes? Tests if the bounds are in the camera frustum.

Parameters

mvpMatrix:Matrix3D — The model view projection matrix for the object to which this bounding box belongs.

Returns
Boolean — True if the bounding box is at least partially inside the frustum
nullify()method 
override public function nullify():void

Sets the bounds to zero size.

rayIntersection()method 
override public function rayIntersection(position:Vector3D, direction:Vector3D, targetNormal:Vector3D):Number

Parameters

position:Vector3D
 
direction:Vector3D
 
targetNormal:Vector3D

Returns
Number
updateBoundingRenderable()method 
override protected function updateBoundingRenderable():void