|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jbox2d.dynamics.World
public class World
Field Summary | |
---|---|
static boolean |
ENABLE_POSITION_CORRECTION
|
static boolean |
ENABLE_TOI
|
static boolean |
ENABLE_WARM_STARTING
|
boolean |
m_allowSleep
|
int |
m_bodyCount
|
Body |
m_bodyList
|
BoundaryListener |
m_boundaryListener
|
BroadPhase |
m_broadPhase
|
int |
m_contactCount
|
ContactFilter |
m_contactFilter
|
Contact |
m_contactList
Do not access, won't be useful! |
ContactListener |
m_contactListener
|
DebugDraw |
m_debugDraw
|
DestructionListener |
m_destructionListener
|
Vec2 |
m_gravity
|
Body |
m_groundBody
|
int |
m_jointCount
|
Joint |
m_jointList
|
boolean |
m_lock
|
int |
m_positionIterationCount
|
Constructor Summary | |
---|---|
World(AABB worldAABB,
Vec2 gravity,
boolean doSleep)
Construct a world object. |
Method Summary | |
---|---|
Body |
createDynamicBody(BodyDef def)
Create a dynamic rigid body given a definition. |
Joint |
createJoint(JointDef def)
Create a joint to constrain bodies together. |
Body |
createStaticBody(BodyDef def)
Create a static rigid body given a definition. |
void |
destroyBody(Body b)
Destroy a rigid body given a definition. |
void |
destroyJoint(Joint j)
Destroy a joint. |
void |
drawDebugData()
For internal use |
void |
drawJoint(Joint joint)
For internal use |
void |
drawShape(Shape shape,
XForm xf,
javax.vecmath.Color3f color,
boolean core)
For internal use |
Body |
getBodyList()
Get the world body list. |
Body |
getGroundBody()
The world provides a single static ground body with no collision shapes. |
Joint |
getJointList()
Get the world joint list. |
Shape[] |
query(AABB aabb,
int maxCount)
Query the world for all shapes that potentially overlap the provided AABB up to max count. |
void |
setDebugDraw(DebugDraw debugDraw)
Register a routine for debug drawing. |
void |
setFilter(ContactFilter filter)
Register a contact filter to provide specific control over collision. |
void |
setListener(BoundaryListener listener)
Register a broad-phase boundary listener. |
void |
setListener(ContactListener listener)
Register a contact event listener |
void |
setListener(DestructionListener listener)
Register a destruction listener. |
void |
solve(TimeStep step)
For internal use |
void |
solveTOI(TimeStep step)
For internal use: find TOI contacts and solve them. |
void |
step(float dt,
int iterations)
Take a time step. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public boolean m_lock
public BroadPhase m_broadPhase
public Body m_bodyList
public Contact m_contactList
public Joint m_jointList
public int m_bodyCount
public int m_contactCount
public int m_jointCount
public Vec2 m_gravity
public boolean m_allowSleep
public Body m_groundBody
public int m_positionIterationCount
public static boolean ENABLE_POSITION_CORRECTION
public static boolean ENABLE_WARM_STARTING
public static boolean ENABLE_TOI
public DestructionListener m_destructionListener
public BoundaryListener m_boundaryListener
public ContactFilter m_contactFilter
public ContactListener m_contactListener
public DebugDraw m_debugDraw
Constructor Detail |
---|
public World(AABB worldAABB, Vec2 gravity, boolean doSleep)
worldAABB
- a bounding box that completely encompasses all your shapes.gravity
- the world gravity vector.doSleep
- improve performance by not simulating inactive bodies.Method Detail |
---|
public Body getGroundBody()
public Body getBodyList()
public Joint getJointList()
public void setListener(DestructionListener listener)
public void setListener(BoundaryListener listener)
public void setFilter(ContactFilter filter)
public void setListener(ContactListener listener)
public void setDebugDraw(DebugDraw debugDraw)
public Body createStaticBody(BodyDef def)
public Body createDynamicBody(BodyDef def)
public void destroyBody(Body b)
public Joint createJoint(JointDef def)
public void destroyJoint(Joint j)
public void step(float dt, int iterations)
dt
- the amount of time to simulate, this should not vary.iterations
- the number of iterations to be used by the constraint solver.public Shape[] query(AABB aabb, int maxCount)
aabb
- the query box.maxCount
- the capacity of the shapes array.
public void solve(TimeStep step)
public void solveTOI(TimeStep step)
public void drawShape(Shape shape, XForm xf, javax.vecmath.Color3f color, boolean core)
public void drawJoint(Joint joint)
public void drawDebugData()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |