| Package | org.flintparticles.twoD.actions |
| Class | public class CollisionZone |
| Inheritance | CollisionZone ActionBase Object |
This action has a priority of -30, so that it executes after most other actions.
Default MXML Propertyzone
| Property | Defined By | ||
|---|---|---|---|
| bounce : Number
The coefficient of restitution when the particles collide. | CollisionZone | ||
![]() | priority : int
Returns a default priority of 0 for this action. | ActionBase | |
| zone : Zone2D
The zone that the particles should collide with. | CollisionZone | ||
| Method | Defined By | ||
|---|---|---|---|
CollisionZone(zone:Zone2D = null, bounce:Number = 1)
The constructor creates a CollisionZone action for use by an emitter. | CollisionZone | ||
![]() | addedToEmitter(emitter:Emitter):void
This method does nothing. | ActionBase | |
![]() | removedFromEmitter(emitter:Emitter):void
This method does nothing. | ActionBase | |
[override]
Checks for collisions between the particle and the zone. | CollisionZone | ||
| bounce | property |
bounce:NumberThe coefficient of restitution when the particles collide. A value of 1 gives a pure elastic collision, with no energy loss. A value between 0 and 1 causes the particles to loose enegy in the collision. A value greater than 1 causes the particles to gain energy in the collision.
public function get bounce():Number public function set bounce(value:Number):void| zone | property |
zone:Zone2DThe zone that the particles should collide with.
public function get zone():Zone2D public function set zone(value:Zone2D):void| CollisionZone | () | Constructor |
public function CollisionZone(zone:Zone2D = null, bounce:Number = 1)The constructor creates a CollisionZone action for use by an emitter. To add a CollisionZone to all particles managed by an emitter, use the emitter's addAction method.
Parameterszone:Zone2D (default = null) — The zone that the particles should collide with.
| |
bounce:Number (default = 1) — The coefficient of restitution when the particles collide.
A value of 1 gives a pure elastic collision, with no energy loss. A
value between 0 and 1 causes the particles to loose enegy in the
collision. A value greater than 1 causes the particle to gain energy
in the collision.
|
See also
| update | () | method |
override public function update(emitter:Emitter, particle:Particle, time:Number):voidChecks for collisions between the particle and the zone.
This method is called by the emitter and need not be called by the user.
Parameters
emitter:Emitter — The Emitter that created the particle.
| |
particle:Particle — The particle to be updated.
| |
time:Number — The duration of the frame - used for time based updates.
|
See also