/** * Snapshot of per-step physics metrics collected when `Space.profilerEnabled` is true. * * All timing values are in **milliseconds**. Counter values are plain integers. * The object is reused across steps (no allocation per frame). */ interface PhysicsMetricsData { /** Total wall-clock time of the last `step()` call. */ totalStepTime: number; /** Time spent in broadphase collision pair detection. */ broadphaseTime: number; /** Time spent in narrowphase (prestep: contact generation, arbiter setup). */ narrowphaseTime: number; /** Time spent in velocity integration + warm-start + velocity solver iterations. */ velocitySolverTime: number; /** Time spent in position integration + position solver iterations. */ positionSolverTime: number; /** Time spent in continuous collision detection (CCD). */ ccdTime: number; /** Time spent in sleep management and island/forest processing. */ sleepTime: number; /** Total number of bodies in the space. */ bodyCount: number; /** Number of dynamic (awake) bodies. */ dynamicBodyCount: number; /** Number of static bodies. */ staticBodyCount: number; /** Number of kinematic bodies. */ kinematicBodyCount: number; /** Number of sleeping bodies. */ sleepingBodyCount: number; /** Number of active collision arbiters. */ contactCount: number; /** Number of active constraints. */ constraintCount: number; /** Number of broadphase pairs tested. */ broadphasePairCount: number; } export type { PhysicsMetricsData as P };