C# Class Box2DX.Dynamics.BodyDef

A body definition holds all the data needed to construct a rigid body. You can safely re-use body definitions.
Show file Open project: KrugerHeavyIndustries/box2d-unity Class Usage Examples

Public Properties

Property Type Description
AllowSleep bool
Angle float
AngularDamping float
AngularVelocity float
FixedRotation bool
IsBullet bool
IsSleeping bool
LinearDamping float
LinearVelocity System.Vector2
MassData Box2DX.Collision.MassData
Position System.Vector2
UserData object

Public Methods

Method Description
BodyDef ( byte init ) : System

This constructor sets the body definition default values.

Method Details

BodyDef() public method

This constructor sets the body definition default values.
public BodyDef ( byte init ) : System
init byte
return System

Property Details

AllowSleep public property

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

Angle public property

The world angle of the body in radians.
public float Angle
return float

AngularDamping public property

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.
public float AngularDamping
return float

AngularVelocity public property

public float AngularVelocity
return float

FixedRotation public property

Should this body be prevented from rotating? Useful for characters.
public bool FixedRotation
return bool

IsBullet public property

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.
public bool IsBullet
return bool

IsSleeping public property

Is this body initially sleeping?
public bool IsSleeping
return bool

LinearDamping public property

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.
public float LinearDamping
return float

LinearVelocity public property

public Vector2,System LinearVelocity
return System.Vector2

MassData public property

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.
public MassData,Box2DX.Collision MassData
return Box2DX.Collision.MassData

Position public property

The world position of the body. Avoid creating bodies at the origin since this can lead to many overlapping shapes.
public Vector2,System Position
return System.Vector2

UserData public property

Use this to store application specific body data.
public object UserData
return object