B2.World

From GiderosMobile
Revision as of 10:12, 23 August 2018 by Hgy29 (talk | contribs)

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

|}