Documentation
    Preparing search index...

    Interface DebugBodyAccess<THandle, TColliderHandle>

    The members of SolverBodyAccess this module reads, declared locally because @fourjs/diagnostics cannot import @fourjs/physics (module header, plan §6h). Transcribed from packages/physics/src/body-access.ts; an adapter satisfies it structurally, and THandle is inferred from the caller because §37's handles are unforgeable brands.

    Everything SolverBodyAccess promises holds here unchanged: reads take out parameters and allocate nothing, forEachBody and forEachCollider visit in creation order (ascending monotonic id, §33), and a "2d" world reports z = 0 with rotation about +Z.

    Bodies and colliders take separate handle parameters because §37 gives them separate brands (PhysicsBodyHandle vs PhysicsColliderHandle, which are mutually unassignable); collapsing them into one would make this interface unsatisfiable by a real adapter. Nothing here dereferences a collider handle — colliders are only counted — so TColliderHandle is inferred and otherwise ignored.

    interface DebugBodyAccess<THandle = unknown, TColliderHandle = unknown> {
        countContacts?(): number;
        forEachBody(visit: (handle: THandle, id: number) => void): void;
        forEachCollider(visit: (handle: TColliderHandle, id: number) => void): void;
        getBodyTransform(
            handle: THandle,
            outPosition: Vector3,
            outRotation: Quaternion,
        ): void;
        getBodyVelocities(
            handle: THandle,
            outLinear: Vector3,
            outAngular: Vector3,
        ): void;
        isBodySleeping(handle: THandle): boolean;
    }

    Type Parameters

    • THandle = unknown
    • TColliderHandle = unknown

    Hierarchy (View Summary)

    Index
    • Live contact points in the narrow phase after the last step (§84). Optional: adapters that cannot walk manifolds omit this and SolverStatistics.contactCount stays NaN.

      Returns number

    • Visits every live body in creation order (§33).

      Parameters

      • visit: (handle: THandle, id: number) => void

      Returns void

    • Visits every live collider in creation order (§33).

      Parameters

      Returns void

    • World transform of one body (§42 "physics" authority's read).

      Parameters

      Returns void

    • Linear (m/s) and angular (rad/s) velocity (§23).

      Parameters

      Returns void

    • §32 sleep state as the solver holds it after the step.

      Parameters

      Returns boolean