22 #include <Box2D/Common/b2Math.h>
23 #include <Box2D/Common/b2BlockAllocator.h>
24 #include <Box2D/Common/b2StackAllocator.h>
25 #include <Box2D/Dynamics/b2ContactManager.h>
26 #include <Box2D/Dynamics/b2WorldCallbacks.h>
27 #include <Box2D/Dynamics/b2TimeStep.h>
94 void Step( float32 timeStep,
95 int32 velocityIterations,
96 int32 positionIterations);
146 bool GetAllowSleeping()
const {
return m_allowSleep; }
150 bool GetWarmStarting()
const {
return m_warmStarting; }
154 bool GetContinuousPhysics()
const {
return m_continuousPhysics; }
158 bool GetSubStepping()
const {
return m_subStepping; }
217 e_newFixture = 0x0001,
219 e_clearForces = 0x0004
225 friend class b2Controller;
230 void DrawJoint(
b2Joint* joint);
258 bool m_continuousPhysics;
288 return m_contactManager.m_contactList;
293 return m_contactManager.m_contactList;
308 return m_contactManager.m_contactCount;
323 return (m_flags & e_locked) == e_locked;
330 m_flags |= e_clearForces;
334 m_flags &= ~e_clearForces;
341 return (m_flags & e_clearForces) == e_clearForces;
346 return m_contactManager;
b2Vec2 GetGravity() const
Get the global gravity vector.
Definition: b2World.h:316
Definition: b2WorldCallbacks.h:36
Profiling data. Times are in milliseconds.
Definition: b2TimeStep.h:25
void SetDebugDraw(b2Draw *debugDraw)
Definition: b2World.cpp:102
b2Contact * GetContactList()
Definition: b2World.h:286
int32 GetTreeBalance() const
Get the balance of the dynamic tree.
Definition: b2World.cpp:1249
Definition: b2WorldCallbacks.h:135
void SetContactFilter(b2ContactFilter *filter)
Definition: b2World.cpp:92
Definition: b2StackAllocator.h:37
int32 GetProxyCount() const
Get the number of broad-phase proxies.
Definition: b2World.cpp:1239
float32 GetTreeQuality() const
Definition: b2World.cpp:1254
void DrawDebugData()
Call this to draw shapes and other debug draw data. This is intentionally non-const.
Definition: b2World.cpp:1135
bool GetAutoClearForces() const
Get the flag that controls automatic clearing of forces after each time step.
Definition: b2World.h:339
void ShiftOrigin(const b2Vec2 &newOrigin)
Definition: b2World.cpp:1259
b2Joint * CreateJoint(const b2JointDef *def)
Definition: b2World.cpp:212
Definition: b2BlockAllocator.h:35
Color for debug drawing. Each value has the range [0,1].
Definition: b2Draw.h:25
Definition: b2Joint.h:103
b2Body * GetBodyList()
Definition: b2World.h:266
void Dump()
Definition: b2World.cpp:1282
void SetSubStepping(bool flag)
Enable/disable single stepped continuous physics. For testing.
Definition: b2World.h:157
void DestroyJoint(b2Joint *joint)
Definition: b2World.cpp:272
void SetContinuousPhysics(bool flag)
Enable/disable continuous physics. For testing.
Definition: b2World.h:153
void DestroyBody(b2Body *body)
Definition: b2World.cpp:131
An axis aligned bounding box.
Definition: b2Collision.h:162
int32 GetContactCount() const
Get the number of contacts (each may have 0 or more contact points).
Definition: b2World.h:306
void SetAutoClearForces(bool flag)
Set flag to control automatic clearing of forces after each time step.
Definition: b2World.h:326
b2Body * CreateBody(const b2BodyDef *def)
Definition: b2World.cpp:107
This is an internal structure.
Definition: b2TimeStep.h:38
void SetContactListener(b2ContactListener *listener)
Definition: b2World.cpp:97
b2Joint * GetJointList()
Definition: b2World.h:276
int32 GetJointCount() const
Get the number of joints.
Definition: b2World.h:301
Joint definitions are used to construct joints.
Definition: b2Joint.h:74
int32 GetBodyCount() const
Get the number of bodies.
Definition: b2World.h:296
A rigid body. These are created via b2World::CreateBody.
Definition: b2Body.h:126
b2World(const b2Vec2 &gravity)
Definition: b2World.cpp:37
~b2World()
Destruct the world. All physics entities are destroyed and all heap memory is released.
Definition: b2World.cpp:66
void ClearForces()
Definition: b2World.cpp:965
void SetWarmStarting(bool flag)
Enable/disable warm starting. For testing.
Definition: b2World.h:149
void RayCast(b2RayCastCallback *callback, const b2Vec2 &point1, const b2Vec2 &point2) const
Definition: b2World.cpp:1019
void Step(float32 timeStep, int32 velocityIterations, int32 positionIterations)
Definition: b2World.cpp:897
bool IsLocked() const
Is the world locked (in the middle of a time step).
Definition: b2World.h:321
void SetAllowSleeping(bool flag)
Enable/disable sleep.
Definition: b2World.cpp:368
A 2D column vector.
Definition: b2Math.h:53
const b2ContactManager & GetContactManager() const
Get the contact manager for testing.
Definition: b2World.h:344
void SetGravity(const b2Vec2 &gravity)
Change the global gravity vector.
Definition: b2World.h:311
const b2Profile & GetProfile() const
Get the current profile.
Definition: b2World.h:349
Definition: b2WorldCallbacks.h:123
void QueryAABB(b2QueryCallback *callback, const b2AABB &aabb) const
Definition: b2World.cpp:986
int32 GetTreeHeight() const
Get the height of the dynamic tree.
Definition: b2World.cpp:1244
Definition: b2Fixture.h:107
void SetDestructionListener(b2DestructionListener *listener)
Definition: b2World.cpp:87