melonJS
    Preparing search index...

    Interface AdapterCapabilities

    Adapter feature flags. The engine reads these to negotiate optional capabilities; user code can branch on them to gracefully degrade when a feature isn't available under the active adapter.

    interface AdapterCapabilities {
        bodies3d?: boolean;
        constraints: boolean;
        continuousCollisionDetection: boolean;
        isGrounded: boolean;
        raycasts: boolean;
        raycasts3d: boolean;
        sleepingBodies: boolean;
        velocityLimit: boolean;
    }
    Index
    bodies3d?: boolean

    Bodies have depth: the velocities, forces, impulses and positions handed to the adapter may be a Vector3d, whose z it applies along the depth axis, and it reads them back with PhysicsAdapter.getVelocity3d. A 2D adapter leaves this out or reports false, and ignores any z.

    true on @melonjs/rapier3d-adapter, which also turns bodies in 3D (PhysicsAdapter.getRotation), and on the built-in adapter, whose bodies move along Z (a Box3d or Sphere resolves there) but turn only about it, as in 2D.

    constraints: boolean

    supports World#addJoint: hinge, rope, weld and slider joints. true on the planck and Rapier adapters; false on the built-in and matter adapters, where world.addJoint() throws. Code meant to run on any adapter checks this first.

    continuousCollisionDetection: boolean

    supports continuous collision detection for fast-moving bodies

    isGrounded: boolean

    supports PhysicsAdapter.isGrounded. Adapters that can't cheaply derive ground contact (no contact iteration) report false.

    raycasts: boolean
    raycasts3d: boolean

    supports PhysicsAdapter.raycast3d. 2D-only adapters (matter, planck, Rapier) report false and omit the method; users can branch on this flag before calling world.adapter.raycast3d?.(...) to skip a no-op delegation.

    sleepingBodies: boolean

    supports body sleeping to reduce simulation cost when idle

    velocityLimit: boolean

    supports BodyDefinition.maxVelocity / PhysicsAdapter.setMaxVelocity. BuiltinAdapter does this via its kinematic integrator; MatterAdapter via an afterUpdate clamp. Adapters that can't enforce a hard cap report false.