Public Member Functions | Public Attributes | List of all members
b2BodyDef Struct Reference

#include <b2_body.h>

Public Member Functions

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

Public Attributes

bool allowSleep
 
float angle
 The world angle of the body in radians. More...
 
float angularDamping
 
float angularVelocity
 The angular velocity of the body. More...
 
bool awake
 Is this body initially awake or sleeping? More...
 
bool bullet
 
bool enabled
 Does this body start out enabled? More...
 
bool fixedRotation
 Should this body be prevented from rotating? Useful for characters. More...
 
float gravityScale
 Scale the gravity applied to this body. More...
 
float linearDamping
 
b2Vec2 linearVelocity
 The linear velocity of the body's origin in world co-ordinates. More...
 
b2Vec2 position
 
b2BodyType type
 
b2BodyUserData userData
 Use this to store application specific body data. More...
 

Detailed Description

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

Definition at line 52 of file b2_body.h.

Constructor & Destructor Documentation

◆ b2BodyDef()

b2BodyDef::b2BodyDef ( )
inline

This constructor sets the body definition default values.

Definition at line 55 of file b2_body.h.

Member Data Documentation

◆ allowSleep

bool b2BodyDef::allowSleep

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

Definition at line 103 of file b2_body.h.

◆ angle

float b2BodyDef::angle

The world angle of the body in radians.

Definition at line 81 of file b2_body.h.

◆ angularDamping

float 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. Units are 1/time

Definition at line 99 of file b2_body.h.

◆ angularVelocity

float b2BodyDef::angularVelocity

The angular velocity of the body.

Definition at line 87 of file b2_body.h.

◆ awake

bool b2BodyDef::awake

Is this body initially awake or sleeping?

Definition at line 106 of file b2_body.h.

◆ bullet

bool b2BodyDef::bullet

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 kinematic and static bodies. This setting is only considered on dynamic bodies.

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

Definition at line 115 of file b2_body.h.

◆ enabled

bool b2BodyDef::enabled

Does this body start out enabled?

Definition at line 118 of file b2_body.h.

◆ fixedRotation

bool b2BodyDef::fixedRotation

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

Definition at line 109 of file b2_body.h.

◆ gravityScale

float b2BodyDef::gravityScale

Scale the gravity applied to this body.

Definition at line 124 of file b2_body.h.

◆ linearDamping

float 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. Units are 1/time

Definition at line 93 of file b2_body.h.

◆ linearVelocity

b2Vec2 b2BodyDef::linearVelocity

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

Definition at line 84 of file b2_body.h.

◆ position

b2Vec2 b2BodyDef::position

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

Definition at line 78 of file b2_body.h.

◆ type

b2BodyType b2BodyDef::type

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

Definition at line 74 of file b2_body.h.

◆ userData

b2BodyUserData b2BodyDef::userData

Use this to store application specific body data.

Definition at line 121 of file b2_body.h.


The documentation for this struct was generated from the following file:


mvsim
Author(s):
autogenerated on Tue Jul 4 2023 03:08:22