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

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.



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
Public Methods
 MethodDefined by
  
BoundingBox(minX:Number, maxX:Number, minY:Number, maxY:Number, minZ:Number, maxZ:Number, 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
  
Returns a value of -20, so that the BoundingBox executes after all movement has occured.
BoundingBox
 Inherited
This method does nothing.
ActionBase
  
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.
BoundingBox
Property detail
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
maxXproperty 
maxX:Number  [read-write]

The maxX coordinate of the box.

Implementation
    public function get maxX():Number
    public function set maxX(value:Number):void
maxYproperty 
maxY:Number  [read-write]

The maxY coordinate of the box.

Implementation
    public function get maxY():Number
    public function set maxY(value:Number):void
maxZproperty 
maxZ:Number  [read-write]

The maxZ coordinate of the box.

Implementation
    public function get maxZ():Number
    public function set maxZ(value:Number):void
minXproperty 
minX:Number  [read-write]

The minX coordinate of the box.

Implementation
    public function get minX():Number
    public function set minX(value:Number):void
minYproperty 
minY:Number  [read-write]

The minY coordinate of the box.

Implementation
    public function get minY():Number
    public function set minY(value:Number):void
minZproperty 
minZ:Number  [read-write]

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, maxX:Number, minY:Number, maxY:Number, minZ:Number, maxZ: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
minX:Number — The minX coordinate of the box.
 
maxX:Number — The maxX coordinate of the box.
 
minY:Number — The minY coordinate of the box.
 
maxY:Number — The maxY coordinate of the box.
 
minZ:Number — The minZ coordinate of the box.
 
maxZ:Number — 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
getDefaultPriority()method
public override function getDefaultPriority():Number

Returns a value of -20, so that the BoundingBox executes after all movement has occured.

Returns
Number

See also

update()method 
public override 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