| Method | Defined by | ||
|---|---|---|---|
|
AllowSleeping(flag:Boolean):void
You can disable sleeping on this body.
| b2Body | ||
|
Apply a force at a world point.
| b2Body | ||
|
Apply an impulse at a point.
| b2Body | ||
|
ApplyTorque(torque:Number):void
Apply a torque.
| b2Body | ||
|
Creates a shape and attach it to this body.
| b2Body | ||
|
DestroyShape(s:b2Shape):void
Destroy a shape.
| b2Body | ||
|
GetAngle():Number
Get the angle in radians.
| b2Body | ||
|
GetAngularVelocity():Number
Get the angular velocity.
| b2Body | ||
|
GetInertia():Number
Get the central rotational inertia of the body.
| b2Body | ||
|
Get the list of all joints attached to this body.
| b2Body | ||
|
Get the linear velocity of the center of mass.
| b2Body | ||
|
Get the world velocity of a local point.
| b2Body | ||
|
Get the world linear velocity of a world point attached to this body.
| b2Body | ||
|
Get the local position of the center of mass.
| b2Body | ||
|
Gets a local point relative to the body's origin given a world point.
| b2Body | ||
|
Gets a local vector given a world vector.
| b2Body | ||
|
GetMass():Number
Get the total mass of the body.
| b2Body | ||
|
Get the next body in the world's body list.
| b2Body | ||
|
Get the world body origin position.
| b2Body | ||
|
Get the list of all shapes attached to this body.
| b2Body | ||
|
GetUserData():*
Get the user data pointer that was provided in the body definition.
| b2Body | ||
|
Get the parent world of this body.
| b2Body | ||
|
Get the world position of the center of mass.
| b2Body | ||
|
Get the world coordinates of a point given the local coordinates.
| b2Body | ||
|
Get the world coordinates of a vector given the local coordinates.
| b2Body | ||
|
Get the body transform for the body's origin.
| b2Body | ||
|
IsBullet():Boolean
Is this body treated like a bullet for continuous collision detection?
| b2Body | ||
|
IsDynamic():Boolean
Is this body dynamic (movable)?
| b2Body | ||
|
IsFrozen():Boolean
Is this body frozen?
| b2Body | ||
|
IsSleeping():Boolean
Is this body sleeping (not simulating).
| b2Body | ||
|
IsStatic():Boolean
Is this body static (immovable)?
| b2Body | ||
|
PutToSleep():void
Put this body to sleep so it will stop simulating.
| b2Body | ||
|
SetAngularVelocity(omega:Number):void
Set the angular velocity.
| b2Body | ||
|
SetBullet(flag:Boolean):void
Should this body be treated like a bullet for continuous collision detection?
| b2Body | ||
|
SetLinearVelocity(v:b2Vec2):void
Set the linear velocity of the center of mass.
| b2Body | ||
|
SetMass(massData:b2MassData):void
Set the mass properties.
| b2Body | ||
|
SetMassFromShapes():void
Compute the mass properties from the attached shapes.
| b2Body | ||
|
SetUserData(data:*):void
Set the user data.
| b2Body | ||
|
Set the position of the body's origin and rotation (radians).
| b2Body | ||
|
WakeUp():void
Wake up this body so it will begin simulating.
| b2Body | ||
| AllowSleeping | () | method |
public function AllowSleeping(flag:Boolean):voidYou can disable sleeping on this body.
Parametersflag:Boolean |
| ApplyForce | () | method |
public function ApplyForce(force:b2Vec2, point:b2Vec2):voidApply 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.
Parametersforce:b2Vec2 — the world force vector, usually in Newtons (N).
|
|
point:b2Vec2 — the world position of the point of application.
|
| ApplyImpulse | () | method |
public function ApplyImpulse(impulse:b2Vec2, point:b2Vec2):voidApply 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.
Parametersimpulse:b2Vec2 — the world impulse vector, usually in N-seconds or kg-m/s.
|
|
point:b2Vec2 — the world position of the point of application.
|
| ApplyTorque | () | method |
public function ApplyTorque(torque:Number):voidApply a torque. This affects the angular velocity without affecting the linear velocity of the center of mass. This wakes up the body.
Parameterstorque:Number — about the z-axis (out of the screen), usually in N-m.
|
| CreateShape | () | method |
public function CreateShape(def:b2ShapeDef):b2ShapeCreates a shape and attach it to this body.
Warning: This function is locked during callbacks.
Parametersdef:b2ShapeDef — the shape definition.
|
b2Shape |
| DestroyShape | () | method |
public function DestroyShape(s:b2Shape):voidDestroy 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.
Warning: This function is locked during callbacks.
Parameterss:b2Shape — the shape to be removed.
|
| GetAngle | () | method |
public function GetAngle():NumberGet the angle in radians.
ReturnsNumber — the current world rotation angle in radians.
|
| GetAngularVelocity | () | method |
public function GetAngularVelocity():NumberGet the angular velocity.
ReturnsNumber — the angular velocity in radians/second.
|
| GetInertia | () | method |
public function GetInertia():NumberGet the central rotational inertia of the body.
ReturnsNumber — the rotational inertia, usually in kg-m^2.
|
| GetJointList | () | method |
public function GetJointList():b2JointEdgeGet the list of all joints attached to this body.
Returnsb2JointEdge |
| GetLinearVelocity | () | method |
public function GetLinearVelocity():b2Vec2Get the linear velocity of the center of mass.
Returnsb2Vec2 —
the linear velocity of the center of mass.
|
| GetLinearVelocityFromLocalPoint | () | method |
public function GetLinearVelocityFromLocalPoint(localPoint:b2Vec2):b2Vec2Get the world velocity of a local point.
ParameterslocalPoint:b2Vec2 — point in local coordinates.
|
b2Vec2 —
the world velocity of a point.
|
| GetLinearVelocityFromWorldPoint | () | method |
public function GetLinearVelocityFromWorldPoint(worldPoint:b2Vec2):b2Vec2Get the world linear velocity of a world point attached to this body.
ParametersworldPoint:b2Vec2 — point in world coordinates.
|
b2Vec2 —
the world velocity of a point.
|
| GetLocalCenter | () | method |
public function GetLocalCenter():b2Vec2Get the local position of the center of mass.
Returnsb2Vec2 |
| GetLocalPoint | () | method |
public function GetLocalPoint(worldPoint:b2Vec2):b2Vec2Gets a local point relative to the body's origin given a world point.
ParametersworldPoint:b2Vec2 — point in world coordinates.
|
b2Vec2 —
the corresponding local point relative to the body's origin.
|
| GetLocalVector | () | method |
public function GetLocalVector(worldVector:b2Vec2):b2Vec2Gets a local vector given a world vector.
ParametersworldVector:b2Vec2 — vector in world coordinates.
|
b2Vec2 —
the corresponding local vector.
|
| GetMass | () | method |
public function GetMass():NumberGet the total mass of the body.
ReturnsNumber — the mass, usually in kilograms (kg).
|
| GetNext | () | method |
| GetPosition | () | method |
public function GetPosition():b2Vec2Get the world body origin position.
Returnsb2Vec2 —
the world position of the body's origin.
|
| GetShapeList | () | method |
public function GetShapeList():b2ShapeGet the list of all shapes attached to this body.
Returnsb2Shape |
| GetUserData | () | method |
public function GetUserData():*Get the user data pointer that was provided in the body definition.
Returns* |
| GetWorld | () | method |
| GetWorldCenter | () | method |
public function GetWorldCenter():b2Vec2Get the world position of the center of mass.
Returnsb2Vec2 |
| GetWorldPoint | () | method |
public function GetWorldPoint(localPoint:b2Vec2):b2Vec2Get the world coordinates of a point given the local coordinates.
ParameterslocalPoint:b2Vec2 — a point on the body measured relative the the body's origin.
|
b2Vec2 —
the same point expressed in world coordinates.
|
| GetWorldVector | () | method |
public function GetWorldVector(localVector:b2Vec2):b2Vec2Get the world coordinates of a vector given the local coordinates.
ParameterslocalVector:b2Vec2 — a vector fixed in the body.
|
b2Vec2 —
the same vector expressed in world coordinates.
|
| GetXForm | () | method |
public function GetXForm():b2XFormGet the body transform for the body's origin.
Returnsb2XForm —
the world transform of the body's origin.
|
| IsBullet | () | method |
public function IsBullet():BooleanIs this body treated like a bullet for continuous collision detection?
ReturnsBoolean |
| IsDynamic | () | method |
public function IsDynamic():BooleanIs this body dynamic (movable)?
ReturnsBoolean |
| IsFrozen | () | method |
public function IsFrozen():BooleanIs this body frozen?
ReturnsBoolean |
| IsSleeping | () | method |
public function IsSleeping():BooleanIs this body sleeping (not simulating).
ReturnsBoolean |
| IsStatic | () | method |
public function IsStatic():BooleanIs this body static (immovable)?
ReturnsBoolean |
| PutToSleep | () | method |
public function PutToSleep():voidPut this body to sleep so it will stop simulating. This also sets the velocity to zero.
| SetAngularVelocity | () | method |
public function SetAngularVelocity(omega:Number):voidSet the angular velocity.
Parametersomega:Number — the new angular velocity in radians/second.
|
| SetBullet | () | method |
public function SetBullet(flag:Boolean):voidShould this body be treated like a bullet for continuous collision detection?
Parametersflag:Boolean |
| SetLinearVelocity | () | method |
public function SetLinearVelocity(v:b2Vec2):voidSet the linear velocity of the center of mass.
Parametersv:b2Vec2 — the new linear velocity of the center of mass.
|
| SetMass | () | method |
public function SetMass(massData:b2MassData):voidSet 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.
ParametersmassData:b2MassData — the mass properties.
|
| SetMassFromShapes | () | method |
public function SetMassFromShapes():voidCompute the mass properties from the attached shapes. You typically call this after adding all the shapes. If you add or remove shapes later, you may want to call this again. Note that this changes the center of mass position.
| SetUserData | () | method |
public function SetUserData(data:*):voidSet the user data. Use this to store your application specific data.
Parametersdata:* |
| SetXForm | () | method |
public function SetXForm(position:b2Vec2, angle:Number):BooleanSet the position of the body's origin and rotation (radians). This breaks any contacts and wakes the other bodies.
Parametersposition: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.
|
Boolean — false if the movement put a shape outside the world. In this case the
body is automatically frozen.
|
| WakeUp | () | method |
public function WakeUp():voidWake up this body so it will begin simulating.