B2.World: Difference between revisions

From GiderosMobile
Created page with "__NOTOC__ '''Supported platforms:''' <br/> '''Available since:''' Gideros 2011.6<br/> === Description === The `b2.World` class inherits from the following class: `EventDispatc..."
 
No edit summary
Line 1: Line 1:
__NOTOC__
__NOTOC__
'''Supported platforms:''' <br/>
'''Supported platforms:''' android, ios, mac, pc<br/>
'''Available since:''' Gideros 2011.6<br/>
'''Available since:''' Gideros 2011.6<br/>
=== Description ===
=== Description ===
Line 7: Line 7:
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 ===
[[b2.World.new]] - <br/>
[[b2.World:clearForces]] - call this after you are done with time steps to clear the forces<br/>
[[b2.World:createBody]] - creates a rigid body given a definition<br/>
[[b2.World:createJoint]] - creates a joint given a definition<br/>
[[b2.World:createParticleSystem]] - create particle system<br/>
[[b2.World:destroyBody]] - destroys a rigid body<br/>
[[b2.World:destroyJoint]] - destroys a joint<br/>
[[b2.World:getGravity]] - returns the gravity vector<br/>
[[b2.World:queryAABB]] - query the world for all fixtures that potentially overlap the provided AABB<br/>
[[b2.World:rayCast]] - raycast the world for all fixtures in the path of the ray<br/>
[[b2.World:setDebugDraw]] - registers a b2.DebugDraw instance for debug drawing<br/>
[[b2.World:setGravity]] - sets the gravity vector<br/>
[[b2.World:step]] - takes a time step<br/>
| style="width: 50%;"|
| style="width: 50%;"|
=== Events ===
=== Events ===
[[Event.BEGIN_CONTACT]]
[[Event.BEGIN_CONTACT_PARTICLE]]
[[Event.END_CONTACT]]
[[Event.POST_SOLVE]]
[[Event.PRE_SOLVE]]
=== Constants ===
=== Constants ===
|}
|}

Revision as of 07:57, 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.













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

Events

Event.BEGIN_CONTACT Event.BEGIN_CONTACT_PARTICLE Event.END_CONTACT Event.POST_SOLVE Event.PRE_SOLVE

Constants