| Package | org.flintparticles.twoD.zones |
| Class | public class LineZone |
| Inheritance | LineZone Object |
| Implements | Zone2D |
| Property | Defined By | ||
|---|---|---|---|
| end : Point
The point at the other end of the line. | LineZone | ||
| endX : Number
The x coordinate of the point at the end of the line. | LineZone | ||
| endY : Number
The y coordinate of the point at the end of the line. | LineZone | ||
| start : Point
The point at one end of the line. | LineZone | ||
| startX : Number
The x coordinate of the point at the start of the line. | LineZone | ||
| startY : Number
The y coordinate of the point at the start of the line. | LineZone | ||
| Method | Defined By | ||
|---|---|---|---|
LineZone(start:Point = null, end:Point = null)
The constructor creates a LineZone zone. | LineZone | ||
collideParticle(particle:Particle2D, bounce:Number = 1):Boolean
Manages collisions between a particle and the zone. | LineZone | ||
contains(x:Number, y:Number):Boolean
Determines whether a point is inside the zone. | LineZone | ||
getArea():Number
Returns the size of the zone. | LineZone | ||
getLocation():Point
Returns a random point inside the zone. | LineZone | ||
| end | property |
end:PointThe point at the other end of the line.
public function get end():Point public function set end(value:Point):void| endX | property |
endX:NumberThe x coordinate of the point at the end of the line.
public function get endX():Number public function set endX(value:Number):void| endY | property |
endY:NumberThe y coordinate of the point at the end of the line.
public function get endY():Number public function set endY(value:Number):void| start | property |
start:PointThe point at one end of the line.
public function get start():Point public function set start(value:Point):void| startX | property |
startX:NumberThe x coordinate of the point at the start of the line.
public function get startX():Number public function set startX(value:Number):void| startY | property |
startY:NumberThe y coordinate of the point at the start of the line.
public function get startY():Number public function set startY(value:Number):void| LineZone | () | Constructor |
public function LineZone(start:Point = null, end:Point = null)The constructor creates a LineZone zone.
Parametersstart:Point (default = null) — The point at one end of the line.
| |
end:Point (default = null) — The point at the other end of the line.
|
| collideParticle | () | method |
public function collideParticle(particle:Particle2D, bounce:Number = 1):BooleanManages collisions between a particle and the zone. The particle will collide with the line defined for this zone. In the interests of speed, the collisions are not exactly accurate at the ends of the line, but are accurate enough to ensure the particle doesn't pass through the line and to look realistic in most circumstances. 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):BooleanDetermines 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():NumberReturns the size of the zone. This method is used by the MultiZone class to manage the balancing between the different zones.
ReturnsNumber — the size of the zone.
|
| getLocation | () | method |
public function getLocation():PointReturns 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.
|