@flighthq/physics3d 0.4.0-next.1694.598ef6f

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.
Files changed (109) hide show
  1. package/dist/contacts.d.ts +4 -0
  2. package/dist/contacts.d.ts.map +1 -0
  3. package/dist/contacts.js +55 -0
  4. package/dist/contacts.js.map +1 -0
  5. package/dist/contract.d.ts +17 -0
  6. package/dist/contract.d.ts.map +1 -0
  7. package/dist/contract.js +17 -0
  8. package/dist/contract.js.map +1 -0
  9. package/dist/enablePhysics3DGuards.d.ts +4 -0
  10. package/dist/enablePhysics3DGuards.d.ts.map +1 -0
  11. package/dist/enablePhysics3DGuards.js +68 -0
  12. package/dist/enablePhysics3DGuards.js.map +1 -0
  13. package/dist/explainPhysics3DJoints.d.ts +3 -0
  14. package/dist/explainPhysics3DJoints.d.ts.map +1 -0
  15. package/dist/explainPhysics3DJoints.js +32 -0
  16. package/dist/explainPhysics3DJoints.js.map +1 -0
  17. package/dist/explainPhysics3DStep.d.ts +3 -0
  18. package/dist/explainPhysics3DStep.d.ts.map +1 -0
  19. package/dist/explainPhysics3DStep.js +48 -0
  20. package/dist/explainPhysics3DStep.js.map +1 -0
  21. package/dist/index.d.ts +14 -0
  22. package/dist/index.d.ts.map +1 -0
  23. package/dist/index.js +14 -0
  24. package/dist/index.js.map +1 -0
  25. package/dist/integrate.d.ts +6 -0
  26. package/dist/integrate.d.ts.map +1 -0
  27. package/dist/integrate.js +154 -0
  28. package/dist/integrate.js.map +1 -0
  29. package/dist/islands.d.ts +5 -0
  30. package/dist/islands.d.ts.map +1 -0
  31. package/dist/islands.js +316 -0
  32. package/dist/islands.js.map +1 -0
  33. package/dist/jointCollisionSuppression.d.ts +4 -0
  34. package/dist/jointCollisionSuppression.d.ts.map +1 -0
  35. package/dist/jointCollisionSuppression.js +40 -0
  36. package/dist/jointCollisionSuppression.js.map +1 -0
  37. package/dist/jointFactories.d.ts +8 -0
  38. package/dist/jointFactories.d.ts.map +1 -0
  39. package/dist/jointFactories.js +126 -0
  40. package/dist/jointFactories.js.map +1 -0
  41. package/dist/jointMath.d.ts +17 -0
  42. package/dist/jointMath.d.ts.map +1 -0
  43. package/dist/jointMath.js +361 -0
  44. package/dist/jointMath.js.map +1 -0
  45. package/dist/jointRegistry.d.ts +8 -0
  46. package/dist/jointRegistry.d.ts.map +1 -0
  47. package/dist/jointRegistry.js +144 -0
  48. package/dist/jointRegistry.js.map +1 -0
  49. package/dist/jointRows.d.ts +32 -0
  50. package/dist/jointRows.d.ts.map +1 -0
  51. package/dist/jointRows.js +308 -0
  52. package/dist/jointRows.js.map +1 -0
  53. package/dist/joints.d.ts +14 -0
  54. package/dist/joints.d.ts.map +1 -0
  55. package/dist/joints.js +758 -0
  56. package/dist/joints.js.map +1 -0
  57. package/dist/massProperties.d.ts +8 -0
  58. package/dist/massProperties.d.ts.map +1 -0
  59. package/dist/massProperties.js +169 -0
  60. package/dist/massProperties.js.map +1 -0
  61. package/dist/ownership.d.ts +5 -0
  62. package/dist/ownership.d.ts.map +1 -0
  63. package/dist/ownership.js +16 -0
  64. package/dist/ownership.js.map +1 -0
  65. package/dist/registerBuiltInPhysics3DJointSolvers.d.ts +3 -0
  66. package/dist/registerBuiltInPhysics3DJointSolvers.d.ts.map +1 -0
  67. package/dist/registerBuiltInPhysics3DJointSolvers.js +14 -0
  68. package/dist/registerBuiltInPhysics3DJointSolvers.js.map +1 -0
  69. package/dist/solver.d.ts +8 -0
  70. package/dist/solver.d.ts.map +1 -0
  71. package/dist/solver.js +383 -0
  72. package/dist/solver.js.map +1 -0
  73. package/dist/step.d.ts +5 -0
  74. package/dist/step.d.ts.map +1 -0
  75. package/dist/step.js +250 -0
  76. package/dist/step.js.map +1 -0
  77. package/dist/stepValidation.d.ts +12 -0
  78. package/dist/stepValidation.d.ts.map +1 -0
  79. package/dist/stepValidation.js +201 -0
  80. package/dist/stepValidation.js.map +1 -0
  81. package/dist/symmetricTensor.d.ts +11 -0
  82. package/dist/symmetricTensor.d.ts.map +1 -0
  83. package/dist/symmetricTensor.js +150 -0
  84. package/dist/symmetricTensor.js.map +1 -0
  85. package/dist/world.d.ts +19 -0
  86. package/dist/world.d.ts.map +1 -0
  87. package/dist/world.js +370 -0
  88. package/dist/world.js.map +1 -0
  89. package/package.json +49 -0
  90. package/src/contacts.test.ts +64 -0
  91. package/src/enablePhysics3DGuards.test.ts +105 -0
  92. package/src/explainPhysics3DJoints.test.ts +101 -0
  93. package/src/explainPhysics3DStep.test.ts +123 -0
  94. package/src/integrate.test.ts +249 -0
  95. package/src/islands.test.ts +357 -0
  96. package/src/jointCollisionSuppression.test.ts +94 -0
  97. package/src/jointFactories.test.ts +195 -0
  98. package/src/jointMath.test.ts +643 -0
  99. package/src/jointRegistry.test.ts +229 -0
  100. package/src/jointRows.test.ts +484 -0
  101. package/src/joints.test.ts +677 -0
  102. package/src/massProperties.test.ts +305 -0
  103. package/src/ownership.test.ts +36 -0
  104. package/src/registerBuiltInPhysics3DJointSolvers.test.ts +48 -0
  105. package/src/solver.test.ts +481 -0
  106. package/src/step.test.ts +390 -0
  107. package/src/stepValidation.test.ts +244 -0
  108. package/src/symmetricTensor.test.ts +166 -0
  109. package/src/world.test.ts +512 -0
@@ -0,0 +1,316 @@
1
+ import { findPhysics3DBody } from './world';
2
+ // Rebuilds deterministic contiguous lists for the awake solve islands.
3
+ //
4
+ // The sleep reduction already owns the union-find graph, so solving consumes that same graph rather
5
+ // than discovering connectivity a second way. Roots are admitted in body order, and bodies, contacts,
6
+ // and joints retain their canonical world-list order inside each root. Disconnected islands therefore
7
+ // cannot perturb one another's iteration order, and sleeping constraints cost no solver scans. Every
8
+ // array and map is world-owned high-water workspace and is cleared and refilled in place.
9
+ //
10
+ // Runs after `updatePhysics3DSleep`, never before: the workspace admits only awake bodies, so building
11
+ // it against an unresolved sleep state would hand the solver islands it is about to put to sleep.
12
+ export function buildPhysics3DSolveIslands(world) {
13
+ const roots = world.solveIslandRoots;
14
+ const byRoot = world.solveIslandByRoot;
15
+ const bodyCounts = world.solveIslandBodyCounts;
16
+ const contactCounts = world.solveIslandContactCounts;
17
+ const jointCounts = world.solveIslandJointCounts;
18
+ roots.length = 0;
19
+ byRoot.clear();
20
+ bodyCounts.length = 0;
21
+ contactCounts.length = 0;
22
+ jointCounts.length = 0;
23
+ for (const body of world.bodies) {
24
+ if (body.type === 'static' || body.sleeping)
25
+ continue;
26
+ const root = islandRootOf(world.islandParents, body.index);
27
+ let island = byRoot.get(root);
28
+ if (island === undefined) {
29
+ island = roots.length;
30
+ roots.push(root);
31
+ byRoot.set(root, island);
32
+ bodyCounts.push(0);
33
+ contactCounts.push(0);
34
+ jointCounts.push(0);
35
+ }
36
+ bodyCounts[island] += 1;
37
+ }
38
+ for (const contact of world.contacts) {
39
+ if (!contact.enabled || contact.sensor)
40
+ continue;
41
+ const island = solveIslandForPair(world, contact.bodyA, contact.bodyB);
42
+ if (island >= 0)
43
+ contactCounts[island] += 1;
44
+ }
45
+ for (const joint of world.joints) {
46
+ const solver = world.jointSolvers.get(joint.kind);
47
+ if (solver === undefined)
48
+ continue;
49
+ const island = solver.usesBodyA === false
50
+ ? solveIslandForBody(world, joint.bodyB)
51
+ : solveIslandForPair(world, joint.bodyA, joint.bodyB);
52
+ if (island >= 0)
53
+ jointCounts[island] += 1;
54
+ }
55
+ prepareIslandSlices(world.solveIslandBodyStarts, bodyCounts, world.solveIslandCursors);
56
+ prepareIslandSlices(world.solveIslandContactStarts, contactCounts, world.solveIslandCursors);
57
+ prepareIslandSlices(world.solveIslandJointStarts, jointCounts, world.solveIslandCursors);
58
+ world.solveIslandBodyIndices.length = islandItemCount(world.solveIslandBodyStarts, bodyCounts);
59
+ world.solveIslandContactIndices.length = islandItemCount(world.solveIslandContactStarts, contactCounts);
60
+ world.solveIslandJointIndices.length = islandItemCount(world.solveIslandJointStarts, jointCounts);
61
+ copyIslandStarts(world.solveIslandCursors, world.solveIslandBodyStarts);
62
+ for (let i = 0; i < world.bodies.length; i += 1) {
63
+ const body = world.bodies[i];
64
+ if (body.type === 'static' || body.sleeping)
65
+ continue;
66
+ const island = byRoot.get(islandRootOf(world.islandParents, body.index));
67
+ if (island !== undefined) {
68
+ world.solveIslandBodyIndices[world.solveIslandCursors[island]] = i;
69
+ world.solveIslandCursors[island] += 1;
70
+ }
71
+ }
72
+ copyIslandStarts(world.solveIslandCursors, world.solveIslandContactStarts);
73
+ for (let i = 0; i < world.contacts.length; i += 1) {
74
+ const contact = world.contacts[i];
75
+ if (!contact.enabled || contact.sensor)
76
+ continue;
77
+ const island = solveIslandForPair(world, contact.bodyA, contact.bodyB);
78
+ if (island >= 0) {
79
+ world.solveIslandContactIndices[world.solveIslandCursors[island]] = i;
80
+ world.solveIslandCursors[island] += 1;
81
+ }
82
+ }
83
+ copyIslandStarts(world.solveIslandCursors, world.solveIslandJointStarts);
84
+ for (let i = 0; i < world.joints.length; i += 1) {
85
+ const joint = world.joints[i];
86
+ const solver = world.jointSolvers.get(joint.kind);
87
+ if (solver === undefined)
88
+ continue;
89
+ const island = solver.usesBodyA === false
90
+ ? solveIslandForBody(world, joint.bodyB)
91
+ : solveIslandForPair(world, joint.bodyA, joint.bodyB);
92
+ if (island >= 0) {
93
+ world.solveIslandJointIndices[world.solveIslandCursors[island]] = i;
94
+ world.solveIslandCursors[island] += 1;
95
+ }
96
+ }
97
+ }
98
+ // Whether a constraint between these two bodies still has anything to solve.
99
+ //
100
+ // A constraint is live only while at least one of its ends can still move this step. Two sleeping
101
+ // bodies, a sleeper against static scenery, or two static bodies all resolve to nothing: every impulse
102
+ // the solver could compute would be applied to a body that is not being integrated.
103
+ //
104
+ // Skipping is not merely an optimisation, and this is the reason sleep needs a solver-side test at all
105
+ // rather than only an integrator-side one. A resting contact usually carries penetration beyond the
106
+ // slop, so the position pass would move a sleeping pair, and the end-of-step stillness test would then
107
+ // read that motion and wake them again. A stack would twitch itself awake every step and never rest.
108
+ export function isRigidBody3DPairAwake(a, b) {
109
+ return isBodyLive(a) || isBodyLive(b);
110
+ }
111
+ // Advances every body's sleep state for one step.
112
+ //
113
+ // Sleep is decided per ISLAND, not per body. Two dynamic bodies are in the same island when a contact
114
+ // or a joint connects them, transitively — so a stack, a chain of links, and a pile all settle or wake
115
+ // as one unit. Deciding per body instead produces the visible failure this exists to prevent: a crate
116
+ // that has stopped moving falls asleep while the crate it rests on is still sliding out from under it,
117
+ // and the sleeper hangs in the air until something happens to wake it.
118
+ //
119
+ // Static bodies are excluded entirely. They never move, so they are neither awake nor asleep, and
120
+ // crucially they do NOT join islands: every dynamic body resting on the same ground would otherwise be
121
+ // transitively connected into one world-sized island that can only sleep when the last object in the
122
+ // level stops moving.
123
+ //
124
+ // An island sleeps only once EVERY member has been continuously below both thresholds for
125
+ // `timeToSleep`. Any member exceeding a threshold resets its own timer, and because the island's timer
126
+ // is the minimum across its members, one moving body keeps the whole island awake.
127
+ export function updatePhysics3DSleep(world, dt) {
128
+ const config = world.config;
129
+ const bodies = world.bodies;
130
+ const parents = world.islandParents;
131
+ const islandTimers = world.islandSleepTimers;
132
+ parents.clear();
133
+ islandTimers.clear();
134
+ // Build the active constraint graph even when sleeping is disabled. The same union-find owns the
135
+ // solve islands below; clearing it and returning here would split every awake body into a singleton
136
+ // and assign a multi-body constraint to only the first of those artificial components.
137
+ for (const contact of world.contacts) {
138
+ if (!contact.enabled || contact.sensor)
139
+ continue;
140
+ unionDynamicPair(world, parents, contact.bodyA, contact.bodyB);
141
+ }
142
+ for (const joint of world.joints) {
143
+ const solver = world.jointSolvers.get(joint.kind);
144
+ if (solver === undefined || solver.usesBodyA === false)
145
+ continue;
146
+ unionDynamicPair(world, parents, joint.bodyA, joint.bodyB);
147
+ }
148
+ if (!config.allowSleeping) {
149
+ // The mechanism is off, so nothing may be left asleep from when it was on — a body that stayed
150
+ // asleep here would never be integrated again and would look frozen for the rest of the session.
151
+ for (const body of bodies) {
152
+ body.sleeping = false;
153
+ body.sleepTimer = 0;
154
+ }
155
+ return;
156
+ }
157
+ // Per-body stillness first: each body's own timer, independent of who it is touching.
158
+ for (const body of bodies) {
159
+ if (body.type === 'static')
160
+ continue;
161
+ if (!body.sleepEnabled) {
162
+ body.sleeping = false;
163
+ body.sleepTimer = 0;
164
+ continue;
165
+ }
166
+ if (isBodyStill(body, config.sleepLinearThreshold, config.sleepAngularThreshold)) {
167
+ body.sleepTimer += dt;
168
+ }
169
+ else {
170
+ body.sleepTimer = 0;
171
+ }
172
+ }
173
+ // A constraint driven by state outside the simulation cannot infer that its next target write is
174
+ // coming, so its solver declares that participating bodies stay awake for the constraint's lifetime.
175
+ // Reset after the stillness pass so even a timestep longer than timeToSleep cannot put one to sleep.
176
+ for (const joint of world.joints) {
177
+ const solver = world.jointSolvers.get(joint.kind);
178
+ if (solver?.keepsBodiesAwake !== true)
179
+ continue;
180
+ if (solver.usesBodyA !== false)
181
+ keepBodyAwake(world, joint.bodyA);
182
+ keepBodyAwake(world, joint.bodyB);
183
+ }
184
+ // The island's timer is the MINIMUM across its members: the least-settled body decides.
185
+ for (const body of bodies) {
186
+ if (body.type === 'static')
187
+ continue;
188
+ const root = islandRootOf(parents, body.index);
189
+ const current = islandTimers.get(root);
190
+ islandTimers.set(root, current === undefined ? body.sleepTimer : Math.min(current, body.sleepTimer));
191
+ }
192
+ for (const body of bodies) {
193
+ if (body.type === 'static')
194
+ continue;
195
+ const islandTimer = islandTimers.get(islandRootOf(parents, body.index)) ?? body.sleepTimer;
196
+ const shouldSleep = body.sleepEnabled && islandTimer >= config.timeToSleep;
197
+ if (!shouldSleep && body.sleeping) {
198
+ // Waking clears the timer so a woken island must earn its rest again from zero rather than
199
+ // falling straight back asleep on the next step.
200
+ body.sleepTimer = 0;
201
+ }
202
+ body.sleeping = shouldSleep;
203
+ if (shouldSleep) {
204
+ // Zeroed rather than merely small. A sleeping body is not integrated, so any residual velocity is
205
+ // motion that will be silently resumed the moment it wakes — a crate that settled ten steps ago
206
+ // would twitch on waking. Zeroing also makes the stillness test trivially true next step, so a
207
+ // body cannot oscillate across the threshold while asleep.
208
+ body.velocityX = 0;
209
+ body.velocityY = 0;
210
+ body.velocityZ = 0;
211
+ body.angularVelocityX = 0;
212
+ body.angularVelocityY = 0;
213
+ body.angularVelocityZ = 0;
214
+ }
215
+ }
216
+ }
217
+ function copyIslandStarts(cursors, starts) {
218
+ cursors.length = starts.length;
219
+ for (let i = 0; i < starts.length; i += 1)
220
+ cursors[i] = starts[i];
221
+ }
222
+ // A body the solver can still move: dynamic or kinematic, and awake. Static bodies are never live —
223
+ // their inverse mass is zero, so an impulse against them changes nothing regardless of sleep state.
224
+ function isBodyLive(body) {
225
+ return body.type !== 'static' && !body.sleeping;
226
+ }
227
+ function isBodyStill(body, linearThreshold, angularThreshold) {
228
+ // A body someone has applied force or torque to is not at rest, whatever its velocity currently
229
+ // reads. Velocity alone would miss it: force is applied during the step, so a sleeper skips the
230
+ // integration that would have turned it into motion, and the force is cleared at the end of the step —
231
+ // the push would be silently swallowed and the body would stay asleep under continuous load.
232
+ if (body.forceX !== 0 || body.forceY !== 0 || body.forceZ !== 0)
233
+ return false;
234
+ if (body.torqueX !== 0 || body.torqueY !== 0 || body.torqueZ !== 0)
235
+ return false;
236
+ const speedSquared = body.velocityX * body.velocityX + body.velocityY * body.velocityY + body.velocityZ * body.velocityZ;
237
+ if (speedSquared > linearThreshold * linearThreshold)
238
+ return false;
239
+ // Compared as a magnitude, not per axis. Three axes each just under the threshold describe a body
240
+ // tumbling at sqrt(3) times it, which per-axis tests would call still.
241
+ const angularSquared = body.angularVelocityX * body.angularVelocityX +
242
+ body.angularVelocityY * body.angularVelocityY +
243
+ body.angularVelocityZ * body.angularVelocityZ;
244
+ return angularSquared <= angularThreshold * angularThreshold;
245
+ }
246
+ function islandItemCount(starts, counts) {
247
+ const last = counts.length - 1;
248
+ return last < 0 ? 0 : starts[last] + counts[last];
249
+ }
250
+ // Union-find with path compression. An index with no entry is its own root, so a body touching nothing
251
+ // is an island of one without needing to be inserted first.
252
+ function islandRootOf(parents, index) {
253
+ let root = index;
254
+ for (;;) {
255
+ const parent = parents.get(root);
256
+ if (parent === undefined || parent === root)
257
+ break;
258
+ root = parent;
259
+ }
260
+ let walk = index;
261
+ for (;;) {
262
+ const parent = parents.get(walk);
263
+ if (parent === undefined || parent === walk)
264
+ break;
265
+ parents.set(walk, root);
266
+ walk = parent;
267
+ }
268
+ return root;
269
+ }
270
+ function keepBodyAwake(world, bodyIndex) {
271
+ const body = findPhysics3DBody(world, bodyIndex);
272
+ if (body !== null && body.type !== 'static')
273
+ body.sleepTimer = 0;
274
+ }
275
+ function prepareIslandSlices(starts, counts, cursors) {
276
+ starts.length = counts.length;
277
+ cursors.length = counts.length;
278
+ let start = 0;
279
+ for (let i = 0; i < counts.length; i += 1) {
280
+ starts[i] = start;
281
+ start += counts[i];
282
+ }
283
+ }
284
+ function solveIslandForBody(world, bodyIndex) {
285
+ const body = findPhysics3DBody(world, bodyIndex);
286
+ if (body === null || body.type === 'static' || body.sleeping)
287
+ return -1;
288
+ return world.solveIslandByRoot.get(islandRootOf(world.islandParents, body.index)) ?? -1;
289
+ }
290
+ function solveIslandForPair(world, bodyA, bodyB) {
291
+ const islandA = solveIslandForBody(world, bodyA);
292
+ if (islandA >= 0)
293
+ return islandA;
294
+ return solveIslandForBody(world, bodyB);
295
+ }
296
+ // Joins two bodies into one island, but only when BOTH are dynamic. A static body is not a member of
297
+ // any island, so it cannot act as a bridge — otherwise the ground would merge every stack in the level
298
+ // into a single island that sleeps only when nothing anywhere is moving.
299
+ //
300
+ // Kinematic bodies deliberately do NOT break islands, even though the solver cannot move them either.
301
+ // A kinematic body joins the islands it touches, and a moving one has its stillness timer reset every
302
+ // step, so the island minimum stays zero and everything riding it stays awake. Excluding it the way
303
+ // static bodies are excluded would let a crate fall asleep on a lift that is still travelling.
304
+ function unionDynamicPair(world, parents, a, b) {
305
+ const first = findPhysics3DBody(world, a);
306
+ const second = findPhysics3DBody(world, b);
307
+ if (first === null || second === null)
308
+ return;
309
+ if (first.type === 'static' || second.type === 'static')
310
+ return;
311
+ const rootA = islandRootOf(parents, a);
312
+ const rootB = islandRootOf(parents, b);
313
+ if (rootA !== rootB)
314
+ parents.set(rootA, rootB);
315
+ }
316
+ //# sourceMappingURL=islands.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"islands.js","sourceRoot":"","sources":["../src/islands.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,uEAAuE;AACvE,EAAE;AACF,oGAAoG;AACpG,sGAAsG;AACtG,sGAAsG;AACtG,qGAAqG;AACrG,0FAA0F;AAC1F,EAAE;AACF,uGAAuG;AACvG,kGAAkG;AAClG,MAAM,UAAU,0BAA0B,CAAC,KAAqB;IAC9D,MAAM,KAAK,GAAG,KAAK,CAAC,gBAAgB,CAAC;IACrC,MAAM,MAAM,GAAG,KAAK,CAAC,iBAAiB,CAAC;IACvC,MAAM,UAAU,GAAG,KAAK,CAAC,qBAAqB,CAAC;IAC/C,MAAM,aAAa,GAAG,KAAK,CAAC,wBAAwB,CAAC;IACrD,MAAM,WAAW,GAAG,KAAK,CAAC,sBAAsB,CAAC;IACjD,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;IACjB,MAAM,CAAC,KAAK,EAAE,CAAC;IACf,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;IACtB,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;IACzB,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC;IAEvB,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QAChC,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,QAAQ;YAAE,SAAS;QACtD,MAAM,IAAI,GAAG,YAAY,CAAC,KAAK,CAAC,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3D,IAAI,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC9B,IA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ointSuppressed(world: Readonly<Physics3DWorld>, bodyA: number, bodyB: number): boolean;
3
+ export declare function rebuildPhysics3DJointCollisionSuppressions(world: Physics3DWorld): void;
4
+ //# sourceMappingURL=jointCollisionSuppression.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jointCollisionSuppression.d.ts","sourceRoot":"","sources":["../src/jointCollisionSuppression.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAI/D,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,QAAQ,CAAC,cAAc,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAIrH;AAYD,wBAAgB,0CAA0C,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAmBtF"}
@@ -0,0 +1,40 @@
1
+ // Constant-time lookup for whether any active joint suppresses collision between a body pair. A broadphase
2
+ // asks this once per candidate pair, so it has to be a lookup rather than a scan of the joint list.
3
+ export function isPhysics3DPairJointSuppressed(world, bodyA, bodyB) {
4
+ const first = Math.min(bodyA, bodyB);
5
+ const second = Math.max(bodyA, bodyB);
6
+ return (world.jointCollisionSuppressions.get(first)?.get(second) ?? 0) > 0;
7
+ }
8
+ // Rebuilds the suppression index from the joint list. Called at every lifecycle and invalidation boundary,
9
+ // where the work is O(joints) once, rather than during the step, where the question is asked O(pairs) times.
10
+ //
11
+ // Rebuilding wholesale is also what makes explicit invalidation sufficient after a caller edits a joint's
12
+ // endpoints or `collideConnected` in place: there is no per-joint shadow state that could still describe the
13
+ // pair the joint used to connect.
14
+ //
15
+ // The nested value is a REFERENCE COUNT, not a flag. Two joints may connect the same pair — a hinge plus a
16
+ // motor-bearing slider on the same hinge line — and removing one of them must not re-enable a collision the
17
+ // other still suppresses.
18
+ export function rebuildPhysics3DJointCollisionSuppressions(world) {
19
+ const suppressions = world.jointCollisionSuppressions;
20
+ suppressions.clear();
21
+ for (const joint of world.joints) {
22
+ if (joint.collideConnected)
23
+ continue;
24
+ // A joint whose kind has no registered solver constrains nothing, and a one-body kind never reads
25
+ // bodyA — in both cases the pair is not actually held together, so suppressing its collision would hide
26
+ // a contact for no reason.
27
+ const solver = world.jointSolvers.get(joint.kind);
28
+ if (solver === undefined || solver.usesBodyA === false)
29
+ continue;
30
+ const first = Math.min(joint.bodyA, joint.bodyB);
31
+ const second = Math.max(joint.bodyA, joint.bodyB);
32
+ let seconds = suppressions.get(first);
33
+ if (seconds === undefined) {
34
+ seconds = new Map();
35
+ suppressions.set(first, seconds);
36
+ }
37
+ seconds.set(second, (seconds.get(second) ?? 0) + 1);
38
+ }
39
+ }
40
+ //# sourceMappingURL=jointCollisionSuppression.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jointCollisionSuppression.js","sourceRoot":"","sources":["../src/jointCollisionSuppression.ts"],"names":[],"mappings":"AAEA,2GAA2G;AAC3G,oGAAoG;AACpG,MAAM,UAAU,8BAA8B,CAAC,KAA+B,EAAE,KAAa,EAAE,KAAa;IAC1G,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACrC,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACtC,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;AAC7E,CAAC;AAED,2GAA2G;AAC3G,6GAA6G;AAC7G,EAAE;AACF,0GAA0G;AAC1G,6GAA6G;AAC7G,kCAAkC;AAClC,EAAE;AACF,2GAA2G;AAC3G,4GAA4G;AAC5G,0BAA0B;AAC1B,MAAM,UAAU,0CAA0C,CAAC,KAAqB;IAC9E,MAAM,YAAY,GAAG,KAAK,CAAC,0BAA0B,CAAC;IACtD,YAAY,CAAC,KAAK,EAAE,CAAC;IACrB,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QACjC,IAAI,KAAK,CAAC,gBAAgB;YAAE,SAAS;QACrC,kGAAkG;QAClG,wGAAwG;QACxG,2BAA2B;QAC3B,MAAM,MAAM,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAClD,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,SAAS,KAAK,KAAK;YAAE,SAAS;QACjE,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;QACjD,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;QAClD,IAAI,OAAO,GAAG,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACtC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,OAAO,GAAG,IAAI,GAAG,EAAE,CAAC;YACpB,YAAY,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACnC,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACtD,CAAC;AACH,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { Physics3DBallAndSocketJoint, Physics3DBallAndSocketJointOptions, Physics3DConeTwistJoint, Physics3DConeTwistJointOptions, Physics3DFixedJoint, Physics3DFixedJointOptions, Physics3DGeneric6DofJoint, Physics3DGeneric6DofJointOptions, Physics3DHingeJoint, Physics3DHingeJointOptions, Physics3DSliderJoint, Physics3DSliderJointOptions } from '@flighthq/types/contract';
2
+ export declare function createPhysics3DBallAndSocketJoint(options: Readonly<Physics3DBallAndSocketJointOptions>): Physics3DBallAndSocketJoint;
3
+ export declare function createPhysics3DConeTwistJoint(options: Readonly<Physics3DConeTwistJointOptions>): Physics3DConeTwistJoint;
4
+ export declare function createPhysics3DFixedJoint(options: Readonly<Physics3DFixedJointOptions>): Physics3DFixedJoint;
5
+ export declare function createPhysics3DGeneric6DofJoint(options: Readonly<Physics3DGeneric6DofJointOptions>): Physics3DGeneric6DofJoint;
6
+ export declare function createPhysics3DHingeJoint(options: Readonly<Physics3DHingeJointOptions>): Physics3DHingeJoint;
7
+ export declare function createPhysics3DSliderJoint(options: Readonly<Physics3DSliderJointOptions>): Physics3DSliderJoint;
8
+ //# sourceMappingURL=jointFactories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jointFactories.d.ts","sourceRoot":"","sources":["../src/jointFactories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,2BAA2B,EAC3B,kCAAkC,EAClC,uBAAuB,EACvB,8BAA8B,EAC9B,mBAAmB,EACnB,0BAA0B,EAC1B,yBAAyB,EACzB,gCAAgC,EAChC,mBAAmB,EACnB,0BAA0B,EAK1B,oBAAoB,EACpB,2BAA2B,EAC5B,MAAM,0BAA0B,CAAC;AAiBlC,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,QAAQ,CAAC,kCAAkC,CAAC,GACpD,2BAA2B,CAE7B;AAKD,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,QAAQ,CAAC,8BAA8B,CAAC,GAChD,uBAAuB,CAezB;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,QAAQ,CAAC,0BAA0B,CAAC,GAAG,mBAAmB,CAE5G;AAKD,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,QAAQ,CAAC,gCAAgC,CAAC,GAClD,yBAAyB,CAoB3B;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,QAAQ,CAAC,0BAA0B,CAAC,GAAG,mBAAmB,CAe5G;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,QAAQ,CAAC,2BAA2B,CAAC,GAAG,oBAAoB,CAe/G"}
@@ -0,0 +1,126 @@
1
+ import { Physics3DBallAndSocketJointKind, Physics3DConeTwistJointKind, Physics3DFixedJointKind, Physics3DGeneric6DofJointKind, Physics3DHingeJointKind, Physics3DSliderJointKind, } from './joints';
2
+ // Joint factories allocate plain data, take one readonly options object, and make only authoring choices.
3
+ // Registration and world membership stay explicit operations, so constructing a joint links no solver math
4
+ // and touches no world.
5
+ //
6
+ // The two shared helpers are also the boundary that keeps solver-owned cache out of every public options
7
+ // type: a caller names anchors, frames, and limits, and never the accumulators.
8
+ export function createPhysics3DBallAndSocketJoint(options) {
9
+ return { kind: Physics3DBallAndSocketJointKind, ...createJointBase(options) };
10
+ }
11
+ // Defaults to a cone of 45 degrees in both directions and a free twist. A cone-twist with no limits at all is
12
+ // a ball-and-socket that costs more, so the swing limit defaults ON and the twist limit — which has no
13
+ // natural neutral range — defaults off.
14
+ export function createPhysics3DConeTwistJoint(options) {
15
+ return {
16
+ kind: Physics3DConeTwistJointKind,
17
+ ...createJointBase(options),
18
+ ...createJointFrames(options),
19
+ enableSwingLimit: options.enableSwingLimit ?? true,
20
+ swingLimitY: options.swingLimitY ?? Math.PI / 4,
21
+ swingLimitZ: options.swingLimitZ ?? Math.PI / 4,
22
+ enableTwistLimit: options.enableTwistLimit ?? false,
23
+ lowerTwistAngle: options.lowerTwistAngle ?? 0,
24
+ upperTwistAngle: options.upperTwistAngle ?? 0,
25
+ swingLimitImpulse: 0,
26
+ lowerTwistImpulse: 0,
27
+ upperTwistImpulse: 0,
28
+ };
29
+ }
30
+ export function createPhysics3DFixedJoint(options) {
31
+ return { kind: Physics3DFixedJointKind, ...createJointBase(options), ...createJointFrames(options) };
32
+ }
33
+ // Defaults every axis to FREE, so a joint built with no bounds constrains nothing and each axis is opted into
34
+ // by naming its interval. The alternative — defaulting to locked — would make a partially configured joint
35
+ // silently rigid, which is the harder failure to see.
36
+ export function createPhysics3DGeneric6DofJoint(options) {
37
+ return {
38
+ kind: Physics3DGeneric6DofJointKind,
39
+ ...createJointBase(options),
40
+ ...createJointFrames(options),
41
+ lowerLinearX: options.lowerLinearX ?? 1,
42
+ lowerLinearY: options.lowerLinearY ?? 1,
43
+ lowerLinearZ: options.lowerLinearZ ?? 1,
44
+ upperLinearX: options.upperLinearX ?? -1,
45
+ upperLinearY: options.upperLinearY ?? -1,
46
+ upperLinearZ: options.upperLinearZ ?? -1,
47
+ lowerAngularX: options.lowerAngularX ?? 1,
48
+ lowerAngularY: options.lowerAngularY ?? 1,
49
+ lowerAngularZ: options.lowerAngularZ ?? 1,
50
+ upperAngularX: options.upperAngularX ?? -1,
51
+ upperAngularY: options.upperAngularY ?? -1,
52
+ upperAngularZ: options.upperAngularZ ?? -1,
53
+ lowerLimitImpulses: [0, 0, 0, 0, 0, 0],
54
+ upperLimitImpulses: [0, 0, 0, 0, 0, 0],
55
+ };
56
+ }
57
+ export function createPhysics3DHingeJoint(options) {
58
+ return {
59
+ kind: Physics3DHingeJointKind,
60
+ ...createJointBase(options),
61
+ ...createJointFrames(options),
62
+ enableLimit: options.enableLimit ?? false,
63
+ lowerAngle: options.lowerAngle ?? 0,
64
+ upperAngle: options.upperAngle ?? 0,
65
+ enableMotor: options.enableMotor ?? false,
66
+ motorSpeed: options.motorSpeed ?? 0,
67
+ maxMotorTorque: options.maxMotorTorque ?? 0,
68
+ motorImpulse: 0,
69
+ lowerLimitImpulse: 0,
70
+ upperLimitImpulse: 0,
71
+ };
72
+ }
73
+ export function createPhysics3DSliderJoint(options) {
74
+ return {
75
+ kind: Physics3DSliderJointKind,
76
+ ...createJointBase(options),
77
+ ...createJointFrames(options),
78
+ enableLimit: options.enableLimit ?? false,
79
+ lowerTranslation: options.lowerTranslation ?? 0,
80
+ upperTranslation: options.upperTranslation ?? 0,
81
+ enableMotor: options.enableMotor ?? false,
82
+ motorSpeed: options.motorSpeed ?? 0,
83
+ maxMotorForce: options.maxMotorForce ?? 0,
84
+ motorImpulse: 0,
85
+ lowerLimitImpulse: 0,
86
+ upperLimitImpulse: 0,
87
+ };
88
+ }
89
+ function createJointBase(options) {
90
+ return {
91
+ bodyA: options.bodyA,
92
+ bodyB: options.bodyB,
93
+ localAnchorAX: options.localAnchorAX ?? 0,
94
+ localAnchorAY: options.localAnchorAY ?? 0,
95
+ localAnchorAZ: options.localAnchorAZ ?? 0,
96
+ localAnchorBX: options.localAnchorBX ?? 0,
97
+ localAnchorBY: options.localAnchorBY ?? 0,
98
+ localAnchorBZ: options.localAnchorBZ ?? 0,
99
+ collideConnected: options.collideConnected ?? false,
100
+ impulse0: 0,
101
+ impulse1: 0,
102
+ impulse2: 0,
103
+ impulse3: 0,
104
+ impulse4: 0,
105
+ impulse5: 0,
106
+ rAX: 0,
107
+ rAY: 0,
108
+ rAZ: 0,
109
+ rBX: 0,
110
+ rBY: 0,
111
+ rBZ: 0,
112
+ };
113
+ }
114
+ function createJointFrames(options) {
115
+ return {
116
+ localRotationAX: options.localRotationAX ?? 0,
117
+ localRotationAY: options.localRotationAY ?? 0,
118
+ localRotationAZ: options.localRotationAZ ?? 0,
119
+ localRotationAW: options.localRotationAW ?? 1,
120
+ localRotationBX: options.localRotationBX ?? 0,
121
+ localRotationBY: options.localRotationBY ?? 0,
122
+ localRotationBZ: options.localRotationBZ ?? 0,
123
+ localRotationBW: options.localRotationBW ?? 1,
124
+ };
125
+ }
126
+ //# sourceMappingURL=jointFactories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jointFactories.js","sourceRoot":"","sources":["../src/jointFactories.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,+BAA+B,EAC/B,2BAA2B,EAC3B,uBAAuB,EACvB,6BAA6B,EAC7B,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,UAAU,CAAC;AAElB,0GAA0G;AAC1G,2GAA2G;AAC3G,wBAAwB;AACxB,EAAE;AACF,yGAAyG;AACzG,gFAAgF;AAChF,MAAM,UAAU,iCAAiC,CAC/C,OAAqD;IAErD,OAAO,EAAE,IAAI,EAAE,+BAA+B,EA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QACN,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,CAAC;KACP,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB,CAAC,OAA6C;IACtE,OAAO;QACL,eAAe,EAAE,OAAO,CAAC,eAAe,IAAI,CAAC;QAC7C,eAAe,EAAE,OAAO,CAAC,eAAe,IAAI,CAAC;QAC7C,eAAe,EAAE,OAAO,CAAC,eAAe,IAAI,CAAC;QAC7C,eAAe,EAAE,OAAO,CAAC,eAAe,IAAI,CAAC;QAC7C,eAAe,EAAE,OAAO,CAAC,eAAe,IAAI,CAAC;QAC7C,eAAe,EAAE,OAAO,CAAC,eAAe,IAAI,CAAC;QAC7C,eAAe,EAAE,OAAO,CAAC,eAAe,IAAI,CAAC;QAC7C,eAAe,EAAE,OAAO,CAAC,eAAe,IAAI,CAAC;KAC9C,CAAC;AACJ,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { Physics3DJoint, Physics3DJointFrames, RigidBody3D } from '@flighthq/types/contract';
2
+ export declare function applyPhysics3DJointAngularImpulse(bodyA: RigidBody3D, bodyB: RigidBody3D, impulseX: number, impulseY: number, impulseZ: number): void;
3
+ export declare function applyPhysics3DJointImpulse(bodyA: RigidBody3D, bodyB: RigidBody3D, rAX: number, rAY: number, rAZ: number, rBX: number, rBY: number, rBZ: number, impulseX: number, impulseY: number, impulseZ: number): void;
4
+ export declare function applyPhysics3DJointRowImpulse(bodyA: RigidBody3D, bodyB: RigidBody3D, directionX: number, directionY: number, directionZ: number, armAX: number, armAY: number, armAZ: number, armBX: number, armBY: number, armBZ: number, impulse: number): void;
5
+ export declare function getPhysics3DJointRowMass(bodyA: Readonly<RigidBody3D>, bodyB: Readonly<RigidBody3D>, directionX: number, directionY: number, directionZ: number, armAX: number, armAY: number, armAZ: number, armBX: number, armBY: number, armBZ: number): number;
6
+ export declare function getPhysics3DJointRowVelocity(bodyA: Readonly<RigidBody3D>, bodyB: Readonly<RigidBody3D>, directionX: number, directionY: number, directionZ: number, armAX: number, armAY: number, armAZ: number, armBX: number, armBY: number, armBZ: number): number;
7
+ export declare function swapPhysics3DJointFrames(frames: Physics3DJointFrames): void;
8
+ export declare function writePhysics3DJointAnchors(bodyA: Readonly<RigidBody3D>, bodyB: Readonly<RigidBody3D>, joint: Physics3DJoint): void;
9
+ export declare function writePhysics3DJointAnchorVelocity(bodyA: Readonly<RigidBody3D>, bodyB: Readonly<RigidBody3D>, joint: Readonly<Physics3DJoint>, out: number[]): void;
10
+ export declare function writePhysics3DJointAngularMass(bodyA: Readonly<RigidBody3D>, bodyB: Readonly<RigidBody3D>, out: number[]): void;
11
+ export declare function writePhysics3DJointFrameBasis(body: Readonly<RigidBody3D>, localRotationX: number, localRotationY: number, localRotationZ: number, localRotationW: number, out: number[]): void;
12
+ export declare function writePhysics3DJointFrameRotation(body: Readonly<RigidBody3D>, localRotationX: number, localRotationY: number, localRotationZ: number, localRotationW: number, out: number[]): void;
13
+ export declare function writePhysics3DJointPointMass(bodyA: Readonly<RigidBody3D>, bodyB: Readonly<RigidBody3D>, rAX: number, rAY: number, rAZ: number, rBX: number, rBY: number, rBZ: number, out: number[]): void;
14
+ export declare function writePhysics3DJointRelativeRotation(frameAX: number, frameAY: number, frameAZ: number, frameAW: number, frameBX: number, frameBY: number, frameBZ: number, frameBW: number, out: number[]): void;
15
+ export declare function writePhysics3DJointRotationError(frameAX: number, frameAY: number, frameAZ: number, frameAW: number, frameBX: number, frameBY: number, frameBZ: number, frameBW: number, out: number[]): void;
16
+ export declare function writePhysics3DJointSeparation(bodyA: Readonly<RigidBody3D>, bodyB: Readonly<RigidBody3D>, joint: Readonly<Physics3DJoint>, out: number[]): void;
17
+ //# sourceMappingURL=jointMath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jointMath.d.ts","sourceRoot":"","sources":["../src/jointMath.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,0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