@nebula-spatial/viewer 0.6.4 → 0.6.6
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/CHANGELOG.md +22 -0
- package/README.md +5 -0
- package/dist/assets/mujoco-physics-worker-MMv4Gmu_.js +5482 -0
- package/dist/assets/{usd-worker-jdyS9s6r.js → usd-worker-HijL9KRX.js} +266 -262
- package/dist/dynamic-raycast-Ctu2X5u5.js +677 -0
- package/dist/{index-QdE4B8Hz.js → index-DyBfusq5.js} +3910 -3522
- package/dist/index.js +12 -12
- package/dist/{mjcf-visual-De37eJ9x.js → mjcf-visual-5WZebsIs.js} +7 -7
- package/dist/mujoco-runtime-CZSNQ7An.js +1601 -0
- package/dist/{session-b0epJBBq.js → session-BerXscrf.js} +7 -7
- package/dist/{session-DDGiY6I8.js → session-CzJBN0Us.js} +19 -19
- package/dist/session-DXUACJAS.js +719 -0
- package/dist/simulation/types.d.ts +26 -0
- package/dist/{spark-renderer-upJSRoni.js → spark-renderer-dvFIUjr0.js} +1 -1
- package/dist/{urdf-session-B-nvkfBZ.js → urdf-session-DRHt0jW4.js} +34 -34
- package/dist/usd-session-CLU3UR4C.js +12726 -0
- package/dist/version.d.ts +1 -1
- package/dist/{xacro-BoRKvNlt.js → xacro-BV6bRVpX.js} +1 -1
- package/openusd/openusd-runtime-manifest.json +3 -3
- package/openusd/openusd_probe.wasm +0 -0
- package/package.json +2 -2
- package/dist/asset-ir-CodOg3S4.js +0 -637
- package/dist/mujoco-runtime-BGh1TiiB.js +0 -791
- package/dist/session-BSSjaFpR.js +0 -562
- package/dist/usd-session-CU8fHxm9.js +0 -11603
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Group as O, MeshStandardMaterial as Z, Mesh as z, PointsMaterial as H, Points as
|
|
1
|
+
import { Group as O, MeshStandardMaterial as Z, Mesh as z, PointsMaterial as H, Points as Q, Color as j, Box3 as $, Vector3 as b, MeshBasicMaterial as J, BoxGeometry as q } from "three";
|
|
2
2
|
import { PLYLoader as X } from "three/examples/jsm/loaders/PLYLoader.js";
|
|
3
3
|
import { S as ee, a as x } from "./spark.module-kM8pwA1o.js";
|
|
4
|
-
import {
|
|
5
|
-
import { a as re, r as ae } from "./spark-renderer-
|
|
4
|
+
import { Q as te, B as _, D as ne, E as ie } from "./index-DyBfusq5.js";
|
|
5
|
+
import { a as re, r as ae } from "./spark-renderer-dvFIUjr0.js";
|
|
6
6
|
function xe(t, e) {
|
|
7
7
|
let u = !1, s = null, c = null, i = null, o = null, w = null, d = null, h = null, r = null, v = "unsupported", B = null, F = null, k = null, S = "y", G;
|
|
8
8
|
const V = P(), T = () => {
|
|
@@ -12,7 +12,7 @@ function xe(t, e) {
|
|
|
12
12
|
}, Y = (n, f) => {
|
|
13
13
|
(h == null ? void 0 : h.scene) !== f && (U(), h = re(n, f, e.requestRender));
|
|
14
14
|
}, E = (async () => {
|
|
15
|
-
var C, N, R, D,
|
|
15
|
+
var C, N, R, D, W, L;
|
|
16
16
|
const n = await le(t);
|
|
17
17
|
if (u || e.signal.aborted) throw I();
|
|
18
18
|
const f = t.entryPath ?? t.filename, p = te(n, f, e.format);
|
|
@@ -42,7 +42,7 @@ function xe(t, e) {
|
|
|
42
42
|
vertexColors: a,
|
|
43
43
|
size: Math.max(4e-3, de(l.boundingBox) * 3e-3),
|
|
44
44
|
sizeAttenuation: !0
|
|
45
|
-
}), g = new
|
|
45
|
+
}), g = new Q(l, y);
|
|
46
46
|
g.name = "viewer-visual-ply-points", m.add(g);
|
|
47
47
|
}
|
|
48
48
|
B = null;
|
|
@@ -55,11 +55,11 @@ function xe(t, e) {
|
|
|
55
55
|
});
|
|
56
56
|
if (await a.initialized, u || e.signal.aborted)
|
|
57
57
|
throw a.dispose(), I();
|
|
58
|
-
if (a.name = "viewer-visual-splat", a.position.set(0, 0, 0), (C = e.options.visualAppearance) != null && C.color && (a.recolor = new
|
|
58
|
+
if (a.name = "viewer-visual-splat", a.position.set(0, 0, 0), (C = e.options.visualAppearance) != null && C.color && (a.recolor = new j(...e.options.visualAppearance.color)), ((N = e.options.visualAppearance) == null ? void 0 : N.opacity) !== void 0 && (a.opacity = e.options.visualAppearance.opacity), m.add(a), o = a, B = ((R = a.packedSplats) == null ? void 0 : R.numSplats) ?? ((D = a.extSplats) == null ? void 0 : D.numSplats) ?? ((W = a.paged) == null ? void 0 : W.numSplats) ?? ((L = a.splats) == null ? void 0 : L.getNumSplats()) ?? null, w = pe(a), w.isEmpty()) throw new Error("Gaussian asset has empty bounds.");
|
|
59
59
|
}
|
|
60
60
|
if (S = e.options.upAxis ?? oe(p.kind), _(m, S), A.add(m), m.updateMatrixWorld(!0), r = new $().setFromObject(m), o && w && (o.updateWorldMatrix(!0, !1), r.union(w.clone().applyMatrix4(o.matrixWorld))), r.isEmpty()) throw new Error("Visual asset has no displayable bounds.");
|
|
61
61
|
if (o && e.options.visualSelectionMode !== "exact") {
|
|
62
|
-
const l = r.getSize(new b()), a = new
|
|
62
|
+
const l = r.getSize(new b()), a = new J({
|
|
63
63
|
transparent: !0,
|
|
64
64
|
// The scene picker filters fully transparent materials, while colorWrite
|
|
65
65
|
// keeps this raycastable proxy invisible in the rendered frame.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DataTexture as ne, LinearMipmapLinearFilter as Xe, LinearFilter as _e, Loader as J, LoaderUtils as Ve, FileLoader as Ge, TextureLoader as Se, RepeatWrapping as pe, ClampToEdgeWrapping as fe, Texture as Y, MeshPhongMaterial as W, MeshLambertMaterial as Fe, ColorManagement as N, Color as k, SRGBColorSpace as X, EquirectangularReflectionMapping as Ne, Matrix4 as L, Group as ce, Bone as he, PropertyBinding as ee, Object3D as Z, PerspectiveCamera as $e, PointLight as de, MathUtils as B, SpotLight as
|
|
1
|
+
import { DataTexture as ne, LinearMipmapLinearFilter as Xe, LinearFilter as _e, Loader as J, LoaderUtils as Ve, FileLoader as Ge, TextureLoader as Se, RepeatWrapping as pe, ClampToEdgeWrapping as fe, Texture as Y, MeshPhongMaterial as W, MeshLambertMaterial as Fe, ColorManagement as N, Color as k, SRGBColorSpace as X, EquirectangularReflectionMapping as Ne, Matrix4 as L, Group as ce, Bone as he, PropertyBinding as ee, Object3D as Z, PerspectiveCamera as $e, PointLight as de, MathUtils as B, SpotLight as je, DirectionalLight as ze, SkinnedMesh as He, Mesh as Ae, LineBasicMaterial as We, Line as Ye, Vector3 as V, Skeleton as qe, AmbientLight as Ke, BufferGeometry as re, Float32BufferAttribute as z, Uint16BufferAttribute as Ze, Matrix3 as Qe, Vector2 as Je, ShapeUtils as et, Vector4 as tt, Euler as j, AnimationClip as nt, Quaternion as G, VectorKeyframeTrack as rt, QuaternionKeyframeTrack as me, NumberKeyframeTrack as st, LoadingManager as at, LinearSRGBColorSpace as ge, RGBAFormat as Ie, UnsignedByteType as Re, NoColorSpace as ot, MeshPhysicalMaterial as De, Box3 as it } from "three";
|
|
2
2
|
import { DRACOLoader as lt } from "three/examples/jsm/loaders/DRACOLoader.js";
|
|
3
3
|
import { GLTFLoader as ct } from "three/examples/jsm/loaders/GLTFLoader.js";
|
|
4
|
-
import {
|
|
4
|
+
import { A as ye, B as we, D as ut, d as ve, E as pt } from "./index-DyBfusq5.js";
|
|
5
5
|
import { TGALoader as ft } from "three/examples/jsm/loaders/TGALoader.js";
|
|
6
6
|
import * as ht from "three/examples/jsm/libs/fflate.module.js";
|
|
7
7
|
import { unzlibSync as dt } from "three/examples/jsm/libs/fflate.module.js";
|
|
@@ -551,13 +551,13 @@ class Et {
|
|
|
551
551
|
t = new de(s, a, i, l);
|
|
552
552
|
break;
|
|
553
553
|
case 1:
|
|
554
|
-
t = new
|
|
554
|
+
t = new ze(s, a);
|
|
555
555
|
break;
|
|
556
556
|
case 2:
|
|
557
557
|
let p = Math.PI / 3;
|
|
558
558
|
n.InnerAngle !== void 0 && (p = B.degToRad(n.InnerAngle.value));
|
|
559
559
|
let f = 0;
|
|
560
|
-
n.OuterAngle !== void 0 && (f = B.degToRad(n.OuterAngle.value), f = Math.max(f, 1)), t = new
|
|
560
|
+
n.OuterAngle !== void 0 && (f = B.degToRad(n.OuterAngle.value), f = Math.max(f, 1)), t = new je(s, a, i, p, f, l);
|
|
561
561
|
break;
|
|
562
562
|
default:
|
|
563
563
|
console.warn("THREE.FBXLoader: Unknown light type " + n.LightType.value + ", defaulting to a PointLight."), t = new de(s, a);
|
|
@@ -703,14 +703,14 @@ class bt {
|
|
|
703
703
|
genGeometry(e, t, n, r) {
|
|
704
704
|
const s = new re();
|
|
705
705
|
e.attrName && (s.name = e.attrName);
|
|
706
|
-
const a = this.parseGeoNode(e, t), i = this.genBuffers(a), l = new
|
|
707
|
-
if (l.applyMatrix4(r), s.setAttribute("position", l), i.colors.length > 0 && s.setAttribute("color", new
|
|
708
|
-
const p = new Qe().getNormalMatrix(r), f = new
|
|
706
|
+
const a = this.parseGeoNode(e, t), i = this.genBuffers(a), l = new z(i.vertex, 3);
|
|
707
|
+
if (l.applyMatrix4(r), s.setAttribute("position", l), i.colors.length > 0 && s.setAttribute("color", new z(i.colors, 3)), t && (s.setAttribute("skinIndex", new Ze(i.weightsIndices, 4)), s.setAttribute("skinWeight", new z(i.vertexWeights, 4)), s.FBX_Deformer = t), i.normal.length > 0) {
|
|
708
|
+
const p = new Qe().getNormalMatrix(r), f = new z(i.normal, 3);
|
|
709
709
|
f.applyNormalMatrix(p), s.setAttribute("normal", f);
|
|
710
710
|
}
|
|
711
711
|
if (i.uvs.forEach(function(p, f) {
|
|
712
712
|
const u = f === 0 ? "uv" : `uv${f}`;
|
|
713
|
-
s.setAttribute(u, new
|
|
713
|
+
s.setAttribute(u, new z(i.uvs[f], 2));
|
|
714
714
|
}), a.material && a.material.mappingType !== "AllSame") {
|
|
715
715
|
let p = i.materialIndex[0], f = 0;
|
|
716
716
|
if (i.materialIndex.forEach(function(u, c) {
|
|
@@ -864,7 +864,7 @@ class bt {
|
|
|
864
864
|
vertexIndices: i,
|
|
865
865
|
vertexPositions: u,
|
|
866
866
|
baseVertexPositions: a
|
|
867
|
-
}, h = this.genBuffers(c), m = new
|
|
867
|
+
}, h = this.genBuffers(c), m = new z(h.vertex, 3);
|
|
868
868
|
m.name = s || n.attrName, m.applyMatrix4(r), e.morphAttributes.position.push(m);
|
|
869
869
|
}
|
|
870
870
|
// Parse normal from FBXTree.Objects.Geometry.LayerElementNormal if it exists
|
|
@@ -1106,8 +1106,8 @@ class Mt {
|
|
|
1106
1106
|
a = c[0], i = c[1];
|
|
1107
1107
|
}
|
|
1108
1108
|
const l = q(0);
|
|
1109
|
-
n !== void 0 && (n = n.map(B.degToRad), n.push(l), n = new
|
|
1110
|
-
const p = new G(), f = new
|
|
1109
|
+
n !== void 0 && (n = n.map(B.degToRad), n.push(l), n = new j().fromArray(n), n = new G().setFromEuler(n)), r !== void 0 && (r = r.map(B.degToRad), r.push(l), r = new j().fromArray(r), r = new G().setFromEuler(r).invert());
|
|
1110
|
+
const p = new G(), f = new j(), u = [];
|
|
1111
1111
|
if (!i || !a) return new me(e + ".quaternion", [0], [0]);
|
|
1112
1112
|
for (let c = 0; c < i.length; c += 3)
|
|
1113
1113
|
f.set(i[c], i[c + 1], i[c + 2], s), p.setFromEuler(f), n !== void 0 && p.premultiply(n), r !== void 0 && p.multiply(r), c > 2 && new G().fromArray(
|
|
@@ -1190,9 +1190,9 @@ class Mt {
|
|
|
1190
1190
|
Math.abs(c[2])
|
|
1191
1191
|
];
|
|
1192
1192
|
if (h[0] >= 180 || h[1] >= 180 || h[2] >= 180) {
|
|
1193
|
-
const g = Math.max(...h) / 180, d = new
|
|
1193
|
+
const g = Math.max(...h) / 180, d = new j(...p, r), T = new j(...u, r), F = new G().setFromEuler(d), y = new G().setFromEuler(T);
|
|
1194
1194
|
F.dot(y) && y.set(-y.x, -y.y, -y.z, -y.w);
|
|
1195
|
-
const x = e.times[i - 1], A = e.times[i] - x, I = new G(), b = new
|
|
1195
|
+
const x = e.times[i - 1], A = e.times[i] - x, I = new G(), b = new j();
|
|
1196
1196
|
for (let v = 0; v < 1; v += 1 / g)
|
|
1197
1197
|
I.copy(F.clone().slerp(y.clone(), v)), s.push(x + v * A), b.setFromQuaternion(I, r), a.push(b.x), a.push(b.y), a.push(b.z);
|
|
1198
1198
|
} else
|
|
@@ -1572,7 +1572,7 @@ function Q(o, e, t, n) {
|
|
|
1572
1572
|
const s = r * n.dataSize, a = s + n.dataSize;
|
|
1573
1573
|
return Ct(Dt, n.buffer, s, a);
|
|
1574
1574
|
}
|
|
1575
|
-
const se = new
|
|
1575
|
+
const se = new j(), H = new V();
|
|
1576
1576
|
function Le(o) {
|
|
1577
1577
|
const e = new L(), t = new L(), n = new L(), r = new L(), s = new L(), a = new L(), i = new L(), l = new L(), p = new L(), f = new L(), u = new L(), c = new L(), h = o.inheritType ? o.inheritType : 0;
|
|
1578
1578
|
o.translation && e.setPosition(H.fromArray(o.translation));
|
|
@@ -1733,7 +1733,7 @@ async function Lt(o, e, t) {
|
|
|
1733
1733
|
return m = new xt(u).parse(o, ""), await Promise.all(i), e.signal.throwIfAborted(), { root: m, textures: l, textureFailures: f };
|
|
1734
1734
|
} catch (g) {
|
|
1735
1735
|
if (n.abort(g), await Promise.allSettled(i), m) {
|
|
1736
|
-
const { disposeModelResources: d } = await import("./index-
|
|
1736
|
+
const { disposeModelResources: d } = await import("./index-DyBfusq5.js").then((T) => T.af);
|
|
1737
1737
|
d(m, l);
|
|
1738
1738
|
} else for (const d of l) d.dispose();
|
|
1739
1739
|
throw g;
|
|
@@ -1940,7 +1940,7 @@ function Nt(o) {
|
|
|
1940
1940
|
if (p.endOffset > s) throw new Error("FBX child extends past its parent.");
|
|
1941
1941
|
if (te.has(p.name) || Be.has(p.name)) {
|
|
1942
1942
|
const f = K(e, l, t, p.name !== "UV");
|
|
1943
|
-
i.push({ name: f.name, values: ["BlendModes", "Alphas"].includes(f.name) ?
|
|
1943
|
+
i.push({ name: f.name, values: ["BlendModes", "Alphas"].includes(f.name) ? jt(e, l, t, f.childrenOffset) : [...f.properties], children: te.has(f.name) ? n(f.childrenOffset, f.endOffset, a + 1) : [] });
|
|
1944
1944
|
}
|
|
1945
1945
|
l = p.endOffset;
|
|
1946
1946
|
}
|
|
@@ -2010,7 +2010,7 @@ function $t(o) {
|
|
|
2010
2010
|
};
|
|
2011
2011
|
return s(0);
|
|
2012
2012
|
}
|
|
2013
|
-
function
|
|
2013
|
+
function jt(o, e, t, n) {
|
|
2014
2014
|
const r = t ? 25 : 13;
|
|
2015
2015
|
let s = e + r + o.getUint8(e + r - 1);
|
|
2016
2016
|
if (s === n) return [];
|
|
@@ -2024,7 +2024,7 @@ function zt(o, e, t, n) {
|
|
|
2024
2024
|
const h = new DataView(c.buffer, c.byteOffset, c.byteLength);
|
|
2025
2025
|
return Array.from({ length: i }, (m, g) => a === "i" ? h.getInt32(g * f, !0) : a === "d" ? h.getFloat64(g * f, !0) : h.getFloat32(g * f, !0));
|
|
2026
2026
|
}
|
|
2027
|
-
const be = (o) => o <= 0.04045 ? o / 12.92 : ((o + 0.055) / 1.055) ** 2.4,
|
|
2027
|
+
const be = (o) => o <= 0.04045 ? o / 12.92 : ((o + 0.055) / 1.055) ** 2.4, zt = (o) => o <= 31308e-7 ? o * 12.92 : 1.055 * o ** (1 / 2.4) - 0.055, Ht = /* @__PURE__ */ new Set([0, 1, 2, 4, 5]), Wt = 4 * 1024 * 1024;
|
|
2028
2028
|
function Me(o) {
|
|
2029
2029
|
const e = o.image, t = (e == null ? void 0 : e.naturalWidth) || (e == null ? void 0 : e.width), n = (e == null ? void 0 : e.naturalHeight) || (e == null ? void 0 : e.height);
|
|
2030
2030
|
if (!t || !n || t * n > Wt) throw new Error("missing image or image exceeds 4M pixels");
|
|
@@ -2085,7 +2085,7 @@ function Yt(o, e, t) {
|
|
|
2085
2085
|
}
|
|
2086
2086
|
const p = new Uint8Array(i * 4);
|
|
2087
2087
|
for (let u = 0; u < i; u++) p[u * 4 + 3] = 255;
|
|
2088
|
-
for (let u = 0; u < i; u++) for (let c = 0; c < 3; c++) p[u * 4 + c] = Math.round(255 * Math.min(1, Math.max(0,
|
|
2088
|
+
for (let u = 0; u < i; u++) for (let c = 0; c < 3; c++) p[u * 4 + c] = Math.round(255 * Math.min(1, Math.max(0, zt(l[u * 3 + c]))));
|
|
2089
2089
|
const f = new ne(p, a.width, a.height);
|
|
2090
2090
|
return f.colorSpace = X, f.generateMipmaps = r.generateMipmaps, f.wrapS = r.wrapS, f.wrapT = r.wrapT, f.minFilter = r.minFilter, f.magFilter = r.magFilter, f.anisotropy = r.anisotropy, f.offset.copy(r.offset), f.repeat.copy(r.repeat), f.center.copy(r.center), f.rotation = r.rotation, f.matrix.copy(r.matrix), f.matrixAutoUpdate = r.matrixAutoUpdate, f.channel = r.channel, f.mapping = r.mapping, f.userData.fbxLayerBaseId = o.layers[0].textureId, f.needsUpdate = !0, f;
|
|
2091
2091
|
}
|