Packagesekati.collisions
Classpublic class AbstractCollisionDetector
InheritanceAbstractCollisionDetector Inheritance flash.events.EventDispatcher
SubclassesCollisionDetector, GroupCollisionDetector

AbstractCollisionDetector provides the core collision detection logic abstract to its subclasses.

BitmapData generated from the display objects ared used in the detection of collisions & the collision angle which is calculated based on the display objects' shape where the collision occurs.

See also

sekati.collisions.Collision
sekati.collisions.CollisionAngle
sekati.collisions.CollisionDetector
sekati.collisions.GroupCollisionDetector
sekati.events.CollisionEvent


Public Properties
 PropertyDefined by
  alphaThreshold : Number
A floating point value from 0 - 1 that determines the minimum alpha value to check for collisions.
AbstractCollisionDetector
  isMonitoring : Boolean
[read-only] Whether the frame-base collision monitor is running.
AbstractCollisionDetector
  numChildren : uint
[read-only] The number of DisplayObjects being checked for collision.
AbstractCollisionDetector
  returnAngleType : String
Determines if the angle returned from a collision is in CollisionAngle.RADIAN or CollisionAngle.DEGREE_ANGLE_TYPE (Default: CollisionAngle.NONE).
AbstractCollisionDetector
Protected Properties
 PropertyDefined by
  objectArray : TypedArray
AbstractCollisionDetector
  objectCheckArray : TypedArray
AbstractCollisionDetector
  objectCollisionArray : TypedArray
AbstractCollisionDetector
Public Methods
 MethodDefined by
  
AbstractCollisionDetector Constructor
AbstractCollisionDetector
  
addItem(obj:DisplayObject):void
Add a DisplayObject to the list of objects to check for collisions.
AbstractCollisionDetector
  
Stub function for subclasses which checks for collisions and returns a Collision TypedArray containing all Collision's.
AbstractCollisionDetector
  
excludeColor(color32:uint, alphaRange:uint = 255, redRange:uint = 20, greenRange:uint = 20, blueRange:uint = 20):void
Defines a color or color range to exclude from collision detections.
AbstractCollisionDetector
  
removeExcludeColor(color32:uint):void
Removes the color specified from the list of colors to exclude from collision detections.
AbstractCollisionDetector
  
removeItem(obj:DisplayObject):void
Remove a DisplayObject from the list of objects to check for collisions.
AbstractCollisionDetector
  
startMonitor():void
Start frame-based automatic collision monitoring.
AbstractCollisionDetector
  
stopMonitor():void
Stop frame-based automatic collision monitoring.
AbstractCollisionDetector
Protected Methods
 MethodDefined by
  
clearArrays():void
Clear the objectCheckArray and objectCollisionArray.
AbstractCollisionDetector
  
monitor(e:Event):void
Frame-based collision monitoring dispatches CollisionEvent's when one or more collisions are detected.
AbstractCollisionDetector
Property detail
alphaThresholdproperty
alphaThreshold:Number  [read-write]

A floating point value from 0 - 1 that determines the minimum alpha value to check for collisions.

Implementation
    public function get alphaThreshold():Number
    public function set alphaThreshold(value:Number):void
isMonitoringproperty 
isMonitoring:Boolean  [read-only]

Whether the frame-base collision monitor is running.

Implementation
    public function get isMonitoring():Boolean
numChildrenproperty 
numChildren:uint  [read-only]

The number of DisplayObjects being checked for collision.

Implementation
    public function get numChildren():uint
objectArrayproperty 
protected var objectArray:TypedArray
objectCheckArrayproperty 
protected var objectCheckArray:TypedArray
objectCollisionArrayproperty 
protected var objectCollisionArray:TypedArray
returnAngleTypeproperty 
returnAngleType:String  [read-write]

Determines if the angle returned from a collision is in CollisionAngle.RADIAN or CollisionAngle.DEGREE_ANGLE_TYPE (Default: CollisionAngle.NONE).

Implementation
    public function get returnAngleType():String
    public function set returnAngleType(value:String):void
Constructor detail
AbstractCollisionDetector()constructor
public function AbstractCollisionDetector()

AbstractCollisionDetector Constructor

Method detail
addItem()method
public function addItem(obj:DisplayObject):void

Add a DisplayObject to the list of objects to check for collisions.

Parameters
obj:DisplayObject
checkCollisions()method 
public function checkCollisions():TypedArray

Stub function for subclasses which checks for collisions and returns a Collision TypedArray containing all Collision's.

Returns
TypedArray
clearArrays()method 
protected function clearArrays():void

Clear the objectCheckArray and objectCollisionArray.

excludeColor()method 
public function excludeColor(color32:uint, alphaRange:uint = 255, redRange:uint = 20, greenRange:uint = 20, blueRange:uint = 20):void

Defines a color or color range to exclude from collision detections. The excludeColor() method expects a 32 bit color value. Optional ranges based on this color can be specified for all channels using the additional parameters. Each range accepts integral values from 0 to 255, accounting for all values for each color channel. The ranges move in both directions at the amount specified for each channel.

Parameters
color32:uint — The color to exclude. Must be a 32 bit value (E.g. 0xFFFFFFFF).
 
alphaRange:uint (default = 255) — The integral range of alpha values to exclude, based on the color's alpha value. Valid values are 0 - 255.
 
redRange:uint (default = 20) — The integral range of red values to exclude, based on the color's red value. Valid values are 0 - 255
 
greenRange:uint (default = 20) — The integral range of green values to exclude, based on the color's green value. Valid values are 0 - 255
 
blueRange:uint (default = 20) — The integral range of blue values to exclude, based on the color's blue value. Valid values are 0 - 255

See also

monitor()method 
protected function monitor(e:Event):void

Frame-based collision monitoring dispatches CollisionEvent's when one or more collisions are detected.

You must explicitly call startMonitor() or stopMonitor() to begin/end monitoring. The status may be checked via isMonitoring

Parameters
e:Event
removeExcludeColor()method 
public function removeExcludeColor(color32:uint):void

Removes the color specified from the list of colors to exclude from collision detections. Must be a color previously added using the excludeColor() method. Expects a 32 bit color value.

Parameters
color32:uint — The color to exclude. Must be a 32 bit value (E.g. 0xFFFFFFFF).

See also

removeItem()method 
public function removeItem(obj:DisplayObject):void

Remove a DisplayObject from the list of objects to check for collisions.

Parameters
obj:DisplayObject
startMonitor()method 
public function startMonitor():void

Start frame-based automatic collision monitoring.

stopMonitor()method 
public function stopMonitor():void

Stop frame-based automatic collision monitoring.