addPhysics

fun App.addPhysics(world: PhysicsWorld = PhysicsWorld()): Physics(source)

Runs world in this app and returns its Physics: steps it in Phase.FIXED_UPDATE by the fixed step, unless paused, then moves every entity with a PhysicsBody and a Transform to its body. The Physics is also kept as a resource: physics finds it again.

Systems run in the order they are added. Add the fixed-step systems that push, steer or spawn things before calling this, and those that read what happened, such as contacts, after.

Throws

if this app already runs physics.