|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jbox2d.dynamics.BodyDef
public class BodyDef
Defines a body. All data is public, and may be set directly.
When you have set the definition to your liking, you can create
the body using World::createDynamicBody(BodyDef) or World::createStaticBody(BodyDef).
Don't forget to call Body::setMassFromShapes or Body::setMass(MassData)
after you create a dynamic body!
| Field Summary | |
|---|---|
boolean |
allowSleep
Set this flag to false if this body should never fall asleep. |
float |
angle
The world angle of the body in radians. |
float |
angularDamping
Angular damping is use to reduce the angular velocity. |
boolean |
fixedRotation
Should this body be prevented from rotating? Useful for characters. |
boolean |
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. |
boolean |
isSleeping
Is this body initially sleeping? |
float |
linearDamping
Linear damping is use to reduce the linear velocity. |
MassData |
massData
You can use this to initialized the mass properties of the body. |
Vec2 |
position
The world position of the body. |
java.lang.Object |
userData
Use this to store application specific body data |
| Constructor Summary | |
|---|---|
BodyDef()
Default body definition. |
|
| Method Summary |
|---|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public MassData massData
public java.lang.Object userData
public Vec2 position
public float angle
public float linearDamping
public float angularDamping
public boolean allowSleep
public boolean isSleeping
public boolean fixedRotation
public boolean isBullet
| Constructor Detail |
|---|
public BodyDef()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||