# Class World

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

public class World extends Object

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `int`
  `activeContacts`
  `static final int`
  `CLEAR_FORCES`
  `int`
  `contactPoolCount`
  `static final int`
  `LOCKED`
  `protected ContactManager`
  `m_contactManager`
  `protected int`
  `m_flags`
  `static final int`
  `NEW_FIXTURE`
  `static final int`
  `WORLD_POOL_CONTAINER_SIZE`
  `static final int`
  `WORLD_POOL_SIZE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `World(Vec2 gravity)`
  `World(Vec2 gravity, IWorldPool pool)`
  `World(Vec2 gravity, IWorldPool argPool, BroadPhaseStrategy broadPhaseStrategy)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `clearForces()`
  `Body`
  `createBody(BodyDef def)`
  `Joint`
  `createJoint(JointDef def)`
  `void`
  `destroyBody(Body body)`
  `void`
  `destroyJoint(Joint j)`
  `void`
  `drawDebugData()`
  `boolean`
  `getAutoClearForces()`
  `int`
  `getBodyCount()`
  `Body`
  `getBodyList()`
  `int`
  `getContactCount()`
  `Contact`
  `getContactList()`
  `ContactManager`
  `getContactManager()`
  `Vec2`
  `getGravity()`
  `int`
  `getJointCount()`
  `Joint`
  `getJointList()`
  `IWorldPool`
  `getPool()`
  `Profile`
  `getProfile()`
  `int`
  `getProxyCount()`
  `int`
  `getTreeBalance()`
  `int`
  `getTreeHeight()`
  `float`
  `getTreeQuality()`
  `boolean`
  `isAllowSleep()`
  `boolean`
  `isContinuousPhysics()`
  `boolean`
  `isLocked()`
  `boolean`
  `isSleepingAllowed()`
  `boolean`
  `isSubStepping()`
  `boolean`
  `isWarmStarting()`
  `Contact`
  `popContact(Fixture fixtureA, int indexA, Fixture fixtureB, int indexB)`
  `void`
  `pushContact(Contact contact)`
  `void`
  `queryAABB(QueryCallback callback, AABB aabb)`
  `void`
  `raycast(RayCastCallback callback, Vec2 point1, Vec2 point2)`
  `void`
  `setAllowSleep(boolean flag)`
  `void`
  `setAutoClearForces(boolean flag)`
  `void`
  `setContactFilter(ContactFilter filter)`
  `void`
  `setContactListener(ContactListener listener)`
  `void`
  `setContinuousPhysics(boolean flag)`
  `void`
  `setDebugDraw(DebugDraw debugDraw)`
  `void`
  `setDestructionListener(DestructionListener listener)`
  `void`
  `setGravity(Vec2 gravity)`
  `void`
  `setSleepingAllowed(boolean sleepingAllowed)`
  `void`
  `setSubStepping(boolean subStepping)`
  `void`
  `setWarmStarting(boolean flag)`
  `void`
  `step(float dt, int velocityIterations, int positionIterations)`

  ### Methods inherited from class Object

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

- ## Field Details

  - ### WORLD_POOL_SIZE

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

  - ### WORLD_POOL_CONTAINER_SIZE

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

  - ### NEW_FIXTURE

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

  - ### LOCKED

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

  - ### CLEAR_FORCES

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

  - ### activeContacts

    public int activeContacts

  - ### contactPoolCount

    public int contactPoolCount

  - ### m_flags

    protected int m_flags

  - ### m_contactManager

    protected ContactManager m_contactManager

- ## Constructor Details

  - ### World

    public World(Vec2 gravity)

  - ### World

    public World(Vec2 gravity, IWorldPool pool)

  - ### World

    public World(Vec2 gravity, IWorldPool argPool, BroadPhaseStrategy broadPhaseStrategy)

- ## Method Details

  - ### setAllowSleep

    public void setAllowSleep(boolean flag)

  - ### setSubStepping

    public void setSubStepping(boolean subStepping)

  - ### isSubStepping

    public boolean isSubStepping()

  - ### isAllowSleep

    public boolean isAllowSleep()

  - ### popContact

    public Contact popContact(Fixture fixtureA, int indexA, Fixture fixtureB, int indexB)

  - ### pushContact

    public void pushContact(Contact contact)

  - ### getPool

    public IWorldPool getPool()

  - ### setDestructionListener

    public void setDestructionListener(DestructionListener listener)

  - ### setContactFilter

    public void setContactFilter(ContactFilter filter)

  - ### setContactListener

    public void setContactListener(ContactListener listener)

  - ### setDebugDraw

    public void setDebugDraw(DebugDraw debugDraw)

  - ### createBody

    public Body createBody(BodyDef def)

  - ### destroyBody

    public void destroyBody(Body body)

  - ### createJoint

    public Joint createJoint(JointDef def)

  - ### destroyJoint

    public void destroyJoint(Joint j)

  - ### step

    public void step(float dt, int velocityIterations, int positionIterations)

  - ### clearForces

    public void clearForces()

  - ### drawDebugData

    public void drawDebugData()

  - ### queryAABB

    public void queryAABB(QueryCallback callback, AABB aabb)

  - ### raycast

    public void raycast(RayCastCallback callback, Vec2 point1, Vec2 point2)

  - ### getBodyList

    public Body getBodyList()

  - ### getJointList

    public Joint getJointList()

  - ### getContactList

    public Contact getContactList()

  - ### isSleepingAllowed

    public boolean isSleepingAllowed()

  - ### setSleepingAllowed

    public void setSleepingAllowed(boolean sleepingAllowed)

  - ### setWarmStarting

    public void setWarmStarting(boolean flag)

  - ### isWarmStarting

    public boolean isWarmStarting()

  - ### setContinuousPhysics

    public void setContinuousPhysics(boolean flag)

  - ### isContinuousPhysics

    public boolean isContinuousPhysics()

  - ### getProxyCount

    public int getProxyCount()

  - ### getBodyCount

    public int getBodyCount()

  - ### getJointCount

    public int getJointCount()

  - ### getContactCount

    public int getContactCount()

  - ### getTreeHeight

    public int getTreeHeight()

  - ### getTreeBalance

    public int getTreeBalance()

  - ### getTreeQuality

    public float getTreeQuality()

  - ### setGravity

    public void setGravity(Vec2 gravity)

  - ### getGravity

    public Vec2 getGravity()

  - ### isLocked

    public boolean isLocked()

  - ### setAutoClearForces

    public void setAutoClearForces(boolean flag)

  - ### getAutoClearForces

    public boolean getAutoClearForces()

  - ### getContactManager

    public ContactManager getContactManager()

  - ### getProfile

    public Profile getProfile()