public static var e_allowSleepFlag:uint = 0x0010
public static var e_bulletFlag:uint = 0x0020
public static var e_dynamicType:uint = 2
public static var e_fixedRotationFlag:uint = 0x0040
public static var e_frozenFlag:uint = 0x0002
public static var e_islandFlag:uint = 0x0004
public static var e_maxTypes:uint = 3
public static var e_sleepFlag:uint = 0x0008
public static var e_staticType:uint = 1
b2internal var m_angularDamping:Number
b2internal var m_angularVelocity:Number
b2internal var m_contactList:b2ContactEdge
b2internal var m_flags:uint
b2internal var m_force:b2Vec2
b2internal var m_I:Number
b2internal var m_jointList:b2JointEdge
b2internal var m_linearDamping:Number
b2internal var m_linearVelocity:b2Vec2
b2internal var m_mass:Number
b2internal var m_next:b2Body
b2internal var m_prev:b2Body
b2internal var m_shapeCount:int
b2internal var m_shapeList:b2Shape
b2internal var m_sleepTime:Number
b2internal var m_sweep:b2Sweep
b2internal var m_torque:Number
b2internal var m_world:b2World
b2internal var m_xf:b2XForm
public function b2Body(bd:b2BodyDef, world:b2World)
Parameters
public function Advance(t:Number):void
Parameters
public function AllowSleeping(flag:Boolean):void
You can disable sleeping on this body.
Parameters
public function ApplyForce(force:b2Vec2, point:b2Vec2):void
Apply a force at a world point. If the force is not
applied at the center of mass, it will generate a torque and
affect the angular velocity. This wakes up the body.
Parameters
| force:b2Vec2 — the world force vector, usually in Newtons (N).
|
|
| point:b2Vec2 — the world position of the point of application.
|
public function ApplyImpulse(impulse:b2Vec2, point:b2Vec2):void
Apply an impulse at a point. This immediately modifies the velocity.
It also modifies the angular velocity if the point of application
is not at the center of mass. This wakes up the body.
Parameters
| impulse:b2Vec2 — the world impulse vector, usually in N-seconds or kg-m/s.
|
|
| point:b2Vec2 — the world position of the point of application.
|
public function ApplyTorque(torque:Number):void
Apply a torque. This affects the angular velocity
without affecting the linear velocity of the center of mass.
This wakes up the body.
Parameters
| torque:Number — about the z-axis (out of the screen), usually in N-m.
|
public function CreateShape(def:b2ShapeDef):b2Shape
Creates a shape and attach it to this body.
Parameters
Returns
public function DestroyShape(s:b2Shape):void
Destroy a shape. This removes the shape from the broad-phase and
therefore destroys any contacts associated with this shape. All shapes
attached to a body are implicitly destroyed when the body is destroyed.
Parameters
| s:b2Shape — the shape to be removed.
|
public function GetAngle():Number
Get the angle in radians.
Returns
| Number — the current world rotation angle in radians.
|
public function GetAngularVelocity():Number
Get the angular velocity.
Returns
| Number — the angular velocity in radians/second.
|
public function GetInertia():Number
Get the central rotational inertia of the body.
Returns
| Number — the rotational inertia, usually in kg-m^2.
|
public function GetJointList():b2JointEdge
Get the list of all joints attached to this body.
Returns
public function GetLinearVelocity():b2Vec2
Get the linear velocity of the center of mass.
Returns
| b2Vec2 —
the linear velocity of the center of mass.
|
public function GetLinearVelocityFromLocalPoint(localPoint:b2Vec2):b2Vec2
Get the world velocity of a local point.
Parameters
| localPoint:b2Vec2 — point in local coordinates.
|
Returns
| b2Vec2 —
the world velocity of a point.
|
public function GetLinearVelocityFromWorldPoint(worldPoint:b2Vec2):b2Vec2
Get the world linear velocity of a world point attached to this body.
Parameters
| worldPoint:b2Vec2 — point in world coordinates.
|
Returns
| b2Vec2 —
the world velocity of a point.
|
public function GetLocalCenter():b2Vec2
Get the local position of the center of mass.
Returns
public function GetLocalPoint(worldPoint:b2Vec2):b2Vec2
Gets a local point relative to the body's origin given a world point.
Parameters
| worldPoint:b2Vec2 — point in world coordinates.
|
Returns
| b2Vec2 —
the corresponding local point relative to the body's origin.
|
public function GetLocalVector(worldVector:b2Vec2):b2Vec2
Gets a local vector given a world vector.
Parameters
| worldVector:b2Vec2 — vector in world coordinates.
|
Returns
| b2Vec2 —
the corresponding local vector.
|
public function GetMass():Number
Get the total mass of the body.
Returns
| Number — the mass, usually in kilograms (kg).
|
public function GetNext():b2Body
Get the next body in the world's body list.
Returns
public function GetPosition():b2Vec2
Get the world body origin position.
Returns
| b2Vec2 —
the world position of the body's origin.
|
public function GetShapeList():b2Shape
Get the list of all shapes attached to this body.
Returns
public function GetUserData():*
Get the user data pointer that was provided in the body definition.
Returns
public function GetWorld():b2World
Get the parent world of this body.
Returns
public function GetWorldCenter():b2Vec2
Get the world position of the center of mass.
Returns
public function GetWorldPoint(localPoint:b2Vec2):b2Vec2
Get the world coordinates of a point given the local coordinates.
Parameters
| localPoint:b2Vec2 — a point on the body measured relative the the body's origin.
|
Returns
| b2Vec2 —
the same point expressed in world coordinates.
|
public function GetWorldVector(localVector:b2Vec2):b2Vec2
Get the world coordinates of a vector given the local coordinates.
Parameters
| localVector:b2Vec2 — a vector fixed in the body.
|
Returns
| b2Vec2 —
the same vector expressed in world coordinates.
|
public function GetXForm():b2XForm
Get the body transform for the body's origin.
Returns
| b2XForm —
the world transform of the body's origin.
|
public function IsBullet():Boolean
Is this body treated like a bullet for continuous collision detection?
Returns
public function IsConnected(other:b2Body):Boolean
Parameters
Returns
public function IsDynamic():Boolean
Is this body dynamic (movable)?
Returns
public function IsFrozen():Boolean
Is this body frozen?
Returns
public function IsSleeping():Boolean
Is this body sleeping (not simulating).
Returns
public function IsStatic():Boolean
Is this body static (immovable)?
Returns
public function PutToSleep():void
Put this body to sleep so it will stop simulating.
This also sets the velocity to zero.
public function SetAngularVelocity(omega:Number):void
Set the angular velocity.
Parameters
| omega:Number — the new angular velocity in radians/second.
|
public function SetBullet(flag:Boolean):void
Should this body be treated like a bullet for continuous collision detection?
Parameters
public function SetLinearVelocity(v:b2Vec2):void
Set the linear velocity of the center of mass.
Parameters
| v:b2Vec2 — the new linear velocity of the center of mass.
|
public function SetMass(massData:b2MassData):void
Set the mass properties. Note that this changes the center of mass position.
If you are not sure how to compute mass properties, use SetMassFromShapes.
The inertia tensor is assumed to be relative to the center of mass.
Parameters
public function SetMassFromShapes():void
public function SetUserData(data:*):void
Set the user data. Use this to store your application specific data.
Parameters
public function SetXForm(position:b2Vec2, angle:Number):Boolean
Set the position of the body's origin and rotation (radians).
This breaks any contacts and wakes the other bodies.
Parameters
| position:b2Vec2 — the new world position of the body's origin (not necessarily the center of mass).
|
|
| angle:Number — the new world rotation angle of the body in radians.
|
Returns
| Boolean — false if the movement put a shape outside the world. In this case the
body is automatically frozen.
|
public function SynchronizeShapes():Boolean
Returns
public function SynchronizeTransform():void
public function WakeUp():void
Wake up this body so it will begin simulating.