@codexo/exojs-physics 0.19.1 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -73
- package/{dist/esm/debug/index.d.ts → debug.d.ts} +1 -2
- package/debug.js +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +17 -23
- package/dist/esm/Aabb.d.ts +0 -10
- package/dist/esm/Aabb.d.ts.map +0 -1
- package/dist/esm/Aabb.js +0 -16
- package/dist/esm/Aabb.js.map +0 -1
- package/dist/esm/Collider.d.ts +0 -107
- package/dist/esm/Collider.d.ts.map +0 -1
- package/dist/esm/Collider.js +0 -284
- package/dist/esm/Collider.js.map +0 -1
- package/dist/esm/ContactGraph.d.ts +0 -154
- package/dist/esm/ContactGraph.d.ts.map +0 -1
- package/dist/esm/ContactGraph.js +0 -383
- package/dist/esm/ContactGraph.js.map +0 -1
- package/dist/esm/ContactModifier.d.ts +0 -62
- package/dist/esm/ContactModifier.d.ts.map +0 -1
- package/dist/esm/ContactModifier.js +0 -49
- package/dist/esm/ContactModifier.js.map +0 -1
- package/dist/esm/PhysicsBody.d.ts +0 -186
- package/dist/esm/PhysicsBody.d.ts.map +0 -1
- package/dist/esm/PhysicsBody.js +0 -526
- package/dist/esm/PhysicsBody.js.map +0 -1
- package/dist/esm/PhysicsBodyComponent.d.ts +0 -45
- package/dist/esm/PhysicsBodyComponent.d.ts.map +0 -1
- package/dist/esm/PhysicsBodyComponent.js +0 -77
- package/dist/esm/PhysicsBodyComponent.js.map +0 -1
- package/dist/esm/PhysicsWorld.d.ts +0 -567
- package/dist/esm/PhysicsWorld.d.ts.map +0 -1
- package/dist/esm/PhysicsWorld.js +0 -1096
- package/dist/esm/PhysicsWorld.js.map +0 -1
- package/dist/esm/TimeStepper.d.ts +0 -40
- package/dist/esm/TimeStepper.d.ts.map +0 -1
- package/dist/esm/TimeStepper.js +0 -59
- package/dist/esm/TimeStepper.js.map +0 -1
- package/dist/esm/backend/NativePhysicsBackend.d.ts +0 -28
- package/dist/esm/backend/NativePhysicsBackend.d.ts.map +0 -1
- package/dist/esm/backend/NativePhysicsBackend.js +0 -52
- package/dist/esm/backend/NativePhysicsBackend.js.map +0 -1
- package/dist/esm/backend/PhysicsBackend.d.ts +0 -38
- package/dist/esm/backend/PhysicsBackend.d.ts.map +0 -1
- package/dist/esm/binding/BindingRegistry.d.ts +0 -48
- package/dist/esm/binding/BindingRegistry.d.ts.map +0 -1
- package/dist/esm/binding/BindingRegistry.js +0 -81
- package/dist/esm/binding/BindingRegistry.js.map +0 -1
- package/dist/esm/binding/PhysicsBinding.d.ts +0 -37
- package/dist/esm/binding/PhysicsBinding.d.ts.map +0 -1
- package/dist/esm/binding/PhysicsBinding.js +0 -54
- package/dist/esm/binding/PhysicsBinding.js.map +0 -1
- package/dist/esm/binding/nodeWorldTransform.d.ts +0 -18
- package/dist/esm/binding/nodeWorldTransform.d.ts.map +0 -1
- package/dist/esm/binding/nodeWorldTransform.js +0 -41
- package/dist/esm/binding/nodeWorldTransform.js.map +0 -1
- package/dist/esm/broadphase/AabbTreeBroadPhase.d.ts +0 -84
- package/dist/esm/broadphase/AabbTreeBroadPhase.d.ts.map +0 -1
- package/dist/esm/broadphase/AabbTreeBroadPhase.js +0 -183
- package/dist/esm/broadphase/AabbTreeBroadPhase.js.map +0 -1
- package/dist/esm/broadphase/BroadPhase.d.ts +0 -25
- package/dist/esm/broadphase/BroadPhase.d.ts.map +0 -1
- package/dist/esm/broadphase/index.d.ts +0 -3
- package/dist/esm/broadphase/index.d.ts.map +0 -1
- package/dist/esm/collision/CollisionProxy.d.ts +0 -15
- package/dist/esm/collision/CollisionProxy.d.ts.map +0 -1
- package/dist/esm/collision/Manifold.d.ts +0 -34
- package/dist/esm/collision/Manifold.d.ts.map +0 -1
- package/dist/esm/collision/Manifold.js +0 -37
- package/dist/esm/collision/Manifold.js.map +0 -1
- package/dist/esm/collision/chainAdjacency.d.ts +0 -2
- package/dist/esm/collision/chainAdjacency.d.ts.map +0 -1
- package/dist/esm/collision/chainAdjacency.js +0 -44
- package/dist/esm/collision/chainAdjacency.js.map +0 -1
- package/dist/esm/collision/dispatch.d.ts +0 -35
- package/dist/esm/collision/dispatch.d.ts.map +0 -1
- package/dist/esm/collision/dispatch.js +0 -58
- package/dist/esm/collision/dispatch.js.map +0 -1
- package/dist/esm/collision/index.d.ts +0 -5
- package/dist/esm/collision/index.d.ts.map +0 -1
- package/dist/esm/collision/narrowphase.d.ts +0 -17
- package/dist/esm/collision/narrowphase.d.ts.map +0 -1
- package/dist/esm/collision/narrowphase.js +0 -555
- package/dist/esm/collision/narrowphase.js.map +0 -1
- package/dist/esm/collision/segments.d.ts +0 -19
- package/dist/esm/collision/segments.d.ts.map +0 -1
- package/dist/esm/collision/segments.js +0 -36
- package/dist/esm/collision/segments.js.map +0 -1
- package/dist/esm/collision/sweep.d.ts +0 -35
- package/dist/esm/collision/sweep.d.ts.map +0 -1
- package/dist/esm/collision/sweep.js +0 -437
- package/dist/esm/collision/sweep.js.map +0 -1
- package/dist/esm/debug/PhysicsDebugDraw.d.ts +0 -72
- package/dist/esm/debug/PhysicsDebugDraw.d.ts.map +0 -1
- package/dist/esm/debug/PhysicsDebugDraw.js +0 -239
- package/dist/esm/debug/PhysicsDebugDraw.js.map +0 -1
- package/dist/esm/debug/index.d.ts.map +0 -1
- package/dist/esm/debug/index.js +0 -3
- package/dist/esm/events.d.ts +0 -36
- package/dist/esm/events.d.ts.map +0 -1
- package/dist/esm/index.d.ts +0 -2
- package/dist/esm/index.d.ts.map +0 -1
- package/dist/esm/index.js +0 -25
- package/dist/esm/joints/DistanceJoint.d.ts +0 -70
- package/dist/esm/joints/DistanceJoint.d.ts.map +0 -1
- package/dist/esm/joints/DistanceJoint.js +0 -167
- package/dist/esm/joints/DistanceJoint.js.map +0 -1
- package/dist/esm/joints/Joint.d.ts +0 -76
- package/dist/esm/joints/Joint.d.ts.map +0 -1
- package/dist/esm/joints/Joint.js +0 -62
- package/dist/esm/joints/Joint.js.map +0 -1
- package/dist/esm/joints/MouseJoint.d.ts +0 -55
- package/dist/esm/joints/MouseJoint.d.ts.map +0 -1
- package/dist/esm/joints/MouseJoint.js +0 -139
- package/dist/esm/joints/MouseJoint.js.map +0 -1
- package/dist/esm/joints/PrismaticJoint.d.ts +0 -84
- package/dist/esm/joints/PrismaticJoint.d.ts.map +0 -1
- package/dist/esm/joints/PrismaticJoint.js +0 -218
- package/dist/esm/joints/PrismaticJoint.js.map +0 -1
- package/dist/esm/joints/RevoluteJoint.d.ts +0 -77
- package/dist/esm/joints/RevoluteJoint.d.ts.map +0 -1
- package/dist/esm/joints/RevoluteJoint.js +0 -204
- package/dist/esm/joints/RevoluteJoint.js.map +0 -1
- package/dist/esm/joints/WeldJoint.d.ts +0 -60
- package/dist/esm/joints/WeldJoint.d.ts.map +0 -1
- package/dist/esm/joints/WeldJoint.js +0 -166
- package/dist/esm/joints/WeldJoint.js.map +0 -1
- package/dist/esm/joints/WheelJoint.d.ts +0 -91
- package/dist/esm/joints/WheelJoint.d.ts.map +0 -1
- package/dist/esm/joints/WheelJoint.js +0 -235
- package/dist/esm/joints/WheelJoint.js.map +0 -1
- package/dist/esm/math.d.ts +0 -29
- package/dist/esm/math.d.ts.map +0 -1
- package/dist/esm/math.js +0 -60
- package/dist/esm/math.js.map +0 -1
- package/dist/esm/physicsBuildInfo.d.ts +0 -16
- package/dist/esm/physicsBuildInfo.d.ts.map +0 -1
- package/dist/esm/physicsBuildInfo.js +0 -10
- package/dist/esm/physicsBuildInfo.js.map +0 -1
- package/dist/esm/public.d.ts +0 -34
- package/dist/esm/public.d.ts.map +0 -1
- package/dist/esm/query/QueryEngine.d.ts +0 -95
- package/dist/esm/query/QueryEngine.d.ts.map +0 -1
- package/dist/esm/query/QueryEngine.js +0 -512
- package/dist/esm/query/QueryEngine.js.map +0 -1
- package/dist/esm/query/SpatialIndex.d.ts +0 -34
- package/dist/esm/query/SpatialIndex.d.ts.map +0 -1
- package/dist/esm/shapes/AnyShape.d.ts +0 -14
- package/dist/esm/shapes/AnyShape.d.ts.map +0 -1
- package/dist/esm/shapes/BoxShape.d.ts +0 -12
- package/dist/esm/shapes/BoxShape.d.ts.map +0 -1
- package/dist/esm/shapes/BoxShape.js +0 -41
- package/dist/esm/shapes/BoxShape.js.map +0 -1
- package/dist/esm/shapes/CapsuleShape.d.ts +0 -30
- package/dist/esm/shapes/CapsuleShape.d.ts.map +0 -1
- package/dist/esm/shapes/CapsuleShape.js +0 -88
- package/dist/esm/shapes/CapsuleShape.js.map +0 -1
- package/dist/esm/shapes/ChainEdgeShape.d.ts +0 -2
- package/dist/esm/shapes/ChainEdgeShape.d.ts.map +0 -1
- package/dist/esm/shapes/ChainEdgeShape.js +0 -66
- package/dist/esm/shapes/ChainEdgeShape.js.map +0 -1
- package/dist/esm/shapes/ChainShape.d.ts +0 -46
- package/dist/esm/shapes/ChainShape.d.ts.map +0 -1
- package/dist/esm/shapes/ChainShape.js +0 -85
- package/dist/esm/shapes/ChainShape.js.map +0 -1
- package/dist/esm/shapes/CircleShape.d.ts +0 -14
- package/dist/esm/shapes/CircleShape.d.ts.map +0 -1
- package/dist/esm/shapes/CircleShape.js +0 -31
- package/dist/esm/shapes/CircleShape.js.map +0 -1
- package/dist/esm/shapes/PolygonShape.d.ts +0 -24
- package/dist/esm/shapes/PolygonShape.d.ts.map +0 -1
- package/dist/esm/shapes/PolygonShape.js +0 -153
- package/dist/esm/shapes/PolygonShape.js.map +0 -1
- package/dist/esm/shapes/SegmentShape.d.ts +0 -31
- package/dist/esm/shapes/SegmentShape.d.ts.map +0 -1
- package/dist/esm/shapes/SegmentShape.js +0 -62
- package/dist/esm/shapes/SegmentShape.js.map +0 -1
- package/dist/esm/shapes/Shape.d.ts +0 -37
- package/dist/esm/shapes/Shape.d.ts.map +0 -1
- package/dist/esm/shapes/Shape.js +0 -15
- package/dist/esm/shapes/Shape.js.map +0 -1
- package/dist/esm/shapes/convexParts.d.ts +0 -21
- package/dist/esm/shapes/convexParts.d.ts.map +0 -1
- package/dist/esm/shapes/convexParts.js +0 -26
- package/dist/esm/shapes/convexParts.js.map +0 -1
- package/dist/esm/shapes/decompose.d.ts +0 -2
- package/dist/esm/shapes/decompose.d.ts.map +0 -1
- package/dist/esm/shapes/decompose.js +0 -272
- package/dist/esm/shapes/decompose.js.map +0 -1
- package/dist/esm/shapes/index.d.ts +0 -9
- package/dist/esm/shapes/index.d.ts.map +0 -1
- package/dist/esm/solver/ContactSolver.d.ts +0 -94
- package/dist/esm/solver/ContactSolver.d.ts.map +0 -1
- package/dist/esm/solver/ContactSolver.js +0 -457
- package/dist/esm/solver/ContactSolver.js.map +0 -1
- package/dist/esm/solver/tolerances.d.ts +0 -2
- package/dist/esm/solver/tolerances.d.ts.map +0 -1
- package/dist/esm/solver/tolerances.js +0 -36
- package/dist/esm/solver/tolerances.js.map +0 -1
- package/dist/esm/sort.d.ts +0 -2
- package/dist/esm/sort.d.ts.map +0 -1
- package/dist/esm/sort.js +0 -44
- package/dist/esm/sort.js.map +0 -1
- package/dist/esm/types.d.ts +0 -35
- package/dist/esm/types.d.ts.map +0 -1
- package/dist/esm/types.js +0 -26
- package/dist/esm/types.js.map +0 -1
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
import { triangulate } from "@codexo/exojs";
|
|
2
|
-
|
|
3
|
-
//#region src/shapes/decompose.ts
|
|
4
|
-
/** Vertices closer than this (px) are welded into one. */
|
|
5
|
-
const weldEpsilon = 1e-4;
|
|
6
|
-
/**
|
|
7
|
-
* Sine-of-turn threshold below which three consecutive vertices count as
|
|
8
|
-
* collinear. Compared against the normalised cross product so the test is
|
|
9
|
-
* scale-free: a 10 px polygon and a 10 000 px one accept the same shapes.
|
|
10
|
-
*/
|
|
11
|
-
const collinearEpsilon = 1e-7;
|
|
12
|
-
/**
|
|
13
|
-
* Fraction of the outline's area below which a triangulation face counts as
|
|
14
|
-
* empty. Ear clipping emits its last triangle without an orientation test, so a
|
|
15
|
-
* polygon whose final three vertices end up collinear yields one zero-area face
|
|
16
|
-
* - it covers nothing and must not become a collider.
|
|
17
|
-
*/
|
|
18
|
-
const degenerateAreaFraction = 1e-9;
|
|
19
|
-
/**
|
|
20
|
-
* Split a simple polygon into convex parts.
|
|
21
|
-
*
|
|
22
|
-
* The input may be concave, wound either way, and may carry duplicate or
|
|
23
|
-
* collinear vertices; it must not intersect itself. The result is a list of
|
|
24
|
-
* strictly convex, counter-clockwise parts whose union is the input and whose
|
|
25
|
-
* interiors do not overlap. An already-convex input yields exactly one part.
|
|
26
|
-
*
|
|
27
|
-
* Deterministic: the same cleaned input always produces the same parts. The
|
|
28
|
-
* number of parts and their order are an artefact of the current algorithm and
|
|
29
|
-
* must not be relied on - assert convexity, preserved area and preserved mass
|
|
30
|
-
* properties instead.
|
|
31
|
-
*
|
|
32
|
-
* Cost is O(n²) in the vertex count (self-intersection check and ear clipping),
|
|
33
|
-
* which suits import-time geometry rather than a per-step path.
|
|
34
|
-
*
|
|
35
|
-
* @throws RangeError if a coordinate is not finite, if fewer than three
|
|
36
|
-
* distinct non-collinear vertices remain after cleanup, or if the outline
|
|
37
|
-
* intersects itself.
|
|
38
|
-
* @internal
|
|
39
|
-
*/
|
|
40
|
-
const decomposeToConvexParts = (vertices) => {
|
|
41
|
-
const points = normalize(vertices);
|
|
42
|
-
const count = points.length / 2;
|
|
43
|
-
assertSimple(points);
|
|
44
|
-
if (isStrictlyConvex(points)) return [toPoints(points, sequence(count))];
|
|
45
|
-
const indices = triangulate(points);
|
|
46
|
-
if (indices.length !== (count - 2) * 3) throw new RangeError(`decomposeToConvexParts: could not triangulate the outline (${indices.length / 3} of ${count - 2} triangles); check it for near-degenerate geometry.`);
|
|
47
|
-
const sourceArea = Math.abs(signedArea(points));
|
|
48
|
-
const cycles = mergeTriangles(points, indices, sourceArea * degenerateAreaFraction);
|
|
49
|
-
const parts = cycles.map((cycle) => toPoints(points, cycle));
|
|
50
|
-
const partArea = cycles.reduce((sum, cycle) => sum + Math.abs(cycleArea(points, cycle)), 0);
|
|
51
|
-
if (parts.length === 0 || Math.abs(partArea - sourceArea) > sourceArea * 1e-6) throw new RangeError(`decomposeToConvexParts: the parts cover ${partArea.toFixed(4)} of the outline's ${sourceArea.toFixed(4)}; the outline is too degenerate to decompose.`);
|
|
52
|
-
return parts;
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* Weld coincident vertices, drop collinear ones and canonicalise to
|
|
56
|
-
* counter-clockwise, returning a flat `[x0, y0, x1, y1, ...]` array.
|
|
57
|
-
*/
|
|
58
|
-
const normalize = (vertices) => {
|
|
59
|
-
const points = [];
|
|
60
|
-
for (const vertex of vertices) {
|
|
61
|
-
if (!Number.isFinite(vertex.x) || !Number.isFinite(vertex.y)) throw new RangeError(`decomposeToConvexParts: vertex has a non-finite component (${vertex.x}, ${vertex.y}).`);
|
|
62
|
-
if (points.length === 0) {
|
|
63
|
-
points.push(vertex.x, vertex.y);
|
|
64
|
-
continue;
|
|
65
|
-
}
|
|
66
|
-
if (Math.hypot(vertex.x - points[points.length - 2], vertex.y - points[points.length - 1]) >= weldEpsilon) points.push(vertex.x, vertex.y);
|
|
67
|
-
}
|
|
68
|
-
if (points.length >= 4 && Math.hypot(points[0] - points[points.length - 2], points[1] - points[points.length - 1]) < weldEpsilon) points.length -= 2;
|
|
69
|
-
if (signedArea(points) < 0) reverseWinding(points);
|
|
70
|
-
dropCollinear(points);
|
|
71
|
-
if (points.length < 6) throw new RangeError(`decomposeToConvexParts: needs at least 3 distinct, non-collinear vertices, received ${points.length / 2} after cleanup.`);
|
|
72
|
-
if (Math.abs(signedArea(points)) <= weldEpsilon) throw new RangeError("decomposeToConvexParts: the outline encloses no area.");
|
|
73
|
-
return points;
|
|
74
|
-
};
|
|
75
|
-
/**
|
|
76
|
-
* Remove every vertex whose two edges are collinear. Repeats until stable: one
|
|
77
|
-
* removal can make its neighbour collinear in turn.
|
|
78
|
-
*/
|
|
79
|
-
const dropCollinear = (points) => {
|
|
80
|
-
let removed = true;
|
|
81
|
-
while (removed && points.length >= 6) {
|
|
82
|
-
removed = false;
|
|
83
|
-
for (let i = 0; i < points.length / 2; i++) {
|
|
84
|
-
const count = points.length / 2;
|
|
85
|
-
if (count < 3) break;
|
|
86
|
-
const p = (i + count - 1) % count;
|
|
87
|
-
const n = (i + 1) % count;
|
|
88
|
-
if (isCollinear(points, p, i, n)) {
|
|
89
|
-
points.splice(i * 2, 2);
|
|
90
|
-
removed = true;
|
|
91
|
-
i--;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
const isCollinear = (points, a, b, c) => {
|
|
97
|
-
const e1x = points[b * 2] - points[a * 2];
|
|
98
|
-
const e1y = points[b * 2 + 1] - points[a * 2 + 1];
|
|
99
|
-
const e2x = points[c * 2] - points[b * 2];
|
|
100
|
-
const e2y = points[c * 2 + 1] - points[b * 2 + 1];
|
|
101
|
-
const lengths = Math.hypot(e1x, e1y) * Math.hypot(e2x, e2y);
|
|
102
|
-
return lengths === 0 || Math.abs(e1x * e2y - e1y * e2x) <= collinearEpsilon * lengths;
|
|
103
|
-
};
|
|
104
|
-
/**
|
|
105
|
-
* Reject an outline that crosses or touches itself. Every pair of non-adjacent
|
|
106
|
-
* edges must be disjoint - a shared point between them is exactly what makes a
|
|
107
|
-
* polygon non-simple, and both ear clipping and the solver assume it cannot
|
|
108
|
-
* happen.
|
|
109
|
-
*/
|
|
110
|
-
const assertSimple = (points) => {
|
|
111
|
-
const count = points.length / 2;
|
|
112
|
-
for (let i = 0; i < count; i++) {
|
|
113
|
-
const iNext = (i + 1) % count;
|
|
114
|
-
for (let j = i + 1; j < count; j++) {
|
|
115
|
-
const jNext = (j + 1) % count;
|
|
116
|
-
if (i === j || iNext === j || jNext === i) continue;
|
|
117
|
-
if (segmentsIntersect(points, i, iNext, j, jNext)) throw new RangeError("decomposeToConvexParts: the outline intersects itself; only simple polygons can be decomposed.");
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
/** `true` when segments `a→b` and `c→d` share any point, touching included. */
|
|
122
|
-
const segmentsIntersect = (points, a, b, c, d) => {
|
|
123
|
-
const o1 = orientation(points, a, b, c);
|
|
124
|
-
const o2 = orientation(points, a, b, d);
|
|
125
|
-
const o3 = orientation(points, c, d, a);
|
|
126
|
-
const o4 = orientation(points, c, d, b);
|
|
127
|
-
if (o1 !== o2 && o3 !== o4) return true;
|
|
128
|
-
return o1 === 0 && onSegment(points, a, b, c) || o2 === 0 && onSegment(points, a, b, d) || o3 === 0 && onSegment(points, c, d, a) || o4 === 0 && onSegment(points, c, d, b);
|
|
129
|
-
};
|
|
130
|
-
/** Sign of the turn `a → b → c`: `1` left, `-1` right, `0` collinear. */
|
|
131
|
-
const orientation = (points, a, b, c) => {
|
|
132
|
-
const cross = (points[b * 2] - points[a * 2]) * (points[c * 2 + 1] - points[a * 2 + 1]) - (points[b * 2 + 1] - points[a * 2 + 1]) * (points[c * 2] - points[a * 2]);
|
|
133
|
-
const scale = Math.hypot(points[b * 2] - points[a * 2], points[b * 2 + 1] - points[a * 2 + 1]) * Math.hypot(points[c * 2] - points[a * 2], points[c * 2 + 1] - points[a * 2 + 1]);
|
|
134
|
-
if (scale === 0 || Math.abs(cross) <= collinearEpsilon * scale) return 0;
|
|
135
|
-
return cross > 0 ? 1 : -1;
|
|
136
|
-
};
|
|
137
|
-
/** `true` when `p` lies within the bounding box of the collinear segment `a→b`. */
|
|
138
|
-
const onSegment = (points, a, b, p) => points[p * 2] >= Math.min(points[a * 2], points[b * 2]) - weldEpsilon && points[p * 2] <= Math.max(points[a * 2], points[b * 2]) + weldEpsilon && points[p * 2 + 1] >= Math.min(points[a * 2 + 1], points[b * 2 + 1]) - weldEpsilon && points[p * 2 + 1] <= Math.max(points[a * 2 + 1], points[b * 2 + 1]) + weldEpsilon;
|
|
139
|
-
/**
|
|
140
|
-
* Hertel-Mehlhorn: start from the triangulation and drop every internal
|
|
141
|
-
* diagonal whose two faces merge into a still-convex polygon. Diagonals are
|
|
142
|
-
* visited in a fixed key order, so the outcome depends only on the cleaned
|
|
143
|
-
* input.
|
|
144
|
-
*/
|
|
145
|
-
const mergeTriangles = (points, indices, degenerateArea) => {
|
|
146
|
-
const cycles = /* @__PURE__ */ new Map();
|
|
147
|
-
const owners = /* @__PURE__ */ new Map();
|
|
148
|
-
const parent = [];
|
|
149
|
-
const find = (id) => {
|
|
150
|
-
let root = id;
|
|
151
|
-
while (parent[root] !== root) root = parent[root];
|
|
152
|
-
return root;
|
|
153
|
-
};
|
|
154
|
-
const stride = points.length / 2;
|
|
155
|
-
const diagonalKey = (a, b) => a < b ? a * stride + b : b * stride + a;
|
|
156
|
-
for (let t = 0; t < indices.length; t += 3) {
|
|
157
|
-
const id = t / 3;
|
|
158
|
-
const cycle = [
|
|
159
|
-
indices[t],
|
|
160
|
-
indices[t + 1],
|
|
161
|
-
indices[t + 2]
|
|
162
|
-
];
|
|
163
|
-
if (Math.abs(cycleArea(points, cycle)) <= degenerateArea) continue;
|
|
164
|
-
parent[id] = id;
|
|
165
|
-
cycles.set(id, cycle);
|
|
166
|
-
for (let e = 0; e < 3; e++) {
|
|
167
|
-
const key = diagonalKey(cycle[e], cycle[(e + 1) % 3]);
|
|
168
|
-
const owner = owners.get(key);
|
|
169
|
-
if (owner === void 0) owners.set(key, [id]);
|
|
170
|
-
else owner.push(id);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
for (const key of [...owners.keys()].sort((x, y) => x - y)) {
|
|
174
|
-
const owner = owners.get(key);
|
|
175
|
-
if (owner.length !== 2) continue;
|
|
176
|
-
const rootA = find(owner[0]);
|
|
177
|
-
const rootB = find(owner[1]);
|
|
178
|
-
if (rootA === rootB) continue;
|
|
179
|
-
const cycleA = cycles.get(rootA);
|
|
180
|
-
const cycleB = cycles.get(rootB);
|
|
181
|
-
const merged = mergeAcross(points, cycleA, cycleB, Math.floor(key / stride), key % stride);
|
|
182
|
-
if (merged === null) continue;
|
|
183
|
-
const keep = rootA < rootB ? rootA : rootB;
|
|
184
|
-
const drop = rootA < rootB ? rootB : rootA;
|
|
185
|
-
cycles.set(keep, merged);
|
|
186
|
-
cycles.delete(drop);
|
|
187
|
-
parent[drop] = keep;
|
|
188
|
-
}
|
|
189
|
-
return [...cycles.values()];
|
|
190
|
-
};
|
|
191
|
-
/**
|
|
192
|
-
* Join two convex cycles across the shared edge between `u` and `v`, or `null`
|
|
193
|
-
* when the union would not be strictly convex. Rejecting a merely collinear
|
|
194
|
-
* junction is deliberate: the resulting part is handed to `PolygonShape`, which
|
|
195
|
-
* refuses collinear edges.
|
|
196
|
-
*/
|
|
197
|
-
const mergeAcross = (points, cycleA, cycleB, u, v) => {
|
|
198
|
-
let a = u;
|
|
199
|
-
let b = v;
|
|
200
|
-
let start = directedEdgeIndex(cycleA, a, b);
|
|
201
|
-
if (start === -1) {
|
|
202
|
-
a = v;
|
|
203
|
-
b = u;
|
|
204
|
-
start = directedEdgeIndex(cycleA, a, b);
|
|
205
|
-
}
|
|
206
|
-
const back = start === -1 ? -1 : directedEdgeIndex(cycleB, b, a);
|
|
207
|
-
if (start === -1 || back === -1) return null;
|
|
208
|
-
const merged = [];
|
|
209
|
-
for (let i = 0; i < cycleA.length; i++) merged.push(cycleA[(start + 1 + i) % cycleA.length]);
|
|
210
|
-
for (let i = 2; i < cycleB.length; i++) merged.push(cycleB[(back + i) % cycleB.length]);
|
|
211
|
-
return isCycleStrictlyConvex(points, merged) ? merged : null;
|
|
212
|
-
};
|
|
213
|
-
/** Index of `a` in `cycle` when `b` immediately follows it, else `-1`. */
|
|
214
|
-
const directedEdgeIndex = (cycle, a, b) => {
|
|
215
|
-
for (let i = 0; i < cycle.length; i++) if (cycle[i] === a && cycle[(i + 1) % cycle.length] === b) return i;
|
|
216
|
-
return -1;
|
|
217
|
-
};
|
|
218
|
-
const isCycleStrictlyConvex = (points, cycle) => {
|
|
219
|
-
for (let i = 0; i < cycle.length; i++) {
|
|
220
|
-
const a = cycle[i];
|
|
221
|
-
const b = cycle[(i + 1) % cycle.length];
|
|
222
|
-
const c = cycle[(i + 2) % cycle.length];
|
|
223
|
-
if (orientation(points, a, b, c) <= 0) return false;
|
|
224
|
-
}
|
|
225
|
-
return true;
|
|
226
|
-
};
|
|
227
|
-
const isStrictlyConvex = (points) => isCycleStrictlyConvex(points, sequence(points.length / 2));
|
|
228
|
-
const sequence = (count) => {
|
|
229
|
-
const out = [];
|
|
230
|
-
for (let i = 0; i < count; i++) out.push(i);
|
|
231
|
-
return out;
|
|
232
|
-
};
|
|
233
|
-
const toPoints = (points, cycle) => cycle.map((index) => ({
|
|
234
|
-
x: points[index * 2],
|
|
235
|
-
y: points[index * 2 + 1]
|
|
236
|
-
}));
|
|
237
|
-
/** Shoelace signed area of an index cycle over `points`. */
|
|
238
|
-
const cycleArea = (points, cycle) => {
|
|
239
|
-
let sum = 0;
|
|
240
|
-
for (let i = 0; i < cycle.length; i++) {
|
|
241
|
-
const a = cycle[i];
|
|
242
|
-
const b = cycle[(i + 1) % cycle.length];
|
|
243
|
-
sum += points[a * 2] * points[b * 2 + 1] - points[b * 2] * points[a * 2 + 1];
|
|
244
|
-
}
|
|
245
|
-
return sum / 2;
|
|
246
|
-
};
|
|
247
|
-
/** Shoelace signed area of a flat point ring; positive is counter-clockwise. */
|
|
248
|
-
const signedArea = (points) => {
|
|
249
|
-
const count = points.length / 2;
|
|
250
|
-
let sum = 0;
|
|
251
|
-
for (let i = 0; i < count; i++) {
|
|
252
|
-
const j = (i + 1) % count;
|
|
253
|
-
sum += points[i * 2] * points[j * 2 + 1] - points[j * 2] * points[i * 2 + 1];
|
|
254
|
-
}
|
|
255
|
-
return sum / 2;
|
|
256
|
-
};
|
|
257
|
-
const reverseWinding = (points) => {
|
|
258
|
-
const count = points.length / 2;
|
|
259
|
-
for (let i = 0; i < Math.floor(count / 2); i++) {
|
|
260
|
-
const j = count - 1 - i;
|
|
261
|
-
const ix = points[i * 2];
|
|
262
|
-
const iy = points[i * 2 + 1];
|
|
263
|
-
points[i * 2] = points[j * 2];
|
|
264
|
-
points[i * 2 + 1] = points[j * 2 + 1];
|
|
265
|
-
points[j * 2] = ix;
|
|
266
|
-
points[j * 2 + 1] = iy;
|
|
267
|
-
}
|
|
268
|
-
};
|
|
269
|
-
|
|
270
|
-
//#endregion
|
|
271
|
-
export { decomposeToConvexParts };
|
|
272
|
-
//# sourceMappingURL=decompose.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"decompose.js","names":[],"sources":["../../../src/shapes/decompose.ts"],"sourcesContent":["import type { PointLike } from '@codexo/exojs';\nimport { triangulate } from '@codexo/exojs';\n\n/** Vertices closer than this (px) are welded into one. */\nconst weldEpsilon = 1e-4;\n/**\n * Sine-of-turn threshold below which three consecutive vertices count as\n * collinear. Compared against the normalised cross product so the test is\n * scale-free: a 10 px polygon and a 10 000 px one accept the same shapes.\n */\nconst collinearEpsilon = 1e-7;\n/**\n * Fraction of the outline's area below which a triangulation face counts as\n * empty. Ear clipping emits its last triangle without an orientation test, so a\n * polygon whose final three vertices end up collinear yields one zero-area face\n * - it covers nothing and must not become a collider.\n */\nconst degenerateAreaFraction = 1e-9;\n\n/**\n * Split a simple polygon into convex parts.\n *\n * The input may be concave, wound either way, and may carry duplicate or\n * collinear vertices; it must not intersect itself. The result is a list of\n * strictly convex, counter-clockwise parts whose union is the input and whose\n * interiors do not overlap. An already-convex input yields exactly one part.\n *\n * Deterministic: the same cleaned input always produces the same parts. The\n * number of parts and their order are an artefact of the current algorithm and\n * must not be relied on - assert convexity, preserved area and preserved mass\n * properties instead.\n *\n * Cost is O(n²) in the vertex count (self-intersection check and ear clipping),\n * which suits import-time geometry rather than a per-step path.\n *\n * @throws RangeError if a coordinate is not finite, if fewer than three\n * distinct non-collinear vertices remain after cleanup, or if the outline\n * intersects itself.\n * @internal\n */\nexport const decomposeToConvexParts = (vertices: ReadonlyArray<Readonly<PointLike>>): PointLike[][] => {\n const points = normalize(vertices);\n const count = points.length / 2;\n\n assertSimple(points);\n\n if (isStrictlyConvex(points)) {\n return [toPoints(points, sequence(count))];\n }\n\n const indices = triangulate(points);\n\n // Ear clipping stops early rather than throwing when it cannot find an ear,\n // so a short index list is how a polygon that survived the checks above but is\n // still numerically degenerate shows up. Accepting it would silently drop area.\n if (indices.length !== (count - 2) * 3) {\n throw new RangeError(\n `decomposeToConvexParts: could not triangulate the outline (${indices.length / 3} of ${count - 2} triangles); check it for near-degenerate geometry.`,\n );\n }\n\n const sourceArea = Math.abs(signedArea(points));\n const cycles = mergeTriangles(points, indices, sourceArea * degenerateAreaFraction);\n const parts = cycles.map(cycle => toPoints(points, cycle));\n\n // Post-condition rather than trust: ear clipping and the merge pass both work\n // on floating-point turns, and any future change that started losing area\n // would otherwise show up as a silently smaller collider.\n const partArea = cycles.reduce((sum, cycle) => sum + Math.abs(cycleArea(points, cycle)), 0);\n\n if (parts.length === 0 || Math.abs(partArea - sourceArea) > sourceArea * 1e-6) {\n throw new RangeError(\n `decomposeToConvexParts: the parts cover ${partArea.toFixed(4)} of the outline's ${sourceArea.toFixed(4)}; the outline is too degenerate to decompose.`,\n );\n }\n\n return parts;\n};\n\n/**\n * Weld coincident vertices, drop collinear ones and canonicalise to\n * counter-clockwise, returning a flat `[x0, y0, x1, y1, ...]` array.\n */\nconst normalize = (vertices: ReadonlyArray<Readonly<PointLike>>): number[] => {\n const points: number[] = [];\n\n for (const vertex of vertices) {\n if (!Number.isFinite(vertex.x) || !Number.isFinite(vertex.y)) {\n throw new RangeError(`decomposeToConvexParts: vertex has a non-finite component (${vertex.x}, ${vertex.y}).`);\n }\n\n if (points.length === 0) {\n points.push(vertex.x, vertex.y);\n\n continue;\n }\n\n if (Math.hypot(vertex.x - points[points.length - 2]!, vertex.y - points[points.length - 1]!) >= weldEpsilon) {\n points.push(vertex.x, vertex.y);\n }\n }\n\n // A trailing vertex coinciding with the first closes the ring explicitly; the\n // ring is implicit here.\n if (points.length >= 4 && Math.hypot(points[0]! - points[points.length - 2]!, points[1]! - points[points.length - 1]!) < weldEpsilon) {\n points.length -= 2;\n }\n\n if (signedArea(points) < 0) {\n reverseWinding(points);\n }\n\n dropCollinear(points);\n\n if (points.length < 6) {\n throw new RangeError(`decomposeToConvexParts: needs at least 3 distinct, non-collinear vertices, received ${points.length / 2} after cleanup.`);\n }\n\n if (Math.abs(signedArea(points)) <= weldEpsilon) {\n throw new RangeError('decomposeToConvexParts: the outline encloses no area.');\n }\n\n return points;\n};\n\n/**\n * Remove every vertex whose two edges are collinear. Repeats until stable: one\n * removal can make its neighbour collinear in turn.\n */\nconst dropCollinear = (points: number[]): void => {\n let removed = true;\n\n while (removed && points.length >= 6) {\n removed = false;\n\n for (let i = 0; i < points.length / 2; i++) {\n const count = points.length / 2;\n\n if (count < 3) {\n break;\n }\n\n const p = (i + count - 1) % count;\n const n = (i + 1) % count;\n\n if (isCollinear(points, p, i, n)) {\n points.splice(i * 2, 2);\n removed = true;\n i--;\n }\n }\n }\n};\n\nconst isCollinear = (points: number[], a: number, b: number, c: number): boolean => {\n const e1x = points[b * 2]! - points[a * 2]!;\n const e1y = points[b * 2 + 1]! - points[a * 2 + 1]!;\n const e2x = points[c * 2]! - points[b * 2]!;\n const e2y = points[c * 2 + 1]! - points[b * 2 + 1]!;\n const lengths = Math.hypot(e1x, e1y) * Math.hypot(e2x, e2y);\n\n return lengths === 0 || Math.abs(e1x * e2y - e1y * e2x) <= collinearEpsilon * lengths;\n};\n\n/**\n * Reject an outline that crosses or touches itself. Every pair of non-adjacent\n * edges must be disjoint - a shared point between them is exactly what makes a\n * polygon non-simple, and both ear clipping and the solver assume it cannot\n * happen.\n */\nconst assertSimple = (points: number[]): void => {\n const count = points.length / 2;\n\n for (let i = 0; i < count; i++) {\n const iNext = (i + 1) % count;\n\n for (let j = i + 1; j < count; j++) {\n const jNext = (j + 1) % count;\n\n // Edges sharing a vertex always \"touch\" at it; only non-adjacent pairs\n // carry information.\n if (i === j || iNext === j || jNext === i) {\n continue;\n }\n\n if (segmentsIntersect(points, i, iNext, j, jNext)) {\n throw new RangeError('decomposeToConvexParts: the outline intersects itself; only simple polygons can be decomposed.');\n }\n }\n }\n};\n\n/** `true` when segments `a→b` and `c→d` share any point, touching included. */\nconst segmentsIntersect = (points: number[], a: number, b: number, c: number, d: number): boolean => {\n const o1 = orientation(points, a, b, c);\n const o2 = orientation(points, a, b, d);\n const o3 = orientation(points, c, d, a);\n const o4 = orientation(points, c, d, b);\n\n if (o1 !== o2 && o3 !== o4) {\n return true;\n }\n\n return (\n (o1 === 0 && onSegment(points, a, b, c)) ||\n (o2 === 0 && onSegment(points, a, b, d)) ||\n (o3 === 0 && onSegment(points, c, d, a)) ||\n (o4 === 0 && onSegment(points, c, d, b))\n );\n};\n\n/** Sign of the turn `a → b → c`: `1` left, `-1` right, `0` collinear. */\nconst orientation = (points: number[], a: number, b: number, c: number): number => {\n const cross =\n (points[b * 2]! - points[a * 2]!) * (points[c * 2 + 1]! - points[a * 2 + 1]!) -\n (points[b * 2 + 1]! - points[a * 2 + 1]!) * (points[c * 2]! - points[a * 2]!);\n const scale =\n Math.hypot(points[b * 2]! - points[a * 2]!, points[b * 2 + 1]! - points[a * 2 + 1]!) *\n Math.hypot(points[c * 2]! - points[a * 2]!, points[c * 2 + 1]! - points[a * 2 + 1]!);\n\n if (scale === 0 || Math.abs(cross) <= collinearEpsilon * scale) {\n return 0;\n }\n\n return cross > 0 ? 1 : -1;\n};\n\n/** `true` when `p` lies within the bounding box of the collinear segment `a→b`. */\nconst onSegment = (points: number[], a: number, b: number, p: number): boolean =>\n points[p * 2]! >= Math.min(points[a * 2]!, points[b * 2]!) - weldEpsilon &&\n points[p * 2]! <= Math.max(points[a * 2]!, points[b * 2]!) + weldEpsilon &&\n points[p * 2 + 1]! >= Math.min(points[a * 2 + 1]!, points[b * 2 + 1]!) - weldEpsilon &&\n points[p * 2 + 1]! <= Math.max(points[a * 2 + 1]!, points[b * 2 + 1]!) + weldEpsilon;\n\n/**\n * Hertel-Mehlhorn: start from the triangulation and drop every internal\n * diagonal whose two faces merge into a still-convex polygon. Diagonals are\n * visited in a fixed key order, so the outcome depends only on the cleaned\n * input.\n */\nconst mergeTriangles = (points: number[], indices: Uint32Array, degenerateArea: number): number[][] => {\n const cycles = new Map<number, number[]>();\n const owners = new Map<number, number[]>();\n // Union-find over part ids: a merged part keeps the lower id, and every\n // diagonal recorded against the absorbed one resolves through here.\n const parent: number[] = [];\n\n const find = (id: number): number => {\n let root = id;\n\n while (parent[root] !== root) {\n root = parent[root]!;\n }\n\n return root;\n };\n\n const stride = points.length / 2;\n const diagonalKey = (a: number, b: number): number => (a < b ? a * stride + b : b * stride + a);\n\n for (let t = 0; t < indices.length; t += 3) {\n const id = t / 3;\n const cycle = [indices[t]!, indices[t + 1]!, indices[t + 2]!];\n\n if (Math.abs(cycleArea(points, cycle)) <= degenerateArea) {\n continue;\n }\n\n parent[id] = id;\n cycles.set(id, cycle);\n\n for (let e = 0; e < 3; e++) {\n const key = diagonalKey(cycle[e]!, cycle[(e + 1) % 3]!);\n const owner = owners.get(key);\n\n if (owner === undefined) {\n owners.set(key, [id]);\n } else {\n owner.push(id);\n }\n }\n }\n\n for (const key of [...owners.keys()].sort((x, y) => x - y)) {\n const owner = owners.get(key)!;\n\n if (owner.length !== 2) {\n continue;\n }\n\n const rootA = find(owner[0]!);\n const rootB = find(owner[1]!);\n\n if (rootA === rootB) {\n continue;\n }\n\n const cycleA = cycles.get(rootA)!;\n const cycleB = cycles.get(rootB)!;\n const merged = mergeAcross(points, cycleA, cycleB, Math.floor(key / stride), key % stride);\n\n if (merged === null) {\n continue;\n }\n\n const keep = rootA < rootB ? rootA : rootB;\n const drop = rootA < rootB ? rootB : rootA;\n\n cycles.set(keep, merged);\n cycles.delete(drop);\n parent[drop] = keep;\n }\n\n return [...cycles.values()];\n};\n\n/**\n * Join two convex cycles across the shared edge between `u` and `v`, or `null`\n * when the union would not be strictly convex. Rejecting a merely collinear\n * junction is deliberate: the resulting part is handed to `PolygonShape`, which\n * refuses collinear edges.\n */\nconst mergeAcross = (points: number[], cycleA: number[], cycleB: number[], u: number, v: number): number[] | null => {\n // Both cycles are counter-clockwise and share the undirected edge, so exactly\n // one of them traverses it as `a → b` and the other as `b → a`.\n let a = u;\n let b = v;\n let start = directedEdgeIndex(cycleA, a, b);\n\n if (start === -1) {\n a = v;\n b = u;\n start = directedEdgeIndex(cycleA, a, b);\n }\n\n const back = start === -1 ? -1 : directedEdgeIndex(cycleB, b, a);\n\n if (start === -1 || back === -1) {\n return null;\n }\n\n // Walk A once starting at b (so it ends on a), then splice in B's vertices\n // strictly between a and b.\n const merged: number[] = [];\n\n for (let i = 0; i < cycleA.length; i++) {\n merged.push(cycleA[(start + 1 + i) % cycleA.length]!);\n }\n\n for (let i = 2; i < cycleB.length; i++) {\n merged.push(cycleB[(back + i) % cycleB.length]!);\n }\n\n return isCycleStrictlyConvex(points, merged) ? merged : null;\n};\n\n/** Index of `a` in `cycle` when `b` immediately follows it, else `-1`. */\nconst directedEdgeIndex = (cycle: number[], a: number, b: number): number => {\n for (let i = 0; i < cycle.length; i++) {\n if (cycle[i] === a && cycle[(i + 1) % cycle.length] === b) {\n return i;\n }\n }\n\n return -1;\n};\n\nconst isCycleStrictlyConvex = (points: number[], cycle: number[]): boolean => {\n for (let i = 0; i < cycle.length; i++) {\n const a = cycle[i]!;\n const b = cycle[(i + 1) % cycle.length]!;\n const c = cycle[(i + 2) % cycle.length]!;\n\n if (orientation(points, a, b, c) <= 0) {\n return false;\n }\n }\n\n return true;\n};\n\nconst isStrictlyConvex = (points: number[]): boolean => isCycleStrictlyConvex(points, sequence(points.length / 2));\n\nconst sequence = (count: number): number[] => {\n const out: number[] = [];\n\n for (let i = 0; i < count; i++) {\n out.push(i);\n }\n\n return out;\n};\n\nconst toPoints = (points: number[], cycle: number[]): PointLike[] => cycle.map(index => ({ x: points[index * 2]!, y: points[index * 2 + 1]! }));\n\n/** Shoelace signed area of an index cycle over `points`. */\nconst cycleArea = (points: number[], cycle: number[]): number => {\n let sum = 0;\n\n for (let i = 0; i < cycle.length; i++) {\n const a = cycle[i]!;\n const b = cycle[(i + 1) % cycle.length]!;\n\n sum += points[a * 2]! * points[b * 2 + 1]! - points[b * 2]! * points[a * 2 + 1]!;\n }\n\n return sum / 2;\n};\n\n/** Shoelace signed area of a flat point ring; positive is counter-clockwise. */\nconst signedArea = (points: number[]): number => {\n const count = points.length / 2;\n let sum = 0;\n\n for (let i = 0; i < count; i++) {\n const j = (i + 1) % count;\n\n sum += points[i * 2]! * points[j * 2 + 1]! - points[j * 2]! * points[i * 2 + 1]!;\n }\n\n return sum / 2;\n};\n\nconst reverseWinding = (points: number[]): void => {\n const count = points.length / 2;\n\n for (let i = 0; i < Math.floor(count / 2); i++) {\n const j = count - 1 - i;\n const ix = points[i * 2]!;\n const iy = points[i * 2 + 1]!;\n\n points[i * 2] = points[j * 2]!;\n points[i * 2 + 1] = points[j * 2 + 1]!;\n points[j * 2] = ix;\n points[j * 2 + 1] = iy;\n }\n};\n"],"mappings":";;;;AAIA,MAAM,cAAc;;;;;;AAMpB,MAAM,mBAAmB;;;;;;;AAOzB,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;AAuB/B,MAAa,0BAA0B,aAAgE;CACrG,MAAM,SAAS,UAAU,QAAQ;CACjC,MAAM,QAAQ,OAAO,SAAS;CAE9B,aAAa,MAAM;CAEnB,IAAI,iBAAiB,MAAM,GACzB,OAAO,CAAC,SAAS,QAAQ,SAAS,KAAK,CAAC,CAAC;CAG3C,MAAM,UAAU,YAAY,MAAM;CAKlC,IAAI,QAAQ,YAAY,QAAQ,KAAK,GACnC,MAAM,IAAI,WACR,8DAA8D,QAAQ,SAAS,EAAE,MAAM,QAAQ,EAAE,oDACnG;CAGF,MAAM,aAAa,KAAK,IAAI,WAAW,MAAM,CAAC;CAC9C,MAAM,SAAS,eAAe,QAAQ,SAAS,aAAa,sBAAsB;CAClF,MAAM,QAAQ,OAAO,K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EA,MAAM,kBAAkB,WAA2B;CACjD,MAAM,QAAQ,OAAO,SAAS;CAE9B,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,MAAM,QAAQ,CAAC,GAAG,KAAK;EAC9C,MAAM,IAAI,QAAQ,IAAI;EACtB,MAAM,KAAK,OAAO,IAAI;EACtB,MAAM,KAAK,OAAO,IAAI,IAAI;EAE1B,OAAO,IAAI,KAAK,OAAO,IAAI;EAC3B,OAAO,IAAI,IAAI,KAAK,OAAO,IAAI,IAAI;EACnC,OAAO,IAAI,KAAK;EAChB,OAAO,IAAI,IAAI,KAAK;CACtB;AACF"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export type { AnyShape } from './AnyShape';
|
|
2
|
-
export { BoxShape } from './BoxShape';
|
|
3
|
-
export { CapsuleShape } from './CapsuleShape';
|
|
4
|
-
export { ChainShape, type ChainShapeOptions } from './ChainShape';
|
|
5
|
-
export { CircleShape } from './CircleShape';
|
|
6
|
-
export { PolygonShape } from './PolygonShape';
|
|
7
|
-
export { SegmentShape } from './SegmentShape';
|
|
8
|
-
export { Shape, type ShapeType } from './Shape';
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shapes/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import type { ContactRecord } from '../ContactGraph';
|
|
2
|
-
/**
|
|
3
|
-
* Native warm-started **TGS-Soft** contact solver (Box2D-v3 "soft step"). Driven
|
|
4
|
-
* by {@link PhysicsWorld} as a sub-stepping loop: detection runs once per frame,
|
|
5
|
-
* then {@link prepare} builds the per-contact constraints (effective masses,
|
|
6
|
-
* frame-start separation + impact velocity, soft factors, and a 2×2 block matrix
|
|
7
|
-
* for two-point manifolds) **once**, and each sub-step runs
|
|
8
|
-
* {@link warmStart} → {@link solveVelocities}(useBias=true) → integrate positions
|
|
9
|
-
* → {@link solveVelocities}(useBias=false) relax. A final {@link applyRestitution}
|
|
10
|
-
* pass adds bounce above the threshold.
|
|
11
|
-
*
|
|
12
|
-
* The position constraint is folded into the velocity solve as a **soft bias**
|
|
13
|
-
* (a damped-spring push-out whose stiffness is decoupled from the iteration
|
|
14
|
-
* count), recomputed each pass from the live per-body delta position/rotation -
|
|
15
|
-
* so there is no separate NGS geometric pass. The contact anchors are rotated by
|
|
16
|
-
* the live sub-step rotation each pass, so a tilting stack's restoring torque is
|
|
17
|
-
* computed against its current orientation (without this the tilt grows instead
|
|
18
|
-
* of being corrected). Two-point manifolds still solve the normal impulses **as a
|
|
19
|
-
* 2×2 block LCP** (Box2D-style), which propagates stack loads far better than
|
|
20
|
-
* solving the points sequentially; the block path carries the soft push-out as
|
|
21
|
-
* its velocity target (hard mass scale), while single-point contacts use the full
|
|
22
|
-
* soft mass/impulse scaling for as long as their push-out target stays inside
|
|
23
|
-
* the cap, and the hard scale once it is clamped. Accumulated impulses are
|
|
24
|
-
* written back to each {@link ContactRecord} for warm-starting the next frame.
|
|
25
|
-
*
|
|
26
|
-
* Internal to {@link NativePhysicsBackend}; not part of the public surface.
|
|
27
|
-
*/
|
|
28
|
-
export declare class ContactSolver {
|
|
29
|
-
private readonly _constraints;
|
|
30
|
-
private _count;
|
|
31
|
-
/**
|
|
32
|
-
* Build the per-contact constraints for this frame from the touching solid
|
|
33
|
-
* contacts. `h` is the sub-step duration (`fixedDelta / subStepCount`); the
|
|
34
|
-
* soft factors are derived from it together with `contactHertz`/`dampingRatio`.
|
|
35
|
-
* Runs once per frame (detection is not repeated per sub-step).
|
|
36
|
-
*/
|
|
37
|
-
prepare(contacts: readonly ContactRecord[], h: number, contactHertz: number, dampingRatio: number): void;
|
|
38
|
-
/** Re-apply the cached impulses from the previous frame (warm-starting); runs each sub-step. */
|
|
39
|
-
warmStart(): void;
|
|
40
|
-
/**
|
|
41
|
-
* One velocity pass over every contact: the normal constraint (block when
|
|
42
|
-
* possible) then friction (Coulomb cone). With `useBias` the normal solve
|
|
43
|
-
* carries the soft push-out bias (the main pass, recomputed from the live
|
|
44
|
-
* separation); without it the relax pass drives the normal velocity to zero so
|
|
45
|
-
* the bias velocity does not remain in the bodies as injected energy.
|
|
46
|
-
*/
|
|
47
|
-
solveVelocities(useBias: boolean): void;
|
|
48
|
-
/**
|
|
49
|
-
* Restitution pass, run once after the sub-step loop. For each loaded point
|
|
50
|
-
* whose frame-start impact speed exceeded the threshold, add the impulse that
|
|
51
|
-
* brings the post-solve normal velocity to `−restitution·impactSpeed`. Kept
|
|
52
|
-
* separate from the main solve so resting contacts (impact below threshold) do
|
|
53
|
-
* not micro-bounce.
|
|
54
|
-
*/
|
|
55
|
-
applyRestitution(): void;
|
|
56
|
-
/** Refresh the live (rotated) contact arms from each body's accumulated sub-step rotation. */
|
|
57
|
-
private _updateArms;
|
|
58
|
-
private _solveVelocityContact;
|
|
59
|
-
/** Per-point friction: clamp the accumulated tangent impulse to the Coulomb cone `±μ·normalImpulse`. */
|
|
60
|
-
private _solveFriction;
|
|
61
|
-
/**
|
|
62
|
-
* Single-point (or ill-conditioned) soft normal solve, accumulated and clamped
|
|
63
|
-
* ≥ 0. The Box2D-v3 incremental form: with the soft bias active the impulse is
|
|
64
|
-
* `−normalMass·massScale·(vn − bias) − impulseScale·accumulated`, which both
|
|
65
|
-
* pushes out the penetration and bleeds a little stored impulse (the damped
|
|
66
|
-
* spring). The relax pass passes `useBias=false`, collapsing it to the hard
|
|
67
|
-
* `−normalMass·vn` (no bias, full mass, no impulse decay).
|
|
68
|
-
*
|
|
69
|
-
* A point whose push-out target was clamped to `maxBiasVelocity` is solved
|
|
70
|
-
* with the hard scale as well: the soft scaling models a spring, and once the
|
|
71
|
-
* target is capped the point would otherwise reach only a fraction of an
|
|
72
|
-
* already limited push-out. That deficit grows with the load, so past the
|
|
73
|
-
* acceleration at which the cap binds the contact would sink without bound
|
|
74
|
-
* instead of settling into a slightly deeper limit cycle.
|
|
75
|
-
*/
|
|
76
|
-
private _solveNormalSequential;
|
|
77
|
-
/**
|
|
78
|
-
* Two-point block normal solve (Box2D LCP): find both new normal impulses
|
|
79
|
-
* `x ≥ 0` so the post-solve normal velocities equal the push-out targets
|
|
80
|
-
* (`velocityBias`, zero in the relax pass) and are complementary, trying the
|
|
81
|
-
* four corners (both active, one active, none). The block path carries the
|
|
82
|
-
* soft push-out as its target but solves with a hard mass scale.
|
|
83
|
-
*/
|
|
84
|
-
private _solveNormalBlock;
|
|
85
|
-
private _acquire;
|
|
86
|
-
/**
|
|
87
|
-
* Pooled constraint at `ci`. Every caller indexes within `0..this._count-1`
|
|
88
|
-
* and `_count` never exceeds the pool length, so the entry always exists; the
|
|
89
|
-
* throw is unreachable and only discharges `noUncheckedIndexedAccess` without a
|
|
90
|
-
* cast or non-null assertion.
|
|
91
|
-
*/
|
|
92
|
-
private _at;
|
|
93
|
-
}
|
|
94
|
-
//# sourceMappingURL=ContactSolver.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContactSolver.d.ts","sourceRoot":"","sources":["../../../src/solver/ContactSolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AA6FrD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA2B;IACxD,OAAO,CAAC,MAAM,CAAK;IAEnB;;;;;OAKG;IACI,OAAO,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAgI9G;IAED,gGAAgG;IACzF,SAAS,IAAI,IAAI,CAiBvB;IAED;;;;;;OAMG;IACI,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAI7C;IAED;;;;;;OAMG;IACI,gBAAgB,IAAI,IAAI,CAqC9B;IAED,8FAA8F;IAC9F,OAAO,CAAC,WAAW;IAmBnB,OAAO,CAAC,qBAAqB;IA4B7B,wGAAwG;IACxG,OAAO,CAAC,cAAc;IAsBtB;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,sBAAsB;IA8B9B;;;;;;OAMG;IACH,OAAO,CAAC,iBAAiB;IAiEzB,OAAO,CAAC,QAAQ;IAQhB;;;;;OAKG;IACH,OAAO,CAAC,GAAG;CASZ"}
|