A World
is an Object representing the state of a Physics simulation and it configurations.
Constructor
Variables
iterations:Int
The amount of iterations that occur each time the World is stepped. The higher the number, the more stable the Physics Simulation will be, at the cost of performance.
static_quadtree:QuadTree
The World's QuadTree for static Bodies. Generally doesn't need to be touched.
Methods
dispose():Void
Disposes the World. DO NOT use the World after disposing it, as it could lead to null reference errors.
inlinefor_each_dynamic(f:Body ‑> Void, recursive:Bool = true):Void
inlinefor_each_static(f:Body ‑> Void, recursive:Bool = true):Void
inlineset(x:Float, y:Float, width:Float, height:Float):Void
Sets the size of the World. Only Bodies within the world bound will be collided
Parameters:
x | The x position of the world bounds |
---|---|
y | The y position of the world bounds |
width | The width of the world bounds |
height | The height of the world bounds |
set_from_members():Void
Sets the size of the World based just large enough to encompass all the members.
inlineset_from_shape(s:Shape):Void
Sets the size of the World based on a given shape.
Parameters:
s | The shape to use as the boundaries of the World |
---|