| Package | org.flintparticles.twoD.actions |
| Class | public class BoundingBox |
| Inheritance | BoundingBox ActionBase |
| 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 | |
|
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:Number [read-write]The left coordinate of the bounding box.
Implementation public function get bottom():Number
public function set bottom(value:Number):void
| bounce | property |
bounce:Number [read-write]The 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.
Implementation public function get bounce():Number
public function set bounce(value:Number):void
| left | property |
left:Number [read-write]The left coordinate of the bounding box.
Implementation public function get left():Number
public function set left(value:Number):void
| right | property |
right:Number [read-write]The left coordinate of the bounding box.
Implementation public function get right():Number
public function set right(value:Number):void
| top | property |
top:Number [read-write]The top coordinate of the bounding box.
Implementation 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 |
public override 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
Parametersemitter: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