| Package | org.flintparticles.twoD.zones |
| Class | public class DiscSectorZone |
| Inheritance | DiscSectorZone Object |
| Implements | Zone2D |
| Property | Defined By | ||
|---|---|---|---|
| center : Point
The centre of the disc. | DiscSectorZone | ||
| centerX : Number
The x coordinate of the point that is the center of the disc. | DiscSectorZone | ||
| centerY : Number
The y coordinate of the point that is the center of the disc. | DiscSectorZone | ||
| innerRadius : Number
The radius of the inner edge of the disc. | DiscSectorZone | ||
| maxAngle : Number
The maximum angle, in radians, for points to be included in the zone. | DiscSectorZone | ||
| minAngle : Number
The minimum angle, in radians, for points to be included in the zone. | DiscSectorZone | ||
| outerRadius : Number
The radius of the outer edge of the disc. | DiscSectorZone | ||
| Method | Defined By | ||
|---|---|---|---|
DiscSectorZone(center:Point = null, outerRadius:Number = 0, innerRadius:Number = 0, minAngle:Number = 0, maxAngle:Number = 0)
The constructor defines a DiscSectorZone zone. | DiscSectorZone | ||
collideParticle(particle:Particle2D, bounce:Number = 1):Boolean
Manages collisions between a particle and the zone. | DiscSectorZone | ||
contains(x:Number, y:Number):Boolean
The contains method determines whether a point is inside the zone. | DiscSectorZone | ||
getArea():Number
The getArea method returns the size of the zone. | DiscSectorZone | ||
getLocation():Point
The getLocation method returns a random point inside the zone. | DiscSectorZone | ||
| center | property |
center:PointThe centre of the disc.
public function get center():Point public function set center(value:Point):void| centerX | property |
centerX:NumberThe x coordinate of the point that is the center of the disc.
public function get centerX():Number public function set centerX(value:Number):void| centerY | property |
centerY:NumberThe y coordinate of the point that is the center of the disc.
public function get centerY():Number public function set centerY(value:Number):void| innerRadius | property |
innerRadius:NumberThe radius of the inner edge of the disc.
public function get innerRadius():Number public function set innerRadius(value:Number):void| maxAngle | property |
maxAngle:NumberThe maximum angle, in radians, for points to be included in the zone. An angle of zero is horizontal and to the right. Positive angles are in a clockwise direction (towards the graphical y axis). Angles are converted to a value between 0 and two times PI.
public function get maxAngle():Number public function set maxAngle(value:Number):void| minAngle | property |
minAngle:NumberThe minimum angle, in radians, for points to be included in the zone. An angle of zero is horizontal and to the right. Positive angles are in a clockwise direction (towards the graphical y axis). Angles are converted to a value between 0 and two times PI.
public function get minAngle():Number public function set minAngle(value:Number):void| outerRadius | property |
outerRadius:NumberThe radius of the outer edge of the disc.
public function get outerRadius():Number public function set outerRadius(value:Number):void| DiscSectorZone | () | Constructor |
public function DiscSectorZone(center:Point = null, outerRadius:Number = 0, innerRadius:Number = 0, minAngle:Number = 0, maxAngle:Number = 0)The constructor defines a DiscSectorZone zone.
Parameterscenter:Point (default = null) — The centre of the disc.
| |
outerRadius:Number (default = 0) — The radius of the outer edge of the disc.
| |
innerRadius:Number (default = 0) — If set, this defines the radius of the inner
edge of the disc. Points closer to the center than this inner radius
are excluded from the zone. If this parameter is not set then all
points inside the outer radius are included in the zone.
| |
minAngle:Number (default = 0) — The minimum angle, in radians, for points to be included in the zone.
An angle of zero is horizontal and to the right. Positive angles are in a clockwise
direction (towards the graphical y axis). Angles are converted to a value between 0
and two times PI.
| |
maxAngle:Number (default = 0) — The maximum angle, in radians, for points to be included in the zone.
An angle of zero is horizontal and to the right. Positive angles are in a clockwise
direction (towards the graphical y axis). Angles are converted to a value between 0
and two times PI.
|
| collideParticle | () | method |
public function collideParticle(particle:Particle2D, bounce:Number = 1):BooleanManages collisions between a particle and the zone. The particle will collide with the edges of the disc sector defined for this zone, from inside or outside the disc. In the interests of speed, these collisions do not take account of the collisionRadius of the particle.
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.
|