PackagePBLabs.Rendering2D
Classpublic class SimpleSpatialComponent
InheritanceSimpleSpatialComponent Inheritance TickedComponent Inheritance EntityComponent
ImplementsISpatialObject2D
SubclassesInterpolated2DMoverComponent

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



Public Properties
 PropertyDefined by
 InheritedIsRegistered : Boolean
Whether or not the component is currently registered with an entity.
EntityComponent
 InheritedName : String
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
The position of the object.
SimpleSpatialComponent
 InheritedRegisterForTicks : Boolean = true
Do we actually want to register for ticks? Useful if a subclass wants to disable the functionality.
TickedComponent
  Rotation : Number = 0
The rotation of the object.
SimpleSpatialComponent
  Size : Point
The size of the object.
SimpleSpatialComponent
  SpatialManager : ISpatialManager2D
The spatial manager this object belongs to.
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
Public Methods
 MethodDefined by
  
CastRay(start:Point, end:Point, mask:ObjectType, info:RayHitInfo):Boolean
Not currently implemented.
SimpleSpatialComponent
 Inherited
OnInterpolateTick(factor:Number):void
This method is called every frame by the ProcessManager on any objects that have been added to it with the AddTickedObject method.
TickedComponent
  
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.
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
SimpleSpatialComponent
  
_OnRemove():void
SimpleSpatialComponent
 Inherited
_OnReset():void
This is called anytime a component is added or removed from the owner entity.
EntityComponent
Property detail
ObjectMaskproperty
ObjectMask:ObjectType  [read-write]

This object's collision flags.

Implementation
    public function get ObjectMask():ObjectType
    public function set ObjectMask(value:ObjectType):void
Positionproperty 
public var Position:Point

The position of the object.

Rotationproperty 
public var Rotation:Number = 0

The rotation of the object.

Sizeproperty 
public var Size:Point

The size of the object.

SpatialManagerproperty 
SpatialManager:ISpatialManager2D  [read-write]

The spatial manager this object belongs to.

Implementation
    public function get SpatialManager():ISpatialManager2D
    public function set SpatialManager(value:ISpatialManager2D):void
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
Method detail
_OnAdd()method
protected override function _OnAdd():void

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

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
OnTick()method 
public override 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.