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
  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
  fixedRotation : Boolean
Should this body be prevented from rotating? Useful for characters.
b2BodyDef
  isBullet : 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
  isSleeping : Boolean
Is this body initially sleeping?
b2BodyDef
  linearDamping : Number
Linear damping is use to reduce the linear velocity.
b2BodyDef
  massData : b2MassData
You can use this to initialized the mass properties of the body.
b2BodyDef
  position : b2Vec2
The world position of the body.
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
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.

fixedRotationproperty 
public var fixedRotation:Boolean

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

isBulletproperty 
public var isBullet: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.

isSleepingproperty 
public var isSleeping:Boolean

Is this body initially sleeping?

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.

massDataproperty 
public var massData:b2MassData

You can use this to initialized the mass properties of the body. If you prefer, you can set the mass properties after the shapes have been added using b2Body::SetMassFromShapes.

See also

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.

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.