@absolutejs/rapier3d 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +72 -1
- package/absolutejs/README.md +72 -1
- package/dist/build-info.mjs +1 -1
- package/dist/provenance.json +5 -5
- package/dist/rapier.mjs +1 -1
- package/dist/types/pipeline/index.d.ts +1 -0
- package/dist/types/pipeline/step_profile.d.ts +65 -0
- package/package.json +1 -1
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { World, ContactConvergenceStats } from "./world";
|
|
2
|
+
import type { EventQueue } from "./event_queue";
|
|
3
|
+
import type { PhysicsHooks } from "./physics_hooks";
|
|
4
|
+
export interface PhysicsStepSample {
|
|
5
|
+
/** Zero-based index among calls made through this recorder. */
|
|
6
|
+
step: number;
|
|
7
|
+
outcome: "completed" | "threw";
|
|
8
|
+
/** Time inside World.step, excluding profile capture and recorder bookkeeping. */
|
|
9
|
+
wallTimeMs: number | null;
|
|
10
|
+
captureStatus: "captured" | "step-threw" | "capture-failed";
|
|
11
|
+
native: {
|
|
12
|
+
lengthUnit: number;
|
|
13
|
+
timestep: number;
|
|
14
|
+
solverIterations: number;
|
|
15
|
+
ccdSubsteps: number;
|
|
16
|
+
timings: {
|
|
17
|
+
stepMs: number;
|
|
18
|
+
collisionDetectionMs: number;
|
|
19
|
+
solverMs: number;
|
|
20
|
+
assemblyMs: number;
|
|
21
|
+
resolutionMs: number;
|
|
22
|
+
ccdMs: number;
|
|
23
|
+
};
|
|
24
|
+
convergence: ContactConvergenceStats;
|
|
25
|
+
} | null;
|
|
26
|
+
}
|
|
27
|
+
export interface PhysicsStepProfile {
|
|
28
|
+
sampleEvery: number;
|
|
29
|
+
sampleStartStep: number;
|
|
30
|
+
maxSamples: number;
|
|
31
|
+
attemptedSteps: number;
|
|
32
|
+
completedSteps: number;
|
|
33
|
+
failedSteps: number;
|
|
34
|
+
timedSteps: number;
|
|
35
|
+
/** Null if a finite sum could not be represented. */
|
|
36
|
+
totalWallTimeMs: number | null;
|
|
37
|
+
maxWallTimeMs: number | null;
|
|
38
|
+
slowestStep: number | null;
|
|
39
|
+
timingErrors: number;
|
|
40
|
+
captureErrors: number;
|
|
41
|
+
samplesOmittedForBudget: number;
|
|
42
|
+
/** Owned bounded samples. They do not estimate all unsampled native phases. */
|
|
43
|
+
samples: PhysicsStepSample[];
|
|
44
|
+
}
|
|
45
|
+
export interface PhysicsStepProfileOptions {
|
|
46
|
+
/** Capture every Nth managed call, default 32; integer 1..1,000,000. */
|
|
47
|
+
sampleEvery?: number;
|
|
48
|
+
/** First managed call eligible for capture, default 0; integer 0..1,000,000,000. */
|
|
49
|
+
sampleStartStep?: number;
|
|
50
|
+
/** Maximum retained/captured native profiles, default 32; integer 0..256. */
|
|
51
|
+
maxSamples?: number;
|
|
52
|
+
/** Monotonic milliseconds; defaults to performance.now. Failures are recorded. */
|
|
53
|
+
now?: () => number;
|
|
54
|
+
}
|
|
55
|
+
/** Borrow a world for explicitly managed steps. No listeners, render loop, timer,
|
|
56
|
+
* transport, or world ownership is created. Each sampled call restores the
|
|
57
|
+
* previous profiler setting, including on an exception. Unselected calls leave
|
|
58
|
+
* the setting alone. World.step exceptions propagate unchanged after accounting.
|
|
59
|
+
* Attach the actual engine/build identity when exporting a snapshot.
|
|
60
|
+
*/
|
|
61
|
+
export declare function createPhysicsStepProfiler(world: World, options?: PhysicsStepProfileOptions): {
|
|
62
|
+
step(eventQueue?: EventQueue, hooks?: PhysicsHooks): void;
|
|
63
|
+
/** Deep-owned report; no live native query is performed here. */
|
|
64
|
+
snapshot(): PhysicsStepProfile;
|
|
65
|
+
};
|