Packagekrewfw.core_internal.collision
Classpublic class CollisionShape
InheritanceCollisionShape Inheritance Object
Subclasses CollisionShapeAABB, CollisionShapeOBB, CollisionShapeSphere

Shape data for collision detection. This class knows subclasses of itself to choose collision detection algorithms.



Public Properties
 PropertyDefined By
  _handler : Function
CollisionShape
  handler : Function
[read-only]
CollisionShape
  offsetX : Number
CollisionShape
  offsetY : Number
CollisionShape
  _owner : KrewActor
CollisionShape
  owner : KrewActor
[read-only]
CollisionShape
  _type : int = 0
CollisionShape
  type : int
[read-only]
CollisionShape
  x : Number
[read-only]
CollisionShape
  y : Number
[read-only]
CollisionShape
Public Methods
 MethodDefined By
  
CollisionShape(owner:KrewActor, handler:Function, offsetX:Number = 0, offsetY:Number = 0)
CollisionShape
  
hitTest(other:CollisionShape):Boolean
CollisionShape
Public Constants
 ConstantDefined By
  SHAPE_AABB : int = 2
[static]
CollisionShape
  SHAPE_OBB : int = 3
[static]
CollisionShape
  SHAPE_SPHERE : int = 1
[static]
CollisionShape
Property Detail
_handlerproperty
public var _handler:Function

_ownerproperty 
public var _owner:KrewActor

_typeproperty 
public var _type:int = 0

handlerproperty 
handler:Function  [read-only]


Implementation
    public function get handler():Function
offsetXproperty 
public var offsetX:Number

offsetYproperty 
public var offsetY:Number

ownerproperty 
owner:KrewActor  [read-only]


Implementation
    public function get owner():KrewActor
typeproperty 
type:int  [read-only]


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


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


Implementation
    public function get y():Number
Constructor Detail
CollisionShape()Constructor
public function CollisionShape(owner:KrewActor, handler:Function, offsetX:Number = 0, offsetY:Number = 0)



Parameters
owner:KrewActor
 
handler:Function
 
offsetX:Number (default = 0)
 
offsetY:Number (default = 0)
Method Detail
hitTest()method
public function hitTest(other:CollisionShape):Boolean

Parameters

other:CollisionShape

Returns
Boolean
Constant Detail
SHAPE_AABBConstant
public static const SHAPE_AABB:int = 2

SHAPE_OBBConstant 
public static const SHAPE_OBB:int = 3

SHAPE_SPHEREConstant 
public static const SHAPE_SPHERE:int = 1