API

Function enableHavokFloatingOrigin

  • Opt a Havok world into multi-region floating-origin simulation (Large World Rendering).

    Loads the floating-origin runtime on demand (physics/havok-floating-origin.ts) so worlds that never call this — i.e. ordinary near-origin physics scenes — never pull that code into their bundle. Once enabled, bodies far apart in world space are simulated in separate regions (each within floatingOriginWorldRadius of its origin) so the float32 Havok solver keeps full precision. Node transforms remain true world coordinates; eye-relative rendering is handled independently by the floating-origin render path.

    Must be called before creating any bodies in the world. Pair it with an engine created with useFloatingOrigin: true so rendering and physics share the same far-from-origin handling.

    Parameters

    • world: PhysicsWorld

      The physics world to enable floating origin on.

    • floatingOriginWorldRadius: number = 100000

      Region capture radius in metres (default 100000, matching Babylon.js).

    Returns Promise<void>