Packagecom.desuade.motion.physics
Classpublic class PrimitivePhysics
InheritancePrimitivePhysics Inheritance BasePrimitive Inheritance Object

Language Version : ActionScript 3
Since : 29.07.2009
Runtime Versions : AIR 1.0, Flash Player 9.0.0

This is a primitive physics object that applies velocity, acceleration, and friction.



Public Properties
 PropertyDefined By
  acceleration : Number
The acceleration of the property.
PrimitivePhysics
  duration : int = 0
How long the physics calculations should be applied for.
PrimitivePhysics
 Inheritedended : Boolean = false
Has the Primitive ended or not.
BasePrimitive
 InheritedendFunc : Function
The function to run on end.
BasePrimitive
  flip : Boolean
Setting this to true will 'flip' the way the property is handled.
PrimitivePhysics
  friction : Number
The friction of the property.
PrimitivePhysics
 Inheritedid : int
This is the unique internal id of the item.
BasePrimitive
 Inheritedisclean : Boolean = true
This is used by the pool to determine if/how the Primitive has been used before in memory.
BasePrimitive
 Inheritedproperty : String
The property on the target.
BasePrimitive
 Inheritedtarget : Object
The target object.
BasePrimitive
 InheritedupdateFunc : Function
The function to run on update.
BasePrimitive
  velocity : Number
The velocity of the property.
PrimitivePhysics
Public Methods
 MethodDefined By
  
The PrimitivePhysics object.
PrimitivePhysics
 Inherited
end(broadcast:Boolean = true):void
This ends the Primitive immediately.
BasePrimitive
  
init(... args):void
[override] This inits the PrimitivePhysics.
PrimitivePhysics
 Inherited
render(time:int):void
This renders the primitive.
BasePrimitive
Property Detail
accelerationproperty
public var acceleration:Number

The acceleration of the property. This is added to the current velocity. A negative acceleration would represent gravity.

durationproperty 
public var duration:int = 0

How long the physics calculations should be applied for.

flipproperty 
public var flip:Boolean

Setting this to true will 'flip' the way the property is handled. This is for properties such as 'y' that are reversed from the cartesian coordinate system.

frictionproperty 
friction:Number

The friction of the property. This will slow down the velocity to 0 if there is no acceleration. Should be a positive number.


Implementation
    public function get friction():Number
    public function set friction(value:Number):void
velocityproperty 
public var velocity:Number

The velocity of the property. This is added to the current value every frame - ie: FPS of 50, with a velocity of 2 = 100/second.

Constructor Detail
PrimitivePhysics()Constructor
public function PrimitivePhysics()

The PrimitivePhysics object.

Method Detail
init()method
override public function init(... args):void

This inits the PrimitivePhysics.

Parameters

... args