The Zones interface must be implemented by all zones.
A zone is a class that defined a region in 2d space. The two required methods
make it easy to get a random point within the zone and to find whether a specific
point is within the zone. Zones are used to define the start location for particles
(in the Position initializer), to define the start velocity for particles (in the
Velocity initializer), and to define zones within which the particles die.
public function contains(p:Point3D):Boolean
The contains method determines whether a point is inside the zone.
Parameters
| p:Point3D — The x coordinate of the location to test for.
|
Returns
| Boolean — true if point is inside the zone, false if it is outside.
|
public function getLocation():Point3D
The getLocation method returns a random point inside the zone.
Returns
| Point3D —
a random point inside the zone.
|
public function getVolume():Number
The getArea method returns the size of the zone.
It's used by the MultiZone class to manage the balancing between the
different zones.
Returns
| Number — the size of the zone.
|
© Richard Lord 2010