| Package | com.pblabs.box2D |
| Class | public class Box2DManagerComponent |
| Inheritance | Box2DManagerComponent EntityComponent Object |
| Implements | ITickedObject, ISpatialManager2D |
| Property | Defined By | ||
|---|---|---|---|
| allowSleep : Boolean | Box2DManagerComponent | ||
| gravity : Point | Box2DManagerComponent | ||
| inverseScale : Number [read-only] | Box2DManagerComponent | ||
![]() | isRegistered : Boolean [read-only]
Whether or not the component is currently registered with an entity. | EntityComponent | |
![]() | name : String [read-only]
The name given to the component when it is added to an entity. | EntityComponent | |
![]() | owner : IEntity
A reference to the entity that this component currently belongs to. | EntityComponent | |
| scale : Number | Box2DManagerComponent | ||
| world : b2World [read-only] | Box2DManagerComponent | ||
| worldBounds : Rectangle | Box2DManagerComponent | ||
| Property | Defined By | ||
|---|---|---|---|
| _allowSleep : Boolean = true | Box2DManagerComponent | ||
| _gravity : Point | Box2DManagerComponent | ||
| _otherItems : BasicSpatialManager2D | Box2DManagerComponent | ||
| _scale : Number = 30 | Box2DManagerComponent | ||
| _world : b2World = null | Box2DManagerComponent | ||
| _worldBounds : Rectangle | Box2DManagerComponent | ||
| Method | Defined By | ||
|---|---|---|---|
| Box2DManagerComponent | |||
addSpatialObject(object:ISpatialObject2D):void | Box2DManagerComponent | ||
| Box2DManagerComponent | |||
getObjectsUnderPoint(worldPosition:Point, results:Array, mask:ObjectType = null):Boolean
Return all the spatial objects under a given point. | Box2DManagerComponent | ||
onInterpolateTick(factor:Number):void | Box2DManagerComponent | ||
onTick(tickRate:Number):void | Box2DManagerComponent | ||
queryCircle(center:Point, radius:Number, mask:ObjectType, results:Array):Boolean | Box2DManagerComponent | ||
queryRectangle(box:Rectangle, mask:ObjectType, results:Array):Boolean | Box2DManagerComponent | ||
![]() |
Registers the component with an entity. | EntityComponent | |
| Box2DManagerComponent | |||
removeSpatialObject(object:ISpatialObject2D):void | Box2DManagerComponent | ||
![]() | reset():void
This is called by an entity on all of its components any time a component
is added or removed. | EntityComponent | |
setDebugDrawer(drawer:b2DebugDraw):void | Box2DManagerComponent | ||
![]() | unregister():void
Unregisters the component from an entity. | EntityComponent | |
| Method | Defined By | ||
|---|---|---|---|
onAdd():void [override] | Box2DManagerComponent | ||
onRemove():void [override] | Box2DManagerComponent | ||
![]() | onReset():void
This is called anytime a component is added or removed from the owner entity. | EntityComponent | |
| _allowSleep | property |
protected var _allowSleep:Boolean = true| _gravity | property |
protected var _gravity:Point| _otherItems | property |
protected var _otherItems:BasicSpatialManager2D| _scale | property |
protected var _scale:Number = 30| _world | property |
protected var _world:b2World = null| _worldBounds | property |
protected var _worldBounds:Rectangle| allowSleep | property |
allowSleep:Boolean public function get allowSleep():Boolean public function set allowSleep(value:Boolean):void| gravity | property |
gravity:Point public function get gravity():Point public function set gravity(value:Point):void| inverseScale | property |
inverseScale:Number [read-only] public function get inverseScale():Number| scale | property |
scale:Number public function get scale():Number public function set scale(value:Number):void| world | property |
| worldBounds | property |
worldBounds:Rectangle public function get worldBounds():Rectangle public function set worldBounds(value:Rectangle):void| add | () | method |
public function add(bodyDef:b2BodyDef, thisArg:* = null, completedCallback:Function = null):voidParameters
bodyDef:b2BodyDef | |
thisArg:* (default = null) | |
completedCallback:Function (default = null) |
| addSpatialObject | () | method |
| castRay | () | method |
public function castRay(start:Point, end:Point, mask:ObjectType, result:RayHitInfo):BooleanParameters
start:Point | |
end:Point | |
mask:ObjectType | |
result:RayHitInfo |
Boolean |
| getObjectsUnderPoint | () | method |
public function getObjectsUnderPoint(worldPosition:Point, results:Array, mask:ObjectType = null):BooleanReturn all the spatial objects under a given point. Objects can optionally implement pixel-level collision checking.
Parameters
worldPosition:Point — Point in worldspace to check.
| |
results:Array — An array into which ISpatialObject2Ds are added based on what is under point.
| |
mask:ObjectType (default = null) — Only consider objects that match this ObjectType. Null uses all types.
|
Boolean — Found something under point or not.
|
| onAdd | () | method |
override protected function onAdd():void| onInterpolateTick | () | method |
public function onInterpolateTick(factor:Number):voidParameters
factor:Number |
| onRemove | () | method |
override protected function onRemove():void| onTick | () | method |
public function onTick(tickRate:Number):voidParameters
tickRate:Number |
| queryCircle | () | method |
public function queryCircle(center:Point, radius:Number, mask:ObjectType, results:Array):BooleanParameters
center:Point | |
radius:Number | |
mask:ObjectType | |
results:Array |
Boolean |
| queryRectangle | () | method |
public function queryRectangle(box:Rectangle, mask:ObjectType, results:Array):BooleanParameters
box:Rectangle | |
mask:ObjectType | |
results:Array |
Boolean |
| remove | () | method |
| removeSpatialObject | () | method |
public function removeSpatialObject(object:ISpatialObject2D):voidParameters
object:ISpatialObject2D |
| setDebugDrawer | () | method |