Packagecom.pblabs.rendering2D
Classpublic class SimpleSpatialComponent
InheritanceSimpleSpatialComponent Inheritance TickedComponent Inheritance EntityComponent Inheritance Object
Implements IMobileSpatialObject2D
Subclasses Interpolated2DMoverComponent

Very basic spatial component that exists at a position. Velocity can be applied, but no physical simulation is done.



Public Properties
 PropertyDefined By
  angularVelocity : Number = 0
The angular velocity of the object in degrees per second.
SimpleSpatialComponent
 InheritedisRegistered : Boolean
[read-only] Whether or not the component is currently registered with an entity.
EntityComponent
 Inheritedname : String
[read-only] The name given to the component when it is added to an entity.
EntityComponent
  objectMask : ObjectType
This object's collision flags.
SimpleSpatialComponent
 Inheritedowner : IEntity
A reference to the entity that this component currently belongs to.
EntityComponent
  position : Point
SimpleSpatialComponent
 InheritedregisterForTicks : Boolean
Set to register/unregister for tick updates.
TickedComponent
  rotation : Number
SimpleSpatialComponent
  size : Point
SimpleSpatialComponent
  spatialManager : ISpatialManager2D
The spatial manager this object belongs to.
SimpleSpatialComponent
  spriteForPointChecks : DisplayObjectRenderer
If set, a SpriteRenderComponent we can use to fulfill point occupied tests.
SimpleSpatialComponent
 InheritedupdatePriority : Number = 0.0
The update priority for this component.
TickedComponent
  velocity : Point
The linear velocity of the object in world units per second.
SimpleSpatialComponent
  worldExtents : Rectangle
[read-only] Axis aligned object bounds in world space.
SimpleSpatialComponent
  x : Number
SimpleSpatialComponent
  y : Number
SimpleSpatialComponent
Public Methods
 MethodDefined By
  
castRay(start:Point, end:Point, mask:ObjectType, info:RayHitInfo):Boolean
Not currently implemented.
SimpleSpatialComponent
  
onTick(tickRate:Number):void
[override] This method is called every tick by the ProcessManager on any objects that have been added to it with the AddTickedObject method.
SimpleSpatialComponent
  
pointOccupied(pos:Point, mask:ObjectType, scene:IScene2D):Boolean
All points in our bounding box are occupied.
SimpleSpatialComponent
 Inherited
register(owner:IEntity, name:String):void
Registers the component with an entity.
EntityComponent
 Inherited
reset():void
This is called by an entity on all of its components any time a component is added or removed.
EntityComponent
 Inherited
unregister():void
Unregisters the component from an entity.
EntityComponent
Protected Methods
 MethodDefined By
  
onAdd():void
[override]
SimpleSpatialComponent
  
onRemove():void
[override]
SimpleSpatialComponent
 Inherited
onReset():void
This is called anytime a component is added or removed from the owner entity.
EntityComponent
Property Detail
angularVelocityproperty
public var angularVelocity:Number = 0

The angular velocity of the object in degrees per second.

objectMaskproperty 
objectMask:ObjectType

This object's collision flags.


Implementation
    public function get objectMask():ObjectType
    public function set objectMask(value:ObjectType):void
positionproperty 
position:Point


Implementation
    public function get position():Point
    public function set position(value:Point):void
rotationproperty 
rotation:Number


Implementation
    public function get rotation():Number
    public function set rotation(value:Number):void
sizeproperty 
size:Point


Implementation
    public function get size():Point
    public function set size(value:Point):void
spatialManagerproperty 
spatialManager:ISpatialManager2D

The spatial manager this object belongs to.


Implementation
    public function get spatialManager():ISpatialManager2D
    public function set spatialManager(value:ISpatialManager2D):void
spriteForPointChecksproperty 
public var spriteForPointChecks:DisplayObjectRenderer

If set, a SpriteRenderComponent we can use to fulfill point occupied tests.

velocityproperty 
public var velocity:Point

The linear velocity of the object in world units per second.

worldExtentsproperty 
worldExtents:Rectangle  [read-only]

Axis aligned object bounds in world space.


Implementation
    public function get worldExtents():Rectangle
xproperty 
x:Number


Implementation
    public function get x():Number
    public function set x(value:Number):void
yproperty 
y:Number


Implementation
    public function get y():Number
    public function set y(value:Number):void
Method Detail
castRay()method
public function castRay(start:Point, end:Point, mask:ObjectType, info:RayHitInfo):Boolean

Not currently implemented. Perform a ray cast against this object.

Parameters

start:Point
 
end:Point
 
mask:ObjectType
 
info:RayHitInfo

Returns
Boolean
onAdd()method 
override protected function onAdd():void

onRemove()method 
override protected function onRemove():void

onTick()method 
override public function onTick(tickRate:Number):void

This method is called every tick by the ProcessManager on any objects that have been added to it with the AddTickedObject method.

Parameters

tickRate:Number — The amount of time (in seconds) specified for a tick.

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

All points in our bounding box are occupied. 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