# Class Body

java.lang.Object
com.codename1.gaming.physics.box2d.dynamics.Body

public class Body extends Object

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `e_activeFlag`
  `static final int`
  `e_autoSleepFlag`
  `static final int`
  `e_awakeFlag`
  `static final int`
  `e_bulletFlag`
  `static final int`
  `e_fixedRotationFlag`
  `static final int`
  `e_islandFlag`
  `static final int`
  `e_toiFlag`
  `float`
  `m_angularDamping`
  `float`
  `m_angularVelocity`
  `ContactEdge`
  `m_contactList`
  `int`
  `m_fixtureCount`
  `Fixture`
  `m_fixtureList`
  `int`
  `m_flags`
  `final Vec2`
  `m_force`
  `float`
  `m_gravityScale`
  `float`
  `m_I`
  `float`
  `m_invI`
  `float`
  `m_invMass`
  `int`
  `m_islandIndex`
  `JointEdge`
  `m_jointList`
  `float`
  `m_linearDamping`
  `final Vec2`
  `m_linearVelocity`
  `float`
  `m_mass`
  `Body`
  `m_next`
  `Body`
  `m_prev`
  `float`
  `m_sleepTime`
  `final Sweep`
  `m_sweep`
  `float`
  `m_torque`
  `BodyType`
  `m_type`
  `Object`
  `m_userData`
  `World`
  `m_world`
  `final Transform`
  `m_xf`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Body(BodyDef bd, World world)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected final void`
  `advance(float t)`
  `void`
  `applyAngularImpulse(float impulse)`
  `final void`
  `applyForce(Vec2 force, Vec2 point)`
  `final void`
  `applyForceToCenter(Vec2 force)`
  `final void`
  `applyLinearImpulse(Vec2 impulse, Vec2 point)`
  `final void`
  `applyTorque(float torque)`
  `final Fixture`
  `createFixture(Shape shape, float density)`
  `final Fixture`
  `createFixture(FixtureDef def)`
  `final void`
  `destroyFixture(Fixture fixture)`
  `final float`
  `getAngle()`
  `final float`
  `getAngularDamping()`
  `final float`
  `getAngularVelocity()`
  `final ContactEdge`
  `getContactList()`
  `final Fixture`
  `getFixtureList()`
  `float`
  `getGravityScale()`
  `final float`
  `getInertia()`
  `final JointEdge`
  `getJointList()`
  `final float`
  `getLinearDamping()`
  `final Vec2`
  `getLinearVelocity()`
  `final Vec2`
  `getLinearVelocityFromLocalPoint(Vec2 localPoint)`
  `final void`
  `getLinearVelocityFromLocalPointToOut(Vec2 localPoint, Vec2 out)`
  `final Vec2`
  `getLinearVelocityFromWorldPoint(Vec2 worldPoint)`
  `final void`
  `getLinearVelocityFromWorldPointToOut(Vec2 worldPoint, Vec2 out)`
  `final Vec2`
  `getLocalCenter()`
  `final Vec2`
  `getLocalPoint(Vec2 worldPoint)`
  `final void`
  `getLocalPointToOut(Vec2 worldPoint, Vec2 out)`
  `final Vec2`
  `getLocalVector(Vec2 worldVector)`
  `final void`
  `getLocalVectorToOut(Vec2 worldVector, Vec2 out)`
  `final void`
  `getLocalVectorToOutUnsafe(Vec2 worldVector, Vec2 out)`
  `final float`
  `getMass()`
  `final void`
  `getMassData(MassData data)`
  `final Body`
  `getNext()`
  `final Vec2`
  `getPosition()`
  `final Transform`
  `getTransform()`
  `BodyType`
  `getType()`
  `final Object`
  `getUserData()`
  `final World`
  `getWorld()`
  `final Vec2`
  `getWorldCenter()`
  `final Vec2`
  `getWorldPoint(Vec2 localPoint)`
  `final void`
  `getWorldPointToOut(Vec2 localPoint, Vec2 out)`
  `final Vec2`
  `getWorldVector(Vec2 localVector)`
  `final void`
  `getWorldVectorToOut(Vec2 localVector, Vec2 out)`
  `final void`
  `getWorldVectorToOutUnsafe(Vec2 localVector, Vec2 out)`
  `boolean`
  `isActive()`
  `boolean`
  `isAwake()`
  `final boolean`
  `isBullet()`
  `boolean`
  `isFixedRotation()`
  `boolean`
  `isSleepingAllowed()`
  `final void`
  `resetMassData()`
  `void`
  `setActive(boolean flag)`
  `final void`
  `setAngularDamping(float angularDamping)`
  `final void`
  `setAngularVelocity(float w)`
  `void`
  `setAwake(boolean flag)`
  `final void`
  `setBullet(boolean flag)`
  `void`
  `setFixedRotation(boolean flag)`
  `void`
  `setGravityScale(float gravityScale)`
  `final void`
  `setLinearDamping(float linearDamping)`
  `final void`
  `setLinearVelocity(Vec2 v)`
  `final void`
  `setMassData(MassData massData)`
  `void`
  `setSleepingAllowed(boolean flag)`
  `final void`
  `setTransform(Vec2 position, float angle)`
  `void`
  `setType(BodyType type)`
  `final void`
  `setUserData(Object data)`
  `boolean`
  `shouldCollide(Body other)`
  `protected final void`
  `synchronizeFixtures()`
  `final void`
  `synchronizeTransform()`

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### e_islandFlag

    public static final int e_islandFlag
    See Also:
      - Constant Field Values

  - ### e_awakeFlag

    public static final int e_awakeFlag
    See Also:
      - Constant Field Values

  - ### e_autoSleepFlag

    public static final int e_autoSleepFlag
    See Also:
      - Constant Field Values

  - ### e_bulletFlag

    public static final int e_bulletFlag
    See Also:
      - Constant Field Values

  - ### e_fixedRotationFlag

    public static final int e_fixedRotationFlag
    See Also:
      - Constant Field Values

  - ### e_activeFlag

    public static final int e_activeFlag
    See Also:
      - Constant Field Values

  - ### e_toiFlag

    public static final int e_toiFlag
    See Also:
      - Constant Field Values

  - ### m_type

    public BodyType m_type

  - ### m_flags

    public int m_flags

  - ### m_islandIndex

    public int m_islandIndex

  - ### m_xf

    public final Transform m_xf

  - ### m_sweep

    public final Sweep m_sweep

  - ### m_linearVelocity

    public final Vec2 m_linearVelocity

  - ### m_angularVelocity

    public float m_angularVelocity

  - ### m_force

    public final Vec2 m_force

  - ### m_torque

    public float m_torque

  - ### m_world

    public World m_world

  - ### m_prev

    public Body m_prev

  - ### m_next

    public Body m_next

  - ### m_fixtureList

    public Fixture m_fixtureList

  - ### m_fixtureCount

    public int m_fixtureCount

  - ### m_jointList

    public JointEdge m_jointList

  - ### m_contactList

    public ContactEdge m_contactList

  - ### m_mass

    public float m_mass

  - ### m_invMass

    public float m_invMass

  - ### m_I

    public float m_I

  - ### m_invI

    public float m_invI

  - ### m_linearDamping

    public float m_linearDamping

  - ### m_angularDamping

    public float m_angularDamping

  - ### m_gravityScale

    public float m_gravityScale

  - ### m_sleepTime

    public float m_sleepTime

  - ### m_userData

    public Object m_userData

- ## Constructor Details

  - ### Body

    public Body(BodyDef bd, World world)

- ## Method Details

  - ### createFixture

    public final Fixture createFixture(FixtureDef def)

  - ### createFixture

    public final Fixture createFixture(Shape shape, float density)

  - ### destroyFixture

    public final void destroyFixture(Fixture fixture)

  - ### setTransform

    public final void setTransform(Vec2 position, float angle)

  - ### getTransform

    public final Transform getTransform()

  - ### getPosition

    public final Vec2 getPosition()

  - ### getAngle

    public final float getAngle()

  - ### getWorldCenter

    public final Vec2 getWorldCenter()

  - ### getLocalCenter

    public final Vec2 getLocalCenter()

  - ### setLinearVelocity

    public final void setLinearVelocity(Vec2 v)

  - ### getLinearVelocity

    public final Vec2 getLinearVelocity()

  - ### setAngularVelocity

    public final void setAngularVelocity(float w)

  - ### getAngularVelocity

    public final float getAngularVelocity()

  - ### getGravityScale

    public float getGravityScale()

  - ### setGravityScale

    public void setGravityScale(float gravityScale)

  - ### applyForce

    public final void applyForce(Vec2 force, Vec2 point)

  - ### applyForceToCenter

    public final void applyForceToCenter(Vec2 force)

  - ### applyTorque

    public final void applyTorque(float torque)

  - ### applyLinearImpulse

    public final void applyLinearImpulse(Vec2 impulse, Vec2 point)

  - ### applyAngularImpulse

    public void applyAngularImpulse(float impulse)

  - ### getMass

    public final float getMass()

  - ### getInertia

    public final float getInertia()

  - ### getMassData

    public final void getMassData(MassData data)

  - ### setMassData

    public final void setMassData(MassData massData)

  - ### resetMassData

    public final void resetMassData()

  - ### getWorldPoint

    public final Vec2 getWorldPoint(Vec2 localPoint)

  - ### getWorldPointToOut

    public final void getWorldPointToOut(Vec2 localPoint, Vec2 out)

  - ### getWorldVector

    public final Vec2 getWorldVector(Vec2 localVector)

  - ### getWorldVectorToOut

    public final void getWorldVectorToOut(Vec2 localVector, Vec2 out)

  - ### getWorldVectorToOutUnsafe

    public final void getWorldVectorToOutUnsafe(Vec2 localVector, Vec2 out)

  - ### getLocalPoint

    public final Vec2 getLocalPoint(Vec2 worldPoint)

  - ### getLocalPointToOut

    public final void getLocalPointToOut(Vec2 worldPoint, Vec2 out)

  - ### getLocalVector

    public final Vec2 getLocalVector(Vec2 worldVector)

  - ### getLocalVectorToOut

    public final void getLocalVectorToOut(Vec2 worldVector, Vec2 out)

  - ### getLocalVectorToOutUnsafe

    public final void getLocalVectorToOutUnsafe(Vec2 worldVector, Vec2 out)

  - ### getLinearVelocityFromWorldPoint

    public final Vec2 getLinearVelocityFromWorldPoint(Vec2 worldPoint)

  - ### getLinearVelocityFromWorldPointToOut

    public final void getLinearVelocityFromWorldPointToOut(Vec2 worldPoint, Vec2 out)

  - ### getLinearVelocityFromLocalPoint

    public final Vec2 getLinearVelocityFromLocalPoint(Vec2 localPoint)

  - ### getLinearVelocityFromLocalPointToOut

    public final void getLinearVelocityFromLocalPointToOut(Vec2 localPoint, Vec2 out)

  - ### getLinearDamping

    public final float getLinearDamping()

  - ### setLinearDamping

    public final void setLinearDamping(float linearDamping)

  - ### getAngularDamping

    public final float getAngularDamping()

  - ### setAngularDamping

    public final void setAngularDamping(float angularDamping)

  - ### getType

    public BodyType getType()

  - ### setType

    public void setType(BodyType type)

  - ### isBullet

    public final boolean isBullet()

  - ### setBullet

    public final void setBullet(boolean flag)

  - ### setSleepingAllowed

    public void setSleepingAllowed(boolean flag)

  - ### isSleepingAllowed

    public boolean isSleepingAllowed()

  - ### setAwake

    public void setAwake(boolean flag)

  - ### isAwake

    public boolean isAwake()

  - ### setActive

    public void setActive(boolean flag)

  - ### isActive

    public boolean isActive()

  - ### setFixedRotation

    public void setFixedRotation(boolean flag)

  - ### isFixedRotation

    public boolean isFixedRotation()

  - ### getFixtureList

    public final Fixture getFixtureList()

  - ### getJointList

    public final JointEdge getJointList()

  - ### getContactList

    public final ContactEdge getContactList()

  - ### getNext

    public final Body getNext()

  - ### getUserData

    public final Object getUserData()

  - ### setUserData

    public final void setUserData(Object data)

  - ### getWorld

    public final World getWorld()

  - ### synchronizeFixtures

    protected final void synchronizeFixtures()

  - ### synchronizeTransform

    public final void synchronizeTransform()

  - ### shouldCollide

    public boolean shouldCollide(Body other)

  - ### advance

    protected final void advance(float t)