@kineviz/gl 0.4.1 → 0.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/index.js +17 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -3
- package/dist/index.mjs.map +1 -1
- package/dist/kineviz-gl.umd.js +17 -3
- package/package.json +1 -1
package/dist/kineviz-gl.umd.js
CHANGED
|
@@ -84849,9 +84849,23 @@ void main() {
|
|
|
84849
84849
|
sz += posArray[gidx * 3 + 2];
|
|
84850
84850
|
}
|
|
84851
84851
|
const n = neighbors.length;
|
|
84852
|
-
|
|
84853
|
-
|
|
84854
|
-
|
|
84852
|
+
let cx = sx / n, cy = sy / n, cz = sz / n;
|
|
84853
|
+
if (!isPlanar) {
|
|
84854
|
+
const len = Math.hypot(cx, cy, cz);
|
|
84855
|
+
if (len > 1e-6) {
|
|
84856
|
+
const s = radius / len;
|
|
84857
|
+
cx *= s;
|
|
84858
|
+
cy *= s;
|
|
84859
|
+
cz *= s;
|
|
84860
|
+
} else {
|
|
84861
|
+
cx = 0;
|
|
84862
|
+
cy = 0;
|
|
84863
|
+
cz = radius;
|
|
84864
|
+
}
|
|
84865
|
+
}
|
|
84866
|
+
posArray[idx * 3] = cx + (Math.random() - 0.5) * 2 * jitter;
|
|
84867
|
+
posArray[idx * 3 + 1] = cy + (Math.random() - 0.5) * 2 * jitter;
|
|
84868
|
+
posArray[idx * 3 + 2] = isPlanar ? 0 : cz + (Math.random() - 0.5) * 2 * jitter;
|
|
84855
84869
|
} else if (isPlanar) {
|
|
84856
84870
|
posArray[idx * 3 + 2] = 0;
|
|
84857
84871
|
}
|