Packagecom.pblabs.rendering2D
Interfacepublic interface ISpatialObject2D

Object with extents and ability to be ray-casted. This is the basic interface for objects that support 2D spatial queries. It is enough to do broad phase collision checks and ray casts.



Public Properties
 PropertyDefined By
  objectMask : ObjectType
[read-only] This object's collision flags.
ISpatialObject2D
  worldExtents : Rectangle
[read-only] Axis aligned object bounds in world space.
ISpatialObject2D
Public Methods
 MethodDefined By
  
castRay(start:Point, end:Point, flags:ObjectType, result:RayHitInfo):Boolean
Perform a ray cast against this object.
ISpatialObject2D
  
pointOccupied(pos:Point, mask:ObjectType, scene:IScene2D):Boolean
Return true if the specified point is occupied by this object, used for ObjectsUnderPoint.
ISpatialObject2D
Property Detail
objectMaskproperty
objectMask:ObjectType  [read-only]

This object's collision flags.


Implementation
    public function get objectMask():ObjectType
worldExtentsproperty 
worldExtents:Rectangle  [read-only]

Axis aligned object bounds in world space.


Implementation
    public function get worldExtents():Rectangle
Method Detail
castRay()method
public function castRay(start:Point, end:Point, flags:ObjectType, result:RayHitInfo):Boolean

Perform a ray cast against this object.

Parameters

start:Point
 
end:Point
 
flags:ObjectType
 
result:RayHitInfo

Returns
Boolean
pointOccupied()method 
public function pointOccupied(pos:Point, mask:ObjectType, scene:IScene2D):Boolean

Return true if the specified point is occupied by this object, used for ObjectsUnderPoint.

Parameters

pos:Point — Location in worldspace to check.
 
mask:ObjectType — If we want to have the results line up with the view, we need access to the scene we're doing the check from.
 
scene:IScene2D

Returns
Boolean