@series-inc/rundot-syncplay 5.23.0-beta.7 → 5.23.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 +116 -15
- package/dist/browser.d.ts +87 -55
- package/dist/browser.js +47 -52
- package/dist/certification.d.ts +32 -3
- package/dist/certification.js +88 -3
- package/dist/cjs/browser.js +259 -87
- package/dist/cjs/certification.js +87 -2
- package/dist/cjs/collision.js +58 -0
- package/dist/cjs/creator.js +2 -1
- package/dist/cjs/engine-complete.js +213 -3
- package/dist/cjs/engine-parity-matrix.js +19 -4
- package/dist/cjs/index.js +199 -132
- package/dist/cjs/math.js +342 -15
- package/dist/cjs/movement3d.js +230 -1
- package/dist/cjs/node.js +5 -1
- package/dist/cjs/noise.js +58 -0
- package/dist/cjs/physics-cert.js +147 -6
- package/dist/cjs/physics2d.js +10 -4
- package/dist/cjs/physics3d-joints.js +637 -0
- package/dist/cjs/physics3d-shared.js +288 -0
- package/dist/cjs/physics3d-solver.js +1351 -0
- package/dist/cjs/physics3d-vehicle.js +467 -0
- package/dist/cjs/physics3d.js +1057 -223
- package/dist/cjs/random.js +49 -0
- package/dist/cjs/replay-bundle.js +127 -20
- package/dist/cjs/sample-scenes.js +3 -0
- package/dist/cjs/sdk-offline.js +6 -32
- package/dist/cjs/sdk-session.js +156 -0
- package/dist/cjs/session-build.js +42 -0
- package/dist/cjs/testing.js +107 -0
- package/dist/cli.js +40 -12
- package/dist/collision.d.ts +12 -0
- package/dist/collision.js +52 -0
- package/dist/creator.d.ts +1 -1
- package/dist/creator.js +1 -1
- package/dist/engine-complete.js +214 -4
- package/dist/engine-parity-matrix.js +19 -4
- package/dist/index.d.ts +94 -89
- package/dist/index.js +45 -56
- package/dist/math.d.ts +59 -6
- package/dist/math.js +342 -15
- package/dist/movement3d.d.ts +73 -0
- package/dist/movement3d.js +229 -1
- package/dist/node.d.ts +4 -0
- package/dist/node.js +2 -0
- package/dist/noise.d.ts +7 -0
- package/dist/noise.js +51 -0
- package/dist/physics-cert.d.ts +1 -1
- package/dist/physics-cert.js +147 -6
- package/dist/physics2d.js +10 -4
- package/dist/physics3d-joints.d.ts +94 -0
- package/dist/physics3d-joints.js +634 -0
- package/dist/physics3d-shared.d.ts +72 -0
- package/dist/physics3d-shared.js +257 -0
- package/dist/physics3d-solver.d.ts +197 -0
- package/dist/physics3d-solver.js +1346 -0
- package/dist/physics3d-vehicle.d.ts +84 -0
- package/dist/physics3d-vehicle.js +463 -0
- package/dist/physics3d.d.ts +108 -8
- package/dist/physics3d.js +1006 -177
- package/dist/random.d.ts +7 -0
- package/dist/random.js +49 -0
- package/dist/replay-bundle.d.ts +40 -1
- package/dist/replay-bundle.js +126 -20
- package/dist/sample-scenes.js +3 -0
- package/dist/sdk-offline.js +6 -32
- package/dist/sdk-session.d.ts +47 -0
- package/dist/sdk-session.js +153 -0
- package/dist/session-build.d.ts +21 -0
- package/dist/session-build.js +39 -0
- package/dist/testing.d.ts +52 -0
- package/dist/testing.js +45 -0
- package/dist/tools/vite-plugin.d.ts +8 -0
- package/dist/tools/vite-plugin.js +63 -9
- package/package.json +11 -3
package/dist/physics3d.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type DeterministicPhysicsMaterial } from './deterministic-primitives.js';
|
|
2
|
-
|
|
2
|
+
import { type Point3D } from './physics3d-shared.js';
|
|
3
|
+
import { type DeterministicPhysicsJoint3D } from './physics3d-joints.js';
|
|
4
|
+
export type DeterministicPhysicsPrimitiveShape3D = {
|
|
3
5
|
readonly type: 'box';
|
|
4
6
|
readonly halfX: number;
|
|
5
7
|
readonly halfY: number;
|
|
@@ -11,13 +13,30 @@ export type DeterministicPhysicsShape3D = {
|
|
|
11
13
|
readonly type: 'capsule';
|
|
12
14
|
readonly radius: number;
|
|
13
15
|
readonly halfHeight: number;
|
|
14
|
-
}
|
|
16
|
+
};
|
|
17
|
+
export interface DeterministicPhysicsCompoundChild3D {
|
|
18
|
+
readonly shape: DeterministicPhysicsPrimitiveShape3D;
|
|
19
|
+
readonly offset: {
|
|
20
|
+
readonly x: number;
|
|
21
|
+
readonly y: number;
|
|
22
|
+
readonly z: number;
|
|
23
|
+
};
|
|
24
|
+
readonly quarterTurns?: {
|
|
25
|
+
readonly x: number;
|
|
26
|
+
readonly y: number;
|
|
27
|
+
readonly z: number;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export type DeterministicPhysicsShape3D = DeterministicPhysicsPrimitiveShape3D | {
|
|
15
31
|
readonly type: 'mesh';
|
|
16
32
|
readonly vertices: readonly {
|
|
17
33
|
readonly x: number;
|
|
18
34
|
readonly y: number;
|
|
19
35
|
readonly z: number;
|
|
20
36
|
}[];
|
|
37
|
+
} | {
|
|
38
|
+
readonly type: 'compound';
|
|
39
|
+
readonly children: readonly DeterministicPhysicsCompoundChild3D[];
|
|
21
40
|
};
|
|
22
41
|
export declare const deterministicPhysicsCallback3D: {
|
|
23
42
|
readonly collisionEnter: 1;
|
|
@@ -28,6 +47,23 @@ export declare const deterministicPhysicsCallback3D: {
|
|
|
28
47
|
readonly triggerExit: 32;
|
|
29
48
|
};
|
|
30
49
|
export type DeterministicPhysicsCallbackMask3D = number;
|
|
50
|
+
export interface DeterministicPhysicsVec3 {
|
|
51
|
+
readonly x: number;
|
|
52
|
+
readonly y: number;
|
|
53
|
+
readonly z: number;
|
|
54
|
+
}
|
|
55
|
+
export interface DeterministicPhysicsQuaternion3D {
|
|
56
|
+
readonly x: number;
|
|
57
|
+
readonly y: number;
|
|
58
|
+
readonly z: number;
|
|
59
|
+
readonly w: number;
|
|
60
|
+
}
|
|
61
|
+
/** Optional per-axis flags used by `lockLinear` / `lockAngular`. */
|
|
62
|
+
export interface DeterministicPhysicsAxisLock3D {
|
|
63
|
+
readonly x?: boolean;
|
|
64
|
+
readonly y?: boolean;
|
|
65
|
+
readonly z?: boolean;
|
|
66
|
+
}
|
|
31
67
|
export interface DeterministicPhysicsBody3D {
|
|
32
68
|
readonly id: string;
|
|
33
69
|
readonly kind: 'static' | 'dynamic' | 'kinematic';
|
|
@@ -44,6 +80,20 @@ export interface DeterministicPhysicsBody3D {
|
|
|
44
80
|
readonly avy?: number;
|
|
45
81
|
readonly avz?: number;
|
|
46
82
|
readonly inertia?: number;
|
|
83
|
+
/** Full 6-DOF orientation (opt-in); bodies without it are rotation-locked through the rigid solver. */
|
|
84
|
+
readonly orientation?: DeterministicPhysicsQuaternion3D;
|
|
85
|
+
readonly angularVel?: DeterministicPhysicsVec3;
|
|
86
|
+
readonly mass?: number;
|
|
87
|
+
readonly linearDamping?: number;
|
|
88
|
+
readonly angularDamping?: number;
|
|
89
|
+
/** Multiplies world gravity for this body; default 1. */
|
|
90
|
+
readonly gravityScale?: number;
|
|
91
|
+
readonly lockLinear?: DeterministicPhysicsAxisLock3D;
|
|
92
|
+
readonly lockAngular?: DeterministicPhysicsAxisLock3D;
|
|
93
|
+
readonly ccd?: boolean;
|
|
94
|
+
/** Canonical sleep state maintained by the rigid solver. */
|
|
95
|
+
readonly sleeping?: boolean;
|
|
96
|
+
readonly lowVelFrames?: number;
|
|
47
97
|
readonly shape: DeterministicPhysicsShape3D;
|
|
48
98
|
readonly layer: number;
|
|
49
99
|
readonly mask: number;
|
|
@@ -52,11 +102,36 @@ export interface DeterministicPhysicsBody3D {
|
|
|
52
102
|
readonly callbackMask?: DeterministicPhysicsCallbackMask3D;
|
|
53
103
|
readonly material?: DeterministicPhysicsMaterial;
|
|
54
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* Persistent warm-start contact impulse cache. Part of canonical world state so
|
|
107
|
+
* snapshot/restore/rollback reproduces solver trajectories bit-identically.
|
|
108
|
+
*/
|
|
109
|
+
export interface DeterministicContactCacheEntry3D {
|
|
110
|
+
readonly pair: string;
|
|
111
|
+
readonly anchorX: number;
|
|
112
|
+
readonly anchorY: number;
|
|
113
|
+
readonly anchorZ: number;
|
|
114
|
+
readonly normalImpulse: number;
|
|
115
|
+
readonly tangentImpulse1: number;
|
|
116
|
+
readonly tangentImpulse2: number;
|
|
117
|
+
}
|
|
118
|
+
export interface DeterministicJointCacheEntry3D {
|
|
119
|
+
readonly jointId: string;
|
|
120
|
+
readonly impulseX: number;
|
|
121
|
+
readonly impulseY: number;
|
|
122
|
+
readonly impulseZ: number;
|
|
123
|
+
readonly axialImpulse: number;
|
|
124
|
+
readonly hingeAngle: number;
|
|
125
|
+
/** Set once a breakable joint exceeded its breakImpulse; sticky across steps. */
|
|
126
|
+
readonly broken?: boolean;
|
|
127
|
+
}
|
|
55
128
|
export interface DeterministicPhysicsWorld3D {
|
|
56
129
|
readonly frame: number;
|
|
57
130
|
readonly bodies: readonly DeterministicPhysicsBody3D[];
|
|
58
131
|
readonly activePairs: readonly string[];
|
|
59
132
|
readonly activePairMetadata: readonly DeterministicPhysicsActivePair3D[];
|
|
133
|
+
readonly contactCache: readonly DeterministicContactCacheEntry3D[];
|
|
134
|
+
readonly jointCache: readonly DeterministicJointCacheEntry3D[];
|
|
60
135
|
}
|
|
61
136
|
export interface DeterministicPhysicsActivePair3D {
|
|
62
137
|
readonly pair: string;
|
|
@@ -135,6 +210,8 @@ export interface DeterministicPhysicsContactEvent3D {
|
|
|
135
210
|
readonly b: string;
|
|
136
211
|
readonly trigger: boolean;
|
|
137
212
|
readonly sensor: boolean;
|
|
213
|
+
/** Accumulated normal impulse (quantized) from the rigid solver; 0 for triggers/exits. */
|
|
214
|
+
readonly normalImpulse?: number;
|
|
138
215
|
}
|
|
139
216
|
export interface DeterministicPhysicsContactDetail3D {
|
|
140
217
|
readonly pair: string;
|
|
@@ -145,6 +222,7 @@ export interface DeterministicPhysicsContactDetail3D {
|
|
|
145
222
|
readonly point: Point3D;
|
|
146
223
|
readonly normal: Point3D;
|
|
147
224
|
readonly penetration: number;
|
|
225
|
+
readonly normalImpulse?: number;
|
|
148
226
|
}
|
|
149
227
|
export interface DeterministicPhysics3DCallbackMaskFixtureResult {
|
|
150
228
|
readonly checksum: string;
|
|
@@ -211,6 +289,8 @@ export interface DeterministicPhysics3DStackFixtureResult {
|
|
|
211
289
|
export interface DeterministicPhysicsStepResult3D {
|
|
212
290
|
readonly world: DeterministicPhysicsWorld3D;
|
|
213
291
|
readonly contacts: readonly DeterministicPhysicsContactEvent3D[];
|
|
292
|
+
/** Joint ids that broke this step (newly, sorted); sticky once broken. */
|
|
293
|
+
readonly brokenJointIds: readonly string[];
|
|
214
294
|
readonly scheduledQueryResults: readonly {
|
|
215
295
|
readonly id: string;
|
|
216
296
|
readonly hits: readonly DeterministicPhysicsHit3D[];
|
|
@@ -229,13 +309,38 @@ export interface DeterministicPhysicsStepResult3D {
|
|
|
229
309
|
readonly checksum: string;
|
|
230
310
|
}
|
|
231
311
|
export declare function createDeterministicPhysicsWorld3D(bodies: readonly DeterministicPhysicsBody3D[]): DeterministicPhysicsWorld3D;
|
|
312
|
+
export interface DeterministicPhysicsImpulseApplication3D {
|
|
313
|
+
readonly bodyId: string;
|
|
314
|
+
readonly impulse: Point3D;
|
|
315
|
+
readonly worldPoint?: Point3D;
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Apply a batch of deterministic impulses in one canonical-world rebuild.
|
|
319
|
+
* Semantically the impulses accumulate in list order (same math as repeated
|
|
320
|
+
* `applyDeterministicImpulse3D`, but velocities are quantized once per body at
|
|
321
|
+
* the end rather than per impulse), and every touched body's contact island is
|
|
322
|
+
* woken. One `O(bodies)` rebuild instead of one per impulse — this is the
|
|
323
|
+
* fast path for per-frame controller output (vehicles, KCC pushes).
|
|
324
|
+
*/
|
|
325
|
+
export declare function applyDeterministicImpulses3D(world: DeterministicPhysicsWorld3D, impulses: readonly DeterministicPhysicsImpulseApplication3D[]): DeterministicPhysicsWorld3D;
|
|
326
|
+
/**
|
|
327
|
+
* Apply a deterministic impulse to a body (linear + angular via lever arm),
|
|
328
|
+
* waking the body and its contact island. Returns a new canonical world.
|
|
329
|
+
*/
|
|
330
|
+
export declare function applyDeterministicImpulse3D(world: DeterministicPhysicsWorld3D, bodyId: string, impulse: Point3D, worldPoint?: Point3D): DeterministicPhysicsWorld3D;
|
|
331
|
+
/** Set a body's linear (and optional angular) velocity deterministically, waking its island. */
|
|
332
|
+
export declare function setDeterministicBodyVelocity3D(world: DeterministicPhysicsWorld3D, bodyId: string, velocity: Point3D, angularVelocity?: Point3D): DeterministicPhysicsWorld3D;
|
|
232
333
|
export declare function stepDeterministicPhysicsWorld3D(world: DeterministicPhysicsWorld3D, options?: {
|
|
233
334
|
readonly gravityY?: number;
|
|
234
335
|
readonly scheduledQueries?: readonly DeterministicPhysicsScheduledQuery3D[];
|
|
235
336
|
readonly constraints?: readonly DeterministicPhysicsConstraint3D[];
|
|
337
|
+
readonly joints?: readonly DeterministicPhysicsJoint3D[];
|
|
236
338
|
readonly dtTicks?: number;
|
|
339
|
+
readonly velocityIterations?: number;
|
|
237
340
|
readonly computeChecksum?: boolean;
|
|
238
341
|
}): DeterministicPhysicsStepResult3D;
|
|
342
|
+
/** O(1) body lookup backed by the per-world query-index cache. */
|
|
343
|
+
export declare function deterministicPhysicsBodyById3D(world: DeterministicPhysicsWorld3D, bodyId: string): DeterministicPhysicsBody3D | undefined;
|
|
239
344
|
export declare function raycastDeterministicPhysics3D(world: DeterministicPhysicsWorld3D, query: DeterministicPhysicsRaycastQuery3D): readonly DeterministicPhysicsHit3D[];
|
|
240
345
|
export declare function raycastDeterministicPhysics3DDetailed(world: DeterministicPhysicsWorld3D, query: DeterministicPhysicsRaycastQuery3D): readonly DeterministicPhysicsDetailedHit3D[];
|
|
241
346
|
export declare function overlapDeterministicPhysics3D(world: DeterministicPhysicsWorld3D, query: DeterministicPhysicsOverlapQuery3D): readonly string[];
|
|
@@ -277,9 +382,4 @@ export declare function runDeterministicPhysics3DStress(bodies: number, frames:
|
|
|
277
382
|
readonly rollbackEquivalent: boolean;
|
|
278
383
|
};
|
|
279
384
|
export declare function runDeterministicPhysics3DStackFixture(stackLayers?: number, frames?: number): DeterministicPhysics3DStackFixtureResult;
|
|
280
|
-
|
|
281
|
-
readonly x: number;
|
|
282
|
-
readonly y: number;
|
|
283
|
-
readonly z: number;
|
|
284
|
-
}
|
|
285
|
-
export {};
|
|
385
|
+
export declare function deriveInverseInertia(shape: DeterministicPhysicsShape3D, mass: number): Point3D;
|