blaze.dynamics.bodyDef
- class
BodyDef
;
- A body definition holds all the data needed to construct a rigid body.
You can safely re-use body definitions.
- this(bVec2 position, float angle);
- This constructor sets the body definition default values.
Params:
positon |
the position of the body |
float angle |
the angle of rotation of the body |
- MassData
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 Body::SetMassFromShapes.
- Object
userData
;
- Use this to store application specific body data.
- bVec2
position
;
- The world
position
of the body. Avoid creating bodies at the origin
since this can lead to many overlapping shapes.
- float
angle
;
- The world
angle
of the body in radians.
- float
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.
- float
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
allowSleep
;
- Set this flag to false if this body should never fall asleep. Note that
this increases CPU usage.
- 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.
Warning:
You should use this flag sparingly since it increases processing time.
|