Packageorg.flintparticles.threeD.actions
Classpublic class BoundingBox
InheritanceBoundingBox Inheritance ActionBase Inheritance Object

The BoundingBox action confines each particle to a box. The box is aligned to the coordinate system axes. 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. This action has a priority of -20, so that it executes after all movement has occured.



Public Properties
 PropertyDefined By
  bounce : Number
The coefficient of restitution when the particles bounce off the sides of the box.
BoundingBox
  maxX : Number
The maxX coordinate of the box.
BoundingBox
  maxY : Number
The maxY coordinate of the box.
BoundingBox
  maxZ : Number
The maxZ coordinate of the box.
BoundingBox
  minX : Number
The minX coordinate of the box.
BoundingBox
  minY : Number
The minY coordinate of the box.
BoundingBox
  minZ : Number
The minZ coordinate of the box.
BoundingBox
 Inheritedpriority : int
Returns a default priority of 0 for this action.
ActionBase
Protected Properties
 PropertyDefined By
 Inherited_priority : int = 0
ActionBase
Public Methods
 MethodDefined By
  
BoundingBox(minX:Number = 0, maxX:Number = 0, minY:Number = 0, maxY:Number = 0, minZ:Number = 0, maxZ:Number = 0, bounce:Number = 1)
The constructor creates a BoundingBox action for use by an emitter.
BoundingBox
 Inherited
addedToEmitter(emitter:Emitter):void
This method does nothing.
ActionBase
 Inherited
This method does nothing.
ActionBase
  
update(emitter:Emitter, particle:Particle, time:Number):void
[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
Property Detail
bounceproperty
bounce:Number

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
maxXproperty 
maxX:Number

The maxX coordinate of the box.


Implementation
    public function get maxX():Number
    public function set maxX(value:Number):void
maxYproperty 
maxY:Number

The maxY coordinate of the box.


Implementation
    public function get maxY():Number
    public function set maxY(value:Number):void
maxZproperty 
maxZ:Number

The maxZ coordinate of the box.


Implementation
    public function get maxZ():Number
    public function set maxZ(value:Number):void
minXproperty 
minX:Number

The minX coordinate of the box.


Implementation
    public function get minX():Number
    public function set minX(value:Number):void
minYproperty 
minY:Number

The minY coordinate of the box.


Implementation
    public function get minY():Number
    public function set minY(value:Number):void
minZproperty 
minZ:Number

The minZ coordinate of the box.


Implementation
    public function get minZ():Number
    public function set minZ(value:Number):void
Constructor Detail
BoundingBox()Constructor
public function BoundingBox(minX:Number = 0, maxX:Number = 0, minY:Number = 0, maxY:Number = 0, minZ:Number = 0, maxZ: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.

Parameters
minX:Number (default = 0) — The minX coordinate of the box.
 
maxX:Number (default = 0) — The maxX coordinate of the box.
 
minY:Number (default = 0) — The minY coordinate of the box.
 
maxY:Number (default = 0) — The maxY coordinate of the box.
 
minZ:Number (default = 0) — The minZ coordinate of the box.
 
maxZ:Number (default = 0) — The maxZ 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

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

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.

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