Example usage for Java com.badlogic.gdx.physics.box2d Body fields, constructors, methods, implement or subclass
The text is from its open source code.
void | applyAngularImpulse(float impulse, boolean wake) Apply an angular impulse. |
void | applyForce(Vector2 force, Vector2 point, boolean wrap) Apply a force at a world point. |
void | applyForceToCenter(Vector2 force, boolean wake) Apply a force to the center of mass. |
void | applyLinearImpulse(Vector2 impulse, Vector2 point, boolean wake) Apply an impulse at a point. |
void | applyLinearImpulse(float impulseX, float impulseY, float pointX, float pointY, boolean wake) Apply an impulse at a point. |
void | applyTorque(float torque, boolean wake) Apply a torque. |
Fixture | createFixture(FixtureDef def) Creates a fixture and attach it to this body. |
Fixture | createFixture(Shape shape, float density) Creates a fixture from a shape and attach it to this body. |
void | destroyFixture(Fixture fixture) Destroy a fixture. |
float | getAngle() Get the angle in radians. |
float | getAngularDamping() Get the angular damping of the body. |
float | getAngularVelocity() Get the angular velocity. |
Array | getFixtureList() Get the list of all fixtures attached to this body. |
float | getGravityScale() |
float | getInertia() Get the rotational inertia of the body about the local origin. |
Array | getJointList() Get the list of all joints attached to this body. |
float | getLinearDamping() Get the linear damping of the body. |
Vector2 | getLinearVelocity() |
Vector2 | getLinearVelocityFromLocalPoint(Vector2 localPoint) Get the world velocity of a local point. |
Vector2 | getLocalCenter() |
float | getMass() Get the total mass of the body. |
MassData | getMassData() Get the mass data of the body. |
Vector2 | getPosition() Get the world body origin position. |
Transform | getTransform() Get the body transform for the body's origin. |
BodyType | getType() Get the type of this body. |
Object | getUserData() Get the user data |
World | getWorld() Get the parent world of this body. |
Vector2 | getWorldCenter() |
Vector2 | getWorldPoint(Vector2 localPoint) Get the world coordinates of a point given the local coordinates. |
Vector2 | getWorldVector(Vector2 localVector) Get the world coordinates of a vector given the local coordinates. |
boolean | isActive() Get the active state of the body. |
boolean | isAwake() Get the sleeping state of this body. |
boolean | isBullet() Is this body treated like a bullet for continuous collision detection? |
boolean | isFixedRotation() Does this body have fixed rotation? |
boolean | isSleepingAllowed() Is this body allowed to sleep |
void | resetMassData() This resets the mass properties to the sum of the mass properties of the fixtures. |
void | setActive(boolean flag) Set the active state of the body. |
void | setAngularDamping(float angularDamping) Set the angular damping of the body. |
void | setAngularVelocity(float omega) Set the angular velocity. |
void | setAwake(boolean flag) Set the sleep state of the body. |
void | setBullet(boolean flag) Should this body be treated like a bullet for continuous collision detection? |
void | setFixedRotation(boolean flag) Set this body to have fixed rotation. |
void | setGravityScale(float scale) Sets the gravity scale of the body |
void | setLinearDamping(float linearDamping) Set the linear damping of the body. |
void | setLinearVelocity(float vX, float vY) Set the linear velocity of the center of mass. |
void | setLinearVelocity(Vector2 v) Set the linear velocity of the center of mass. |
void | setMassData(MassData data) Set the mass properties to override the mass properties of the fixtures. |
void | setSleepingAllowed(boolean flag) You can disable sleeping on this body. |
void | setTransform(Vector2 position, float angle) Set the position of the body's origin and rotation. |
void | setTransform(float x, float y, float angle) Set the position of the body's origin and rotation. |
void | setType(BodyType type) Set the type of this body. |
void | setUserData(Object userData) Set the user data |