Packagecitrus.physics
Classpublic class APhysicsEngine
InheritanceAPhysicsEngine Inheritance CitrusObject Inheritance Object
Subclasses AwayPhysics, Box2D, Nape

An abstract template used by every physics engine.



Public Properties
 PropertyDefined By
  animation : String
[read-only]
APhysicsEngine
  art : ICitrusArt
[read-only]
APhysicsEngine
  debugView : IDebugView
[read-only] Shortcut to the debugView use to change the debug drawer's flags with debugView.debugMode() or access it directly through debugView.debugDrawer.
APhysicsEngine
  depth : Number
[read-only]
APhysicsEngine
  group : uint
APhysicsEngine
  height : Number
[read-only]
APhysicsEngine
 InheritedhideParamWarnings : Boolean = false
[static]
CitrusObject
 InheritedID : uint
[read-only]
CitrusObject
  inverted : Boolean
[read-only]
APhysicsEngine
 Inheritedkill : Boolean = false
Set it to true if you want to remove, clean and destroy the object.
CitrusObject
 Inheritedname : String
A name to identify easily an objet.
CitrusObject
  offsetX : Number
[read-only]
APhysicsEngine
  offsetY : Number
[read-only]
APhysicsEngine
  parallaxX : Number
[read-only]
APhysicsEngine
  parallaxY : Number
[read-only]
APhysicsEngine
  realDebugView : *
[read-only]
APhysicsEngine
  registration : String
[read-only]
APhysicsEngine
  rotation : Number
[read-only]
APhysicsEngine
  touchable : Boolean
APhysicsEngine
 Inheritedtype : String = classicObject
Added to the CE's render list via the State and the add method.
CitrusObject
 InheritedupdateCallEnabled : Boolean = false
This property prevent the update method to be called by the enter frame, it will save performances.
CitrusObject
  velocity : Array
[read-only]
APhysicsEngine
  view : *
APhysicsEngine
  visible : Boolean
APhysicsEngine
  width : Number
[read-only]
APhysicsEngine
  x : Number
[read-only]
APhysicsEngine
  y : Number
[read-only]
APhysicsEngine
  z : Number
[read-only]
APhysicsEngine
Protected Properties
 PropertyDefined By
  _art : ICitrusArt
APhysicsEngine
 Inherited_ce : CitrusEngine
CitrusObject
  _group : uint = 1
APhysicsEngine
 Inherited_initialized : Boolean = false
CitrusObject
 Inherited_params : Object
CitrusObject
  _realDebugView : *
APhysicsEngine
 Inherited_timeDelta : Number
The time elasped between two update call.
CitrusObject
  _touchable : Boolean = false
APhysicsEngine
  _view : *
APhysicsEngine
  _visible : Boolean = false
APhysicsEngine
Public Methods
 MethodDefined By
  
APhysicsEngine(name:String, params:Object = null)
APhysicsEngine
 Inherited
destroy():void
Seriously, dont' forget to release your listeners, signals, and physics objects here.
CitrusObject
  
APhysicsEngine
  
APhysicsEngine
  
handleArtReady(citrusArt:ICitrusArt):void
APhysicsEngine
 Inherited
initialize(poolObjectParams:Object = null):void
Call in the constructor if the Object is added via the State and the add method.
CitrusObject
 Inherited
setParams(object:Object, params:Object):void
The initialize method usually calls this.
CitrusObject
 Inherited
toString():String
CitrusObject
 Inherited
update(timeDelta:Number):void
The current state calls update every tick.
CitrusObject
Property Detail
_artproperty
protected var _art:ICitrusArt

_groupproperty 
protected var _group:uint = 1

_realDebugViewproperty 
protected var _realDebugView:*

_touchableproperty 
protected var _touchable:Boolean = false

_viewproperty 
protected var _view:*

_visibleproperty 
protected var _visible:Boolean = false

animationproperty 
animation:String  [read-only]


Implementation
    public function get animation():String
artproperty 
art:ICitrusArt  [read-only]


Implementation
    public function get art():ICitrusArt
debugViewproperty 
debugView:IDebugView  [read-only]

Shortcut to the debugView use to change the debug drawer's flags with debugView.debugMode() or access it directly through debugView.debugDrawer. exists only after the physics engine has been added to the state. Example : changing the debug views flags: Box2D : var b2d:Box2D = new Box2D("b2d"); b2d.gravity = b2Vec2.Make(0,0); b2d.visible = true; add(b2d); b2d.debugView.debugMode(b2DebugDraw.e_shapeBit|b2DebugDraw.e_jointBit); //or (b2d.debugView.debugDrawer as b2DebugDraw).SetFlags(b2DebugDraw.e_shapeBit | b2DebugDraw.e_jointBit); Nape: nape = new Nape("nape"); nape.visible = true; add(nape); nape.debugView.debugMode(NapeDebugArt.draw_Bodies | NapeDebugArt.draw_BodyDetail | NapeDebugArt.draw_CollisionArbiters); //or var shapedebug:ShapeDebug = nape.debugView.debugDrawer as ShapeDebug; shapedebug.drawBodies = true; shapedebug.drawBodyDetail = true; shapedebug.drawCollisionArbiters = true;


Implementation
    public function get debugView():IDebugView
depthproperty 
depth:Number  [read-only]


Implementation
    public function get depth():Number
groupproperty 
group:uint


Implementation
    public function get group():uint
    public function set group(value:uint):void
heightproperty 
height:Number  [read-only]


Implementation
    public function get height():Number
invertedproperty 
inverted:Boolean  [read-only]


Implementation
    public function get inverted():Boolean
offsetXproperty 
offsetX:Number  [read-only]


Implementation
    public function get offsetX():Number
offsetYproperty 
offsetY:Number  [read-only]


Implementation
    public function get offsetY():Number
parallaxXproperty 
parallaxX:Number  [read-only]


Implementation
    public function get parallaxX():Number
parallaxYproperty 
parallaxY:Number  [read-only]


Implementation
    public function get parallaxY():Number
realDebugViewproperty 
realDebugView:*  [read-only]


Implementation
    public function get realDebugView():*
registrationproperty 
registration:String  [read-only]


Implementation
    public function get registration():String
rotationproperty 
rotation:Number  [read-only]


Implementation
    public function get rotation():Number
touchableproperty 
touchable:Boolean


Implementation
    public function get touchable():Boolean
    public function set touchable(value:Boolean):void
velocityproperty 
velocity:Array  [read-only]


Implementation
    public function get velocity():Array
viewproperty 
view:*


Implementation
    public function get view():*
    public function set view(value:any):void
visibleproperty 
visible:Boolean


Implementation
    public function get visible():Boolean
    public function set visible(value:Boolean):void
widthproperty 
width:Number  [read-only]


Implementation
    public function get width():Number
xproperty 
x:Number  [read-only]


Implementation
    public function get x():Number
yproperty 
y:Number  [read-only]


Implementation
    public function get y():Number
zproperty 
z:Number  [read-only]


Implementation
    public function get z():Number
Constructor Detail
APhysicsEngine()Constructor
public function APhysicsEngine(name:String, params:Object = null)



Parameters
name:String
 
params:Object (default = null)
Method Detail
getBody()method
public function getBody():*

Returns
*
handleArtChanged()method 
public function handleArtChanged(citrusArt:ICitrusArt):void

Parameters

citrusArt:ICitrusArt

handleArtReady()method 
public function handleArtReady(citrusArt:ICitrusArt):void

Parameters

citrusArt:ICitrusArt