| Package | idv.cjcat.stardust.twoD.actions |
| Class | public class Deflect |
| Inheritance | Deflect Action2D Action StardustElement |
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
| Method | Defined by | ||
|---|---|---|---|
|
Deflect()
| Deflect | ||
|
addDeflector(deflector:Deflector):void
Adds a deflector to the simulation.
| Deflect | ||
|
clearDeflectors():void
Removes all deflectors from the simulation.
| Deflect | ||
![]() |
getElementTypeXMLTag():XML
| Action | |
|
getRelatedObjects():Array
| Deflect | ||
![]() |
getXMLTag():XML
Returns the root tag of the XML representation.
| StardustElement | |
|
getXMLTagName():String
| Deflect | ||
|
parseXML(xml:XML, builder:XMLBuilder = null):void
| Deflect | ||
![]() |
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 | ||
| Deflect | |||
| Deflect | () | constructor |
public function Deflect()
| addDeflector | () | method |
public function addDeflector(deflector:Deflector):voidAdds a deflector to the simulation.
Parametersdeflector:Deflector |
| clearDeflectors | () | method |
public function clearDeflectors():voidRemoves 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):voidRemoves a deflector from the simulation.
Parametersdeflector: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 |