Difference between revisions of "B2.World"
Line 6: | Line 6: | ||
<br /> | <br /> | ||
The `b2.World` class manages all physics entities and dynamic simulation. It is possible to create and manage more than one `b2.World` instance.<br /> | The `b2.World` class manages all physics entities and dynamic simulation. It is possible to create and manage more than one `b2.World` instance.<br /> | ||
− | <br /> | + | <br />{|- |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | {|- | ||
| style="width: 50%;"| | | style="width: 50%;"| | ||
=== Methods === | === Methods === | ||
Line 50: | Line 24: | ||
| style="width: 50%;"| | | style="width: 50%;"| | ||
=== Events === | === Events === | ||
− | [[Event.BEGIN_CONTACT]] | + | [[Event.BEGIN_CONTACT]]<br/> |
− | [[Event.BEGIN_CONTACT_PARTICLE]] | + | [[Event.BEGIN_CONTACT_PARTICLE]]<br/> |
− | [[Event.END_CONTACT]] | + | [[Event.END_CONTACT]]<br/> |
− | [[Event.POST_SOLVE]] | + | [[Event.POST_SOLVE]]<br/> |
− | [[Event.PRE_SOLVE]] | + | [[Event.PRE_SOLVE]]<br/> |
=== Constants === | === Constants === | ||
|} | |} |
Revision as of 09:12, 23 August 2018
Supported platforms: android, ios, mac, pc
Available since: Gideros 2011.6
Description
The `b2.World` class inherits from the following class: `EventDispatcher`.
The `b2.World` class manages all physics entities and dynamic simulation. It is possible to create and manage more than one `b2.World` instance.
{|-
| style="width: 50%;"|
Methods
b2.World.new -
b2.World:clearForces - call this after you are done with time steps to clear the forces
b2.World:createBody - creates a rigid body given a definition
b2.World:createJoint - creates a joint given a definition
b2.World:createParticleSystem - create particle system
b2.World:destroyBody - destroys a rigid body
b2.World:destroyJoint - destroys a joint
b2.World:getGravity - returns the gravity vector
b2.World:queryAABB - query the world for all fixtures that potentially overlap the provided AABB
b2.World:rayCast - raycast the world for all fixtures in the path of the ray
b2.World:setDebugDraw - registers a b2.DebugDraw instance for debug drawing
b2.World:setGravity - sets the gravity vector
b2.World:step - takes a time step
| style="width: 50%;"|
Events
Event.BEGIN_CONTACT
Event.BEGIN_CONTACT_PARTICLE
Event.END_CONTACT
Event.POST_SOLVE
Event.PRE_SOLVE
Constants
|}