PackageBox2D.Dynamics
Classpublic class b2BodyDef
Sourceb2BodyDef.as

A body definition holds all the data needed to construct a rigid body. You can safely re-use body definitions.



Public Properties
 PropertyDefined by
  active : Boolean
Does this body start out active?
b2BodyDef
  allowSleep : Boolean
Set this flag to false if this body should never fall asleep.
b2BodyDef
  angle : Number
The world angle of the body in radians.
b2BodyDef
  angularDamping : Number
Angular damping is use to reduce the angular velocity.
b2BodyDef
  angularVelocity : Number
The angular velocity of the body.
b2BodyDef
  awake : Boolean
Is this body initially awake or sleeping?
b2BodyDef
  bullet : Boolean
Is this a fast moving body that should be prevented from tunneling through other moving bodies? Note that all bodies are prevented from tunneling through static bodies.
b2BodyDef
  fixedRotation : Boolean
Should this body be prevented from rotating? Useful for characters.
b2BodyDef
  inertiaScale : Number
Scales the inertia tensor.
b2BodyDef
  linearDamping : Number
Linear damping is use to reduce the linear velocity.
b2BodyDef
  linearVelocity : b2Vec2
The linear velocity of the body's origin in world co-ordinates.
b2BodyDef
  position : b2Vec2
The world position of the body.
b2BodyDef
  type : uint
The body type: static, kinematic, or dynamic.
b2BodyDef
  userData : *
Use this to store application specific body data.
b2BodyDef
Public Methods
 MethodDefined by
  
This constructor sets the body definition default values.
b2BodyDef
Property detail
activeproperty
public var active:Boolean

Does this body start out active?

allowSleepproperty 
public var allowSleep:Boolean

Set this flag to false if this body should never fall asleep. Note that this increases CPU usage.

angleproperty 
public var angle:Number

The world angle of the body in radians.

angularDampingproperty 
public var angularDamping:Number

Angular damping is use to reduce the angular velocity. The damping parameter can be larger than 1.0f but the damping effect becomes sensitive to the time step when the damping parameter is large.

angularVelocityproperty 
public var angularVelocity:Number

The angular velocity of the body.

awakeproperty 
public var awake:Boolean

Is this body initially awake or sleeping?

bulletproperty 
public var bullet:Boolean

Is this a fast moving body that should be prevented from tunneling through other moving bodies? Note that all bodies are prevented from tunneling through static bodies.

Warning: You should use this flag sparingly since it increases processing time.

fixedRotationproperty 
public var fixedRotation:Boolean

Should this body be prevented from rotating? Useful for characters.

inertiaScaleproperty 
public var inertiaScale:Number

Scales the inertia tensor.

Warning: Experimental

linearDampingproperty 
public var linearDamping:Number

Linear damping is use to reduce the linear velocity. The damping parameter can be larger than 1.0f but the damping effect becomes sensitive to the time step when the damping parameter is large.

linearVelocityproperty 
public var linearVelocity:b2Vec2

The linear velocity of the body's origin in world co-ordinates.

positionproperty 
public var position:b2Vec2

The world position of the body. Avoid creating bodies at the origin since this can lead to many overlapping shapes.

typeproperty 
public var type:uint

The body type: static, kinematic, or dynamic. A member of the b2BodyType class Note: if a dynamic body would have zero mass, the mass is set to one.

See also

userDataproperty 
public var userData:*

Use this to store application specific body data.

Constructor detail
b2BodyDef()constructor
public function b2BodyDef()

This constructor sets the body definition default values.