| Package | org.flintparticles.twoD.actions |
| Class | public class BoundingBox |
| Inheritance | BoundingBox ActionBase Object |
| Property | Defined By | ||
|---|---|---|---|
| bottom : Number
The left coordinate of the bounding box. | BoundingBox | ||
| bounce : Number
The coefficient of restitution when the particles bounce off the
sides of the box. | BoundingBox | ||
| left : Number
The left coordinate of the bounding box. | BoundingBox | ||
![]() | priority : int
Returns a default priority of 0 for this action. | ActionBase | |
| right : Number
The left coordinate of the bounding box. | BoundingBox | ||
| top : Number
The top coordinate of the bounding box. | BoundingBox | ||
| Method | Defined By | ||
|---|---|---|---|
BoundingBox(left:Number = 0, top:Number = 0, right:Number = 0, bottom:Number = 0, bounce:Number = 1)
The constructor creates a BoundingBox action for use by
an emitter. | BoundingBox | ||
![]() | addedToEmitter(emitter:Emitter):void
This method does nothing. | ActionBase | |
![]() | removedFromEmitter(emitter:Emitter):void
This method does nothing. | ActionBase | |
[override]
Tests whether the particle is at the edge of the box and, if so,
adjusts its velocity to bounce in back towards the center of the
box. | BoundingBox | ||
| bottom | property |
bottom:NumberThe left coordinate of the bounding box.
public function get bottom():Number public function set bottom(value:Number):void| bounce | property |
bounce:NumberThe coefficient of restitution when the particles bounce off the sides of the box. A value of 1 gives a pure pure elastic collision, with no energy loss. A value between 0 and 1 causes the particle to loose enegy in the collision. A value greater than 1 causes the particle to gain energy in the collision.
public function get bounce():Number public function set bounce(value:Number):void| left | property |
left:NumberThe left coordinate of the bounding box.
public function get left():Number public function set left(value:Number):void| right | property |
right:NumberThe left coordinate of the bounding box.
public function get right():Number public function set right(value:Number):void| top | property |
top:NumberThe top coordinate of the bounding box.
public function get top():Number public function set top(value:Number):void| BoundingBox | () | Constructor |
public function BoundingBox(left:Number = 0, top:Number = 0, right:Number = 0, bottom:Number = 0, bounce:Number = 1)The constructor creates a BoundingBox action for use by an emitter. To add a BoundingBox to all particles created by an emitter, use the emitter's addAction method.
Parametersleft:Number (default = 0) — The left coordinate of the box.
| |
top:Number (default = 0) — The top coordinate of the box.
| |
right:Number (default = 0) — The right coordinate of the box.
| |
bottom:Number (default = 0) — The bottom coordinate of the box.
| |
bounce:Number (default = 1) — The coefficient of restitution when the particles bounce off the
sides of the box. A value of 1 gives a pure elastic collision, with no energy loss.
A value between 0 and 1 causes the particle 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):voidTests whether the particle is at the edge of the box and, if so, adjusts its velocity to bounce in back towards the center of the box.
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