23 #include <Box2D/Common/b2Math.h>
24 #include <Box2D/Common/b2BlockAllocator.h>
25 #include <Box2D/Common/b2StackAllocator.h>
26 #include <Box2D/Dynamics/b2ContactManager.h>
27 #include <Box2D/Dynamics/b2WorldCallbacks.h>
28 #include <Box2D/Dynamics/b2TimeStep.h>
29 #include <Box2D/Particle/b2ParticleSystem.h>
113 void Step( float32 timeStep,
114 int32 velocityIterations,
115 int32 positionIterations,
116 int32 particleIterations);
124 int32 velocityIterations,
125 int32 positionIterations)
127 Step(timeStep, velocityIterations, positionIterations, 1);
200 bool GetAllowSleeping()
const {
return m_allowSleep; }
204 bool GetWarmStarting()
const {
return m_warmStarting; }
208 bool GetContinuousPhysics()
const {
return m_continuousPhysics; }
212 bool GetSubStepping()
const {
return m_subStepping; }
268 return m_liquidFunVersion;
273 return m_liquidFunVersionString;
276 #if LIQUIDFUN_EXTERNAL_LANGUAGE_API
279 b2World(float32 gravityX, float32 gravityY);
282 void SetGravity(float32 gravityX, float32 gravityY);
283 #endif // LIQUIDFUN_EXTERNAL_LANGUAGE_API
290 e_newFixture = 0x0001,
292 e_clearForces = 0x0004
298 friend class b2Controller;
301 void Init(
const b2Vec2& gravity);
306 void DrawJoint(
b2Joint* joint);
337 bool m_continuousPhysics;
347 const char *m_liquidFunVersionString;
372 return m_particleSystemList;
377 return m_particleSystemList;
382 return m_contactManager.m_contactList;
387 return m_contactManager.m_contactList;
402 return m_contactManager.m_contactCount;
417 return (m_flags & e_locked) == e_locked;
424 m_flags |= e_clearForces;
428 m_flags &= ~e_clearForces;
435 return (m_flags & e_clearForces) == e_clearForces;
440 return m_contactManager;
448 #if LIQUIDFUN_EXTERNAL_LANGUAGE_API
451 Init(
b2Vec2(gravityX, gravityY));
458 #endif // LIQUIDFUN_EXTERNAL_LANGUAGE_API
b2Vec2 GetGravity() const
Get the global gravity vector.
Definition: b2World.h:410
Definition: b2WorldCallbacks.h:41
Profiling data. Times are in milliseconds.
Definition: b2TimeStep.h:26
void SetDebugDraw(b2Draw *debugDraw)
Definition: b2World.cpp:88
b2ParticleSystem * CreateParticleSystem(const b2ParticleSystemDef *def)
Definition: b2World.cpp:353
Definition: b2ParticleSystem.h:153
b2Contact * GetContactList()
Definition: b2World.h:380
int32 GetTreeBalance() const
Get the balance of the dynamic tree.
Definition: b2World.cpp:1410
Definition: b2WorldCallbacks.h:241
const b2Version * GetVersion() const
Get API version.
Definition: b2World.h:267
void SetContactFilter(b2ContactFilter *filter)
Definition: b2World.cpp:78
void QueryShapeAABB(b2QueryCallback *callback, const b2Shape &shape, const b2Transform &xf) const
Definition: b2World.cpp:1089
Definition: b2StackAllocator.h:37
int32 GetProxyCount() const
Get the number of broad-phase proxies.
Definition: b2World.cpp:1400
Definition: b2ParticleSystem.h:281
float32 GetTreeQuality() const
Definition: b2World.cpp:1415
void DrawDebugData()
Call this to draw shapes and other debug draw data. This is intentionally non-const.
Definition: b2World.cpp:1264
bool GetAutoClearForces() const
Get the flag that controls automatic clearing of forces after each time step.
Definition: b2World.h:433
void ShiftOrigin(const b2Vec2 &newOrigin)
Definition: b2World.cpp:1420
void Step(float32 timeStep, int32 velocityIterations, int32 positionIterations, int32 particleIterations)
Definition: b2World.cpp:976
b2Joint * CreateJoint(const b2JointDef *def)
Definition: b2World.cpp:198
Definition: b2BlockAllocator.h:36
Color for debug drawing. Each value has the range [0,1].
Definition: b2Draw.h:27
Definition: b2Joint.h:103
b2Body * GetBodyList()
Definition: b2World.h:350
void Dump()
Definition: b2World.cpp:1443
void SetSubStepping(bool flag)
Enable/disable single stepped continuous physics. For testing.
Definition: b2World.h:211
void DestroyJoint(b2Joint *joint)
Definition: b2World.cpp:258
Definition: b2Settings.h:244
void SetContinuousPhysics(bool flag)
Enable/disable continuous physics. For testing.
Definition: b2World.h:207
void DestroyBody(b2Body *body)
Definition: b2World.cpp:117
A group of particles. b2ParticleGroup::CreateParticleGroup creates these.
Definition: b2ParticleGroup.h:172
int CalculateReasonableParticleIterations(float32 timeStep) const
Definition: b2World.cpp:1389
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:400
void SetAutoClearForces(bool flag)
Set flag to control automatic clearing of forces after each time step.
Definition: b2World.h:420
b2Body * CreateBody(const b2BodyDef *def)
Definition: b2World.cpp:93
This is an internal structure.
Definition: b2TimeStep.h:39
void SetContactListener(b2ContactListener *listener)
Definition: b2World.cpp:83
b2Joint * GetJointList()
Definition: b2World.h:360
int32 GetJointCount() const
Get the number of joints.
Definition: b2World.h:395
Joint definitions are used to construct joints.
Definition: b2Joint.h:74
int32 GetBodyCount() const
Get the number of bodies.
Definition: b2World.h:390
A rigid body. These are created via b2World::CreateBody.
Definition: b2Body.h:132
b2World(const b2Vec2 &gravity)
Definition: b2World.cpp:38
~b2World()
Destruct the world. All physics entities are destroyed and all heap memory is released.
Definition: b2World.cpp:43
void ClearForces()
Definition: b2World.cpp:1053
const char * GetVersionString() const
Get API version string.
Definition: b2World.h:272
void SetWarmStarting(bool flag)
Enable/disable warm starting. For testing.
Definition: b2World.h:203
void RayCast(b2RayCastCallback *callback, const b2Vec2 &point1, const b2Vec2 &point2) const
Definition: b2World.cpp:1122
void Step(float32 timeStep, int32 velocityIterations, int32 positionIterations)
Definition: b2World.h:123
bool IsLocked() const
Is the world locked (in the middle of a time step).
Definition: b2World.h:415
b2ParticleSystem * GetParticleSystemList()
Definition: b2World.h:370
void SetAllowSleeping(bool flag)
Enable/disable sleep.
Definition: b2World.cpp:406
A 2D column vector.
Definition: b2Math.h:56
void DestroyParticleSystem(b2ParticleSystem *p)
Definition: b2World.cpp:376
const b2ContactManager & GetContactManager() const
Get the contact manager for testing.
Definition: b2World.h:438
void SetGravity(const b2Vec2 &gravity)
Change the global gravity vector.
Definition: b2World.h:405
const b2Profile & GetProfile() const
Get the current profile.
Definition: b2World.h:443
Definition: b2WorldCallbacks.h:208
void QueryAABB(b2QueryCallback *callback, const b2AABB &aabb) const
Definition: b2World.cpp:1074
int32 GetTreeHeight() const
Get the height of the dynamic tree.
Definition: b2World.cpp:1405
Definition: b2Fixture.h:108
void SetDestructionListener(b2DestructionListener *listener)
Definition: b2World.cpp:73