Documentation
    Preparing search index...

    Class SolverRegistry

    The solvers an application has opted into, and the §37 selection rule over them (PH-19).

    Applications normally use the shared registry through registerSolver and resolveSolver. Construct one directly to keep a selection scope to itself — a test that must not see another test's registrations, or a host running two engines:

    const registry = new SolverRegistry();
    registerRapierSolver(registry);
    const world = new PhysicsWorld({ dimension: "2d", solver: "auto", solverRegistry: registry });
    Index
    • get size(): number

      Number of registered solvers.

      Returns number

    • get solvers(): SolverName[]

      The registered solvers, in registration order.

      Returns SolverName[]

    • Whether name is registered.

      Parameters

      Returns boolean

    • Adds registration. Returns this so registrations chain.

      Re-adding the identical registration (same isSupported and create) is a no-op and returns this, so calling registerRapierSolver() twice is safe: nothing is overwritten and nothing about "auto" changes.

      Parameters

      Returns this

      FourError INVALID_APPLICATION_STATE if a different solver is already registered under that name — a silent overwrite would make which solver "auto" builds depend on module evaluation order, and a simulation that changes solver for that reason is not reproducible (§33).

    • Builds the adapter selection names (§20, §37).

      A named solver is handed back unfiltered, so an unsatisfiable request fails in PhysicsWorld's constructor with its existing §21/§33 message (see the module header). Only "not registered" and "cannot load here" are refused from this file.

      "auto" walks registration order and takes the first solver that is supported here and whose §37 capabilities cover the world's dimension and determinism. Every solver it passes over is reported through SolverResolveOptions.onReject, and when none fits the throw names each one and why — because "no solver was found" without that list is the least actionable message this API could produce (§85).

      The adapter comes back uninitialized: PhysicsWorld.initialize awaits adapter.initialize (§37), and that is where a wasm image loads.

      Parameters

      Returns PhysicsWorldAdapter

    • Removes name's registration; true if there was one.

      Parameters

      Returns boolean