Packageorg.flintparticles.actions
Classpublic class BoundingBox
InheritanceBoundingBox Inheritance Action

The BoundingBox action confines each particle to a box. The particle bounces back off the side of the box when it reaches the edge. The bounce treats the particle as a circular body and displays no loss of energy in the collision.



Public Properties
 PropertyDefined 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
  box : Rectangle
The bounding box.
BoundingBox
  left : Number
The left coordinate of the bounding box.
BoundingBox
  right : Number
The left coordinate of the bounding box.
BoundingBox
  top : Number
The top coordinate of the bounding box.
BoundingBox
Public Methods
 MethodDefined by
  
BoundingBox(left:Number, top:Number, right:Number, bottom:Number, bounce:Number = 1)
The constructor creates a BoundingBox action for use by an emitter.
BoundingBox
 Inherited
addedToEmitter(emitter:Emitter):void
The addedToEmitter method is called by the emitter when the Action is added to it It is called within the emitter's addAction method and need not be called by the user.
Action
  
The getDefaultPriority method is used to order the execution of actions.
BoundingBox
 Inherited
The removedFromEmitter method is called by the emitter when the Action is removed from it It is called within the emitter's removeAction method and need not be called by the user.
Action
  
update(emitter:Emitter, particle:Particle, time:Number):void
The update method is used by the emitter to apply the action to every particle.
BoundingBox
Property detail
bottomproperty
bottom:Number  [read-write]

The left coordinate of the bounding box.

Implementation
    public function get bottom():Number
    public function set bottom(value:Number):void
bounceproperty 
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
boxproperty 
box:Rectangle  [read-write]

The bounding box.

Implementation
    public function get box():Rectangle
    public function set box(value:Rectangle):void
leftproperty 
left:Number  [read-write]

The left coordinate of the bounding box.

Implementation
    public function get left():Number
    public function set left(value:Number):void
rightproperty 
right:Number  [read-write]

The left coordinate of the bounding box.

Implementation
    public function get right():Number
    public function set right(value:Number):void
topproperty 
top:Number  [read-write]

The top coordinate of the bounding box.

Implementation
    public function get top():Number
    public function set top(value:Number):void
Constructor detail
BoundingBox()constructor
public function BoundingBox(left:Number, top:Number, right:Number, bottom:Number, 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.

Parameters
left:Number — The left coordinate of the box. The coordinates are in the coordinate space of the object containing the emitter.
 
top:Number — The top coordinate of the box. The coordinates are in the coordinate space of the object containing the emitter.
 
right:Number — The right coordinate of the box. The coordinates are in the coordinate space of the object containing the emitter.
 
bottom:Number — The bottom coordinate of the box. The coordinates are in the coordinate space of the object containing the emitter.
 
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

Method detail
getDefaultPriority()method
public override function getDefaultPriority():Number

The getDefaultPriority method is used to order the execution of actions. It is called within the emitter's addAction method when the user doesn't manually set a priority. It need not be called directly by the user.

Returns
Number
update()method 
public override function update(emitter:Emitter, particle:Particle, time:Number):void

The update method is used by the emitter to apply the action to every particle. It is called within the emitter's update loop 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.