@flighthq/physics2d 0.3.0-next.1032.e2b99fc → 0.3.0-next.1162.e90e518

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.
@@ -1,4 +1,6 @@
1
1
  export * from './colliderTransform';
2
+ export * from './jointRegistry';
3
+ export * from './joints';
2
4
  export * from './massProperties';
3
5
  export * from './solver';
4
6
  export * from './step';
@@ -1 +1 @@
1
- {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
package/dist/contract.js CHANGED
@@ -1,4 +1,6 @@
1
1
  export * from './colliderTransform';
2
+ export * from './jointRegistry';
3
+ export * from './joints';
2
4
  export * from './massProperties';
3
5
  export * from './solver';
4
6
  export * from './step';
@@ -1 +1 @@
1
- {"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  export { createPhysics2DColliderWorldShape, updatePhysics2DColliderWorldShape, writePhysics2DColliderBounds, } from './colliderTransform';
2
+ export { Physics2DDistanceJointKind, Physics2DMouseJointKind, Physics2DRevoluteJointKind, Physics2DRopeJointKind, Physics2DWeldJointKind, physics2DDistanceJointSolver, physics2DMouseJointSolver, physics2DRevoluteJointSolver, physics2DRopeJointSolver, physics2DWeldJointSolver, } from './joints';
3
+ export { addPhysics2DJoint, getPhysics2DJointSolver, registerPhysics2DJointSolver, removePhysics2DJoint, } from './jointRegistry';
2
4
  export { computePhysics2DColliderMassData, updateRigidBody2DMassData } from './massProperties';
3
- export { applyPhysics2DImpulse, relativeNormalVelocity, solvePhysics2DContacts, warmStartPhysics2DContacts, } from './solver';
5
+ export { applyPhysics2DImpulse, relativeNormalVelocity, solvePhysics2DContacts, solvePhysics2DContactsOnce, warmStartPhysics2DContacts, } from './solver';
4
6
  export { stepPhysics2D } from './step';
5
7
  export { addPhysics2DBody, findPhysics2DBody, createPhysics2DCollider, createPhysics2DSolverConfig, createPhysics2DWorld, createRigidBody2D, isPhysics2DPairOrdered, removePhysics2DBody, } from './world';
6
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iCAAiC,EACjC,iCAAiC,EACjC,4BAA4B,GAC7B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gCAAgC,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,GAC3B,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,EACvB,2BAA2B,EAC3B,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iCAAiC,EACjC,iCAAiC,EACjC,4BAA4B,GAC7B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,EACtB,sBAAsB,EACtB,4BAA4B,EAC5B,yBAAyB,EACzB,4BAA4B,EAC5B,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,4BAA4B,EAC5B,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gCAAgC,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,EACvB,2BAA2B,EAC3B,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,SAAS,CAAC"}
package/dist/index.js CHANGED
@@ -1,6 +1,8 @@
1
1
  export { createPhysics2DColliderWorldShape, updatePhysics2DColliderWorldShape, writePhysics2DColliderBounds, } from './colliderTransform';
2
+ export { Physics2DDistanceJointKind, Physics2DMouseJointKind, Physics2DRevoluteJointKind, Physics2DRopeJointKind, Physics2DWeldJointKind, physics2DDistanceJointSolver, physics2DMouseJointSolver, physics2DRevoluteJointSolver, physics2DRopeJointSolver, physics2DWeldJointSolver, } from './joints';
3
+ export { addPhysics2DJoint, getPhysics2DJointSolver, registerPhysics2DJointSolver, removePhysics2DJoint, } from './jointRegistry';
2
4
  export { computePhysics2DColliderMassData, updateRigidBody2DMassData } from './massProperties';
3
- export { applyPhysics2DImpulse, relativeNormalVelocity, solvePhysics2DContacts, warmStartPhysics2DContacts, } from './solver';
5
+ export { applyPhysics2DImpulse, relativeNormalVelocity, solvePhysics2DContacts, solvePhysics2DContactsOnce, warmStartPhysics2DContacts, } from './solver';
4
6
  export { stepPhysics2D } from './step';
5
7
  export { addPhysics2DBody, findPhysics2DBody, createPhysics2DCollider, createPhysics2DSolverConfig, createPhysics2DWorld, createRigidBody2D, isPhysics2DPairOrdered, removePhysics2DBody, } from './world';
6
8
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iCAAiC,EACjC,iCAAiC,EACjC,4BAA4B,GAC7B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gCAAgC,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,GAC3B,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,EACvB,2BAA2B,EAC3B,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iCAAiC,EACjC,iCAAiC,EACjC,4BAA4B,GAC7B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,EACtB,sBAAsB,EACtB,4BAA4B,EAC5B,yBAAyB,EACzB,4BAA4B,EAC5B,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,4BAA4B,EAC5B,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gCAAgC,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,EACvB,2BAA2B,EAC3B,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,SAAS,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { Physics2DJoint, Physics2DJointKind, Physics2DJointSolver, Physics2DWorld } from '@flighthq/types/contract';
2
+ export declare function addPhysics2DJoint(world: Physics2DWorld, joint: Physics2DJoint): Physics2DJoint;
3
+ export declare function getPhysics2DJointSolver(world: Readonly<Physics2DWorld>, kind: Physics2DJointKind): Physics2DJointSolver | null;
4
+ export declare function registerPhysics2DJointSolver(world: Physics2DWorld, kind: Physics2DJointKind, solver: Physics2DJointSolver): void;
5
+ export declare function removePhysics2DJoint(world: Physics2DWorld, joint: Readonly<Physics2DJoint>): boolean;
6
+ //# sourceMappingURL=jointRegistry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jointRegistry.d.ts","sourceRoot":"","sources":["../src/jointRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACf,MAAM,0BAA0B,CAAC;AAalC,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,GAAG,cAAc,CAgB9F;AAKD,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,QAAQ,CAAC,cAAc,CAAC,EAC/B,IAAI,EAAE,kBAAkB,GACvB,oBAAoB,GAAG,IAAI,CAE7B;AASD,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,cAAc,EACrB,IAAI,EAAE,kBAAkB,EACxB,MAAM,EAAE,oBAAoB,GAC3B,IAAI,CAEN;AAGD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,QAAQ,CAAC,cAAc,CAAC,GAAG,OAAO,CAKpG"}
@@ -0,0 +1,52 @@
1
+ import { findPhysics2DBody, isPhysics2DPairOrdered } from './world';
2
+ // Adds `joint` to `world` under the same canonical body ordering contacts use, swapping its two ends when
3
+ // the caller supplied them the other way round.
4
+ //
5
+ // A joint is a constraint in the SAME sequential solve list as a contact, so it inherits the same
6
+ // obligation: each impulse lands on the velocities the previous one left, and an ordering that varied
7
+ // with construction history would make the result vary with it. Contacts get this from the broadphase
8
+ // pair sort; joints have no broadphase, so it is enforced here, at the one place a joint enters the
9
+ // world. The anchors and lever arms swap with the bodies — a joint whose ends were exchanged without its
10
+ // anchors would attach to the wrong points and hold the pair in a pose nobody asked for.
11
+ export function addPhysics2DJoint(world, joint) {
12
+ const first = findPhysics2DBody(world, joint.bodyA);
13
+ const second = findPhysics2DBody(world, joint.bodyB);
14
+ if (first !== null && second !== null && !isPhysics2DPairOrdered(first, second)) {
15
+ const bodyA = joint.bodyA;
16
+ joint.bodyA = joint.bodyB;
17
+ joint.bodyB = bodyA;
18
+ const anchorX = joint.localAnchorAX;
19
+ const anchorY = joint.localAnchorAY;
20
+ joint.localAnchorAX = joint.localAnchorBX;
21
+ joint.localAnchorAY = joint.localAnchorBY;
22
+ joint.localAnchorBX = anchorX;
23
+ joint.localAnchorBY = anchorY;
24
+ }
25
+ world.joints.push(joint);
26
+ return joint;
27
+ }
28
+ // The solver registered for `kind`, or null when none is. A missing solver is an expected condition, not
29
+ // an error: a scene deserialized with a joint kind the running build does not know about should import
30
+ // and simply not constrain, rather than refuse to load.
31
+ export function getPhysics2DJointSolver(world, kind) {
32
+ return world.jointSolvers.get(kind) ?? null;
33
+ }
34
+ // Registers `solver` for `kind` on this world. Last write wins, so a caller may replace a built-in with
35
+ // its own — collisions are avoided by the vendor-prefix convention (bare names reserved for built-ins),
36
+ // not by a guard that would make overriding impossible.
37
+ //
38
+ // Registration is per-world and explicit rather than a module-level table populated on import, so a
39
+ // bundle that never registers a joint never links one: nine solvers are nine chunks of constraint math,
40
+ // and a game using none of them should pay for none of them.
41
+ export function registerPhysics2DJointSolver(world, kind, solver) {
42
+ world.jointSolvers.set(kind, solver);
43
+ }
44
+ // Removes `joint` from `world`. Returns false when the world does not hold it.
45
+ export function removePhysics2DJoint(world, joint) {
46
+ const at = world.joints.indexOf(joint);
47
+ if (at < 0)
48
+ return false;
49
+ world.joints.splice(at, 1);
50
+ return true;
51
+ }
52
+ //# sourceMappingURL=jointRegistry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jointRegistry.js","sourceRoot":"","sources":["../src/jointRegistry.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEpE,0GAA0G;AAC1G,gDAAgD;AAChD,EAAE;AACF,kGAAkG;AAClG,sGAAsG;AACtG,sGAAsG;AACtG,oGAAoG;AACpG,yGAAyG;AACzG,yFAAyF;AACzF,MAAM,UAAU,iBAAiB,CAAC,KAAqB,EAAE,KAAqB;IAC5E,MAAM,KAAK,GAAG,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,MAAM,GAAG,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACrD,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,KAAK,IAAI,IAAI,C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,CAAC;IACzB,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAC3B,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,27 @@
1
+ import type { Physics2DJoint, Physics2DWorld } from '@flighthq/types/contract';
2
+ export declare const Physics2DDistanceJointKind = "Distance";
3
+ export declare const Physics2DMouseJointKind = "Mouse";
4
+ export declare const Physics2DRevoluteJointKind = "Revolute";
5
+ export declare const Physics2DRopeJointKind = "Rope";
6
+ export declare const Physics2DWeldJointKind = "Weld";
7
+ export declare const physics2DDistanceJointSolver: {
8
+ prepare(world: Physics2DWorld, joint: Physics2DJoint, dt: number): void;
9
+ solve(world: Physics2DWorld, joint: Physics2DJoint): void;
10
+ };
11
+ export declare const physics2DMouseJointSolver: {
12
+ prepare(world: Physics2DWorld, joint: Physics2DJoint, dt: number): void;
13
+ solve(world: Physics2DWorld, joint: Physics2DJoint): void;
14
+ };
15
+ export declare const physics2DRevoluteJointSolver: {
16
+ prepare(world: Physics2DWorld, joint: Physics2DJoint, dt: number): void;
17
+ solve(world: Physics2DWorld, joint: Physics2DJoint): void;
18
+ };
19
+ export declare const physics2DRopeJointSolver: {
20
+ prepare(world: Physics2DWorld, joint: Physics2DJoint, dt: number): void;
21
+ solve(world: Physics2DWorld, joint: Physics2DJoint): void;
22
+ };
23
+ export declare const physics2DWeldJointSolver: {
24
+ prepare(world: Physics2DWorld, joint: Physics2DJoint, dt: number): void;
25
+ solve(world: Physics2DWorld, joint: Physics2DJoint): void;
26
+ };
27
+ //# 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,EAEV,cAAc,EAId,cAAc,EAEf,MAAM,0BAA0B,CAAC;AAMlC,eAAO,MAAM,0BAA0B,aAAa,CAAC;AACrD,eAAO,MAAM,uBAAuB,UAAU,CAAC;AAC/C,eAAO,MAAM,0BAA0B,aAAa,CAAC;AACrD,eAAO,MAAM,sBAAsB,SAAS,CAAC;AAC7C,eAAO,MAAM,sBAAsB,SAAS,CAAC;AAQ7C,eAAO,MAAM,4BAA4B;mBACxB,cAAc,SAAS,cAAc,MAAM,MAAM,GAAG,IAAI;iBA8C1D,cAAc,SAAS,cAAc,GAAG,IAAI;CAa1D,CAAC;AAOF,eAAO,MAAM,yBAAyB;mBACrB,cAAc,SAAS,cAAc,MAAM,MAAM,GAAG,IAAI;iBAoB1D,cAAc,SAAS,cAAc,GAAG,IAAI;CAqC1D,CAAC;AAOF,eAAO,MAAM,4BAA4B;mBACxB,cAAc,SAAS,cAAc,MAAM,MAAM,GAAG,IAAI;iBAU1D,cAAc,SAAS,cAAc,GAAG,IAAI;CAQ1D,CAAC;AAMF,eAAO,MAAM,wBAAwB;mBACpB,cAAc,SAAS,cAAc,MAAM,MAAM,GAAG,IAAI;iBA2B1D,cAAc,SAAS,cAAc,GAAG,IAAI;CAe1D,CAAC;AAOF,eAAO,MAAM,wBAAwB;mBACpB,cAAc,SAAS,cAAc,MAAM,MAAM,GAAG,IAAI;iBAmB1D,cAAc,SAAS,cAAc,GAAG,IAAI;CAe1D,CAAC"}
package/dist/joints.js ADDED
@@ -0,0 +1,314 @@
1
+ import { applyPhysics2DImpulse } from './solver';
2
+ import { findPhysics2DBody } from './world';
3
+ // The built-in joint kinds. Bare names are reserved for these; a user's own joint takes a vendor prefix.
4
+ export const Physics2DDistanceJointKind = 'Distance';
5
+ export const Physics2DMouseJointKind = 'Mouse';
6
+ export const Physics2DRevoluteJointKind = 'Revolute';
7
+ export const Physics2DRopeJointKind = 'Rope';
8
+ export const Physics2DWeldJointKind = 'Weld';
9
+ // Holds two anchors a fixed distance apart, rigidly or as a damped spring.
10
+ //
11
+ // One scalar constraint along the axis between the anchors. Softness enters as a modified effective mass
12
+ // plus a position bias rather than as a separate force: solving a spring as a constraint keeps it stable
13
+ // at any stiffness, where adding a spring FORCE explodes once the stiffness times the timestep exceeds
14
+ // what the integrator can follow.
15
+ export const physics2DDistanceJointSolver = {
16
+ prepare(world, joint, dt) {
17
+ const distance = joint;
18
+ const bodyA = findPhysics2DBody(world, joint.bodyA);
19
+ const bodyB = findPhysics2DBody(world, joint.bodyB);
20
+ if (bodyA === null || bodyB === null)
21
+ return;
22
+ writeJointAnchors(bodyA, bodyB, joint);
23
+ const axisX = bodyB.x + joint.rBX - (bodyA.x + joint.rAX);
24
+ const axisY = bodyB.y + joint.rBY - (bodyA.y + joint.rAY);
25
+ const length = Math.sqrt(axisX * axisX + axisY * axisY);
26
+ if (length > EPSILON) {
27
+ axisScratch[0] = axisX / length;
28
+ axisScratch[1] = axisY / length;
29
+ }
30
+ else {
31
+ // Coincident anchors leave the axis undefined. Any unit vector is as correct as another and none is
32
+ // wrong for one step, where dividing by the length would seed NaN into both bodies permanently.
33
+ axisScratch[0] = 1;
34
+ axisScratch[1] = 0;
35
+ }
36
+ const mass = axisEffectiveMass(bodyA, bodyB, joint, axisScratch[0], axisScratch[1]);
37
+ const separation = length - distance.length;
38
+ if (distance.stiffness > 0) {
39
+ const angular = 2 * Math.PI * distance.stiffness;
40
+ const damp = 2 * mass * distance.damping * angular;
41
+ const spring = mass * angular * angular;
42
+ const gamma = dt * (damp + dt * spring);
43
+ jointScratch[2] = gamma > 0 ? 1 / gamma : 0;
44
+ jointScratch[1] = separation * dt * spring * jointScratch[2];
45
+ const softMass = mass + jointScratch[2];
46
+ jointScratch[0] = softMass > 0 ? 1 / softMass : 0;
47
+ }
48
+ else {
49
+ jointScratch[0] = mass > 0 ? 1 / mass : 0;
50
+ jointScratch[1] = separation * (BAUMGARTE / dt);
51
+ jointScratch[2] = 0;
52
+ }
53
+ distance.rAX = joint.rAX;
54
+ jointStateScratch.set(distance, [
55
+ jointScratch[0],
56
+ jointScratch[1],
57
+ jointScratch[2],
58
+ axisScratch[0],
59
+ axisScratch[1],
60
+ ]);
61
+ },
62
+ solve(world, joint) {
63
+ const state = jointStateScratch.get(joint);
64
+ if (state === undefined)
65
+ return;
66
+ const bodyA = findPhysics2DBody(world, joint.bodyA);
67
+ const bodyB = findPhysics2DBody(world, joint.bodyB);
68
+ if (bodyA === null || bodyB === null)
69
+ return;
70
+ const [effectiveMass, bias, gamma, axisX, axisY] = state;
71
+ const velocity = axisRelativeVelocity(bodyA, bodyB, joint, axisX, axisY);
72
+ const lambda = -effectiveMass * (velocity + bias + gamma * joint.impulse0);
73
+ joint.impulse0 += lambda;
74
+ applyPhysics2DImpulse(bodyA, bodyB, joint.rAX, joint.rAY, joint.rBX, joint.rBY, -lambda * axisX, -lambda * axisY);
75
+ },
76
+ };
77
+ // Drags one body toward a moving world-space target with bounded force.
78
+ //
79
+ // Always soft, and that is not a tuning choice: a rigid drag lets a user inject unbounded energy simply by
80
+ // moving the cursor faster than the simulation can follow, and the rest of the world absorbs it. The force
81
+ // bound is what keeps a dragged body from tunnelling through a wall it is pulled into.
82
+ export const physics2DMouseJointSolver = {
83
+ prepare(world, joint, dt) {
84
+ const mouse = joint;
85
+ const bodyB = findPhysics2DBody(world, joint.bodyB);
86
+ if (bodyB === null)
87
+ return;
88
+ const cos = Math.cos(bodyB.angle);
89
+ const sin = Math.sin(bodyB.angle);
90
+ joint.rBX = joint.localAnchorBX * cos - joint.localAnchorBY * sin;
91
+ joint.rBY = joint.localAnchorBX * sin + joint.localAnchorBY * cos;
92
+ joint.rAX = 0;
93
+ joint.rAY = 0;
94
+ const angular = 2 * Math.PI * (mouse.stiffness > 0 ? mouse.stiffness : 5);
95
+ const damp = 2 * mouse.damping * angular;
96
+ const spring = angular * angular;
97
+ const gamma = dt * (damp + dt * spring);
98
+ const inverseGamma = gamma > 0 ? 1 / gamma : 0;
99
+ const biasFactor = dt * spring * inverseGamma;
100
+ jointStateScratch.set(mouse, [inverseGamma, biasFactor, 0, 0, 0]);
101
+ },
102
+ solve(world, joint) {
103
+ const mouse = joint;
104
+ const state = jointStateScratch.get(joint);
105
+ if (state === undefined)
106
+ return;
107
+ const bodyB = findPhysics2DBody(world, joint.bodyB);
108
+ if (bodyB === null)
109
+ return;
110
+ const [inverseGamma, biasFactor] = state;
111
+ const anchorX = bodyB.x + joint.rBX;
112
+ const anchorY = bodyB.y + joint.rBY;
113
+ const errorX = anchorX - mouse.targetX;
114
+ const errorY = anchorY - mouse.targetY;
115
+ const velocityX = bodyB.velocityX - bodyB.angularVelocity * joint.rBY;
116
+ const velocityY = bodyB.velocityY + bodyB.angularVelocity * joint.rBX;
117
+ const mass = bodyB.inverseMass > 0 ? 1 / bodyB.inverseMass : 0;
118
+ let impulseX = -mass * (velocityX + biasFactor * errorX + inverseGamma * joint.impulse0);
119
+ let impulseY = -mass * (velocityY + biasFactor * errorY + inverseGamma * joint.impulse1);
120
+ const previousX = joint.impulse0;
121
+ const previousY = joint.impulse1;
122
+ joint.impulse0 += impulseX;
123
+ joint.impulse1 += impulseY;
124
+ // Clamped on the ACCUMULATED impulse, so a later iteration can correct an earlier overshoot while the
125
+ // total force stays inside the bound.
126
+ const magnitude = Math.sqrt(joint.impulse0 * joint.impulse0 + joint.impulse1 * joint.impulse1);
127
+ if (magnitude > mouse.maxForce && magnitude > 0) {
128
+ const scale = mouse.maxForce / magnitude;
129
+ joint.impulse0 *= scale;
130
+ joint.impulse1 *= scale;
131
+ }
132
+ impulseX = joint.impulse0 - previousX;
133
+ impulseY = joint.impulse1 - previousY;
134
+ bodyB.velocityX += impulseX * bodyB.inverseMass;
135
+ bodyB.velocityY += impulseY * bodyB.inverseMass;
136
+ bodyB.angularVelocity += bodyB.inverseInertia * (joint.rBX * impulseY - joint.rBY * impulseX);
137
+ },
138
+ };
139
+ // Pins two bodies at a point, leaving rotation free — a hinge.
140
+ //
141
+ // Two scalar constraints, one per axis of the shared point, solved as a coupled pair rather than
142
+ // independently: solving x then y lets each undo part of the other's correction, and a hinge under load
143
+ // visibly creeps.
144
+ export const physics2DRevoluteJointSolver = {
145
+ prepare(world, joint, dt) {
146
+ const bodyA = findPhysics2DBody(world, joint.bodyA);
147
+ const bodyB = findPhysics2DBody(world, joint.bodyB);
148
+ if (bodyA === null || bodyB === null)
149
+ return;
150
+ writeJointAnchors(bodyA, bodyB, joint);
151
+ const errorX = bodyB.x + joint.rBX - (bodyA.x + joint.rAX);
152
+ const errorY = bodyB.y + joint.rBY - (bodyA.y + joint.rAY);
153
+ jointStateScratch.set(joint, [errorX * (BAUMGARTE / dt), errorY * (BAUMGARTE / dt), 0, 0, 0]);
154
+ },
155
+ solve(world, joint) {
156
+ const state = jointStateScratch.get(joint);
157
+ if (state === undefined)
158
+ return;
159
+ const bodyA = findPhysics2DBody(world, joint.bodyA);
160
+ const bodyB = findPhysics2DBody(world, joint.bodyB);
161
+ if (bodyA === null || bodyB === null)
162
+ return;
163
+ solvePointConstraint(bodyA, bodyB, joint, state[0], state[1]);
164
+ },
165
+ };
166
+ // An inequality constraint that acts only at full extension. Slack within `maxLength`, caught at it.
167
+ //
168
+ // The non-negative clamp on the accumulated impulse is what makes it a rope rather than a stiff bar: a
169
+ // rope may pull the bodies together and may never push them apart.
170
+ export const physics2DRopeJointSolver = {
171
+ prepare(world, joint, dt) {
172
+ const rope = joint;
173
+ const bodyA = findPhysics2DBody(world, joint.bodyA);
174
+ const bodyB = findPhysics2DBody(world, joint.bodyB);
175
+ if (bodyA === null || bodyB === null)
176
+ return;
177
+ writeJointAnchors(bodyA, bodyB, joint);
178
+ const axisX = bodyB.x + joint.rBX - (bodyA.x + joint.rAX);
179
+ const axisY = bodyB.y + joint.rBY - (bodyA.y + joint.rAY);
180
+ const length = Math.sqrt(axisX * axisX + axisY * axisY);
181
+ const unitX = length > EPSILON ? axisX / length : 1;
182
+ const unitY = length > EPSILON ? axisY / length : 0;
183
+ const mass = axisEffectiveMass(bodyA, bodyB, joint, unitX, unitY);
184
+ const excess = length - rope.maxLength;
185
+ // Slack: no constraint at all this step, which is what a rope IS. Marked by a zero effective mass so
186
+ // the iterations skip it without a second flag to keep in sync.
187
+ const active = excess > 0;
188
+ jointStateScratch.set(rope, [
189
+ active && mass > 0 ? 1 / mass : 0,
190
+ active ? excess * (BAUMGARTE / dt) : 0,
191
+ 0,
192
+ unitX,
193
+ unitY,
194
+ ]);
195
+ if (!active)
196
+ joint.impulse0 = 0;
197
+ },
198
+ solve(world, joint) {
199
+ const state = jointStateScratch.get(joint);
200
+ if (state === undefined || state[0] === 0)
201
+ return;
202
+ const bodyA = findPhysics2DBody(world, joint.bodyA);
203
+ const bodyB = findPhysics2DBody(world, joint.bodyB);
204
+ if (bodyA === null || bodyB === null)
205
+ return;
206
+ const [effectiveMass, bias, , axisX, axisY] = state;
207
+ const velocity = axisRelativeVelocity(bodyA, bodyB, joint, axisX, axisY);
208
+ let lambda = -effectiveMass * (velocity + bias);
209
+ const previous = joint.impulse0;
210
+ joint.impulse0 = Math.min(0, previous + lambda);
211
+ lambda = joint.impulse0 - previous;
212
+ applyPhysics2DImpulse(bodyA, bodyB, joint.rAX, joint.rAY, joint.rBX, joint.rBY, -lambda * axisX, -lambda * axisY);
213
+ },
214
+ };
215
+ // Pins the anchors together and locks the relative angle — rigid attachment.
216
+ //
217
+ // The point constraint plus one angular constraint. It is solved rather than exact, so it flexes under
218
+ // enough load; a truly rigid attachment is one body with two colliders, and the difference is that a weld
219
+ // can be broken at runtime.
220
+ export const physics2DWeldJointSolver = {
221
+ prepare(world, joint, dt) {
222
+ const weld = joint;
223
+ const bodyA = findPhysics2DBody(world, joint.bodyA);
224
+ const bodyB = findPhysics2DBody(world, joint.bodyB);
225
+ if (bodyA === null || bodyB === null)
226
+ return;
227
+ writeJointAnchors(bodyA, bodyB, joint);
228
+ const errorX = bodyB.x + joint.rBX - (bodyA.x + joint.rAX);
229
+ const errorY = bodyB.y + joint.rBY - (bodyA.y + joint.rAY);
230
+ const angleError = bodyB.angle - bodyA.angle - weld.referenceAngle;
231
+ const angularMass = bodyA.inverseInertia + bodyB.inverseInertia;
232
+ jointStateScratch.set(weld, [
233
+ errorX * (BAUMGARTE / dt),
234
+ errorY * (BAUMGARTE / dt),
235
+ angleError * (BAUMGARTE / dt),
236
+ angularMass > 0 ? 1 / angularMass : 0,
237
+ 0,
238
+ ]);
239
+ },
240
+ solve(world, joint) {
241
+ const state = jointStateScratch.get(joint);
242
+ if (state === undefined)
243
+ return;
244
+ const bodyA = findPhysics2DBody(world, joint.bodyA);
245
+ const bodyB = findPhysics2DBody(world, joint.bodyB);
246
+ if (bodyA === null || bodyB === null)
247
+ return;
248
+ const angularVelocity = bodyB.angularVelocity - bodyA.angularVelocity;
249
+ const angularLambda = -state[3] * (angularVelocity + state[2]);
250
+ joint.impulse2 += angularLambda;
251
+ bodyA.angularVelocity -= bodyA.inverseInertia * angularLambda;
252
+ bodyB.angularVelocity += bodyB.inverseInertia * angularLambda;
253
+ solvePointConstraint(bodyA, bodyB, joint, state[0], state[1]);
254
+ },
255
+ };
256
+ // The shared two-axis point solve behind revolute and weld. Each axis is solved against the velocities the
257
+ // other just left, which is the sequential-impulse property doing its job within one constraint.
258
+ function solvePointConstraint(bodyA, bodyB, joint, biasX, biasY) {
259
+ const massX = axisEffectiveMass(bodyA, bodyB, joint, 1, 0);
260
+ const velocityX = axisRelativeVelocity(bodyA, bodyB, joint, 1, 0);
261
+ const lambdaX = massX > 0 ? -(velocityX + biasX) / massX : 0;
262
+ joint.impulse0 += lambdaX;
263
+ applyPhysics2DImpulse(bodyA, bodyB, joint.rAX, joint.rAY, joint.rBX, joint.rBY, -lambdaX, 0);
264
+ const massY = axisEffectiveMass(bodyA, bodyB, joint, 0, 1);
265
+ const velocityY = axisRelativeVelocity(bodyA, bodyB, joint, 0, 1);
266
+ const lambdaY = massY > 0 ? -(velocityY + biasY) / massY : 0;
267
+ joint.impulse1 += lambdaY;
268
+ applyPhysics2DImpulse(bodyA, bodyB, joint.rAX, joint.rAY, joint.rBX, joint.rBY, 0, -lambdaY);
269
+ }
270
+ // Rotates each body's local anchor into world space, relative to that body's centre of mass — the lever
271
+ // arm every joint impulse acts through.
272
+ function writeJointAnchors(bodyA, bodyB, joint) {
273
+ const cosA = Math.cos(bodyA.angle);
274
+ const sinA = Math.sin(bodyA.angle);
275
+ const cosB = Math.cos(bodyB.angle);
276
+ const sinB = Math.sin(bodyB.angle);
277
+ joint.rAX = (joint.localAnchorAX - bodyA.centerX) * cosA - (joint.localAnchorAY - bodyA.centerY) * sinA;
278
+ joint.rAY = (joint.localAnchorAX - bodyA.centerX) * sinA + (joint.localAnchorAY - bodyA.centerY) * cosA;
279
+ joint.rBX = (joint.localAnchorBX - bodyB.centerX) * cosB - (joint.localAnchorBY - bodyB.centerY) * sinB;
280
+ joint.rBY = (joint.localAnchorBX - bodyB.centerX) * sinB + (joint.localAnchorBY - bodyB.centerY) * cosB;
281
+ }
282
+ // The pair's inverse effective mass along `axis` at the joint anchors — the same quantity a contact
283
+ // constraint uses, over the joint's lever arms instead of a contact point's.
284
+ function axisEffectiveMass(bodyA, bodyB, joint, axisX, axisY) {
285
+ const crossA = joint.rAX * axisY - joint.rAY * axisX;
286
+ const crossB = joint.rBX * axisY - joint.rBY * axisX;
287
+ return (bodyA.inverseMass +
288
+ bodyB.inverseMass +
289
+ bodyA.inverseInertia * crossA * crossA +
290
+ bodyB.inverseInertia * crossB * crossB);
291
+ }
292
+ function axisRelativeVelocity(bodyA, bodyB, joint, axisX, axisY) {
293
+ const vax = bodyA.velocityX - bodyA.angularVelocity * joint.rAY;
294
+ const vay = bodyA.velocityY + bodyA.angularVelocity * joint.rAX;
295
+ const vbx = bodyB.velocityX - bodyB.angularVelocity * joint.rBY;
296
+ const vby = bodyB.velocityY + bodyB.angularVelocity * joint.rBX;
297
+ // B relative to A, the same sense as the positional error the bias is built from, so a positive value
298
+ // means the pair is separating along this axis. The contact solver measures the OPPOSITE sense, because
299
+ // its normal points the other way. Mixing the two is not a sign slip that shows up as a small error: the
300
+ // correction then adds to the violation instead of cancelling it, every iteration compounds it, and the
301
+ // bodies leave the world within one step.
302
+ return (vbx - vax) * axisX + (vby - vay) * axisY;
303
+ }
304
+ // Per-step solver state, keyed by joint. A Map rather than fields on the joint because the five numbers
305
+ // each solver needs mean different things per kind, and putting a fixed block of untyped scratch on the
306
+ // public entity would make the header describe the solver's internals.
307
+ const jointStateScratch = new Map();
308
+ const axisScratch = [0, 0];
309
+ const jointScratch = [0, 0, 0];
310
+ const EPSILON = 1e-9;
311
+ // The fraction of a joint's positional error corrected per step. Matches the contact solver's rationale:
312
+ // correcting all of it at once turns a deep error into an explosion.
313
+ const BAUMGARTE = 0.2;
314
+ //# sourceMappingURL=joints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"joints.js","sourceRoot":"","sources":["../src/joints.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,yGAAyG;AACzG,MAAM,CAAC,MAAM,0BAA0B,GAAG,UAAU,CAAC;AACrD,MAAM,CAAC,MAAM,uBAAuB,GAAG,OAAO,CAAC;AAC/C,MAAM,CAAC,MAAM,0BAA0B,GAAG,UAAU,CAAC;AACrD,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC;AAC7C,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC;AAE7C,2EAA2E;AAC3E,EAAE;AACF,yGAAyG;AACzG,yGAAyG;AACzG,uGAAuG;AACvG,kCAAkC;AAClC,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,OAAO,CAAC,KAAqB,EAAE,KAAqB,EAAE,EAAU;QAC9D,MAAM,QAAQ,GAAG,KAA+B,CAAC;QACjD,MAAM,KAAK,GAAG,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;QACpD,MAAM,KAAK,GAAG,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;QACpD,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,IAAI;YAAE,OAAO;Q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GED
@@ -2,5 +2,6 @@ import type { Physics2DContactPoint, Physics2DWorld, RigidBody2D } from '@flight
2
2
  export declare function applyPhysics2DImpulse(bodyA: RigidBody2D, bodyB: RigidBody2D, rAX: number, rAY: number, rBX: number, rBY: number, impulseX: number, impulseY: number): void;
3
3
  export declare function relativeNormalVelocity(bodyA: Readonly<RigidBody2D>, bodyB: Readonly<RigidBody2D>, point: Readonly<Physics2DContactPoint>, normalX: number, normalY: number): number;
4
4
  export declare function solvePhysics2DContacts(world: Physics2DWorld): void;
5
+ export declare function solvePhysics2DContactsOnce(world: Physics2DWorld): void;
5
6
  export declare function warmStartPhysics2DContacts(world: Physics2DWorld): void;
6
7
  //# sourceMappingURL=solver.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"solver.d.ts","sourceRoot":"","sources":["../src/solver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,qBAAqB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAarH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,WAAW,EAClB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,IAAI,CAON;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,QAAQ,CAAC,WAAW,CAAC,EAC5B,KAAK,EAAE,QAAQ,CAAC,WAAW,CAAC,EAC5B,KAAK,EAAE,QAAQ,CAAC,qBAAqB,CAAC,EACtC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,MAAM,CAMR;AAyED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAWlE;AAYD,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAmBtE"}
1
+ {"version":3,"file":"solver.d.ts","sourceRoot":"","sources":["../src/solver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,qBAAqB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAarH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,WAAW,EAClB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,IAAI,CAON;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,QAAQ,CAAC,WAAW,CAAC,EAC5B,KAAK,EAAE,QAAQ,CAAC,WAAW,CAAC,EAC5B,KAAK,EAAE,QAAQ,CAAC,qBAAqB,CAAC,EACtC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,MAAM,CAMR;AAyED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAGlE;AAKD,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAQtE;AAYD,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAmBtE"}
package/dist/solver.js CHANGED
@@ -65,16 +65,21 @@ function solvePhysics2DContact(contact, bodyA, bodyB) {
65
65
  // non-negative, which is the difference between a stable stack and one that vibrates.
66
66
  export function solvePhysics2DContacts(world) {
67
67
  const iterations = world.config.velocityIterations;
68
- for (let iteration = 0; iteration < iterations; iteration++) {
69
- for (const contact of world.contacts) {
70
- if (contact.sensor)
71
- continue;
72
- const bodyA = findPhysics2DBody(world, contact.bodyA);
73
- const bodyB = findPhysics2DBody(world, contact.bodyB);
74
- if (bodyA === null || bodyB === null)
75
- continue;
76
- solvePhysics2DContact(contact, bodyA, bodyB);
77
- }
68
+ for (let iteration = 0; iteration < iterations; iteration++)
69
+ solvePhysics2DContactsOnce(world);
70
+ }
71
+ // One pass over the contact list. Split out so the step can interleave it with the joint pass inside a
72
+ // single iteration loop: joints and contacts constrain the same bodies, and giving either a whole pass to
73
+ // itself lets it undo what the other just corrected.
74
+ export function solvePhysics2DContactsOnce(world) {
75
+ for (const contact of world.contacts) {
76
+ if (contact.sensor)
77
+ continue;
78
+ const bodyA = findPhysics2DBody(world, contact.bodyA);
79
+ const bodyB = findPhysics2DBody(world, contact.bodyB);
80
+ if (bodyA === null || bodyB === null)
81
+ continue;
82
+ solvePhysics2DContact(contact, bodyA, bodyB);
78
83
  }
79
84
  }
80
85
  // Applies each contact's cached impulses before the first iteration — the warm start.
@@ -1 +1 @@
1
- {"version":3,"file":"solver.js","sourceRoot":"","sources":["../src/solver.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,qGAAqG;AACrG,uGAAuG;AACvG,0GAA0G;AAC1G,EAAE;AACF,uGAAuG;AACvG,wGAAwG;AACxG,wGAAwG;AACxG,kGAAkG;AAClG,uEAAuE;AACvE,MAAM,UAAU,qBAAqB,CACnC,KAAkB,EAClB,KAAkB,EAClB,GAAW,EACX,GAAW,EACX,GAAW,EACX,GAAW,EACX,QAAgB,EAChB,QAAgB;IAEhB,KAAK,CAAC,SAAS,IAAI,QAAQ,GAAG,KAAK,CAAC,WAAW,CAAC;IAChD,KAAK,CAAC,SAAS,IAAI,QAAQ,GAAG,KAAK,CAAC,WAAW,CAAC;IAChD,KAAK,CAAC,eAAe,IAAI,KAAK,CAAC,cAAc,GAAG,CAAC,GAAG,GAAG,QAAQ,GAAG,GAAG,GAAG,QAAQ,CAAC,CAAC;IAClF,KAAK,CAAC,SAAS,IAAI,QAAQ,GAAG,KAAK,CAAC,WAAW,CAAC;IAChD,KAAK,CAAC,SAAS,IAAI,QAAQ,GAAG,KAAK,CAAC,WAAW,CAAC;IAChD,KAAK,CAAC,eAAe,IAAI,KAAK,CAAC,cAAc,GAAG,CAAC,GAAG,GAAG,QAAQ,GAAG,GAA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,SAAS,GAAG,KAAK,CAAC,eAAe,GAAG,GAAG,CAAC;IAC1D,qGAAqG;IACrG,uCAAuC;IACvC,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC;AACnD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../src/step.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAIV,cAAc,EAIf,MAAM,0BAA0B,CAAC;AA+OlC,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAsCrE"}
1
+ {"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../src/step.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAIV,cAAc,EAIf,MAAM,0BAA0B,CAAC;AAqRlC,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAiDrE"}