Java com.badlogic.gdx.physics.box2d Body fields, constructors, methods, implement or subclass

Example usage for Java com.badlogic.gdx.physics.box2d Body fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for com.badlogic.gdx.physics.box2d Body.

The text is from its open source code.

Method

voidapplyAngularImpulse(float impulse, boolean wake)
Apply an angular impulse.
voidapplyForce(Vector2 force, Vector2 point, boolean wrap)
Apply a force at a world point.
voidapplyForceToCenter(Vector2 force, boolean wake)
Apply a force to the center of mass.
voidapplyLinearImpulse(Vector2 impulse, Vector2 point, boolean wake)
Apply an impulse at a point.
voidapplyLinearImpulse(float impulseX, float impulseY, float pointX, float pointY, boolean wake)
Apply an impulse at a point.
voidapplyTorque(float torque, boolean wake)
Apply a torque.
FixturecreateFixture(FixtureDef def)
Creates a fixture and attach it to this body.
FixturecreateFixture(Shape shape, float density)
Creates a fixture from a shape and attach it to this body.
voiddestroyFixture(Fixture fixture)
Destroy a fixture.
floatgetAngle()
Get the angle in radians.
floatgetAngularDamping()
Get the angular damping of the body.
floatgetAngularVelocity()
Get the angular velocity.
ArraygetFixtureList()
Get the list of all fixtures attached to this body.
floatgetGravityScale()
floatgetInertia()
Get the rotational inertia of the body about the local origin.
ArraygetJointList()
Get the list of all joints attached to this body.
floatgetLinearDamping()
Get the linear damping of the body.
Vector2getLinearVelocity()
Vector2getLinearVelocityFromLocalPoint(Vector2 localPoint)
Get the world velocity of a local point.
Vector2getLocalCenter()
floatgetMass()
Get the total mass of the body.
MassDatagetMassData()
Get the mass data of the body.
Vector2getPosition()
Get the world body origin position.
TransformgetTransform()
Get the body transform for the body's origin.
BodyTypegetType()
Get the type of this body.
ObjectgetUserData()
Get the user data
WorldgetWorld()
Get the parent world of this body.
Vector2getWorldCenter()
Vector2getWorldPoint(Vector2 localPoint)
Get the world coordinates of a point given the local coordinates.
Vector2getWorldVector(Vector2 localVector)
Get the world coordinates of a vector given the local coordinates.
booleanisActive()
Get the active state of the body.
booleanisAwake()
Get the sleeping state of this body.
booleanisBullet()
Is this body treated like a bullet for continuous collision detection?
booleanisFixedRotation()
Does this body have fixed rotation?
booleanisSleepingAllowed()
Is this body allowed to sleep
voidresetMassData()
This resets the mass properties to the sum of the mass properties of the fixtures.
voidsetActive(boolean flag)
Set the active state of the body.
voidsetAngularDamping(float angularDamping)
Set the angular damping of the body.
voidsetAngularVelocity(float omega)
Set the angular velocity.
voidsetAwake(boolean flag)
Set the sleep state of the body.
voidsetBullet(boolean flag)
Should this body be treated like a bullet for continuous collision detection?
voidsetFixedRotation(boolean flag)
Set this body to have fixed rotation.
voidsetGravityScale(float scale)
Sets the gravity scale of the body
voidsetLinearDamping(float linearDamping)
Set the linear damping of the body.
voidsetLinearVelocity(float vX, float vY)
Set the linear velocity of the center of mass.
voidsetLinearVelocity(Vector2 v)
Set the linear velocity of the center of mass.
voidsetMassData(MassData data)
Set the mass properties to override the mass properties of the fixtures.
voidsetSleepingAllowed(boolean flag)
You can disable sleeping on this body.
voidsetTransform(Vector2 position, float angle)
Set the position of the body's origin and rotation.
voidsetTransform(float x, float y, float angle)
Set the position of the body's origin and rotation.
voidsetType(BodyType type)
Set the type of this body.
voidsetUserData(Object userData)
Set the user data