@flighthq/physics3d 0.4.0-edge.1908.751021c
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/dist/broadphase.d.ts +4 -0
- package/dist/broadphase.d.ts.map +1 -0
- package/dist/broadphase.js +158 -0
- package/dist/broadphase.js.map +1 -0
- package/dist/colliderCollision.d.ts +5 -0
- package/dist/colliderCollision.d.ts.map +1 -0
- package/dist/colliderCollision.js +55 -0
- package/dist/colliderCollision.js.map +1 -0
- package/dist/colliderTransform.d.ts +5 -0
- package/dist/colliderTransform.d.ts.map +1 -0
- package/dist/colliderTransform.js +424 -0
- package/dist/colliderTransform.js.map +1 -0
- package/dist/contactIntake.d.ts +5 -0
- package/dist/contactIntake.d.ts.map +1 -0
- package/dist/contactIntake.js +237 -0
- package/dist/contactIntake.js.map +1 -0
- package/dist/contacts.d.ts +4 -0
- package/dist/contacts.d.ts.map +1 -0
- package/dist/contacts.js +64 -0
- package/dist/contacts.js.map +1 -0
- package/dist/continuous.d.ts +5 -0
- package/dist/continuous.d.ts.map +1 -0
- package/dist/continuous.js +829 -0
- package/dist/continuous.js.map +1 -0
- package/dist/contract.d.ts +28 -0
- package/dist/contract.d.ts.map +1 -0
- package/dist/contract.js +28 -0
- package/dist/contract.js.map +1 -0
- package/dist/debugGeometry.d.ts +4 -0
- package/dist/debugGeometry.d.ts.map +1 -0
- package/dist/debugGeometry.js +333 -0
- package/dist/debugGeometry.js.map +1 -0
- package/dist/enablePhysics3DGuards.d.ts +4 -0
- package/dist/enablePhysics3DGuards.d.ts.map +1 -0
- package/dist/enablePhysics3DGuards.js +155 -0
- package/dist/enablePhysics3DGuards.js.map +1 -0
- package/dist/explainPhysics3DCollision.d.ts +3 -0
- package/dist/explainPhysics3DCollision.d.ts.map +1 -0
- package/dist/explainPhysics3DCollision.js +30 -0
- package/dist/explainPhysics3DCollision.js.map +1 -0
- package/dist/explainPhysics3DJoints.d.ts +3 -0
- package/dist/explainPhysics3DJoints.d.ts.map +1 -0
- package/dist/explainPhysics3DJoints.js +32 -0
- package/dist/explainPhysics3DJoints.js.map +1 -0
- package/dist/explainPhysics3DStep.d.ts +3 -0
- package/dist/explainPhysics3DStep.d.ts.map +1 -0
- package/dist/explainPhysics3DStep.js +51 -0
- package/dist/explainPhysics3DStep.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/integrate.d.ts +6 -0
- package/dist/integrate.d.ts.map +1 -0
- package/dist/integrate.js +184 -0
- package/dist/integrate.js.map +1 -0
- package/dist/islands.d.ts +6 -0
- package/dist/islands.d.ts.map +1 -0
- package/dist/islands.js +333 -0
- package/dist/islands.js.map +1 -0
- package/dist/jointBreakage.d.ts +5 -0
- package/dist/jointBreakage.d.ts.map +1 -0
- package/dist/jointBreakage.js +44 -0
- package/dist/jointBreakage.js.map +1 -0
- package/dist/jointCollisionSuppression.d.ts +4 -0
- package/dist/jointCollisionSuppression.d.ts.map +1 -0
- package/dist/jointCollisionSuppression.js +40 -0
- package/dist/jointCollisionSuppression.js.map +1 -0
- package/dist/jointFactories.d.ts +9 -0
- package/dist/jointFactories.d.ts.map +1 -0
- package/dist/jointFactories.js +159 -0
- package/dist/jointFactories.js.map +1 -0
- package/dist/jointMath.d.ts +17 -0
- package/dist/jointMath.d.ts.map +1 -0
- package/dist/jointMath.js +361 -0
- package/dist/jointMath.js.map +1 -0
- package/dist/jointReaction.d.ts +8 -0
- package/dist/jointReaction.d.ts.map +1 -0
- package/dist/jointReaction.js +65 -0
- package/dist/jointReaction.js.map +1 -0
- package/dist/jointRegistry.d.ts +8 -0
- package/dist/jointRegistry.d.ts.map +1 -0
- package/dist/jointRegistry.js +144 -0
- package/dist/jointRegistry.js.map +1 -0
- package/dist/jointRows.d.ts +33 -0
- package/dist/jointRows.d.ts.map +1 -0
- package/dist/jointRows.js +352 -0
- package/dist/jointRows.js.map +1 -0
- package/dist/joints.d.ts +16 -0
- package/dist/joints.d.ts.map +1 -0
- package/dist/joints.js +1060 -0
- package/dist/joints.js.map +1 -0
- package/dist/massProperties.d.ts +13 -0
- package/dist/massProperties.d.ts.map +1 -0
- package/dist/massProperties.js +462 -0
- package/dist/massProperties.js.map +1 -0
- package/dist/material.d.ts +3 -0
- package/dist/material.d.ts.map +1 -0
- package/dist/material.js +13 -0
- package/dist/material.js.map +1 -0
- package/dist/nodeSync.d.ts +3 -0
- package/dist/nodeSync.d.ts.map +1 -0
- package/dist/nodeSync.js +16 -0
- package/dist/nodeSync.js.map +1 -0
- package/dist/ownership.d.ts +8 -0
- package/dist/ownership.d.ts.map +1 -0
- package/dist/ownership.js +26 -0
- package/dist/ownership.js.map +1 -0
- package/dist/physics3DBroadphasePublication.d.ts +5 -0
- package/dist/physics3DBroadphasePublication.d.ts.map +1 -0
- package/dist/physics3DBroadphasePublication.js +49 -0
- package/dist/physics3DBroadphasePublication.js.map +1 -0
- package/dist/physics3DSpatialIndexingGuards.d.ts +4 -0
- package/dist/physics3DSpatialIndexingGuards.d.ts.map +1 -0
- package/dist/physics3DSpatialIndexingGuards.js +11 -0
- package/dist/physics3DSpatialIndexingGuards.js.map +1 -0
- package/dist/registerBuiltInPhysics3DJointSolvers.d.ts +3 -0
- package/dist/registerBuiltInPhysics3DJointSolvers.d.ts.map +1 -0
- package/dist/registerBuiltInPhysics3DJointSolvers.js +15 -0
- package/dist/registerBuiltInPhysics3DJointSolvers.js.map +1 -0
- package/dist/solver.d.ts +8 -0
- package/dist/solver.d.ts.map +1 -0
- package/dist/solver.js +460 -0
- package/dist/solver.js.map +1 -0
- package/dist/step.d.ts +5 -0
- package/dist/step.d.ts.map +1 -0
- package/dist/step.js +302 -0
- package/dist/step.js.map +1 -0
- package/dist/stepValidation.d.ts +13 -0
- package/dist/stepValidation.d.ts.map +1 -0
- package/dist/stepValidation.js +284 -0
- package/dist/stepValidation.js.map +1 -0
- package/dist/symmetricTensor.d.ts +11 -0
- package/dist/symmetricTensor.d.ts.map +1 -0
- package/dist/symmetricTensor.js +150 -0
- package/dist/symmetricTensor.js.map +1 -0
- package/dist/world.d.ts +27 -0
- package/dist/world.d.ts.map +1 -0
- package/dist/world.js +762 -0
- package/dist/world.js.map +1 -0
- package/dist/worldQueries.d.ts +11 -0
- package/dist/worldQueries.d.ts.map +1 -0
- package/dist/worldQueries.js +409 -0
- package/dist/worldQueries.js.map +1 -0
- package/package.json +55 -0
- package/src/broadphase.test.ts +265 -0
- package/src/colliderCollision.test.ts +57 -0
- package/src/colliderTransform.test.ts +221 -0
- package/src/contactIntake.test.ts +370 -0
- package/src/contacts.test.ts +64 -0
- package/src/continuous.test.ts +679 -0
- package/src/debugGeometry.test.ts +288 -0
- package/src/enablePhysics3DGuards.test.ts +206 -0
- package/src/explainPhysics3DCollision.test.ts +78 -0
- package/src/explainPhysics3DJoints.test.ts +101 -0
- package/src/explainPhysics3DStep.test.ts +142 -0
- package/src/integrate.test.ts +279 -0
- package/src/islands.test.ts +384 -0
- package/src/jointBreakage.test.ts +143 -0
- package/src/jointCollisionSuppression.test.ts +94 -0
- package/src/jointFactories.test.ts +244 -0
- package/src/jointMath.test.ts +646 -0
- package/src/jointReaction.test.ts +241 -0
- package/src/jointRegistry.test.ts +229 -0
- package/src/jointRows.test.ts +548 -0
- package/src/joints.test.ts +1066 -0
- package/src/massProperties.test.ts +611 -0
- package/src/material.test.ts +40 -0
- package/src/nodeSync.test.ts +50 -0
- package/src/ownership.test.ts +61 -0
- package/src/physics3DBroadphasePublication.test.ts +63 -0
- package/src/physics3DSpatialIndexingGuards.test.ts +43 -0
- package/src/registerBuiltInPhysics3DJointSolvers.test.ts +51 -0
- package/src/solver.test.ts +567 -0
- package/src/step.test.ts +490 -0
- package/src/stepValidation.test.ts +346 -0
- package/src/stress.test.ts +526 -0
- package/src/symmetricTensor.test.ts +166 -0
- package/src/world.test.ts +1127 -0
- package/src/worldQueries.test.ts +565 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { rebuildPhysics3DJointCollisionSuppressions } from './jointCollisionSuppression';
|
|
2
|
+
import { assertPhysics3DWorldNotStepping, physics3DJointOwners } from './ownership';
|
|
3
|
+
import { findPhysics3DBody, wakePhysics3DBody } from './world';
|
|
4
|
+
// Adds `joint` to `world` under the same canonical body ordering contacts use, exchanging its two ends when
|
|
5
|
+
// the caller supplied them the other way round.
|
|
6
|
+
//
|
|
7
|
+
// A joint is a constraint in the SAME sequential solve list as a contact, so it inherits the same
|
|
8
|
+
// obligation: each impulse lands on the velocities the previous one left, and an ordering that varied with
|
|
9
|
+
// construction history would make the result vary with it. Contacts get their order from the broadphase pair
|
|
10
|
+
// sort; joints have no broadphase, so it is enforced here, at the one place a joint enters a world.
|
|
11
|
+
export function addPhysics3DJoint(world, joint) {
|
|
12
|
+
assertPhysics3DWorldNotStepping(world);
|
|
13
|
+
if (physics3DJointOwners.has(joint) || world.joints.includes(joint)) {
|
|
14
|
+
throw new Error('Cannot add a physics joint that already belongs to a physics world');
|
|
15
|
+
}
|
|
16
|
+
// Canonicalize only when the kind can be consulted. A joint whose solver is not registered yet is
|
|
17
|
+
// explicitly supported — a scene deserialized ahead of the code that solves it — and exchanging its ends
|
|
18
|
+
// now would move the bodies, anchors, and frames while the kind's own direction-bearing fields stayed as
|
|
19
|
+
// authored: the generic half of a swap with the kind's half missing, which no later registration repairs.
|
|
20
|
+
// An unregistered joint constrains nothing, so its order does not matter until a solver exists, and
|
|
21
|
+
// `registerPhysics3DJointSolver` canonicalizes what is already in the world at that point.
|
|
22
|
+
const active = getPhysics3DJointSolver(world, joint.kind) !== null;
|
|
23
|
+
if (active)
|
|
24
|
+
canonicalizeJointEnds(world, joint);
|
|
25
|
+
world.joints.push(joint);
|
|
26
|
+
physics3DJointOwners.set(joint, world);
|
|
27
|
+
rebuildPhysics3DJointCollisionSuppressions(world);
|
|
28
|
+
// Adding an active constraint changes what both bodies may do THIS step. A sleeping pair would skip
|
|
29
|
+
// prepare and solve forever unless something unrelated happened to wake it.
|
|
30
|
+
if (active)
|
|
31
|
+
wakeJointBodies(world, joint);
|
|
32
|
+
return joint;
|
|
33
|
+
}
|
|
34
|
+
// The solver registered for `kind` on this world, or null when none is. A missing solver is an expected
|
|
35
|
+
// condition rather than an error: a scene deserialized with a joint kind the running build does not know
|
|
36
|
+
// about should import and simply not constrain, rather than refuse to load.
|
|
37
|
+
export function getPhysics3DJointSolver(world, kind) {
|
|
38
|
+
return world.jointSolvers.get(kind) ?? null;
|
|
39
|
+
}
|
|
40
|
+
// Discards solver-owned state after a stored joint's authored parameters change. Returns false when the
|
|
41
|
+
// world does not hold the joint.
|
|
42
|
+
//
|
|
43
|
+
// A cached impulse is an answer to the PREVIOUS constraint equation. Reapplying it after an anchor, frame,
|
|
44
|
+
// limit, or motor changes kicks both bodies before the new equation gets its first iteration — which reads
|
|
45
|
+
// as a joint that lurches when it is edited rather than as a stale cache. The kind clears whatever
|
|
46
|
+
// accumulators only it knows about; the common `impulse0..5` block is cleared here.
|
|
47
|
+
export function invalidatePhysics3DJoint(world, joint) {
|
|
48
|
+
assertPhysics3DWorldNotStepping(world);
|
|
49
|
+
if (physics3DJointOwners.get(joint) !== world || !world.joints.includes(joint))
|
|
50
|
+
return false;
|
|
51
|
+
getPhysics3DJointSolver(world, joint.kind)?.clearAccumulatedImpulses?.(joint);
|
|
52
|
+
joint.impulse0 = 0;
|
|
53
|
+
joint.impulse1 = 0;
|
|
54
|
+
joint.impulse2 = 0;
|
|
55
|
+
joint.impulse3 = 0;
|
|
56
|
+
joint.impulse4 = 0;
|
|
57
|
+
joint.impulse5 = 0;
|
|
58
|
+
rebuildPhysics3DJointCollisionSuppressions(world);
|
|
59
|
+
wakeJointBodies(world, joint);
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
// Whether the two bodies are in canonical order — `bodyA` before `bodyB` by persistent index.
|
|
63
|
+
//
|
|
64
|
+
// Ordered by INDEX rather than by anything geometric. Any order derived from coordinates flips the moment
|
|
65
|
+
// those coordinates cross, which would renumber a joint's ends mid-simulation and invalidate every
|
|
66
|
+
// accumulator keyed to them. Identity survives motion; position does not.
|
|
67
|
+
export function isPhysics3DPairOrdered(a, b) {
|
|
68
|
+
return a <= b;
|
|
69
|
+
}
|
|
70
|
+
// Registers `solver` for `kind` on this world. Last write wins, so a caller may replace a built-in with its
|
|
71
|
+
// own — collisions are avoided by the vendor-prefix convention (bare names reserved for built-ins) rather
|
|
72
|
+
// than by a guard that would make overriding impossible.
|
|
73
|
+
//
|
|
74
|
+
// Registration is per-world and explicit rather than a module-level table populated on import, so a bundle
|
|
75
|
+
// that never registers a joint never links one: six solvers are six blocks of constraint math, and a game
|
|
76
|
+
// using none of them should pay for none of them.
|
|
77
|
+
export function registerPhysics3DJointSolver(world, kind, solver) {
|
|
78
|
+
assertPhysics3DWorldNotStepping(world);
|
|
79
|
+
world.jointSolvers.set(kind, solver);
|
|
80
|
+
// Joints of this kind may already be in the world: `addPhysics3DJoint` deliberately leaves an
|
|
81
|
+
// unknown-kind joint in its authored order. This is where that deferred work happens, so the outcome no
|
|
82
|
+
// longer depends on whether the scene or the solver arrived first.
|
|
83
|
+
for (const joint of world.joints) {
|
|
84
|
+
if (joint.kind !== kind)
|
|
85
|
+
continue;
|
|
86
|
+
canonicalizeJointEnds(world, joint);
|
|
87
|
+
// Registration turns an inert descriptor into a live constraint, and re-registration may replace its
|
|
88
|
+
// equation outright. Both are the same topology change from a sleeping neighbour's point of view.
|
|
89
|
+
wakeJointBodies(world, joint);
|
|
90
|
+
}
|
|
91
|
+
rebuildPhysics3DJointCollisionSuppressions(world);
|
|
92
|
+
}
|
|
93
|
+
// Removes `joint` from `world`. Returns false when the world does not hold it.
|
|
94
|
+
export function removePhysics3DJoint(world, joint) {
|
|
95
|
+
assertPhysics3DWorldNotStepping(world);
|
|
96
|
+
const at = world.joints.indexOf(joint);
|
|
97
|
+
if (at < 0)
|
|
98
|
+
return false;
|
|
99
|
+
if (getPhysics3DJointSolver(world, joint.kind) !== null)
|
|
100
|
+
wakeJointBodies(world, joint);
|
|
101
|
+
world.joints.splice(at, 1);
|
|
102
|
+
physics3DJointOwners.delete(joint);
|
|
103
|
+
rebuildPhysics3DJointCollisionSuppressions(world);
|
|
104
|
+
return true;
|
|
105
|
+
}
|
|
106
|
+
// Exchanges `joint`'s ends when the pair is out of canonical order and the kind consents.
|
|
107
|
+
//
|
|
108
|
+
// The kind is asked only when a swap is actually pending, because `swapEnds` both vetoes AND transforms:
|
|
109
|
+
// calling it otherwise would apply a reversal to ends that never moved. What the generic half can move is
|
|
110
|
+
// only what every joint has — two body indices and two anchors. Anything a kind measures FROM bodyA TO
|
|
111
|
+
// bodyB, including its frames, reverses with them and is the kind's own to carry across.
|
|
112
|
+
function canonicalizeJointEnds(world, joint) {
|
|
113
|
+
const solver = getPhysics3DJointSolver(world, joint.kind);
|
|
114
|
+
if (solver?.usesBodyA === false)
|
|
115
|
+
return;
|
|
116
|
+
if (isPhysics3DPairOrdered(joint.bodyA, joint.bodyB))
|
|
117
|
+
return;
|
|
118
|
+
if (!(solver?.swapEnds?.(joint) ?? true))
|
|
119
|
+
return;
|
|
120
|
+
const bodyA = joint.bodyA;
|
|
121
|
+
joint.bodyA = joint.bodyB;
|
|
122
|
+
joint.bodyB = bodyA;
|
|
123
|
+
const anchorX = joint.localAnchorAX;
|
|
124
|
+
const anchorY = joint.localAnchorAY;
|
|
125
|
+
const anchorZ = joint.localAnchorAZ;
|
|
126
|
+
joint.localAnchorAX = joint.localAnchorBX;
|
|
127
|
+
joint.localAnchorAY = joint.localAnchorBY;
|
|
128
|
+
joint.localAnchorAZ = joint.localAnchorBZ;
|
|
129
|
+
joint.localAnchorBX = anchorX;
|
|
130
|
+
joint.localAnchorBY = anchorY;
|
|
131
|
+
joint.localAnchorBZ = anchorZ;
|
|
132
|
+
}
|
|
133
|
+
function wakeJointBodies(world, joint) {
|
|
134
|
+
const solver = getPhysics3DJointSolver(world, joint.kind);
|
|
135
|
+
if (solver === null)
|
|
136
|
+
return;
|
|
137
|
+
const bodyA = solver.usesBodyA === false ? null : findPhysics3DBody(world, joint.bodyA);
|
|
138
|
+
const bodyB = findPhysics3DBody(world, joint.bodyB);
|
|
139
|
+
if (bodyA !== null)
|
|
140
|
+
wakePhysics3DBody(bodyA);
|
|
141
|
+
if (bodyB !== null)
|
|
142
|
+
wakePhysics3DBody(bodyB);
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=jointRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jointRegistry.js","sourceRoot":"","sources":["../src/jointRegistry.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,0CAA0C,EAAE,MAAM,6BAA6B,CAAC;AACzF,OAAO,EAAE,+BAA+B,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE/D,4GAA4G;AAC5G,gDAAgD;AAChD,EAAE;AACF,kGAAkG;AAClG,2GAA2G;AAC3G,6GAA6G;AAC7G,oGAAoG;AACpG,MAAM,UAAU,iBAAiB,CAA2B,KAAqB,EAAE,KAAQ;IACzF,+BAA+B,CAAC,KAAK,CAAC,CAAC;IACvC,IAAI,oBAAoB,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACpE,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAC;IACxF,CAAC;IAED,kGAAkG;IAClG,yGAAyG;IACzG,yGAAyG;IACzG,0GAA0G;IAC1G,oGAAoG;IACpG,2FAA2F;IAC3F,MAAM,MAAM,GAAG,uBAAuB,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IACnE,IAAI,MAAM;QAAE,qBAAqB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAChD,KAAK,CAAC,MAAM,CAAC,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,eAAe,CAAC,KAA+B,EAAE,KAA+B;IACvF,MAAM,MAAM,GAAG,uBAAuB,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAC1D,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO;IAC5B,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACxF,MAAM,KAAK,GAAG,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACpD,IAAI,KAAK,KAAK,IAAI;QAAE,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC7C,IAAI,KAAK,KAAK,IAAI;QAAE,iBAAiB,CAAC,KAAK,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Physics3DJoint, Physics3DJointFrames, RigidBody3D } from '@flighthq/types/contract';
|
|
2
|
+
export declare const ROW_LENGTH = 9;
|
|
3
|
+
export declare const POINT_MASS = 0;
|
|
4
|
+
export declare const POINT_BIAS = 6;
|
|
5
|
+
export declare const POINT_LENGTH = 9;
|
|
6
|
+
export declare function applyRow(bodyA: RigidBody3D, bodyB: RigidBody3D, state: readonly number[], offset: number, impulse: number): void;
|
|
7
|
+
export declare function beginJointSolve(joint: Physics3DJoint, length: number): number[];
|
|
8
|
+
export declare function clearJointSolve(joint: Physics3DJoint): void;
|
|
9
|
+
export declare function getJointSolveState(joint: Readonly<Physics3DJoint>): number[] | undefined;
|
|
10
|
+
export declare function getRowMass(bodyA: Readonly<RigidBody3D>, bodyB: Readonly<RigidBody3D>, state: readonly number[], offset: number): number;
|
|
11
|
+
export declare function getRowVelocity(bodyA: Readonly<RigidBody3D>, bodyB: Readonly<RigidBody3D>, state: readonly number[], offset: number): number;
|
|
12
|
+
export declare function prepareAngularBlock(bodyA: Readonly<RigidBody3D>, bodyB: Readonly<RigidBody3D>, state: number[], massOffset: number, biasOffset: number, dt: number): void;
|
|
13
|
+
export declare function preparePointBlock(bodyA: Readonly<RigidBody3D>, bodyB: Readonly<RigidBody3D>, joint: Physics3DJoint, state: number[], dt: number): void;
|
|
14
|
+
export declare function readFrameBases(bodyA: Readonly<RigidBody3D>, bodyB: Readonly<RigidBody3D>, frames: Physics3DJointFrames): void;
|
|
15
|
+
export declare function readFrameRotations(bodyA: Readonly<RigidBody3D>, bodyB: Readonly<RigidBody3D>, frames: Physics3DJointFrames): void;
|
|
16
|
+
export declare function readJointImpulse(joint: Readonly<Physics3DJoint>, slot: number): number;
|
|
17
|
+
export declare function solveAngularBlock(bodyA: RigidBody3D, bodyB: RigidBody3D, joint: Physics3DJoint, state: readonly number[], massOffset: number, biasOffset: number): void;
|
|
18
|
+
export declare function solveEqualityRow(bodyA: RigidBody3D, bodyB: RigidBody3D, joint: Physics3DJoint, slot: number, state: readonly number[], offset: number, mass: number, error: number, biasFactor: number): void;
|
|
19
|
+
export declare function solveLowerLimitRow(bodyA: RigidBody3D, bodyB: RigidBody3D, state: number[], offset: number, mass: number, error: number, biasFactor: number, accumulatorSlot: number, gamma?: number): void;
|
|
20
|
+
export declare function solveMotorRow(bodyA: RigidBody3D, bodyB: RigidBody3D, state: readonly number[], offset: number, mass: number, speed: number, maxImpulse: number, previous: number): number;
|
|
21
|
+
export declare function solvePointBlock(bodyA: RigidBody3D, bodyB: RigidBody3D, joint: Physics3DJoint, state: readonly number[]): void;
|
|
22
|
+
export declare function solveUpperLimitRow(bodyA: RigidBody3D, bodyB: RigidBody3D, state: number[], offset: number, mass: number, error: number, biasFactor: number, accumulatorSlot: number, gamma?: number): void;
|
|
23
|
+
export declare function warmStartAngularBlock(bodyA: RigidBody3D, bodyB: RigidBody3D, joint: Readonly<Physics3DJoint>): void;
|
|
24
|
+
export declare function warmStartPointBlock(bodyA: RigidBody3D, bodyB: RigidBody3D, joint: Readonly<Physics3DJoint>): void;
|
|
25
|
+
export declare function writeAngularRow(state: number[], offset: number, axisX: number, axisY: number, axisZ: number): void;
|
|
26
|
+
export declare function writeJointImpulse(joint: Physics3DJoint, slot: number, value: number): void;
|
|
27
|
+
export declare function writePhysics3DSoftRowParameters(mass: number, frequencyHz: number, dampingRatio: number, dt: number, hardBiasFactor: number, out: number[]): void;
|
|
28
|
+
export declare function writeRow(state: number[], offset: number, directionX: number, directionY: number, directionZ: number, armAX: number, armAY: number, armAZ: number, armBX: number, armBY: number, armBZ: number): void;
|
|
29
|
+
export declare const frameABasis: number[];
|
|
30
|
+
export declare const frameBBasis: number[];
|
|
31
|
+
export declare const frameARotation: number[];
|
|
32
|
+
export declare const frameBRotation: number[];
|
|
33
|
+
//# sourceMappingURL=jointRows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jointRows.d.ts","sourceRoot":"","sources":["../src/jointRows.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAiClG,eAAO,MAAM,UAAU,IAAI,CAAC;AAI5B,eAAO,MAAM,UAAU,IAAI,CAAC;AAC5B,eAAO,MAAM,UAAU,IAAI,CAAC;AAC5B,eAAO,MAAM,YAAY,IAAI,CAAC;AAG9B,wBAAgB,QAAQ,CACtB,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GACd,IAAI,CAgBN;AAaD,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAc/E;AAMD,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAE3D;AAID,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,QAAQ,CAAC,cAAc,CAAC,GAAG,MAAM,EAAE,GAA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ACxD,eAAO,MAAM,WAAW,UAA+B,CAAC;AACxD,eAAO,MAAM,cAAc,UAAe,CAAC;AAC3C,eAAO,MAAM,cAAc,UAAe,CAAC"}
|
|
@@ -0,0 +1,352 @@
|
|
|
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
|
+
// `gamma` is the row's COMPLIANCE, zero for a hard stop. It multiplies the ACCUMULATED impulse rather
|
|
160
|
+
// than this iteration's, because a soft constraint is one that gives way in proportion to how hard it
|
|
161
|
+
// has already been pushing — a statement about the total, not the increment. The non-negative clamp
|
|
162
|
+
// survives softening untouched: a compliant stop still may only push back through the bound.
|
|
163
|
+
export function solveLowerLimitRow(bodyA, bodyB, state, offset, mass, error, biasFactor, accumulatorSlot, gamma = 0) {
|
|
164
|
+
const velocity = getRowVelocity(bodyA, bodyB, state, offset);
|
|
165
|
+
const previous = state[accumulatorSlot];
|
|
166
|
+
const total = Math.max(previous - mass * (velocity + error * biasFactor + gamma * previous), 0);
|
|
167
|
+
state[accumulatorSlot] = total;
|
|
168
|
+
applyRow(bodyA, bodyB, state, offset, total - previous);
|
|
169
|
+
}
|
|
170
|
+
// Drives a row's coordinate toward `speed`, spending at most `maxImpulse`, and returns the new accumulated
|
|
171
|
+
// motor impulse for the caller to store on its kind-specific field.
|
|
172
|
+
//
|
|
173
|
+
// Clamped on the ACCUMULATED impulse rather than per iteration, so the bound is a force or a torque. A
|
|
174
|
+
// per-iteration clamp would scale the motor's real strength with the iteration count, which presents as a
|
|
175
|
+
// motor that gets stronger when the solver is tuned for accuracy.
|
|
176
|
+
export function solveMotorRow(bodyA, bodyB, state, offset, mass, speed, maxImpulse, previous) {
|
|
177
|
+
const velocity = getRowVelocity(bodyA, bodyB, state, offset);
|
|
178
|
+
const total = Math.min(Math.max(previous - mass * (velocity - speed), -maxImpulse), maxImpulse);
|
|
179
|
+
applyRow(bodyA, bodyB, state, offset, total - previous);
|
|
180
|
+
return total;
|
|
181
|
+
}
|
|
182
|
+
// Solves the three point rows as one coupled block, accumulating into `impulse0` through `impulse2`.
|
|
183
|
+
//
|
|
184
|
+
// Coupled rather than solved axis by axis. Solving x, then y, then z lets each undo part of the previous
|
|
185
|
+
// correction, and a loaded joint visibly creeps — the 3D form of the same failure a 2D revolute shows when
|
|
186
|
+
// its two rows are separated.
|
|
187
|
+
export function solvePointBlock(bodyA, bodyB, joint, state) {
|
|
188
|
+
writePhysics3DJointAnchorVelocity(bodyA, bodyB, joint, blockVector);
|
|
189
|
+
readBlock(state, POINT_MASS, blockTensor);
|
|
190
|
+
applySymmetricTensor(blockTensor, blockVector[0] + state[POINT_BIAS], blockVector[1] + state[POINT_BIAS + 1], blockVector[2] + state[POINT_BIAS + 2], blockResult);
|
|
191
|
+
const impulseX = -blockResult[0];
|
|
192
|
+
const impulseY = -blockResult[1];
|
|
193
|
+
const impulseZ = -blockResult[2];
|
|
194
|
+
joint.impulse0 += impulseX;
|
|
195
|
+
joint.impulse1 += impulseY;
|
|
196
|
+
joint.impulse2 += impulseZ;
|
|
197
|
+
applyPhysics3DJointImpulse(bodyA, bodyB, joint.rAX, joint.rAY, joint.rAZ, joint.rBX, joint.rBY, joint.rBZ, impulseX, impulseY, impulseZ);
|
|
198
|
+
}
|
|
199
|
+
// Holds a row's coordinate at or below its upper bound. `error` is the SIGNED distance below the bound —
|
|
200
|
+
// positive inside the interval, negative once the bound has been crossed.
|
|
201
|
+
//
|
|
202
|
+
// The mirror of `solveLowerLimitRow`, reached by reading the row backwards: negating both the velocity and
|
|
203
|
+
// the applied impulse turns "at least" into "at most" without a second sign convention to keep straight.
|
|
204
|
+
export function solveUpperLimitRow(bodyA, bodyB, state, offset, mass, error, biasFactor, accumulatorSlot, gamma = 0) {
|
|
205
|
+
const velocity = -getRowVelocity(bodyA, bodyB, state, offset);
|
|
206
|
+
const previous = state[accumulatorSlot];
|
|
207
|
+
const total = Math.max(previous - mass * (velocity + error * biasFactor + gamma * previous), 0);
|
|
208
|
+
state[accumulatorSlot] = total;
|
|
209
|
+
applyRow(bodyA, bodyB, state, offset, -(total - previous));
|
|
210
|
+
}
|
|
211
|
+
// Reapplies the angular lock's accumulated impulse before iteration begins.
|
|
212
|
+
export function warmStartAngularBlock(bodyA, bodyB, joint) {
|
|
213
|
+
applyPhysics3DJointAngularImpulse(bodyA, bodyB, joint.impulse3, joint.impulse4, joint.impulse5);
|
|
214
|
+
}
|
|
215
|
+
// Reapplies the point constraint's accumulated impulse before iteration begins.
|
|
216
|
+
export function warmStartPointBlock(bodyA, bodyB, joint) {
|
|
217
|
+
applyPhysics3DJointImpulse(bodyA, bodyB, joint.rAX, joint.rAY, joint.rAZ, joint.rBX, joint.rBY, joint.rBZ, joint.impulse0, joint.impulse1, joint.impulse2);
|
|
218
|
+
}
|
|
219
|
+
// Writes a purely angular row: no linear impulse, both arms the axis it turns about. The row's coordinate is
|
|
220
|
+
// then the relative rotation angle about that axis.
|
|
221
|
+
export function writeAngularRow(state, offset, axisX, axisY, axisZ) {
|
|
222
|
+
writeRow(state, offset, 0, 0, 0, axisX, axisY, axisZ, axisX, axisY, axisZ);
|
|
223
|
+
}
|
|
224
|
+
// Writes one of the six common accumulators by index.
|
|
225
|
+
export function writeJointImpulse(joint, slot, value) {
|
|
226
|
+
switch (slot) {
|
|
227
|
+
case 0:
|
|
228
|
+
joint.impulse0 = value;
|
|
229
|
+
break;
|
|
230
|
+
case 1:
|
|
231
|
+
joint.impulse1 = value;
|
|
232
|
+
break;
|
|
233
|
+
case 2:
|
|
234
|
+
joint.impulse2 = value;
|
|
235
|
+
break;
|
|
236
|
+
case 3:
|
|
237
|
+
joint.impulse3 = value;
|
|
238
|
+
break;
|
|
239
|
+
case 4:
|
|
240
|
+
joint.impulse4 = value;
|
|
241
|
+
break;
|
|
242
|
+
default:
|
|
243
|
+
joint.impulse5 = value;
|
|
244
|
+
break;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
// Derives the three numbers a SOFT constraint row needs from the motion a caller described, writing
|
|
248
|
+
// `[mass, biasFactor, gamma]`.
|
|
249
|
+
//
|
|
250
|
+
// A frequency and a damping ratio describe the motion wanted; stiffness and damping are what the solver
|
|
251
|
+
// needs, and converting between them requires the mass being moved. Deriving them here, per-step and
|
|
252
|
+
// per-pair, is what makes a 2 Hz spring oscillate at 2 Hz whatever it is attached to — an authored
|
|
253
|
+
// stiffness would change frequency the moment either body's mass did.
|
|
254
|
+
//
|
|
255
|
+
// `biasFactor` is returned in the position a hard row's own bias factor occupies, so a row solves
|
|
256
|
+
// identically either way and the only difference between a stop and a spring is which three numbers it
|
|
257
|
+
// was handed.
|
|
258
|
+
//
|
|
259
|
+
// `hardBiasFactor` is what to fall back to when the spring cannot be computed, and it is a PARAMETER
|
|
260
|
+
// rather than a constant because the two callers legitimately disagree about it: a two-sided rest row
|
|
261
|
+
// corrects at `BAUMGARTE / dt`, while a one-sided limit row corrects fully at `1 / dt`. Baking either
|
|
262
|
+
// in would silently change the other's hard behaviour the first time it took this path.
|
|
263
|
+
//
|
|
264
|
+
// Compliance adds to the INVERSE mass, which is why the returned mass is not a scaled version of the
|
|
265
|
+
// input: softening makes a constraint easier to violate, and that is an addition on the reciprocal side.
|
|
266
|
+
// A non-positive frequency or timestep returns the HARD parameters, so "spring enabled with no
|
|
267
|
+
// frequency set" degrades to the stop it replaced rather than to a constraint that does nothing.
|
|
268
|
+
export function writePhysics3DSoftRowParameters(mass, frequencyHz, dampingRatio, dt, hardBiasFactor, out) {
|
|
269
|
+
if (!(frequencyHz > 0) || !(dt > 0)) {
|
|
270
|
+
out[0] = mass;
|
|
271
|
+
out[1] = hardBiasFactor;
|
|
272
|
+
out[2] = 0;
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
const angular = TAU * frequencyHz;
|
|
276
|
+
const damping = 2 * mass * dampingRatio * angular;
|
|
277
|
+
const stiffness = mass * angular * angular;
|
|
278
|
+
const gammaDenominator = dt * (damping + dt * stiffness);
|
|
279
|
+
const gamma = gammaDenominator > 0 ? 1 / gammaDenominator : 0;
|
|
280
|
+
const inverseMass = mass > 0 ? 1 / mass : 0;
|
|
281
|
+
const softened = inverseMass + gamma;
|
|
282
|
+
out[0] = softened > 0 ? 1 / softened : 0;
|
|
283
|
+
out[1] = dt * stiffness * gamma;
|
|
284
|
+
out[2] = gamma;
|
|
285
|
+
}
|
|
286
|
+
// Writes one constraint row into a joint's per-step state.
|
|
287
|
+
export function writeRow(state, offset, directionX, directionY, directionZ, armAX, armAY, armAZ, armBX, armBY, armBZ) {
|
|
288
|
+
state[offset] = directionX;
|
|
289
|
+
state[offset + 1] = directionY;
|
|
290
|
+
state[offset + 2] = directionZ;
|
|
291
|
+
state[offset + 3] = armAX;
|
|
292
|
+
state[offset + 4] = armAY;
|
|
293
|
+
state[offset + 5] = armAZ;
|
|
294
|
+
state[offset + 6] = armBX;
|
|
295
|
+
state[offset + 7] = armBY;
|
|
296
|
+
state[offset + 8] = armBZ;
|
|
297
|
+
}
|
|
298
|
+
// Establishes a frame pair's eight components for the same reason `beginJointSolve` establishes the impulse
|
|
299
|
+
// accumulators: a reconstructed joint satisfies the required type at compile time only, and an absent
|
|
300
|
+
// rotation would multiply through into both bodies as NaN. Four absent components give the identity, which is
|
|
301
|
+
// what an author who never set a frame meant.
|
|
302
|
+
function establishFrames(frames) {
|
|
303
|
+
frames.localRotationAX ??= 0;
|
|
304
|
+
frames.localRotationAY ??= 0;
|
|
305
|
+
frames.localRotationAZ ??= 0;
|
|
306
|
+
frames.localRotationAW ??= 1;
|
|
307
|
+
frames.localRotationBX ??= 0;
|
|
308
|
+
frames.localRotationBY ??= 0;
|
|
309
|
+
frames.localRotationBZ ??= 0;
|
|
310
|
+
frames.localRotationBW ??= 1;
|
|
311
|
+
}
|
|
312
|
+
function readBlock(state, offset, out) {
|
|
313
|
+
out[0] = state[offset];
|
|
314
|
+
out[1] = state[offset + 1];
|
|
315
|
+
out[2] = state[offset + 2];
|
|
316
|
+
out[3] = state[offset + 3];
|
|
317
|
+
out[4] = state[offset + 4];
|
|
318
|
+
out[5] = state[offset + 5];
|
|
319
|
+
}
|
|
320
|
+
function writeBlock(state, offset, source) {
|
|
321
|
+
state[offset] = source[0];
|
|
322
|
+
state[offset + 1] = source[1];
|
|
323
|
+
state[offset + 2] = source[2];
|
|
324
|
+
state[offset + 3] = source[3];
|
|
325
|
+
state[offset + 4] = source[4];
|
|
326
|
+
state[offset + 5] = source[5];
|
|
327
|
+
}
|
|
328
|
+
// The fraction of a joint's positional error corrected per step. Matches the contact solver's rationale:
|
|
329
|
+
// correcting all of it at once turns a deep error into an explosion.
|
|
330
|
+
const BAUMGARTE = 0.2;
|
|
331
|
+
const TAU = 2 * Math.PI;
|
|
332
|
+
// The world-space frames the prepare pass leaves for the kind that asked for them. Module scratch rather than
|
|
333
|
+
// per-joint state because they are consumed within one `prepare`, never across two.
|
|
334
|
+
export const frameABasis = new Array(9).fill(0);
|
|
335
|
+
export const frameBBasis = new Array(9).fill(0);
|
|
336
|
+
export const frameARotation = [0, 0, 0, 1];
|
|
337
|
+
export const frameBRotation = [0, 0, 0, 1];
|
|
338
|
+
const blockTensor = [0, 0, 0, 0, 0, 0];
|
|
339
|
+
const blockInverse = [0, 0, 0, 0, 0, 0];
|
|
340
|
+
const blockVector = [0, 0, 0];
|
|
341
|
+
const blockResult = [0, 0, 0];
|
|
342
|
+
// Per-step solver state, keyed WEAKLY by joint. A module-global strong Map would retain every joint ever
|
|
343
|
+
// prepared for the lifetime of the module: removing a joint from a world drops the world's reference but not
|
|
344
|
+
// this one, and there is no deletion hook to forget, because a joint can leave a world without this module
|
|
345
|
+
// being told. Keying weakly makes the retention question disappear rather than answering it — the entry goes
|
|
346
|
+
// when the joint does, at every exit path, including ones nobody has written yet.
|
|
347
|
+
//
|
|
348
|
+
// A Map of arrays rather than fields on the joint, because the numbers each kind needs mean different things
|
|
349
|
+
// per kind, and a fixed block of untyped scratch on the public entity would make the header describe the
|
|
350
|
+
// solver's internals.
|
|
351
|
+
const jointSolveStates = new WeakMap();
|
|
352
|
+
//# 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,EACjC,0BAA0B,EAC1B,8BAA8B,EAC9B,6BAA6B,EAC7B,gCAAgC,EAChC,4BAA4B,EAC5B,gCAAgC,EAChC,6BAA6B,GAC9B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAEjF,2GAA2G;AAC3G,6GAA6G;AAC7G,gFAAgF;AAChF,EAAE;AACF,2GAA2G;AAC3G,yDAAyD;AACzD,EAAE;AACF,2GAA2G;AAC3G,2GAA2G;AAC3G,0GAA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xB,8GAA8G;AAC9G,oFAAoF;AACpF,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,KAAK,CAAS,CAAC,CAAC,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"}
|
package/dist/joints.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Physics3DJointSolver } from '@flighthq/types/contract';
|
|
2
|
+
export declare const Physics3DBallAndSocketJointKind = "BallAndSocket";
|
|
3
|
+
export declare const Physics3DConeTwistJointKind = "ConeTwist";
|
|
4
|
+
export declare const Physics3DDistanceJointKind = "Distance";
|
|
5
|
+
export declare const Physics3DFixedJointKind = "Fixed";
|
|
6
|
+
export declare const Physics3DGeneric6DofJointKind = "Generic6Dof";
|
|
7
|
+
export declare const Physics3DHingeJointKind = "Hinge";
|
|
8
|
+
export declare const Physics3DSliderJointKind = "Slider";
|
|
9
|
+
export declare const physics3DBallAndSocketJointSolver: Physics3DJointSolver;
|
|
10
|
+
export declare const physics3DDistanceJointSolver: Physics3DJointSolver;
|
|
11
|
+
export declare const physics3DFixedJointSolver: Physics3DJointSolver;
|
|
12
|
+
export declare const physics3DHingeJointSolver: Physics3DJointSolver;
|
|
13
|
+
export declare const physics3DConeTwistJointSolver: Physics3DJointSolver;
|
|
14
|
+
export declare const physics3DGeneric6DofJointSolver: Physics3DJointSolver;
|
|
15
|
+
export declare const physics3DSliderJointSolver: Physics3DJointSolver;
|
|
16
|
+
//# 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,EAQV,oBAAoB,EAGrB,MAAM,0BAA0B,CAAC;AA4ClC,eAAO,MAAM,+BAA+B,kBAAkB,CAAC;AAC/D,eAAO,MAAM,2BAA2B,cAAc,CAAC;AACvD,eAAO,MAAM,0BAA0B,aAAa,CAAC;AACrD,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,oBA0C/C,CAAC;AAUF,eAAO,MAAM,4BAA4B,EAAE,oBAyK1C,CAAC;AAIF,eAAO,MAAM,yBAAyB,EAAE,oBAuDvC,CAAC;AAQF,eAAO,MAAM,yBAAyB,EAAE,oBA2OvC,CAAC;AAOF,eAAO,MAAM,6BAA6B,EAAE,oBAqN3C,CAAC;AAQF,eAAO,MAAM,+BAA+B,EAAE,oBAyN7C,CAAC;AAQF,eAAO,MAAM,0BAA0B,EAAE,oBA2MxC,CAAC"}
|