@woosh/meep-engine 2.161.0 → 2.162.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/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"description": "Pure JavaScript game engine. Fully featured and production ready.",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"author": "Alexander Goldring",
|
|
9
|
-
"version": "2.
|
|
9
|
+
"version": "2.162.0",
|
|
10
10
|
"main": "build/meep.module.js",
|
|
11
11
|
"module": "build/meep.module.js",
|
|
12
12
|
"exports": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"make_cap.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/ecs/path/tube/build/make_cap.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"make_cap.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/ecs/path/tube/build/make_cap.js"],"names":[],"mappings":"AA+PA;;;;;;;;;;;;;;GAcG;AACH,4DAbW,MAAM,gBACN,YAAY,GAAC,MAAM,EAAE,cACrB,OAAO,EAAE,gBACT,OAAO,EAAE,eAET,OAAO,EAAE,SACT,MAAM,EAAE,gBACR,MAAM,EAAE,GAAC,YAAY,gBACrB,MAAM,mBACN,MAAM,EAAE,GAAC,YAAY,aACrB,MAAM,QACN,OAAO,QA6BjB;AAED;;;;;;GAMG;AACH,wDALW,MAAM,OACN;IAAC,aAAa,EAAC,MAAM,CAAC;IAAC,YAAY,EAAC,MAAM,CAAA;CAAC,mBAC3C,MAAM,QACN,OAAO,QAiBjB;wBAjUuB,OAAO;wBAMP,eAAe"}
|
|
@@ -79,10 +79,32 @@ function make_cap_round(
|
|
|
79
79
|
const B = in_binormals[index];
|
|
80
80
|
const T = in_tangents[index];
|
|
81
81
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
tangent
|
|
85
|
-
|
|
82
|
+
// Outward cap axis. Derive it from the PATH itself (the segment between the
|
|
83
|
+
// cap and its neighbour sample) rather than from N x B: the Frenet frame's
|
|
84
|
+
// tangent can flip sign at curvature features, and an N x B-derived axis
|
|
85
|
+
// would then make the cap bulge inward for a frame ("cap twists off-axis").
|
|
86
|
+
// The path direction is always well-defined and outward. Fall back to the
|
|
87
|
+
// frame only if the neighbour sample is coincident (degenerate segment).
|
|
88
|
+
const point_count = in_positions.length / 3;
|
|
89
|
+
const neighbour = direction > 0
|
|
90
|
+
? Math.min(index + 1, point_count - 1)
|
|
91
|
+
: Math.max(index - 1, 0);
|
|
92
|
+
const n3 = neighbour * 3;
|
|
93
|
+
|
|
94
|
+
const tangent = new Vector3(
|
|
95
|
+
Px - in_positions[n3],
|
|
96
|
+
Py - in_positions[n3 + 1],
|
|
97
|
+
Pz - in_positions[n3 + 2]
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
if (tangent.lengthSq() > 1e-12) {
|
|
101
|
+
tangent.normalize();
|
|
102
|
+
} else {
|
|
103
|
+
// degenerate: neighbour coincides with the cap point, use the frame
|
|
104
|
+
tangent.crossVectors(N, B);
|
|
105
|
+
tangent.normalize();
|
|
106
|
+
tangent.multiplyScalar(-direction);
|
|
107
|
+
}
|
|
86
108
|
|
|
87
109
|
const normal = direction > 0 ? N : N.clone().negate();
|
|
88
110
|
const binormal = direction > 0 ? B : B.clone().negate();
|