| Package | org.flintparticles.twoD.zones |
| Class | public class PointZone |
| Inheritance | PointZone Object |
| Implements | Zone2D |
| Property | Defined 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 | ||
| Method | Defined 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 | ||
| point | property |
point:PointThe point that is the zone.
public function get point():Point public function set point(value:Point):void| x | property |
x:NumberThe x coordinate of the point that is the zone.
public function get x():Number public function set x(value:Number):void| y | property |
y:NumberThe y coordinate of the point that is the zone.
public function get y():Number public function set y(value:Number):void| PointZone | () | Constructor |
public function PointZone(point:Point = null)The constructor defines a PointZone zone.
Parameterspoint:Point (default = null) — The point that is the zone.
|
| collideParticle | () | method |
public function collideParticle(particle:Particle2D, bounce:Number = 1):BooleanManages 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.
|
Boolean — Whether a collision occured.
|
| contains | () | method |
public function contains(x:Number, y:Number):BooleanThe 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.
|
Boolean — true if point is inside the zone, false if it is outside.
|
| getArea | () | method |
public function getArea():NumberThe 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.
ReturnsNumber — a random point inside the zone.
|
| getLocation | () | method |
public function getLocation():PointThe 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.
ReturnsPoint — a random point inside the zone.
|