b2BodyDef Struct Reference

A body definition holds all the data needed to construct a rigid body. More...

List of all members.

Public Member Functions

 b2BodyDef ()
 This constructor sets the body definition default values.

Public Attributes

b2MassData massData
 You can use this to initialized the mass properties of the body.
void * userData
 Use this to store application specific body data.
b2Vec2 position
 The world position of the body.
float32 angle
 The world angle of the body in radians.
float32 linearDamping
 Linear damping is use to reduce the linear velocity.
float32 angularDamping
 Angular damping is use to reduce the angular velocity.
bool allowSleep
 Set this flag to false if this body should never fall asleep.
bool isSleeping
 Is this body initially sleeping?
bool fixedRotation
 Should this body be prevented from rotating? Useful for characters.
bool isBullet
 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.


Detailed Description

A body definition holds all the data needed to construct a rigid body.

You can safely re-use body definitions.


Member Data Documentation

b2MassData b2BodyDef::massData

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.

b2Vec2 b2BodyDef::position

The world position of the body.

Avoid creating bodies at the origin since this can lead to many overlapping shapes.

float32 b2BodyDef::linearDamping

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.

float32 b2BodyDef::angularDamping

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.

bool b2BodyDef::allowSleep

Set this flag to false if this body should never fall asleep.

Note that this increases CPU usage.

bool b2BodyDef::isBullet

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.


The documentation for this struct was generated from the following file:
Generated on Fri Mar 7 23:58:18 2008 for Box2D by  doxygen 1.5.4