createWorld

fun createWorld(gravity: Vector2 = Vector2.Zero, allowSleep: Boolean = true): World

World factory function.

Return

a new World instance with given parameters.

Parameters

gravity

world's gravity applied to bodies on each step. Defaults to no gravity (0f, 0f).

allowSleep

if true, inactive bodies will not be simulated. Improves performance. Defaults to true.