PackagePBLabs.Rendering2D
Interfacepublic interface ISpatialManager2D
ImplementorsBasicSpatialManager2D, Box2DManagerComponent

Basic interface for 2D spatial database. This provides enough capabilities to do visibility culling, limited picking, and ray casts. Most implementations (like ones using a physics library) will expose a lot more functionality, but this is enough to do rendering and UI tasks.



Public Methods
 MethodDefined by
  
Add a generic spatial object to this manager.
ISpatialManager2D
  
CastRay(start:Point, end:Point, flags:ObjectType, result:RayHitInfo):Boolean
Cast a ray and (optionally) return information about what it hits in result.
ISpatialManager2D
  
QueryCircle(center:Point, radius:Number, mask:ObjectType, results:Array):Boolean
Return all the spatial objects that overlap the specified circle.
ISpatialManager2D
  
QueryRectangle(box:Rectangle, mask:ObjectType, results:Array):Boolean
Return all the spatial objects that overlap with the specified box and match one or more of the types in the mask.
ISpatialManager2D
  
Remove a previously registered object from this manager.
ISpatialManager2D
Method detail
AddSpatialObject()method
public function AddSpatialObject(object:ISpatialObject2D):void

Add a generic spatial object to this manager. A manager with advanced functionality will support both general ISpatialObject2D implementations as well as enabling special functionality for its peered classes.

Parameters
object:ISpatialObject2D
CastRay()method 
public function CastRay(start:Point, end:Point, flags:ObjectType, result:RayHitInfo):Boolean

Cast a ray and (optionally) return information about what it hits in result.

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

Returns
Boolean
QueryCircle()method 
public function QueryCircle(center:Point, radius:Number, mask:ObjectType, results:Array):Boolean

Return all the spatial objects that overlap the specified circle.

Parameters
center:Point
 
radius:Number
 
mask:ObjectType
 
results:Array

Returns
Boolean

See also

QueryRectangle
QueryRectangle()method 
public function QueryRectangle(box:Rectangle, mask:ObjectType, results:Array):Boolean

Return all the spatial objects that overlap with the specified box and match one or more of the types in the mask.

Parameters
box:Rectangle
 
mask:ObjectType
 
results:Array

Returns
Boolean — True if one or more objects were found and push()'ed to results.
RemoveSpatialObject()method 
public function RemoveSpatialObject(object:ISpatialObject2D):void

Remove a previously registered object from this manager.

Parameters
object:ISpatialObject2D

See also

AddSpatialObject