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


Inherited from BoundingVolumeBase.


Can be created using method new:

Lib.Away3D.Bounds.BoundingSphere.new()

Creates a new BoundingSphere object



Created BoundingSphere object has properties:

radius

[read-only] The radius of the bounding sphere, calculated from the contents of the entity.


methods:

clone()

Clones the current BoundingVolume object 


containsPoint(position)

Method for calculating whether the given position is contained within the bounding volume. Returns true/false

position - Vector3D, The position in local coordinates to be checked. 

fromExtremes(minX, minY, minZ, maxX, maxY, maxZ)

Sets the bounds to the given extrema.

minX - The minimum x value of the bounds

minY - The minimum y value of the bounds 

minZ - The minimum z value of the bounds

maxX - The maximum x value of the bounds

maxY - The maximum y value of the bounds

maxZ - The maximum z value of the bounds 

fromSphere(center, radius)

Sets the bound to fit a given sphere.

center - Vector3D, The center of the sphere to be bounded

radius - Number, The radius of the sphere to be bounded 

isInFrustum(planes, numPlanes)

Tests if the bounds are in the camera frustum. Returns true/false

planes - table of Plane3D objects

numPlanes - number of planes to test

nullify()

Sets the bounds to zero size.


rayIntersection(position:Vector3D, direction:Vector3D, targetNormal:Vector3D):Number

Method for calculating whether an intersection of the given ray occurs with the bounding volume. Returns  ray entry distance or -1.

position -Vector3D, The starting position of the casting ray in local coordinates.

direction - Vector3D, A unit vector representing the direction of the casting ray in local coordinates.

targetNorma - Vector3D, The vector to store the bounds' normal at the point of collision

Created with the Personal Edition of HelpNDoc: Write EPub books for the iPad