Packageflare.physics
Classpublic class Particle

Represents a Particle in a physics simulation. A particle is a point-mass (or point-charge) subject to physical forces.



Public Properties
 PropertyDefined by
  age : Number
The age of the particle in simulation ticks.
Particle
  degree : Number
The number of springs (degree) attached to this particle.
Particle
  die : Boolean
Flag indicating that the particle is scheduled for removal.
Particle
  fixed : Boolean
Flag indicating if the particule should have a fixed position.
Particle
  fx : Number
The x force exerted on the particle.
Particle
  fy : Number
The y force exerted on the particle.
Particle
  mass : Number
The mass (or charge) of the particle.
Particle
  tag : uint
Tag property for storing an arbitrary value.
Particle
  _vx : Number
A temporary x velocity variable.
Particle
  vx : Number
The x velocity of the particle.
Particle
  _vy : Number
A temporary y velocity variable.
Particle
  vy : Number
The y velocity of the particle.
Particle
  x : Number
The x position of the particle.
Particle
  y : Number
The y position of the particle.
Particle
Public Methods
 MethodDefined by
  
Particle(mass:Number = 1, x:Number = 0, y:Number = 0, vx:Number = 0, vy:Number = 0, fixed:Boolean = false)
Creates a new Particle with given parameters.
Particle
  
init(mass:Number = 1, x:Number = 0, y:Number = 0, vx:Number = 0, vy:Number = 0, fixed:Boolean = false):void
Initializes an existing particle instance.
Particle
  
kill():void
"Kills" this particle, scheduling it for removal in the next simulation cycle.
Particle
Property detail
ageproperty
public var age:Number

The age of the particle in simulation ticks.

degreeproperty 
public var degree:Number

The number of springs (degree) attached to this particle.

dieproperty 
public var die:Boolean

Flag indicating that the particle is scheduled for removal.

fixedproperty 
public var fixed:Boolean

Flag indicating if the particule should have a fixed position.

fxproperty 
public var fx:Number

The x force exerted on the particle.

fyproperty 
public var fy:Number

The y force exerted on the particle.

massproperty 
public var mass:Number

The mass (or charge) of the particle.

tagproperty 
public var tag:uint

Tag property for storing an arbitrary value.

_vxproperty 
public var _vx:Number

A temporary x velocity variable.

vxproperty 
public var vx:Number

The x velocity of the particle.

_vyproperty 
public var _vy:Number

A temporary y velocity variable.

vyproperty 
public var vy:Number

The y velocity of the particle.

xproperty 
public var x:Number

The x position of the particle.

yproperty 
public var y:Number

The y position of the particle.

Constructor detail
Particle()constructor
public function Particle(mass:Number = 1, x:Number = 0, y:Number = 0, vx:Number = 0, vy:Number = 0, fixed:Boolean = false)

Creates a new Particle with given parameters.

Parameters
mass:Number (default = 1) — the mass (or charge) of the particle
 
x:Number (default = 0) — the x position of the particle
 
y:Number (default = 0) — the y position of the particle
 
vx:Number (default = 0) — the x velocity of the particle
 
vy:Number (default = 0) — the y velocity of the particle
 
fixed:Boolean (default = false) — flag indicating if the particle should have a fixed position
Method detail
init()method
public function init(mass:Number = 1, x:Number = 0, y:Number = 0, vx:Number = 0, vy:Number = 0, fixed:Boolean = false):void

Initializes an existing particle instance.

Parameters
mass:Number (default = 1) — the mass (or charge) of the particle
 
x:Number (default = 0) — the x position of the particle
 
y:Number (default = 0) — the y position of the particle
 
vx:Number (default = 0) — the x velocity of the particle
 
vy:Number (default = 0) — the y velocity of the particle
 
fixed:Boolean (default = false) — flag indicating if the particle should have a fixed position
kill()method 
public function kill():void

"Kills" this particle, scheduling it for removal in the next simulation cycle.