@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,308 @@
1
+ import { applyPhysics3DJointAngularImpulse, applyPhysics3DJointImpulse, applyPhysics3DJointRowImpulse, getPhysics3DJointRowMass, getPhysics3DJointRowVelocity, writePhysics3DJointAnchorVelocity, writePhysics3DJointAnchors, writePhysics3DJointAngularMass, writePhysics3DJointFrameBasis, writePhysics3DJointFrameRotation, writePhysics3DJointPointMass, writePhysics3DJointRotationError, writePhysics3DJointSeparation, } from './jointMath';
2
+ import { applySymmetricTensor, inverseSymmetricTensor } from './symmetricTensor';
3
+ // The constraint FAMILIES every 3D joint kind is composed from. `jointMath` is the arithmetic; this is the
4
+ // sequential-impulse pattern applied to it — prepare a block, warm-start it, solve it — so a kind reads as a
5
+ // list of the constraints it imposes rather than as a page of index arithmetic.
6
+ //
7
+ // Package-internal, and layered: `jointMath` knows nothing about per-step state, this file owns the layout
8
+ // of that state, and `joints` composes these into kinds.
9
+ //
10
+ // A CONSTRAINT ROW is nine consecutive numbers in a joint's per-step state: the linear direction, then the
11
+ // angular arm on A, then the angular arm on B. Storing the three vectors as one block is what lets a row's
12
+ // mass, velocity, and impulse be addressed as `(state, offset)` rather than as nine arguments repeated at
13
+ // every call site — and it is why a row's three readings can never quietly describe different constraints.
14
+ // A PURELY ANGULAR row is one whose direction is zero and whose two arms are the axis it turns about.
15
+ // The width of one constraint row in a joint's per-step state.
16
+ export const ROW_LENGTH = 9;
17
+ // The three-number blocks a point constraint occupies at the start of a joint's state: the inverted 3x3
18
+ // effective mass, then the positional bias.
19
+ export const POINT_MASS = 0;
20
+ export const POINT_BIAS = 6;
21
+ export const POINT_LENGTH = 9;
22
+ // Applies one row's impulse.
23
+ export function applyRow(bodyA, bodyB, state, offset, impulse) {
24
+ if (impulse === 0)
25
+ return;
26
+ applyPhysics3DJointRowImpulse(bodyA, bodyB, state[offset], state[offset + 1], state[offset + 2], state[offset + 3], state[offset + 4], state[offset + 5], state[offset + 6], state[offset + 7], state[offset + 8], impulse);
27
+ }
28
+ // Establishes a joint's impulse accumulators and returns its reusable per-step scratch, sized to `length`.
29
+ //
30
+ // The accumulators are established HERE rather than defended at each read, because every read assumes the
31
+ // field is already a number and a joint can reach a solver without one: the type declares them required, but
32
+ // a joint reconstructed from a saved world satisfies that only at compile time. The first read then computes
33
+ // `undefined + x`, and because an accumulator feeds the next iteration the NaN does not stay local — it goes
34
+ // out through the applied impulse into both bodies' velocities and from there into every contact they touch.
35
+ //
36
+ // The scratch array is reused rather than reallocated. Every solver rebuilds its whole block each substep, so
37
+ // it is pure destination; allocating a fresh one per joint per step made the step's allocation profile scale
38
+ // with the joint count, which is the hidden per-frame allocation this package's charter forbids.
39
+ export function beginJointSolve(joint, length) {
40
+ joint.impulse0 ??= 0;
41
+ joint.impulse1 ??= 0;
42
+ joint.impulse2 ??= 0;
43
+ joint.impulse3 ??= 0;
44
+ joint.impulse4 ??= 0;
45
+ joint.impulse5 ??= 0;
46
+ let state = jointSolveStates.get(joint);
47
+ if (state === undefined) {
48
+ state = [];
49
+ jointSolveStates.set(joint, state);
50
+ }
51
+ state.length = length;
52
+ return state;
53
+ }
54
+ // Discards a joint's per-step state, so a `solve` after a `prepare` that could not run finds nothing rather
55
+ // than the previous step's numbers. A prepare bails when a body index no longer resolves, and without this
56
+ // the stale block would be applied against whichever bodies did resolve — an impulse computed for a pair
57
+ // that no longer exists.
58
+ export function clearJointSolve(joint) {
59
+ jointSolveStates.delete(joint);
60
+ }
61
+ // A joint's per-step state, or undefined when it has none. A `solve` reads this and returns early on
62
+ // undefined, which is what makes a bailed `prepare` mean "this joint does nothing this step".
63
+ export function getJointSolveState(joint) {
64
+ return jointSolveStates.get(joint);
65
+ }
66
+ // The scalar effective mass of one row, or 0 when the pair cannot move along it.
67
+ export function getRowMass(bodyA, bodyB, state, offset) {
68
+ return getPhysics3DJointRowMass(bodyA, bodyB, state[offset], state[offset + 1], state[offset + 2], state[offset + 3], state[offset + 4], state[offset + 5], state[offset + 6], state[offset + 7], state[offset + 8]);
69
+ }
70
+ // The rate one row's coordinate is changing, B relative to A.
71
+ export function getRowVelocity(bodyA, bodyB, state, offset) {
72
+ return getPhysics3DJointRowVelocity(bodyA, bodyB, state[offset], state[offset + 1], state[offset + 2], state[offset + 3], state[offset + 4], state[offset + 5], state[offset + 6], state[offset + 7], state[offset + 8]);
73
+ }
74
+ // Builds the three-row angular lock: the inverted sum of the two world inverse inertia tensors, and the bias
75
+ // that rotates frame B back onto frame A. Reads the frames left by `readFrameRotations`.
76
+ export function prepareAngularBlock(bodyA, bodyB, state, massOffset, biasOffset, dt) {
77
+ writePhysics3DJointAngularMass(bodyA, bodyB, blockTensor);
78
+ inverseSymmetricTensor(blockTensor, blockInverse);
79
+ writeBlock(state, massOffset, blockInverse);
80
+ writePhysics3DJointRotationError(frameARotation[0], frameARotation[1], frameARotation[2], frameARotation[3], frameBRotation[0], frameBRotation[1], frameBRotation[2], frameBRotation[3], blockVector);
81
+ const bias = BAUMGARTE / dt;
82
+ state[biasOffset] = blockVector[0] * bias;
83
+ state[biasOffset + 1] = blockVector[1] * bias;
84
+ state[biasOffset + 2] = blockVector[2] * bias;
85
+ }
86
+ // Builds the three-row point constraint: the lever arms, the inverted 3x3 effective mass, and the bias that
87
+ // pulls the two anchors back together. Occupies `POINT_MASS` through `POINT_BIAS` at the head of the state.
88
+ export function preparePointBlock(bodyA, bodyB, joint, state, dt) {
89
+ writePhysics3DJointAnchors(bodyA, bodyB, joint);
90
+ writePhysics3DJointPointMass(bodyA, bodyB, joint.rAX, joint.rAY, joint.rAZ, joint.rBX, joint.rBY, joint.rBZ, blockTensor);
91
+ inverseSymmetricTensor(blockTensor, blockInverse);
92
+ writeBlock(state, POINT_MASS, blockInverse);
93
+ writePhysics3DJointSeparation(bodyA, bodyB, joint, blockVector);
94
+ const bias = BAUMGARTE / dt;
95
+ state[POINT_BIAS] = blockVector[0] * bias;
96
+ state[POINT_BIAS + 1] = blockVector[1] * bias;
97
+ state[POINT_BIAS + 2] = blockVector[2] * bias;
98
+ }
99
+ // The world-space axes of both bodies' joint frames, left in `frameABasis` and `frameBBasis`. Each is nine
100
+ // numbers, column-major: X axis, then Y, then Z.
101
+ export function readFrameBases(bodyA, bodyB, frames) {
102
+ establishFrames(frames);
103
+ writePhysics3DJointFrameBasis(bodyA, frames.localRotationAX, frames.localRotationAY, frames.localRotationAZ, frames.localRotationAW, frameABasis);
104
+ writePhysics3DJointFrameBasis(bodyB, frames.localRotationBX, frames.localRotationBY, frames.localRotationBZ, frames.localRotationBW, frameBBasis);
105
+ }
106
+ // Both bodies' joint frames as world-space quaternions, left in `frameARotation` and `frameBRotation`.
107
+ export function readFrameRotations(bodyA, bodyB, frames) {
108
+ establishFrames(frames);
109
+ writePhysics3DJointFrameRotation(bodyA, frames.localRotationAX, frames.localRotationAY, frames.localRotationAZ, frames.localRotationAW, frameARotation);
110
+ writePhysics3DJointFrameRotation(bodyB, frames.localRotationBX, frames.localRotationBY, frames.localRotationBZ, frames.localRotationBW, frameBRotation);
111
+ }
112
+ // Reads one of the six common accumulators by index, for the kinds whose rows are numbered rather than named.
113
+ export function readJointImpulse(joint, slot) {
114
+ switch (slot) {
115
+ case 0:
116
+ return joint.impulse0;
117
+ case 1:
118
+ return joint.impulse1;
119
+ case 2:
120
+ return joint.impulse2;
121
+ case 3:
122
+ return joint.impulse3;
123
+ case 4:
124
+ return joint.impulse4;
125
+ default:
126
+ return joint.impulse5;
127
+ }
128
+ }
129
+ // Solves the three angular lock rows as one coupled block, accumulating into `impulse3` through `impulse5`.
130
+ export function solveAngularBlock(bodyA, bodyB, joint, state, massOffset, biasOffset) {
131
+ readBlock(state, massOffset, blockTensor);
132
+ applySymmetricTensor(blockTensor, bodyB.angularVelocityX - bodyA.angularVelocityX + state[biasOffset], bodyB.angularVelocityY - bodyA.angularVelocityY + state[biasOffset + 1], bodyB.angularVelocityZ - bodyA.angularVelocityZ + state[biasOffset + 2], blockResult);
133
+ const impulseX = -blockResult[0];
134
+ const impulseY = -blockResult[1];
135
+ const impulseZ = -blockResult[2];
136
+ joint.impulse3 += impulseX;
137
+ joint.impulse4 += impulseY;
138
+ joint.impulse5 += impulseZ;
139
+ applyPhysics3DJointAngularImpulse(bodyA, bodyB, impulseX, impulseY, impulseZ);
140
+ }
141
+ // Solves one equality row — a coordinate held at exactly its target — accumulating into a common slot.
142
+ export function solveEqualityRow(bodyA, bodyB, joint, slot, state, offset, mass, error, biasFactor) {
143
+ const velocity = getRowVelocity(bodyA, bodyB, state, offset);
144
+ const impulse = -mass * (velocity + error * biasFactor);
145
+ writeJointImpulse(joint, slot, readJointImpulse(joint, slot) + impulse);
146
+ applyRow(bodyA, bodyB, state, offset, impulse);
147
+ }
148
+ // Holds a row's coordinate at or above its lower bound. `error` is the SIGNED distance above the bound —
149
+ // positive inside the interval, negative once the bound has been crossed.
150
+ //
151
+ // The non-negative clamp on the ACCUMULATED impulse is what makes this a limit rather than a spring: it may
152
+ // push the coordinate back up through the bound and may never pull it down.
153
+ //
154
+ // The bias uses the signed error with no clamp, and both clamps are wrong in opposite ways. `max(error, 0)`
155
+ // suppresses correctly but cannot correct: it zeroes the bias exactly when the bound has been crossed, so a
156
+ // joint authored out of range and sitting still is never pushed back. `min(error, 0)` corrects but cannot
157
+ // suppress: it zeroes the bias while INSIDE the interval, and the row then brakes any approach to the bound
158
+ // from a distance — a motor at speed held at a standstill by a limit it was nowhere near.
159
+ export function solveLowerLimitRow(bodyA, bodyB, state, offset, mass, error, biasFactor, accumulatorSlot) {
160
+ const velocity = getRowVelocity(bodyA, bodyB, state, offset);
161
+ const previous = state[accumulatorSlot];
162
+ const total = Math.max(previous - mass * (velocity + error * biasFactor), 0);
163
+ state[accumulatorSlot] = total;
164
+ applyRow(bodyA, bodyB, state, offset, total - previous);
165
+ }
166
+ // Drives a row's coordinate toward `speed`, spending at most `maxImpulse`, and returns the new accumulated
167
+ // motor impulse for the caller to store on its kind-specific field.
168
+ //
169
+ // Clamped on the ACCUMULATED impulse rather than per iteration, so the bound is a force or a torque. A
170
+ // per-iteration clamp would scale the motor's real strength with the iteration count, which presents as a
171
+ // motor that gets stronger when the solver is tuned for accuracy.
172
+ export function solveMotorRow(bodyA, bodyB, state, offset, mass, speed, maxImpulse, previous) {
173
+ const velocity = getRowVelocity(bodyA, bodyB, state, offset);
174
+ const total = Math.min(Math.max(previous - mass * (velocity - speed), -maxImpulse), maxImpulse);
175
+ applyRow(bodyA, bodyB, state, offset, total - previous);
176
+ return total;
177
+ }
178
+ // Solves the three point rows as one coupled block, accumulating into `impulse0` through `impulse2`.
179
+ //
180
+ // Coupled rather than solved axis by axis. Solving x, then y, then z lets each undo part of the previous
181
+ // correction, and a loaded joint visibly creeps — the 3D form of the same failure a 2D revolute shows when
182
+ // its two rows are separated.
183
+ export function solvePointBlock(bodyA, bodyB, joint, state) {
184
+ writePhysics3DJointAnchorVelocity(bodyA, bodyB, joint, blockVector);
185
+ readBlock(state, POINT_MASS, blockTensor);
186
+ applySymmetricTensor(blockTensor, blockVector[0] + state[POINT_BIAS], blockVector[1] + state[POINT_BIAS + 1], blockVector[2] + state[POINT_BIAS + 2], blockResult);
187
+ const impulseX = -blockResult[0];
188
+ const impulseY = -blockResult[1];
189
+ const impulseZ = -blockResult[2];
190
+ joint.impulse0 += impulseX;
191
+ joint.impulse1 += impulseY;
192
+ joint.impulse2 += impulseZ;
193
+ applyPhysics3DJointImpulse(bodyA, bodyB, joint.rAX, joint.rAY, joint.rAZ, joint.rBX, joint.rBY, joint.rBZ, impulseX, impulseY, impulseZ);
194
+ }
195
+ // Holds a row's coordinate at or below its upper bound. `error` is the SIGNED distance below the bound —
196
+ // positive inside the interval, negative once the bound has been crossed.
197
+ //
198
+ // The mirror of `solveLowerLimitRow`, reached by reading the row backwards: negating both the velocity and
199
+ // the applied impulse turns "at least" into "at most" without a second sign convention to keep straight.
200
+ export function solveUpperLimitRow(bodyA, bodyB, state, offset, mass, error, biasFactor, accumulatorSlot) {
201
+ const velocity = -getRowVelocity(bodyA, bodyB, state, offset);
202
+ const previous = state[accumulatorSlot];
203
+ const total = Math.max(previous - mass * (velocity + error * biasFactor), 0);
204
+ state[accumulatorSlot] = total;
205
+ applyRow(bodyA, bodyB, state, offset, -(total - previous));
206
+ }
207
+ // Reapplies the angular lock's accumulated impulse before iteration begins.
208
+ export function warmStartAngularBlock(bodyA, bodyB, joint) {
209
+ applyPhysics3DJointAngularImpulse(bodyA, bodyB, joint.impulse3, joint.impulse4, joint.impulse5);
210
+ }
211
+ // Reapplies the point constraint's accumulated impulse before iteration begins.
212
+ export function warmStartPointBlock(bodyA, bodyB, joint) {
213
+ applyPhysics3DJointImpulse(bodyA, bodyB, joint.rAX, joint.rAY, joint.rAZ, joint.rBX, joint.rBY, joint.rBZ, joint.impulse0, joint.impulse1, joint.impulse2);
214
+ }
215
+ // Writes a purely angular row: no linear impulse, both arms the axis it turns about. The row's coordinate is
216
+ // then the relative rotation angle about that axis.
217
+ export function writeAngularRow(state, offset, axisX, axisY, axisZ) {
218
+ writeRow(state, offset, 0, 0, 0, axisX, axisY, axisZ, axisX, axisY, axisZ);
219
+ }
220
+ // Writes one of the six common accumulators by index.
221
+ export function writeJointImpulse(joint, slot, value) {
222
+ switch (slot) {
223
+ case 0:
224
+ joint.impulse0 = value;
225
+ break;
226
+ case 1:
227
+ joint.impulse1 = value;
228
+ break;
229
+ case 2:
230
+ joint.impulse2 = value;
231
+ break;
232
+ case 3:
233
+ joint.impulse3 = value;
234
+ break;
235
+ case 4:
236
+ joint.impulse4 = value;
237
+ break;
238
+ default:
239
+ joint.impulse5 = value;
240
+ break;
241
+ }
242
+ }
243
+ // Writes one constraint row into a joint's per-step state.
244
+ export function writeRow(state, offset, directionX, directionY, directionZ, armAX, armAY, armAZ, armBX, armBY, armBZ) {
245
+ state[offset] = directionX;
246
+ state[offset + 1] = directionY;
247
+ state[offset + 2] = directionZ;
248
+ state[offset + 3] = armAX;
249
+ state[offset + 4] = armAY;
250
+ state[offset + 5] = armAZ;
251
+ state[offset + 6] = armBX;
252
+ state[offset + 7] = armBY;
253
+ state[offset + 8] = armBZ;
254
+ }
255
+ // Establishes a frame pair's eight components for the same reason `beginJointSolve` establishes the impulse
256
+ // accumulators: a reconstructed joint satisfies the required type at compile time only, and an absent
257
+ // rotation would multiply through into both bodies as NaN. Four absent components give the identity, which is
258
+ // what an author who never set a frame meant.
259
+ function establishFrames(frames) {
260
+ frames.localRotationAX ??= 0;
261
+ frames.localRotationAY ??= 0;
262
+ frames.localRotationAZ ??= 0;
263
+ frames.localRotationAW ??= 1;
264
+ frames.localRotationBX ??= 0;
265
+ frames.localRotationBY ??= 0;
266
+ frames.localRotationBZ ??= 0;
267
+ frames.localRotationBW ??= 1;
268
+ }
269
+ function readBlock(state, offset, out) {
270
+ out[0] = state[offset];
271
+ out[1] = state[offset + 1];
272
+ out[2] = state[offset + 2];
273
+ out[3] = state[offset + 3];
274
+ out[4] = state[offset + 4];
275
+ out[5] = state[offset + 5];
276
+ }
277
+ function writeBlock(state, offset, source) {
278
+ state[offset] = source[0];
279
+ state[offset + 1] = source[1];
280
+ state[offset + 2] = source[2];
281
+ state[offset + 3] = source[3];
282
+ state[offset + 4] = source[4];
283
+ state[offset + 5] = source[5];
284
+ }
285
+ // The fraction of a joint's positional error corrected per step. Matches the contact solver's rationale:
286
+ // correcting all of it at once turns a deep error into an explosion.
287
+ const BAUMGARTE = 0.2;
288
+ // The world-space frames the prepare pass leaves for the kind that asked for them. Module scratch rather than
289
+ // per-joint state because they are consumed within one `prepare`, never across two.
290
+ export const frameABasis = new Array(9).fill(0);
291
+ export const frameBBasis = new Array(9).fill(0);
292
+ export const frameARotation = [0, 0, 0, 1];
293
+ export const frameBRotation = [0, 0, 0, 1];
294
+ const blockTensor = [0, 0, 0, 0, 0, 0];
295
+ const blockInverse = [0, 0, 0, 0, 0, 0];
296
+ const blockVector = [0, 0, 0];
297
+ const blockResult = [0, 0, 0];
298
+ // Per-step solver state, keyed WEAKLY by joint. A module-global strong Map would retain every joint ever
299
+ // prepared for the lifetime of the module: removing a joint from a world drops the world's reference but not
300
+ // this one, and there is no deletion hook to forget, because a joint can leave a world without this module
301
+ // being told. Keying weakly makes the retention question disappear rather than answering it — the entry goes
302
+ // when the joint does, at every exit path, including ones nobody has written yet.
303
+ //
304
+ // A Map of arrays rather than fields on the joint, because the numbers each kind needs mean different things
305
+ // per kind, and a fixed block of untyped scratch on the public entity would make the header describe the
306
+ // solver's internals.
307
+ const jointSolveStates = new WeakMap();
308
+ //# sourceMappingURL=jointRows.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jointRows.js","sourceRoot":"","sources":["../src/jointRows.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,iCAAiC,EACjC,0BAA0B,EAC1B,6BAA6B,EAC7B,wBAAwB,EACxB,4BAA4B,EAC5B,iCAAiC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AAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACxD,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,KAAK,CAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACxD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3C,MAAM,WAAW,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACvC,MAAM,YAAY,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACxC,MAAM,WAAW,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAC9B,MAAM,WAAW,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAE9B,yGAAyG;AACzG,6GAA6G;AAC7G,2GAA2G;AAC3G,6GAA6G;AAC7G,kFAAkF;AAClF,EAAE;AACF,6GAA6G;AAC7G,yGAAyG;AACzG,sBAAsB;AACtB,MAAM,gBAAgB,GAAG,IAAI,OAAO,EAA4B,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { Physics3DJointSolver } from '@flighthq/types/contract';
2
+ export declare const Physics3DBallAndSocketJointKind = "BallAndSocket";
3
+ export declare const Physics3DConeTwistJointKind = "ConeTwist";
4
+ export declare const Physics3DFixedJointKind = "Fixed";
5
+ export declare const Physics3DGeneric6DofJointKind = "Generic6Dof";
6
+ export declare const Physics3DHingeJointKind = "Hinge";
7
+ export declare const Physics3DSliderJointKind = "Slider";
8
+ export declare const physics3DBallAndSocketJointSolver: Physics3DJointSolver;
9
+ export declare const physics3DFixedJointSolver: Physics3DJointSolver;
10
+ export declare const physics3DHingeJointSolver: Physics3DJointSolver;
11
+ export declare const physics3DConeTwistJointSolver: Physics3DJointSolver;
12
+ export declare const physics3DGeneric6DofJointSolver: Physics3DJointSolver;
13
+ export declare const physics3DSliderJointSolver: Physics3DJointSolver;
14
+ //# sourceMappingURL=joints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"joints.d.ts","sourceRoot":"","sources":["../src/joints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAMV,oBAAoB,EAGrB,MAAM,0BAA0B,CAAC;AAyClC,eAAO,MAAM,+BAA+B,kBAAkB,CAAC;AAC/D,eAAO,MAAM,2BAA2B,cAAc,CAAC;AACvD,eAAO,MAAM,uBAAuB,UAAU,CAAC;AAC/C,eAAO,MAAM,6BAA6B,gBAAgB,CAAC;AAC3D,eAAO,MAAM,uBAAuB,UAAU,CAAC;AAC/C,eAAO,MAAM,wBAAwB,WAAW,CAAC;AAIjD,eAAO,MAAM,iCAAiC,EAAE,oBAgC/C,CAAC;AAIF,eAAO,MAAM,yBAAyB,EAAE,oBA+CvC,CAAC;AAQF,eAAO,MAAM,yBAAyB,EAAE,oBA+MvC,CAAC;AAOF,eAAO,MAAM,6BAA6B,EAAE,oBAiK3C,CAAC;AAQF,eAAO,MAAM,+BAA+B,EAAE,oBA4K7C,CAAC;AAQF,eAAO,MAAM,0BAA0B,EAAE,oBA+KxC,CAAC"}