Constructor
new World2D()
- Source:
Classes
- World2D
Members
CLMDs
- Description:
- The collision manifolds that have passed narrowphase and verified to be colliding.
- Source:
The collision manifolds that have passed narrowphase and verified to be colliding.
CLMDs
- Source:
- Description:
- This is a cheap way of determining which pairs of bodies could be colliding.
- Source:
This is a cheap way of determining which pairs of bodies could be colliding.
Type:
- Description:
- The collision manifolds that have passed broadphase and could be colliding
- Source:
- Deprecated:
The collision manifolds that have passed broadphase and could be colliding
Type:
fixedFrameRate :number
- Description:
- Time in seconds that a single frame takes.This has more precedence than the first parameter of World2D.update(),set to this to zero if you want to use the latter as the delta time.
- Source:
Time in seconds that a single frame takes.This has more precedence than the first parameter of World2D.update(),set to this to zero if you want to use the latter as the delta time.
Type:
gravitationalAcceleration :Vector2
- Description:
- The gravitational pull of the world.
- Source:
The gravitational pull of the world.
Type:
- Description:
- Gravitational pull of the world,will affect all bodies except static bodies.
- Source:
- Deprecated:
Gravitational pull of the world,will affect all bodies except static bodies.
Type:
- Description:
- This accurately tests body pairs to check
for collision and outputs a manifold for each body pair.
- Source:
This accurately tests body pairs to check
for collision and outputs a manifold for each body pair.
Type:
Methods
query(bound, outopt) → {Array.<T>}
- Description:
- Searches for objects in a given bounds and returns them.
- Source:
Parameters:
Name |
Type |
Attributes |
Default |
Description |
bound |
Bounds
|
|
|
the region to search in |
out |
Array.<T>
|
<optional>
|
[]
|
an array to store results in |
Returns:
-
Type
-
Array.<T>
(static) applyGravity(gravity, movable, bodies)
- Source:
Parameters:
(static) broadPhase(world)
- Source:
Parameters:
Name |
Type |
Description |
world |
World2D
|
|
(static) collisionDetection(manager, world)
- Source:
Parameters:
Name |
Type |
Description |
manager |
any
|
|
world |
World2D
|
|
(static) collisionResponse(dt, manager, world, CLMDs)
- Source:
Parameters:
Name |
Type |
Description |
dt |
number
|
|
manager |
Manager
|
|
world |
World2D
|
|
CLMDs |
string
|
Array.<any>
|
|
(static) narrowPhase(manager, world, contactList)
- Source:
Parameters:
(static) update(world, bodies, dt, manager, entities, transform, movable, bounds)
- Source:
Parameters:
Name |
Type |
Description |
world |
World2D
|
|
bodies |
Array.<Array.<Body2D>>
|
|
dt |
Number
|
the time passed between the last call and this call. |
manager |
Manager
|
|
entities |
Array.<Array.<Entity>>
|
|
transform |
Array.<Array.<Transform>>
|
|
movable |
Array.<Array.<Movable>>
|
|
bounds |
Array.<Array.<BoundingBox>>
|
|
(static) updateBodies(bodies, transform, bounds)
- Source:
Parameters: