Packageorg.rapidphysics
Classpublic class RapidObject
InheritanceRapidObject Inheritance RapidBasic Inheritance Object
Subclasses RapidCircle, RapidLine, RapidPoint, RapidText

This class has LOTS of physics properties.



Public Properties
 PropertyDefined By
  acceleration : Point
Mess with this in your update loop
RapidObject
 Inheritedactive : Boolean
RapidBasic
  center : Point
Relative to (x,y)
RapidObject
 Inheritedexists : Boolean
RapidBasic
  fillColor : uint
RapidObject
  fixed : Boolean = false
Set to true to prevent this object from moving
RapidObject
  height : Number
Depending on the shape, height can totally be negative!
RapidObject
  lineColor : uint
0xRRGGBB
RapidObject
  maxVelocity : Point
RapidObject
  nextPosition : Point
RapidObject
  nextVelocity : Point
RapidObject
  nextX : Number
RapidObject
  nextY : Number
RapidObject
  position : Point
RapidObject
  predictMotionFunction : Function
I wrote some code to allow dynamic changes between Euler integration and Verlet integration.
RapidObject
  prevX : Number
RapidObject
  prevY : Number
RapidObject
  radians : Number
RapidObject
  shape : Shape
RapidObject
  thickness : Number = 1
RapidObject
  velocity : Point
Mess with this in your update loop
RapidObject
 Inheritedvisible : Boolean
RapidBasic
  width : Number
Depending on the shape, width can totally be negative!
RapidObject
  x : Number
RapidObject
  y : Number
RapidObject
Protected Properties
 PropertyDefined By
  alpha : Number
RapidObject
  _point : Point
General usage
RapidObject
Public Methods
 MethodDefined By
  
RapidObject(X:Number = 0, Y:Number = 0)
RapidObject
  
debugDraw():void
[override]
RapidObject
  
destroy():void
[override]
RapidObject
  
draw():void
[override]
RapidObject
  
postUpdate():void
[override] Predicts where this object will be by the next preUpdate() Provides enough information to draw physics information, and resolve collisions
RapidObject
  
preDraw():void
[override]
RapidObject
  
preUpdate():void
[override] Occurs right after collision resolution Set x to nextX, etc etc
RapidObject
  
reset(X:Number, Y:Number):void
RapidObject
  
setIntegrationMethod(method:Number):void
takes RapidG.INTEGRATION_EULER, etc.
RapidObject
  
update():void
[override] Add your game's update logic here
RapidObject
Protected Methods
 MethodDefined By
  
RapidObject
  
RapidObject
  
Override this function if your shape has a different center
RapidObject
  
RapidObject
Property Detail
_pointproperty
protected var _point:Point

General usage

accelerationproperty 
public var acceleration:Point

Mess with this in your update loop

alphaproperty 
protected var alpha:Number

centerproperty 
public var center:Point

Relative to (x,y)

fillColorproperty 
public var fillColor:uint

fixedproperty 
public var fixed:Boolean = false

Set to true to prevent this object from moving

heightproperty 
public var height:Number

Depending on the shape, height can totally be negative!

lineColorproperty 
public var lineColor:uint

0xRRGGBB

maxVelocityproperty 
public var maxVelocity:Point

nextPositionproperty 
public var nextPosition:Point

nextVelocityproperty 
public var nextVelocity:Point

nextXproperty 
nextX:Number


Implementation
    public function get nextX():Number
    public function set nextX(value:Number):void
nextYproperty 
nextY:Number


Implementation
    public function get nextY():Number
    public function set nextY(value:Number):void
positionproperty 
public var position:Point

predictMotionFunctionproperty 
public var predictMotionFunction:Function

I wrote some code to allow dynamic changes between Euler integration and Verlet integration. This isn't too practical for actual usage, but good for engine development

prevXproperty 
public var prevX:Number

prevYproperty 
public var prevY:Number

radiansproperty 
public var radians:Number

shapeproperty 
public var shape:Shape

thicknessproperty 
public var thickness:Number = 1

velocityproperty 
public var velocity:Point

Mess with this in your update loop

widthproperty 
public var width:Number

Depending on the shape, width can totally be negative!

xproperty 
x:Number


Implementation
    public function get x():Number
    public function set x(value:Number):void
yproperty 
y:Number


Implementation
    public function get y():Number
    public function set y(value:Number):void
Constructor Detail
RapidObject()Constructor
public function RapidObject(X:Number = 0, Y:Number = 0)



Parameters
X:Number (default = 0)
 
Y:Number (default = 0)
Method Detail
debugDraw()method
override public function debugDraw():void

destroy()method 
override public function destroy():void

draw()method 
override public function draw():void

postUpdate()method 
override public function postUpdate():void

Predicts where this object will be by the next preUpdate() Provides enough information to draw physics information, and resolve collisions

predictMotionEuler()method 
protected function predictMotionEuler():void

predictMotionVerlet()method 
protected function predictMotionVerlet():void

preDraw()method 
override public function preDraw():void

preUpdate()method 
override public function preUpdate():void

Occurs right after collision resolution Set x to nextX, etc etc

reset()method 
public function reset(X:Number, Y:Number):void

Parameters

X:Number
 
Y:Number

setIntegrationMethod()method 
public function setIntegrationMethod(method:Number):void

takes RapidG.INTEGRATION_EULER, etc.

Parameters

method:Number

update()method 
override public function update():void

Add your game's update logic here

updateCenter()method 
protected function updateCenter():void

Override this function if your shape has a different center

updateMotion()method 
protected function updateMotion():void