public class BodyDef extends Object
| Constructor and Description |
|---|
BodyDef() |
| Modifier and Type | Method and Description |
|---|---|
float |
getAngle()
The world angle of the body in radians.
|
float |
getAngularDamping()
Angular damping is use to reduce the angular velocity.
|
float |
getAngularVelocity()
The angular velocity of the body.
|
float |
getGravityScale()
Experimental: scales the inertia tensor.
|
float |
getLinearDamping()
Linear damping is use to reduce the linear velocity.
|
Vec2 |
getLinearVelocity()
The linear velocity of the body in world co-ordinates.
|
Vec2 |
getPosition()
The world position of the body.
|
BodyType |
getType()
The body type: static, kinematic, or dynamic.
|
Object |
getUserData()
Use this to store application specific body data.
|
boolean |
isActive()
Does this body start out active?
|
boolean |
isAllowSleep()
Set this flag to false if this body should never fall asleep.
|
boolean |
isAwake()
Is this body initially sleeping?
|
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 kinematic and static bodies.
|
boolean |
isFixedRotation()
Should this body be prevented from rotating? Useful for characters.
|
void |
setActive(boolean active)
Does this body start out active?
|
void |
setAllowSleep(boolean allowSleep)
Set this flag to false if this body should never fall asleep.
|
void |
setAngle(float angle)
The world angle of the body in radians.
|
void |
setAngularDamping(float angularDamping)
Angular damping is use to reduce the angular velocity.
|
void |
setAngularVelocity(float angularVelocity)
The angular velocity of the body.
|
void |
setAwake(boolean awake)
Is this body initially sleeping?
|
void |
setBullet(boolean 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.
|
void |
setFixedRotation(boolean fixedRotation)
Should this body be prevented from rotating? Useful for characters.
|
void |
setGravityScale(float gravityScale)
Experimental: scales the inertia tensor.
|
void |
setLinearDamping(float linearDamping)
Linear damping is use to reduce the linear velocity.
|
void |
setLinearVelocity(Vec2 linearVelocity)
The linear velocity of the body in world co-ordinates.
|
void |
setPosition(Vec2 position)
The world position of the body.
|
void |
setType(BodyType type)
The body type: static, kinematic, or dynamic.
|
void |
setUserData(Object userData)
Use this to store application specific body data.
|
public BodyType getType()
public void setType(BodyType type)
public Object getUserData()
public void setUserData(Object userData)
public Vec2 getPosition()
public void setPosition(Vec2 position)
public float getAngle()
public void setAngle(float angle)
public Vec2 getLinearVelocity()
public void setLinearVelocity(Vec2 linearVelocity)
public float getAngularVelocity()
public void setAngularVelocity(float angularVelocity)
public float getLinearDamping()
public void setLinearDamping(float linearDamping)
public float getAngularDamping()
public void setAngularDamping(float angularDamping)
public boolean isAllowSleep()
public void setAllowSleep(boolean allowSleep)
public boolean isAwake()
public void setAwake(boolean awake)
public boolean isFixedRotation()
public void setFixedRotation(boolean fixedRotation)
public boolean isBullet()
public void setBullet(boolean bullet)
public boolean isActive()
public void setActive(boolean active)
public float getGravityScale()
public void setGravityScale(float gravityScale)
Copyright © 2017. All rights reserved.