file: PhysicsWorld.aus

class: PhysicsWorld

[22:7] extends: FxObj

Wraps FXGL's PhysicsWorld, the jbox2d-backed physics simulator that drives every collidable entity in the game. Reached at runtime via fxgl.getPhysicsWorld; obtain a wrapper via the (Ajo) constructor. The main user-facing operations are registering CollisionHandlers to react when entities of two types touch, adjusting world gravity, and casting rays for line-of-sight or hit tests. Note: this wrapper is the registration point for CollisionHandler. After constructing a handler via new CollisionHandler(typeA, typeB) and wiring its callbacks, register it here with physicsWorld.addCollisionHandler(handler).

Methods