Force | +--com.robertpenner.physics.forces.ElasticForce
The ElasticForce class implements elastic force according to Hooke's Law. Extends the Force class. Designed to collaborate with the PhysicsParticle class.
ActionScript 2.0; Flash Player 6
Property summary
Property | Description |
---|---|
anchor:Vector |
The anchor property of the ElasticForce. |
tautness:Number |
The tautness property of the ElasticForce. |
Method summary
Method | Description |
---|---|
getAnchor() : Vector |
Gets the anchor of an ElasticForce instance. |
setAnchor(x:Number, y:Number) : Void |
Sets the anchor of an ElasticForce instance. |
var eForce:ElasticForce = new ElasticForce(0, 0, .002);
anchorX:Number
- The x position that the particle is pulled towards.
anchorY:Number
- The y position that the particle is pulled towards.
tautness:Number
- The stiffness of the force of elasticity; a value between 0 and 1.
life:Number
- The lifespan of the force in frames; this defaults to infinity if the parameter is omitted.
Creates an instance of the ElasticForce class.
trace (eForce.getAnchor());
Nothing.
Gets the anchor of an ElasticForce instance.
var eForce:ElasticForce = new ElasticForce(0, 0, .002);
eForce.setAnchor(100, 250);
x:Number
- The anchor's x position of the ElasticForce.
y:Number
- The anchor's y position of the ElasticForce.
Nothing.
Sets the anchor of an ElasticForce instance.
trace (eForce.anchor);
The anchor property of the ElasticForce.
trace (eForce.tautness);
The tautness property of the ElasticForce.