Packagecom.whirled.contrib.platformer.board
Classpublic class SimpleActorBounds
InheritanceSimpleActorBounds Inheritance ActorBounds Inheritance DynamicBounds
ImplementsSimpleBounds

Provides collision detection support for an actor that has an axis aligned rectangular bounding box.



Public Properties
 PropertyDefined by
 Inheritedactor : Actor
ActorBounds
 Inheritedcontroller : DynamicController
DynamicBounds
 Inheriteddyn : Dynamic
DynamicBounds
  fcCalls : int = 0
[static]
SimpleActorBounds
  hitX : Boolean
SimpleActorBounds
  hitY : Boolean
SimpleActorBounds
Protected Properties
 PropertyDefined by
  _buffer : Array
SimpleActorBounds
 Inherited_collider : Collider
DynamicBounds
  _hitX : Boolean
SimpleActorBounds
  _hitY : Boolean
SimpleActorBounds
  _lines : Array
SimpleActorBounds
  _log : String
SimpleActorBounds
  _mlines : Array
SimpleActorBounds
 Inherited_rect : Rect
DynamicBounds
  _resetMLines : Boolean
SimpleActorBounds
Public Methods
 MethodDefined by
  
SimpleActorBounds
  
adjustHeight(newHeight:Number):Boolean
SimpleActorBounds
 Inherited
checkAndPush(dest:Array, source:Array):void
DynamicBounds
  
collidedWith(ab:SimpleActorBounds, crosslines:Array):void
SimpleActorBounds
  
crossers(ld:LineData, xd:Number, yd:Number):Array
Returns an array of crossing lines.
SimpleActorBounds
  
didCross(ld:LineData, xd:Number, yd:Number):Boolean
Returns true if any of the actor bounds crosses the line after the translation.
SimpleActorBounds
  
findColliders(delta:Number, cd:ColliderDetails = null):ColliderDetails
SimpleActorBounds
  
SimpleActorBounds
  
getBoundLines():Array
SimpleActorBounds
 Inherited
DynamicBounds
  
SimpleActorBounds
 Inherited
DynamicBounds
  
isContained(ld0:LineData, ld1:LineData, sides:Array):Boolean
Returns true if any part of the actor is inside the convex shape made by the two lines.
SimpleActorBounds
 Inherited
DynamicBounds
  
move(cd:ColliderDetails):Number
Attempts to move an actor on it's current vector for the supplied amount of time.
SimpleActorBounds
  
Returns true if these actors are colliding.
SimpleActorBounds
  
simpleCollideLines(olines:Array):Boolean
SimpleActorBounds
  
translate(dX:Number, dY:Number):void
Translates the actor and updates all the boundary data.
SimpleActorBounds
  
updateBounds():void
SimpleActorBounds
 Inherited
DynamicBounds
Protected Methods
 MethodDefined by
  
clearLog():void
SimpleActorBounds
 Inherited
DynamicBounds
 Inherited
dynLD(x1:Number, y1:Number, x2:Number, y2:Number, type:int):LineData
DynamicBounds
 Inherited
dynUpdateLD(line:LineData, x1:Number, y1:Number, x2:Number, y2:Number, reset:Boolean = false):void
DynamicBounds
  
flog(... data):void
SimpleActorBounds
  
genMovementBounds(cdX:Number, cdY:Number):void
SimpleActorBounds
  
getLines():Array
SimpleActorBounds
  
inYBounds(line:LineData):Boolean
SimpleActorBounds
  
log(... data):void
SimpleActorBounds
  
pointLine(x:Number, y:Number):LineData
SimpleActorBounds
  
startLog():void
SimpleActorBounds
  
writeLog():void
SimpleActorBounds
Public Constants
 ConstantDefined by
  DEBUG : Boolean = false
[static]
SimpleActorBounds
Protected Constants
 ConstantDefined by
  ACTOR_BOUND : int
[static]
SimpleActorBounds
  MIN_ATTACH_DIST : Number = 0.1
[static]
SimpleActorBounds
Property detail
_bufferproperty
protected var _buffer:Array
fcCallsproperty 
public static var fcCalls:int = 0
_hitXproperty 
protected var _hitX:Boolean
hitXproperty 
hitX:Boolean  [read-write]Implementation
    public function get hitX():Boolean
    public function set hitX(value:Boolean):void
_hitYproperty 
protected var _hitY:Boolean
hitYproperty 
hitY:Boolean  [read-write]Implementation
    public function get hitY():Boolean
    public function set hitY(value:Boolean):void
_linesproperty 
protected var _lines:Array
_logproperty 
protected var _log:String
_mlinesproperty 
protected var _mlines:Array
_resetMLinesproperty 
protected var _resetMLines:Boolean
Constructor detail
SimpleActorBounds()constructor
public function SimpleActorBounds(ac:ActorController, c:Collider)Parameters
ac:ActorController
 
c:Collider
Method detail
adjustHeight()method
public function adjustHeight(newHeight:Number):BooleanParameters
newHeight:Number

Returns
Boolean
clearLog()method 
protected function clearLog():void
collidedWith()method 
public function collidedWith(ab:SimpleActorBounds, crosslines:Array):voidParameters
ab:SimpleActorBounds
 
crosslines:Array
crossers()method 
public function crossers(ld:LineData, xd:Number, yd:Number):Array

Returns an array of crossing lines.

Parameters
ld:LineData
 
xd:Number
 
yd:Number

Returns
Array
didCross()method 
public function didCross(ld:LineData, xd:Number, yd:Number):Boolean

Returns true if any of the actor bounds crosses the line after the translation.

Parameters
ld:LineData
 
xd:Number
 
yd:Number

Returns
Boolean
findColliders()method 
public function findColliders(delta:Number, cd:ColliderDetails = null):ColliderDetailsParameters
delta:Number
 
cd:ColliderDetails (default = null)

Returns
ColliderDetails
flog()method 
protected function flog(... data):voidParameters
... data
genMovementBounds()method 
protected function genMovementBounds(cdX:Number, cdY:Number):voidParameters
cdX:Number
 
cdY:Number
getBottomLine()method 
public function getBottomLine():LineData

Returns
LineData
getBoundLines()method 
public function getBoundLines():Array

Returns
Array
getLines()method 
protected function getLines():Array

Returns
Array
getMovementBoundLines()method 
public function getMovementBoundLines():Array

Returns
Array
inYBounds()method 
protected function inYBounds(line:LineData):BooleanParameters
line:LineData

Returns
Boolean
isContained()method 
public function isContained(ld0:LineData, ld1:LineData, sides:Array):Boolean

Returns true if any part of the actor is inside the convex shape made by the two lines.

Parameters
ld0:LineData
 
ld1:LineData
 
sides:Array

Returns
Boolean
log()method 
protected function log(... data):voidParameters
... data
move()method 
public function move(cd:ColliderDetails):Number

Attempts to move an actor on it's current vector for the supplied amount of time. If the actor collides with any world objects, the actor may get attached to a new ground line, the movement vector may be altered. returns: The remaining time left after the first collision occured.

Parameters
cd:ColliderDetails

Returns
Number
pointLine()method 
protected function pointLine(x:Number, y:Number):LineDataParameters
x:Number
 
y:Number

Returns
LineData
simpleCollide()method 
public function simpleCollide(ab:SimpleActorBounds):Boolean

Returns true if these actors are colliding.

Parameters
ab:SimpleActorBounds

Returns
Boolean
simpleCollideLines()method 
public function simpleCollideLines(olines:Array):BooleanParameters
olines:Array

Returns
Boolean
startLog()method 
protected function startLog():void
translate()method 
public override function translate(dX:Number, dY:Number):void

Translates the actor and updates all the boundary data.

Parameters
dX:Number
 
dY:Number
updateBounds()method 
public override function updateBounds():void
writeLog()method 
protected function writeLog():void
Constant detail
ACTOR_BOUNDconstant
protected static const ACTOR_BOUND:int
DEBUGconstant 
public static const DEBUG:Boolean = false
MIN_ATTACH_DISTconstant 
protected static const MIN_ATTACH_DIST:Number = 0.1