Box2D: b2BodyDef Struct Reference

Box2D

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

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.

The world position of the body.

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

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.

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.

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

Note that this increases CPU usage.

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:
  • b2Body.h

Generated on Sun Apr 13 15:21:27 2008 for Box2D by  doxygen 1.5.4