@ifc-lite/clash 2.3.1 → 2.4.2
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/adapters/step.js +1 -0
- package/dist/adapters/step.js.map +1 -1
- package/dist/analysis.d.ts +6 -6
- package/dist/analysis.d.ts.map +1 -1
- package/dist/analysis.js +30 -29
- package/dist/analysis.js.map +1 -1
- package/dist/contact/narrow-phase.js +1 -1
- package/dist/engine-ts/broad.d.ts.map +1 -1
- package/dist/engine-ts/broad.js +11 -10
- package/dist/engine-ts/broad.js.map +1 -1
- package/dist/engine-ts/depth.d.ts +83 -11
- package/dist/engine-ts/depth.d.ts.map +1 -1
- package/dist/engine-ts/depth.js +134 -67
- package/dist/engine-ts/depth.js.map +1 -1
- package/dist/engine-ts/kernel.d.ts +2 -0
- package/dist/engine-ts/kernel.d.ts.map +1 -1
- package/dist/engine-ts/narrow.d.ts +8 -0
- package/dist/engine-ts/narrow.d.ts.map +1 -1
- package/dist/engine-ts/narrow.js +24 -15
- package/dist/engine-ts/narrow.js.map +1 -1
- package/dist/engine-ts/obb-detect.d.ts +3 -0
- package/dist/engine-ts/obb-detect.d.ts.map +1 -0
- package/dist/engine-ts/obb-detect.js +298 -0
- package/dist/engine-ts/obb-detect.js.map +1 -0
- package/dist/engine-ts/obb.d.ts +14 -23
- package/dist/engine-ts/obb.d.ts.map +1 -1
- package/dist/engine-ts/obb.js +35 -140
- package/dist/engine-ts/obb.js.map +1 -1
- package/dist/engine-ts/orchestrator.d.ts.map +1 -1
- package/dist/engine-ts/orchestrator.js +59 -15
- package/dist/engine-ts/orchestrator.js.map +1 -1
- package/dist/engine-ts/tri-mesh.d.ts +10 -7
- package/dist/engine-ts/tri-mesh.d.ts.map +1 -1
- package/dist/engine-ts/tri-mesh.js +34 -28
- package/dist/engine-ts/tri-mesh.js.map +1 -1
- package/dist/engine-ts/ts-kernel.d.ts.map +1 -1
- package/dist/engine-ts/ts-kernel.js +1 -0
- package/dist/engine-ts/ts-kernel.js.map +1 -1
- package/dist/engine-wasm/wasm-kernel.d.ts.map +1 -1
- package/dist/engine-wasm/wasm-kernel.js +10 -1
- package/dist/engine-wasm/wasm-kernel.js.map +1 -1
- package/dist/math/aabb.d.ts +9 -0
- package/dist/math/aabb.d.ts.map +1 -1
- package/dist/math/aabb.js +13 -0
- package/dist/math/aabb.js.map +1 -1
- package/dist/math/generated/plato.g.d.ts +11 -2
- package/dist/math/generated/plato.g.d.ts.map +1 -1
- package/dist/math/generated/plato.g.js +347 -190
- package/dist/math/generated/plato.g.js.map +1 -1
- package/dist/math/triangle-intersect.d.ts +12 -6
- package/dist/math/triangle-intersect.d.ts.map +1 -1
- package/dist/math/triangle-intersect.js +12 -6
- package/dist/math/triangle-intersect.js.map +1 -1
- package/dist/types.d.ts +15 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +10 -10
package/dist/engine-ts/depth.js
CHANGED
|
@@ -1,76 +1,108 @@
|
|
|
1
1
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
2
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
3
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
-
import { isThroughPenetration,
|
|
4
|
+
import { isThroughPenetration, obbPenetration } from './obb.js';
|
|
5
|
+
import { depthFloor, estimateFloor } from '../math/aabb.js';
|
|
5
6
|
export function boxPenetration(small, large) {
|
|
6
7
|
const oa = small.getObb();
|
|
7
8
|
const ob = large.getObb();
|
|
8
9
|
if (!oa || !ob)
|
|
9
10
|
return null;
|
|
10
|
-
const
|
|
11
|
-
if (
|
|
11
|
+
const pen = obbPenetration(oa, ob);
|
|
12
|
+
if (pen == null)
|
|
12
13
|
return null;
|
|
13
|
-
return { mtd, through: isThroughPenetration(oa, ob) };
|
|
14
|
+
return { mtd: pen.depth, axis: pen.axis, through: isThroughPenetration(oa, ob) };
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
17
|
+
* Distance from `p` to `mesh`'s surface, and whether `p` is CLEAR of that
|
|
18
|
+
* surface: farther from it than the pair's depth floor along the direction
|
|
19
|
+
* from the nearest surface point to `p` (#5751).
|
|
20
|
+
*
|
|
21
|
+
* A ray-parity (`containsPoint`) verdict is trustworthy only for a clear
|
|
22
|
+
* point. For a point on the surface — which is exactly where a probe lands
|
|
23
|
+
* for a flush pair — parity is a coin flip decided by f32 rounding, and any
|
|
24
|
+
* rigid translation re-rolls it. The threshold is the classification floor
|
|
25
|
+
* itself (`depthFloor`, #5591): a point within it of a surface is within f32
|
|
26
|
+
* noise of being on it, so it is evidence of contact, not of volume. One rule
|
|
27
|
+
* for every probe that asks "is this point clearly inside". Bit-identical to
|
|
28
|
+
* the Rust `surface_clearance`.
|
|
22
29
|
*/
|
|
23
|
-
|
|
30
|
+
export function surfaceClearance(mesh, p, a, b) {
|
|
31
|
+
const [d, q] = mesh.closestOnSurface(p);
|
|
32
|
+
const clear = d > 0 && d > depthFloor([(p[0] - q[0]) / d, (p[1] - q[1]) / d, (p[2] - q[2]) / d], a, b);
|
|
33
|
+
return [d, clear];
|
|
34
|
+
}
|
|
35
|
+
/** `p` is inside `mesh`'s solid AND clear of its surface (see
|
|
36
|
+
* {@link surfaceClearance}). Parity first: it is the cheaper query. */
|
|
37
|
+
export function clearlyInside(mesh, p, a, b) {
|
|
38
|
+
return mesh.containsPoint(p) && surfaceClearance(mesh, p, a, b)[1];
|
|
39
|
+
}
|
|
24
40
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* coordinate magnitude (not a fixed constant — infra models sit far from the
|
|
28
|
-
* origin, where a fixed epsilon would be far too tight, and small models sit
|
|
29
|
-
* near it, where a fixed epsilon would be far too loose).
|
|
41
|
+
* Whether `inner` — AABB-contained in `outer`, with no triangle pair crossing
|
|
42
|
+
* beyond f32 noise — is buried in `outer`'s solid (#5473).
|
|
30
43
|
*
|
|
31
|
-
* `
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* the
|
|
37
|
-
*
|
|
38
|
-
* floor of 1.0 so a model near the origin still gets the single-unit ULP,
|
|
39
|
-
* not zero.
|
|
44
|
+
* With no crossing, each connected shell of `inner` lies entirely on one side
|
|
45
|
+
* of `outer`'s surface up to touching it, so one probe point per shell decides
|
|
46
|
+
* by ray parity — provided the probe is not itself on `outer`'s surface, where
|
|
47
|
+
* parity is a coin flip decided by f32 rounding. The old probe, `inner`'s
|
|
48
|
+
* first vertex, is exactly that point for a flush pair (an element resting
|
|
49
|
+
* against the inside of another's AABB touches it AT its vertices), so a rigid
|
|
50
|
+
* translation re-rolled the verdict.
|
|
40
51
|
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
+
* Candidates are `inner`'s vertex centroid (when that lies inside `inner`) and
|
|
53
|
+
* every vertex; a candidate is CLEAR of `outer`'s surface by
|
|
54
|
+
* {@link surfaceClearance} (the pair's depth floor along its own direction,
|
|
55
|
+
* the same rule as the AABB-penetration probe, #5751).
|
|
56
|
+
* 1. Any clear candidate inside `outer` means its shell is buried: `true`.
|
|
57
|
+
* Every candidate is checked, because `inner` may be several disconnected
|
|
58
|
+
* shells and only one of them need be buried (review of #5564); an outside
|
|
59
|
+
* shell must not end the search.
|
|
60
|
+
* 2. Otherwise any clear candidate is outside, and no shell is clearly
|
|
61
|
+
* buried: `false`.
|
|
62
|
+
* 3. With no clear candidate at all — every vertex on `outer`'s surface — the
|
|
63
|
+
* one farthest from it decides. That is what separates an element exactly
|
|
64
|
+
* filling a notch (its centroid is outside) from a duplicate of part of
|
|
65
|
+
* `outer` (its centroid is inside).
|
|
66
|
+
*
|
|
67
|
+
* `a` / `b` are the pair's element AABBs (in either order: the floor is
|
|
68
|
+
* symmetric). Visit order and strict comparisons keep the pick bit-identical
|
|
69
|
+
* to the Rust `contained_solid_is_buried`.
|
|
52
70
|
*/
|
|
53
|
-
function
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
71
|
+
export function containedSolidIsBuried(inner, outer, a, b) {
|
|
72
|
+
if (inner.count === 0)
|
|
73
|
+
return false;
|
|
74
|
+
const candidates = [];
|
|
75
|
+
const c = inner.vertexCentroid();
|
|
76
|
+
if (inner.containsPoint(c))
|
|
77
|
+
candidates.push(c);
|
|
78
|
+
const n = inner.vertexCount();
|
|
79
|
+
for (let i = 0; i < n; i += 1)
|
|
80
|
+
candidates.push(inner.vertex(i));
|
|
81
|
+
// 1. A clearly buried shell.
|
|
82
|
+
if (candidates.some((p) => clearlyInside(outer, p, a, b)))
|
|
83
|
+
return true;
|
|
84
|
+
// 2./3. No shell is clearly buried.
|
|
85
|
+
let probe = null;
|
|
86
|
+
let farthest = -Infinity;
|
|
87
|
+
for (const p of candidates) {
|
|
88
|
+
const [d, clear] = surfaceClearance(outer, p, a, b);
|
|
89
|
+
if (clear)
|
|
90
|
+
return false;
|
|
91
|
+
if (d > farthest) {
|
|
92
|
+
farthest = d;
|
|
93
|
+
probe = p;
|
|
62
94
|
}
|
|
63
95
|
}
|
|
64
|
-
return
|
|
96
|
+
return probe !== null && outer.containsPoint(probe);
|
|
65
97
|
}
|
|
66
98
|
/**
|
|
67
99
|
* Deepest penetration of `mesh`'s crossing-triangle VERTICES into `other`:
|
|
68
|
-
* the
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
100
|
+
* the vertex of the triangles flagged in `crossFlags` (the pairs the narrow
|
|
101
|
+
* phase saw genuinely crossing `other`) that lies inside `other` farthest
|
|
102
|
+
* from its surface. Each vertex is visited once (deduped by vertex index, in
|
|
103
|
+
* index order, strict `>` — bit-identical to the Rust
|
|
104
|
+
* `crossing_vertex_penetration`). `null` when no flagged vertex is strictly
|
|
105
|
+
* inside.
|
|
74
106
|
*
|
|
75
107
|
* This is NOT a depth metric and must never be reported as one — it is the
|
|
76
108
|
* sampling probe PR #2536 was held over (`maxPenetrationInto`): its value is
|
|
@@ -87,7 +119,7 @@ function precisionFloor(elA, elB) {
|
|
|
87
119
|
*/
|
|
88
120
|
export function crossingVertexPenetration(mesh, other, crossFlags) {
|
|
89
121
|
const seen = new Uint8Array(mesh.vertexCount());
|
|
90
|
-
let
|
|
122
|
+
let deepest = null;
|
|
91
123
|
for (let t = 0; t < mesh.count; t += 1) {
|
|
92
124
|
if (crossFlags[t] === 0)
|
|
93
125
|
continue;
|
|
@@ -98,12 +130,13 @@ export function crossingVertexPenetration(mesh, other, crossFlags) {
|
|
|
98
130
|
const v = mesh.vertex(vi);
|
|
99
131
|
if (!other.containsPoint(v))
|
|
100
132
|
continue;
|
|
101
|
-
const d = other.
|
|
102
|
-
if (d > depth)
|
|
103
|
-
|
|
133
|
+
const [d, q] = other.closestOnSurface(v);
|
|
134
|
+
if (d > (deepest?.depth ?? 0)) {
|
|
135
|
+
deepest = { depth: d, axis: [(v[0] - q[0]) / d, (v[1] - q[1]) / d, (v[2] - q[2]) / d] };
|
|
136
|
+
}
|
|
104
137
|
}
|
|
105
138
|
}
|
|
106
|
-
return
|
|
139
|
+
return deepest;
|
|
107
140
|
}
|
|
108
141
|
/**
|
|
109
142
|
* Turns the candidate penetration depths into the final `(status,
|
|
@@ -125,10 +158,22 @@ export function crossingVertexPenetration(mesh, other, crossFlags) {
|
|
|
125
158
|
* - the box MTD, when both elements are certified boxes (`box`);
|
|
126
159
|
* - the crossing-vertex penetration, for a CONTAINED pair with a crossing
|
|
127
160
|
* vertex inside the other solid (`meshEvidence`) — evidence for this gate
|
|
128
|
-
* only, never a reported depth (see `crossingVertexPenetration`)
|
|
161
|
+
* only, never a reported depth (see `crossingVertexPenetration`), and
|
|
162
|
+
* only where the reported depth would be the ESTIMATE (#5717).
|
|
163
|
+
*
|
|
164
|
+
* Each candidate is tested against the floor OF ITS OWN DIRECTION — the
|
|
165
|
+
* pair's per-axis f32 noise projected onto the direction that candidate was
|
|
166
|
+
* measured along (`depthFloor`, `estimateFloor`; #5405). A single floor from
|
|
167
|
+
* the max coordinate over all axes handed a Z-direction depth the noise of
|
|
168
|
+
* an X coordinate 10 km out: a genuine 2 mm overlap read as `touch` there and
|
|
169
|
+
* `hard` at the origin, and near the origin the X extent pinned the threshold
|
|
170
|
+
* for contacts that have no X component at all.
|
|
129
171
|
*
|
|
130
|
-
* The pair is `hard` only when
|
|
131
|
-
* floor
|
|
172
|
+
* The pair is `hard` only when every candidate that BEARS ON THE REPORTED
|
|
173
|
+
* NUMBER clears its floor — all three when the report is the estimate, and
|
|
174
|
+
* the estimate and the MTD when the box path certified a depth, since a
|
|
175
|
+
* sampling probe may not overrule an exact one (#5717).
|
|
176
|
+
* That is what makes the floor unreachable by depth-source selection:
|
|
132
177
|
* a sub-floor box MTD cannot be promoted by the through-penetration guard
|
|
133
178
|
* swapping in a larger AABB estimate; a sub-floor crossing-vertex
|
|
134
179
|
* penetration on a contained pair (surfaces authored flush — the eight
|
|
@@ -144,12 +189,32 @@ export function crossingVertexPenetration(mesh, other, crossFlags) {
|
|
|
144
189
|
* from.
|
|
145
190
|
*/
|
|
146
191
|
export function depthClashResult(box, estimate, meshEvidence, elA, elB, rule, point, bounds) {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
192
|
+
// `||` in the same order as the Rust kernel, each comparison `<=` so a NaN
|
|
193
|
+
// candidate never counts as below its floor, on either side.
|
|
194
|
+
const estFloor = estimateFloor(elA.bounds, elB.bounds);
|
|
195
|
+
const boxFloor = box != null ? depthFloor(box.axis, elA.bounds, elB.bounds) : null;
|
|
196
|
+
// Whether the pair has a CERTIFIED depth, i.e. whether the number this
|
|
197
|
+
// function would report is the exact box MTD or the AABB estimate. Hoisted
|
|
198
|
+
// above the floor test because the mesh-evidence term needs it too.
|
|
199
|
+
const measured = box != null && !box.through;
|
|
200
|
+
const belowFloor = estimate <= estFloor ||
|
|
201
|
+
(box != null && boxFloor != null && box.mtd <= boxFloor) ||
|
|
202
|
+
// Mesh evidence guards the ESTIMATE, and only the estimate (#5717).
|
|
203
|
+
// `crossingVertexPenetration` is not a depth metric — its own doc
|
|
204
|
+
// comment says so, and it underestimates by an amount that depends on
|
|
205
|
+
// tessellation. That is harmless when it is the only thing standing
|
|
206
|
+
// between a flush contained pair and a fabricated AABB estimate, the
|
|
207
|
+
// case it was added for. It is not harmless against a certified box
|
|
208
|
+
// MTD: a vertex lying ON a face the two boxes share reads as a
|
|
209
|
+
// sub-floor "penetration" once rotation pushes it a noise-width
|
|
210
|
+
// inside, and vetoed a 20 mm overlap the exact box depth had measured
|
|
211
|
+
// correctly. Two boxes that are genuinely flush already report 0
|
|
212
|
+
// through the MTD term above (#5355), so nothing here needs the
|
|
213
|
+
// probe's second opinion.
|
|
214
|
+
(!measured &&
|
|
215
|
+
meshEvidence != null &&
|
|
216
|
+
meshEvidence.depth <= depthFloor(meshEvidence.axis, elA.bounds, elB.bounds));
|
|
217
|
+
if (belowFloor) {
|
|
153
218
|
if (!rule.reportTouch)
|
|
154
219
|
return null;
|
|
155
220
|
// distance is exactly 0 here (the classification, not a measurement, is
|
|
@@ -160,13 +225,15 @@ export function depthClashResult(box, estimate, meshEvidence, elA, elB, rule, po
|
|
|
160
225
|
// Estimate-vs-mesh selection, reachable only above the floor: the box MTD
|
|
161
226
|
// is certified (`mesh`) unless the pair is a through-penetration, where
|
|
162
227
|
// the AABB estimate is the honest number (see `boxPenetration`).
|
|
163
|
-
|
|
228
|
+
// The reported depth carries ITS OWN floor out with it (#5639), so the
|
|
229
|
+
// reported touching band is decided by the same rule as this verdict.
|
|
164
230
|
return {
|
|
165
231
|
status: 'hard',
|
|
166
232
|
distance: -(measured ? box.mtd : estimate),
|
|
167
233
|
distanceKind: measured ? 'mesh' : 'estimate',
|
|
168
234
|
point,
|
|
169
235
|
bounds,
|
|
236
|
+
depthFloor: measured && boxFloor != null ? boxFloor : estFloor,
|
|
170
237
|
};
|
|
171
238
|
}
|
|
172
239
|
//# sourceMappingURL=depth.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"depth.js","sourceRoot":"","sources":["../../src/engine-ts/depth.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAY/D,OAAO,EAAE,oBAAoB,EAAE,
|
|
1
|
+
{"version":3,"file":"depth.js","sourceRoot":"","sources":["../../src/engine-ts/depth.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAY/D,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAgC5D,MAAM,UAAU,cAAc,CAAC,KAAc,EAAE,KAAc;IAC3D,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;IAC1B,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;IAC1B,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE;QAAE,OAAO,IAAI,CAAC;IAC5B,MAAM,GAAG,GAAG,cAAc,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IACnC,IAAI,GAAG,IAAI,IAAI;QAAE,OAAO,IAAI,CAAC;IAC7B,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,oBAAoB,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC;AACnF,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAa,EAAE,CA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AAC,QAAQ,CAAC;QAC1C,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU;QAC5C,KAAK;QACL,MAAM;QACN,UAAU,EAAE,QAAQ,IAAI,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ;KAC/D,CAAC;AACJ,CAAC"}
|
|
@@ -16,6 +16,8 @@ export interface NarrowRecord {
|
|
|
16
16
|
distanceKind: ClashDistanceKind;
|
|
17
17
|
point: Vec3;
|
|
18
18
|
bounds: AABB;
|
|
19
|
+
/** See `Clash.depthFloor`. Absent for every non-`hard` record. */
|
|
20
|
+
depthFloor?: number;
|
|
19
21
|
}
|
|
20
22
|
export interface RuleDetection {
|
|
21
23
|
records: NarrowRecord[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kernel.d.ts","sourceRoot":"","sources":["../../src/engine-ts/kernel.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,iBAAiB,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEvG;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,uDAAuD;IACvD,CAAC,EAAE,MAAM,CAAC;IACV,uDAAuD;IACvD,CAAC,EAAE,MAAM,CAAC;IACV,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,iFAAiF;IACjF,YAAY,EAAE,iBAAiB,CAAC;IAChC,KAAK,EAAE,IAAI,CAAC;IACZ,MAAM,EAAE,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"kernel.d.ts","sourceRoot":"","sources":["../../src/engine-ts/kernel.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,iBAAiB,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEvG;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` result, the f32 noise floor of `distance` along the
|
|
16
|
+
* direction it was measured (`depthFloor` / `estimateFloor`): the depth at
|
|
17
|
+
* or below which this pair would have been `touch`. Absent otherwise.
|
|
18
|
+
* Carried out so the reported touching band is decided by the same rule as
|
|
19
|
+
* the verdict (#5639). Mirrors the Rust `NarrowResult::depth_floor`.
|
|
20
|
+
*/
|
|
21
|
+
depthFloor?: number;
|
|
14
22
|
}
|
|
15
23
|
/**
|
|
16
24
|
* Narrow-phase test for one candidate element pair.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"narrow.d.ts","sourceRoot":"","sources":["../../src/engine-ts/narrow.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,iBAAiB,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAKvG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAG7C,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,YAAY,EAAE,iBAAiB,CAAC;IAChC,KAAK,EAAE,IAAI,CAAC;IACZ,MAAM,EAAE,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"narrow.d.ts","sourceRoot":"","sources":["../../src/engine-ts/narrow.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,iBAAiB,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAKvG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAG7C,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,YAAY,EAAE,iBAAiB,CAAC;IAChC,KAAK,EAAE,IAAI,CAAC;IACZ,MAAM,EAAE,IAAI,CAAC;IACb;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAID;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CACtB,GAAG,EAAE,YAAY,EACjB,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,YAAY,EACjB,IAAI,EAAE,OAAO,EACb,IAAI,EAAE,SAAS,EACf,SAAS,EAAE,MAAM,GAChB,YAAY,GAAG,IAAI,CAoQrB"}
|
package/dist/engine-ts/narrow.js
CHANGED
|
@@ -5,7 +5,7 @@ import { aabbContains, boundsOfPoints, center, inflate, overlapBounds, signedGap
|
|
|
5
5
|
import { centroid, mid } from '../math/vec3.js';
|
|
6
6
|
import { triTriIntersect } from '../math/triangle-intersect.js';
|
|
7
7
|
import { triTriDistance } from '../math/triangle-distance.js';
|
|
8
|
-
import { boxPenetration, crossingVertexPenetration, depthClashResult } from './depth.js';
|
|
8
|
+
import { boxPenetration, clearlyInside, containedSolidIsBuried, crossingVertexPenetration, depthClashResult } from './depth.js';
|
|
9
9
|
/**
|
|
10
10
|
* Narrow-phase test for one candidate element pair.
|
|
11
11
|
*
|
|
@@ -165,32 +165,36 @@ export function testPair(elA, triA, elB, triB, rule, tolerance) {
|
|
|
165
165
|
// extent), so without it a flush contained pair — whose only measurable
|
|
166
166
|
// penetration is f32 noise — would be promoted to `hard` at a number
|
|
167
167
|
// that measures nothing (the eight Infra-Bridge pairs, see
|
|
168
|
-
// `depthClashResult`).
|
|
168
|
+
// `depthClashResult`). Since #5406 a pair flush to within the tri-tri
|
|
169
|
+
// predicate's own f32 noise band no longer crosses at all; this still
|
|
170
|
+
// decides a crossing above that band but at or below its precision floor.
|
|
171
|
+
// `null` means "no crossing vertex inside at all" (e.g. a thin member
|
|
172
|
+
// piercing straight through) — no evidence either way, not evidence of a
|
|
173
|
+
// sub-floor contact. The deeper side wins, the small side on a tie (the
|
|
174
|
+
// Rust kernel's order).
|
|
169
175
|
let meshEvidence = null;
|
|
170
176
|
if (crossSmall !== null && crossLarge !== null) {
|
|
171
|
-
const
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
// of a sub-floor contact.
|
|
175
|
-
if (d > 0)
|
|
176
|
-
meshEvidence = d;
|
|
177
|
+
const s = crossingVertexPenetration(small, large, crossSmall);
|
|
178
|
+
const l = crossingVertexPenetration(large, small, crossLarge);
|
|
179
|
+
meshEvidence = s !== null && l !== null && l.depth > s.depth ? l : (s ?? l);
|
|
177
180
|
}
|
|
178
181
|
return depthClashResult(boxPenetration(small, large), Math.max(0, -signedGap(elA.bounds, elB.bounds)), meshEvidence, elA, elB, rule, point, contactBounds);
|
|
179
182
|
}
|
|
180
183
|
// Fully-enclosed solid: no surface crossing, but one element's AABB is wholly
|
|
181
184
|
// inside the other's, so it may be buried (e.g. equipment inside a slab). With
|
|
182
185
|
// no surface crossing the inner solid is entirely inside OR entirely outside
|
|
183
|
-
// the other, so ray-casting ONE
|
|
184
|
-
//
|
|
185
|
-
//
|
|
186
|
+
// the other, so ray-casting ONE probe point of the contained mesh against the
|
|
187
|
+
// other solid decides it — and ray casting (not an AABB test) correctly
|
|
188
|
+
// returns "outside" when the inner sits in a concave notch. The probe is
|
|
189
|
+
// chosen off the other's surface, see `containedSolidIsBuried` (#5473).
|
|
186
190
|
// Test B-contains-A first, then A-contains-B, so the inner pick is
|
|
187
191
|
// deterministic (and identical to the Rust kernel) on equal AABBs.
|
|
188
192
|
// Either way there is no surface crossing. When both elements are boxes the
|
|
189
193
|
// exact box-box depth is available (see `boxPenetration`) and is reported
|
|
190
194
|
// as measured; otherwise the AABB gap is an estimate, not a measured depth.
|
|
191
195
|
const enclosed = aabbContains(elB.bounds, elA.bounds)
|
|
192
|
-
? triA
|
|
193
|
-
: aabbContains(elA.bounds, elB.bounds) && triB
|
|
196
|
+
? containedSolidIsBuried(triA, triB, elA.bounds, elB.bounds)
|
|
197
|
+
: aabbContains(elA.bounds, elB.bounds) && containedSolidIsBuried(triB, triA, elA.bounds, elB.bounds);
|
|
194
198
|
if (enclosed) {
|
|
195
199
|
// `depthClashResult` may return `null` here (below the f32 floor and
|
|
196
200
|
// `!rule.reportTouch`) — that is a suppressed touch, not "no clash",
|
|
@@ -218,8 +222,13 @@ export function testPair(elA, triA, elB, triB, rule, tolerance) {
|
|
|
218
222
|
if (gap < -tolerance) {
|
|
219
223
|
const probeCentroid = mid(triA.vertexCentroid(), triB.vertexCentroid());
|
|
220
224
|
const probeOverlap = center(overlap);
|
|
221
|
-
|
|
222
|
-
|
|
225
|
+
// Each probe counts only when it is CLEARLY inside both solids: for a
|
|
226
|
+
// flush pair the AABB-overlap centre sits ON the shared face, where ray
|
|
227
|
+
// parity is a coin flip, and a lucky flip used to report the pair `hard`
|
|
228
|
+
// at the AABB estimate (an element dimension, not a depth) — differently
|
|
229
|
+
// wherever the model sat (#5751). Same rule as `containedSolidIsBuried`.
|
|
230
|
+
const insideBoth = (p) => clearlyInside(triA, p, elA.bounds, elB.bounds) && clearlyInside(triB, p, elA.bounds, elB.bounds);
|
|
231
|
+
if (insideBoth(probeCentroid) || insideBoth(probeOverlap)) {
|
|
223
232
|
// Report the tight contact region (the touching patch where the surfaces
|
|
224
233
|
// actually coincide), clamped to the element overlap — not the whole-
|
|
225
234
|
// element AABB intersection, which for angled members spans nearly the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"narrow.js","sourceRoot":"","sources":["../../src/engine-ts/narrow.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAG/D,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC1G,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,yBAAyB,EAAE,gBAAg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