Property | Defined by | ||
---|---|---|---|
b2_dynamicBody : uint = 2 [static]
| b2Body | ||
b2_kinematicBody : uint = 1 [static]
| b2Body | ||
b2_staticBody : uint = 0 [static]
| b2Body |
Method | Defined by | ||
---|---|---|---|
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 fixture and attach it to this body.
| b2Body | ||
Creates a fixture from a shape and attach it to this body.
| b2Body | ||
DestroyFixture(fixture:b2Fixture):void
Destroy a fixture.
| b2Body | ||
GetAngle():Number
Get the angle in radians.
| b2Body | ||
GetAngularDamping():Number
Get the angular damping of the body
| b2Body | ||
GetAngularVelocity():Number
Get the angular velocity.
| b2Body | ||
Get a list of all contacts attached to this body.
| b2Body | ||
Get the list of all controllers attached to this body.
| b2Body | ||
Get the definition containing the body properties.
| b2Body | ||
Get the list of all fixtures attached to this body.
| b2Body | ||
GetInertia():Number
Get the central rotational inertia of the body.
| b2Body | ||
Get the list of all joints attached to this body.
| b2Body | ||
GetLinearDamping():Number
Get the linear damping of the 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 | ||
GetMassData(data:b2MassData):void
Get the mass data of the body.
| b2Body | ||
Get the next body in the world's body list.
| b2Body | ||
Get the world body origin position.
| b2Body | ||
Get the body transform for the body's origin.
| b2Body | ||
GetType():uint
Get the type of 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 | ||
IsActive():Boolean
Get the active state of the body.
| b2Body | ||
IsAwake():Boolean
Get the sleeping state of this body.
| b2Body | ||
IsBullet():Boolean
Is this body treated like a bullet for continuous collision detection?
| b2Body | ||
IsFixedRotation():Boolean
Does this body have fixed rotation?
| b2Body | ||
IsSleepingAllowed():Boolean
Is this body allowed to sleep?
| b2Body | ||
Merges another body into this.
| b2Body | ||
ResetMassData():void
This resets the mass properties to the sum of the mass properties of the fixtures.
| b2Body | ||
SetActive(flag:Boolean):void
Set the active state of the body.
| b2Body | ||
SetAngle(angle:Number):void
Set the world body angle
| b2Body | ||
SetAngularDamping(angularDamping:Number):void
Set the angular damping of the body.
| b2Body | ||
SetAngularVelocity(omega:Number):void
Set the angular velocity.
| b2Body | ||
SetAwake(flag:Boolean):void
Set the sleep state of the body.
| b2Body | ||
SetBullet(flag:Boolean):void
Should this body be treated like a bullet for continuous collision detection?
| b2Body | ||
SetFixedRotation(fixed:Boolean):void
Set this body to have fixed rotation.
| b2Body | ||
SetLinearDamping(linearDamping:Number):void
Set the linear damping of the body.
| b2Body | ||
SetLinearVelocity(v:b2Vec2):void
Set the linear velocity of the center of mass.
| b2Body | ||
SetMassData(massData:b2MassData):void
Set the mass properties to override the mass properties of the fixtures
Note that this changes the center of mass position.
| b2Body | ||
SetPosition(position:b2Vec2):void
Setthe world body origin position.
| b2Body | ||
SetPositionAndAngle(position:b2Vec2, angle:Number):void
Set the position of the body's origin and rotation (radians).
| b2Body | ||
SetSleepingAllowed(flag:Boolean):void
Is this body allowed to sleep
| b2Body | ||
SetTransform(xf:b2Transform):void
Set the position of the body's origin and rotation (radians).
| b2Body | ||
SetType(type:uint):void
Set the type of this body.
| b2Body | ||
SetUserData(data:*):void
Set the user data.
| b2Body | ||
Splits a body into two, preserving dynamic properties
| b2Body |
b2_dynamicBody | property |
public static var b2_dynamicBody:uint = 2
b2_kinematicBody | property |
public static var b2_kinematicBody:uint = 1
b2_staticBody | property |
public static var b2_staticBody:uint = 0
ApplyForce | () | method |
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.
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):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.
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):void
Apply 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.
|
CreateFixture | () | method |
public function CreateFixture(def:b2FixtureDef):b2Fixture
Creates a fixture and attach it to this body. Use this function if you need to set some fixture parameters, like friction. Otherwise you can create the fixture directly from a shape. If the density is non-zero, this function automatically updates the mass of the body. Contacts are not created until the next time step.
Warning: This function is locked during callbacks.
Parametersdef:b2FixtureDef — the fixture definition.
|
b2Fixture |
CreateFixture2 | () | method |
public function CreateFixture2(shape:b2Shape, density:Number = 0.0):b2Fixture
Creates a fixture from a shape and attach it to this body. This is a convenience function. Use b2FixtureDef if you need to set parameters like friction, restitution, user data, or filtering. This function automatically updates the mass of the body.
Warning: This function is locked during callbacks.
Parametersshape:b2Shape — the shape to be cloned.
|
|
density:Number (default = 0.0 ) — the shape density (set to zero for static bodies).
|
b2Fixture |
DestroyFixture | () | method |
public function DestroyFixture(fixture:b2Fixture):void
Destroy a fixture. This removes the fixture from the broad-phase and destroys all contacts associated with this fixture. This will automatically adjust the mass of the body if the body is dynamic and the fixture has positive density. All fixtures attached to a body are implicitly destroyed when the body is destroyed.
Warning: This function is locked during callbacks.
Parametersfixture:b2Fixture — the fixture to be removed.
|
GetAngle | () | method |
public function GetAngle():Number
Get the angle in radians.
ReturnsNumber — the current world rotation angle in radians.
|
GetAngularDamping | () | method |
public function GetAngularDamping():Number
Get the angular damping of the body
ReturnsNumber |
GetAngularVelocity | () | method |
public function GetAngularVelocity():Number
Get the angular velocity.
ReturnsNumber — the angular velocity in radians/second.
|
GetContactList | () | method |
public function GetContactList():b2ContactEdge
Get a list of all contacts attached to this body.
Returnsb2ContactEdge |
GetControllerList | () | method |
public function GetControllerList():b2ControllerEdge
Get the list of all controllers attached to this body.
Returnsb2ControllerEdge |
GetDefinition | () | method |
public function GetDefinition():b2BodyDef
Get the definition containing the body properties.
Note: This provides a feature specific to this port.
Returnsb2BodyDef |
GetFixtureList | () | method |
public function GetFixtureList():b2Fixture
Get the list of all fixtures attached to this body.
Returnsb2Fixture |
GetInertia | () | method |
public function GetInertia():Number
Get the central rotational inertia of the body.
ReturnsNumber — the rotational inertia, usually in kg-m^2.
|
GetJointList | () | method |
public function GetJointList():b2JointEdge
Get the list of all joints attached to this body.
Returnsb2JointEdge |
GetLinearDamping | () | method |
public function GetLinearDamping():Number
Get the linear damping of the body.
ReturnsNumber |
GetLinearVelocity | () | method |
public function GetLinearVelocity():b2Vec2
Get the linear velocity of the center of mass.
Returnsb2Vec2 —
the linear velocity of the center of mass.
|
GetLinearVelocityFromLocalPoint | () | method |
public function GetLinearVelocityFromLocalPoint(localPoint:b2Vec2):b2Vec2
Get 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):b2Vec2
Get 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():b2Vec2
Get the local position of the center of mass.
Returnsb2Vec2 |
GetLocalPoint | () | method |
public function GetLocalPoint(worldPoint:b2Vec2):b2Vec2
Gets 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):b2Vec2
Gets a local vector given a world vector.
ParametersworldVector:b2Vec2 — vector in world coordinates.
|
b2Vec2 —
the corresponding local vector.
|
GetMass | () | method |
public function GetMass():Number
Get the total mass of the body.
ReturnsNumber — the mass, usually in kilograms (kg).
|
GetMassData | () | method |
public function GetMassData(data:b2MassData):void
Get the mass data of the body. The rotational inertial is relative to the center of mass.
Parametersdata:b2MassData |
GetNext | () | method |
GetPosition | () | method |
public function GetPosition():b2Vec2
Get the world body origin position.
Returnsb2Vec2 —
the world position of the body's origin.
|
GetTransform | () | method |
public function GetTransform():b2Transform
Get the body transform for the body's origin.
Returnsb2Transform —
the world transform of the body's origin.
|
GetType | () | method |
public function GetType():uint
Get the type of this body.
Returnsuint — type enum as a uint
|
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():b2Vec2
Get the world position of the center of mass.
Returnsb2Vec2 |
GetWorldPoint | () | method |
public function GetWorldPoint(localPoint:b2Vec2):b2Vec2
Get 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):b2Vec2
Get 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.
|
IsActive | () | method |
public function IsActive():Boolean
Get the active state of the body.
ReturnsBoolean — true if active.
|
IsAwake | () | method |
public function IsAwake():Boolean
Get the sleeping state of this body.
ReturnsBoolean — true if body is sleeping
|
IsBullet | () | method |
public function IsBullet():Boolean
Is this body treated like a bullet for continuous collision detection?
ReturnsBoolean |
IsFixedRotation | () | method |
public function IsFixedRotation():Boolean
Does this body have fixed rotation?
ReturnsBoolean — true means fixed rotation
|
IsSleepingAllowed | () | method |
public function IsSleepingAllowed():Boolean
Is this body allowed to sleep?
ReturnsBoolean |
Merge | () | method |
public function Merge(other:b2Body):void
Merges another body into this. Only fixtures, mass and velocity are effected, Other properties are ignored
Note: This provides a feature specific to this port.
Parametersother:b2Body |
ResetMassData | () | method |
public function ResetMassData():void
This resets the mass properties to the sum of the mass properties of the fixtures. This normally does not need to be called unless you called SetMassData to override the mass and later you want to reset the mass.
SetActive | () | method |
public function SetActive(flag:Boolean):void
Set the active state of the body. An inactive body is not simulated and cannot be collided with or woken up. If you pass a flag of true, all fixtures will be added to the broad-phase. If you pass a flag of false, all fixtures will be removed from the broad-phase and all contacts will be destroyed. Fixtures and joints are otherwise unaffected. You may continue to create/destroy fixtures and joints on inactive bodies. Fixtures on an inactive body are implicitly inactive and will not participate in collisions, ray-casts, or queries. Joints connected to an inactive body are implicitly inactive. An inactive body is still owned by a b2World object and remains in the body list.
Parametersflag:Boolean |
SetAngle | () | method |
public function SetAngle(angle:Number):void
Set the world body angle
Parametersangle:Number — the new angle of the body.
|
SetAngularDamping | () | method |
public function SetAngularDamping(angularDamping:Number):void
Set the angular damping of the body.
ParametersangularDamping:Number |
SetAngularVelocity | () | method |
public function SetAngularVelocity(omega:Number):void
Set the angular velocity.
Parametersomega:Number — the new angular velocity in radians/second.
|
SetAwake | () | method |
public function SetAwake(flag:Boolean):void
Set the sleep state of the body. A sleeping body has vety low CPU cost.
Parametersflag:Boolean — - set to true to put body to sleep, false to wake it
|
SetBullet | () | method |
public function SetBullet(flag:Boolean):void
Should this body be treated like a bullet for continuous collision detection?
Parametersflag:Boolean |
SetFixedRotation | () | method |
public function SetFixedRotation(fixed:Boolean):void
Set this body to have fixed rotation. This causes the mass to be reset.
Parametersfixed:Boolean — - true means no rotation
|
SetLinearDamping | () | method |
public function SetLinearDamping(linearDamping:Number):void
Set the linear damping of the body.
ParameterslinearDamping:Number |
SetLinearVelocity | () | method |
public function SetLinearVelocity(v:b2Vec2):void
Set the linear velocity of the center of mass.
Parametersv:b2Vec2 — the new linear velocity of the center of mass.
|
SetMassData | () | method |
public function SetMassData(massData:b2MassData):void
Set the mass properties to override the mass properties of the fixtures Note that this changes the center of mass position. Note that creating or destroying fixtures can also alter the mass. This function has no effect if the body isn't dynamic.
Warning: The supplied rotational inertia should be relative to the center of mass
ParametersmassData:b2MassData — the mass properties.
|
SetPosition | () | method |
public function SetPosition(position:b2Vec2):void
Setthe world body origin position.
Parametersposition:b2Vec2 — the new position of the body
|
SetPositionAndAngle | () | method |
public function SetPositionAndAngle(position:b2Vec2, angle:Number):void
Set 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.
|
SetSleepingAllowed | () | method |
public function SetSleepingAllowed(flag:Boolean):void
Is this body allowed to sleep
Parametersflag:Boolean |
SetTransform | () | method |
public function SetTransform(xf:b2Transform):void
Set the position of the body's origin and rotation (radians). This breaks any contacts and wakes the other bodies. Note this is less efficient than the other overload - you should use that if the angle is available.
Parametersxf:b2Transform — the transform of position and angle to set the bdoy to.
|
SetType | () | method |
public function SetType(type:uint):void
Set the type of this body. This may alter the mass and velocity
Parameterstype:uint — - enum stored as a static member of b2Body
|
SetUserData | () | method |
public function SetUserData(data:*):void
Set the user data. Use this to store your application specific data.
Parametersdata:* |
Split | () | method |
public function Split(callback:Function):b2Body
Splits a body into two, preserving dynamic properties
Note: This provides a feature specific to this port.
Parameterscallback:Function — Called once per fixture, return true to move this fixture to the new body
function Callback(fixture:b2Fixture):Boolean
|
b2Body —
The newly created bodies
|