Packageorg.flintparticles.twoD.zones
Classpublic class PointZone
InheritancePointZone Inheritance Object
Implements Zone2D

The PointZone zone defines a zone that contains a single point.



Public Properties
 PropertyDefined By
  point : Point
The point that is the zone.
PointZone
  x : Number
The x coordinate of the point that is the zone.
PointZone
  y : Number
The y coordinate of the point that is the zone.
PointZone
Public Methods
 MethodDefined By
  
PointZone(point:Point = null)
The constructor defines a PointZone zone.
PointZone
  
collideParticle(particle:Particle2D, bounce:Number = 1):Boolean
Manages collisions between a particle and the zone.
PointZone
  
contains(x:Number, y:Number):Boolean
The contains method determines whether a point is inside the zone.
PointZone
  
getArea():Number
The getArea method returns the size of the zone.
PointZone
  
getLocation():Point
The getLocation method returns a random point inside the zone.
PointZone
Property Detail
pointproperty
point:Point

The point that is the zone.


Implementation
    public function get point():Point
    public function set point(value:Point):void
xproperty 
x:Number

The x coordinate of the point that is the zone.


Implementation
    public function get x():Number
    public function set x(value:Number):void
yproperty 
y:Number

The y coordinate of the point that is the zone.


Implementation
    public function get y():Number
    public function set y(value:Number):void
Constructor Detail
PointZone()Constructor
public function PointZone(point:Point = null)

The constructor defines a PointZone zone.

Parameters
point:Point (default = null) — The point that is the zone.
Method Detail
collideParticle()method
public function collideParticle(particle:Particle2D, bounce:Number = 1):Boolean

Manages collisions between a particle and the zone. Particles will colide with the point defined for this zone. The collisionRadius of the particle is used when calculating the collision.

Parameters

particle:Particle2D — The particle to be tested for collision with the zone.
 
bounce:Number (default = 1) — The coefficient of restitution for the collision.

Returns
Boolean — Whether a collision occured.
contains()method 
public function contains(x:Number, y:Number):Boolean

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

Parameters

x:Number — The x coordinate of the location to test for.
 
y:Number — The y coordinate of the location to test for.

Returns
Boolean — true if point is inside the zone, false if it is outside.
getArea()method 
public function getArea():Number

The getArea method returns the size of the zone. This method is used by the MultiZone class. Usually, it need not be called directly by the user.

Returns
Number — a random point inside the zone.
getLocation()method 
public function getLocation():Point

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

Returns
Point — a random point inside the zone.