Packageorg.flintparticles.threeD.zones
Classpublic class SphereZone
InheritanceSphereZone Inheritance Object
Implements Zone3D

The SphereZone zone defines a zone that contains all the points in a sphere. The sphere can be positioned anywhere in 3D space and may, optionally, be hollow in the middle.



Public Properties
 PropertyDefined By
  center : Vector3D
The point at the center of the sphere.
SphereZone
  innerRadius : Number
The radius of the hollow center of the sphere.
SphereZone
  outerRadius : Number
The outer radius of the sphere.
SphereZone
Public Methods
 MethodDefined By
  
SphereZone(center:Vector3D = null, outerRadius:Number = 0, innerRadius:Number = 0)
The constructor creates a SphereZone 3D zone.
SphereZone
  
contains(p:Vector3D):Boolean
The contains method determines whether a point is inside the sphere.
SphereZone
  
getLocation():Vector3D
The getLocation method returns a random point inside the sphere.
SphereZone
  
getVolume():Number
The getVolume method returns the volume of the sphere.
SphereZone
Property Detail
centerproperty
center:Vector3D

The point at the center of the sphere.


Implementation
    public function get center():Vector3D
    public function set center(value:Vector3D):void
innerRadiusproperty 
innerRadius:Number

The radius of the hollow center of the sphere.


Implementation
    public function get innerRadius():Number
    public function set innerRadius(value:Number):void
outerRadiusproperty 
outerRadius:Number

The outer radius of the sphere.


Implementation
    public function get outerRadius():Number
    public function set outerRadius(value:Number):void
Constructor Detail
SphereZone()Constructor
public function SphereZone(center:Vector3D = null, outerRadius:Number = 0, innerRadius:Number = 0)

The constructor creates a SphereZone 3D zone.

Parameters
center:Vector3D (default = null) — The point at the center of the sphere.
 
outerRadius:Number (default = 0) — The outer radius of the sphere.
 
innerRadius:Number (default = 0) — The inner radius of the sphere. This defines the hollow center of the sphere. If set to zero, the sphere is solid throughout.
Method Detail
contains()method
public function contains(p:Vector3D):Boolean

The contains method determines whether a point is inside the sphere. This method is used by the initializers and actions that use the zone. Usually, it need not be called directly by the user.

Parameters

p:Vector3D — The location to test.

Returns
Boolean — true if the location is inside the zone, false if it is outside.
getLocation()method 
public function getLocation():Vector3D

The getLocation method returns a random point inside the sphere. This method is used by the initializers and actions that use the zone. Usually, it need not be called directly by the user.

Returns
Vector3D — A random point inside the zone.
getVolume()method 
public function getVolume():Number

The getVolume method returns the volume of the sphere. This method is used by the MultiZone class. Usually, it need not be called directly by the user.

Returns
Number — the volume of the sphere.