Packageidv.cjcat.stardust.twoD.actions
Classpublic class Deflect
InheritanceDeflect Inheritance Action2D Inheritance Action Inheritance StardustElement

This action is useful to manipulate a particle's position and velocity as you like.

Each deflector returns a MotionData4D object, which contains four numeric properties: x, y, vx, and vy, according to the particle's positoin and velocity. The particle's position and velocity are then reassigned to the new values (x, y) and (vx, vy), respectively.

Deflectors can be used to create obstacles, bounding boxes, etc.

Default priority = -5;

See also

idv.cjcat.stardust.twoD.deflectors.Deflector


Public Properties
 PropertyDefined by
 Inheritedactive : Boolean
Denotes if the action is active, true by default.
Action
 Inheritedmask : int
The action will affect a particle only if it's active and the bitwise AND of the action's mask and the particle's mask is non-zero, 1 by default.
Action
 Inheritedname : String
StardustElement
 InheritedneedsSortedParticles : Boolean
Tells the emitter whether this action requires that particles must be sorted before the update() calls.
Action
 InheritedonAdd : ISignal
Dispatched when the added to an emitter.
Action
 InheritedonPriorityChange : ISignal
Dispatched when the action's priority is changed.
Action
 InheritedonRemove : ISignal
Dispatched when the removed from an emitter.
Action
 Inheritedpriority : int
Actions will be sorted by the associated emitter according to their priorities.
Action
 InheritedskipThisAction : Boolean
Reset to false on each emitter step.
Action
 Inheritedsupports2D : Boolean
Whether this action supports 2D.
Action
 Inheritedsupports3D : Boolean
Whether this action supports 3D.
Action
Public Methods
 MethodDefined by
  
Deflect
  
addDeflector(deflector:Deflector):void
Adds a deflector to the simulation.
Deflect
  
Removes all deflectors from the simulation.
Deflect
 Inherited
Action
  
Deflect
 Inherited
getXMLTag():XML
Returns the root tag of the XML representation.
StardustElement
  
getXMLTagName():String
Deflect
  
parseXML(xml:XML, builder:XMLBuilder = null):void
Deflect
 Inherited
postUpdate(emitter:Emitter, time:Number):void
[Template Method] This method is called once after each Emitter.step() method call, after the update() calls with each particles in the emitter.
Action
  
removeDeflector(deflector:Deflector):void
Removes a deflector from the simulation.
Deflect
  
toXML():XML
Deflect
  
update(emitter:Emitter, particle:Particle, time:Number):void
Deflect
Constructor detail
Deflect()constructor
public function Deflect()
Method detail
addDeflector()method
public function addDeflector(deflector:Deflector):void

Adds a deflector to the simulation.

Parameters
deflector:Deflector
clearDeflectors()method 
public function clearDeflectors():void

Removes all deflectors from the simulation.

getRelatedObjects()method 
public override function getRelatedObjects():Array

Returns
Array
getXMLTagName()method 
public override function getXMLTagName():String

Returns
String
parseXML()method 
public override function parseXML(xml:XML, builder:XMLBuilder = null):voidParameters
xml:XML
 
builder:XMLBuilder (default = null)
removeDeflector()method 
public function removeDeflector(deflector:Deflector):void

Removes a deflector from the simulation.

Parameters
deflector:Deflector
toXML()method 
public override function toXML():XML

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