@nebula-spatial/viewer 0.5.6 → 0.5.7
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 +35 -0
- package/README.md +101 -7
- package/USD-VISUAL-MATERIAL-SUPPORT.md +10 -1
- package/dist/assets/types.d.ts +14 -2
- package/dist/assets/usd-worker-B-HuMXLo.js +1505 -0
- package/dist/collision-debug-B2CISPB9.js +792 -0
- package/dist/{index-D6-ClMfm.js → index-BTAC6njT.js} +4170 -2956
- package/dist/index.d.ts +5 -1
- package/dist/index.js +18 -16
- package/dist/inspection/types.d.ts +79 -2
- package/dist/{mjcf-visual-B8RE9CqV.js → mjcf-visual-BVT3h87h.js} +1 -1
- package/dist/mujoco-runtime-CAyK0LHM.js +698 -0
- package/dist/session-BQ8eCFRL.js +786 -0
- package/dist/{session-CDrNB1J2.js → session-Dwoi1H46.js} +2 -2
- package/dist/simulation/mujoco-wasm-module.d.ts +11 -0
- package/dist/simulation/openusd-wasm-module.d.ts +10 -0
- package/dist/{stage-CSRMl8kx.js → stage-DUC-YNhD.js} +1 -1
- package/dist/{urdf-session-DD3HOAib.js → urdf-session-E0Nnr4Vs.js} +14 -11
- package/dist/usd-session-BUD3KtCr.js +6875 -0
- package/dist/version.d.ts +1 -1
- package/dist/{xacro-BpICdIYd.js → xacro-F7rdDouN.js} +1 -1
- package/openusd/openusd-runtime-manifest.json +3 -3
- package/openusd/openusd_probe.js +14 -14
- package/package.json +2 -1
- package/dist/assets/usd-worker-CnpILBYh.js +0 -1352
- package/dist/collision-debug-CqRm6cC8.js +0 -479
- package/dist/mujoco-runtime-ZuEJSHnD.js +0 -396
- package/dist/session-DgvOdcLe.js +0 -632
- package/dist/usd-session-BCCp_YDr.js +0 -6217
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DataTexture as N, LinearMipmapLinearFilter as re, LinearFilter as se, LoadingManager as oe, Loader as ae, Texture as C, TextureLoader as ie, LinearSRGBColorSpace as V, SRGBColorSpace as le, RGBAFormat as K, UnsignedByteType as J, NoColorSpace as ce, Mesh as ue, MeshPhysicalMaterial as Z, MeshPhongMaterial as k, MeshLambertMaterial as fe, Color as _, Group as pe, Box3 as de, Vector3 as he } from "three";
|
|
2
2
|
import { DRACOLoader as me } from "three/examples/jsm/loaders/DRACOLoader.js";
|
|
3
3
|
import { GLTFLoader as ge } from "three/examples/jsm/loaders/GLTFLoader.js";
|
|
4
|
-
import { D as ye } from "./index-
|
|
5
|
-
import { d as Y, a as q, S as we } from "./stage-
|
|
4
|
+
import { D as ye } from "./index-BTAC6njT.js";
|
|
5
|
+
import { d as Y, a as q, S as we } from "./stage-DUC-YNhD.js";
|
|
6
6
|
import { TGALoader as be } from "three/examples/jsm/loaders/TGALoader.js";
|
|
7
7
|
import { FBXLoader as xe } from "three/examples/jsm/loaders/FBXLoader.js";
|
|
8
8
|
import { unzlibSync as Ee } from "three/examples/jsm/libs/fflate.module.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface MujocoWasmCompileOptions {
|
|
2
|
+
readonly mujocoBaseUrl?: string;
|
|
3
|
+
readonly signal?: AbortSignal;
|
|
4
|
+
}
|
|
5
|
+
/** Resolves the same MuJoCo WASM URL used by `MujocoRuntime.initialize`. */
|
|
6
|
+
export declare function resolveMujocoWasmUrl(mujocoBaseUrl?: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* Downloads and compiles the configured MuJoCo WASM. Caching and sharing are
|
|
9
|
+
* owned by the caller; this function creates no global cache.
|
|
10
|
+
*/
|
|
11
|
+
export declare function compileMujocoWasmModule(options?: MujocoWasmCompileOptions): Promise<WebAssembly.Module>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface OpenUsdWasmCompileOptions {
|
|
2
|
+
readonly openUsdBaseUrl?: string;
|
|
3
|
+
readonly openUsdRuntimeId?: string;
|
|
4
|
+
readonly signal?: AbortSignal;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Downloads and compiles the configured OpenUSD Probe. Caching and sharing are
|
|
8
|
+
* owned by the caller; this function creates no global cache.
|
|
9
|
+
*/
|
|
10
|
+
export declare function compileOpenUsdWasmModule(options?: OpenUsdWasmCompileOptions): Promise<WebAssembly.Module>;
|
|
@@ -3,7 +3,7 @@ var S = (a, t, e) => t in a ? R(a, t, { enumerable: !0, configurable: !0, writab
|
|
|
3
3
|
var s = (a, t, e) => S(a, typeof t != "symbol" ? t + "" : t, e);
|
|
4
4
|
import * as i from "three";
|
|
5
5
|
import { Quaternion as C, Vector3 as V } from "three";
|
|
6
|
-
import { V as b, D as A,
|
|
6
|
+
import { V as b, D as A, w as W } from "./index-BTAC6njT.js";
|
|
7
7
|
import { disposeModelResources as T } from "./resources-CHhCm2f7.js";
|
|
8
8
|
const v = 1, B = (
|
|
9
9
|
/* glsl */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var dn = Object.defineProperty;
|
|
2
2
|
var pn = (n, t, i) => t in n ? dn(n, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : n[t] = i;
|
|
3
3
|
var $ = (n, t, i) => pn(n, typeof t != "symbol" ? t + "" : t, i);
|
|
4
|
-
import { d as mn,
|
|
5
|
-
import { S as xn, m as ui } from "./stage-
|
|
4
|
+
import { d as mn, f as hn, c as yn, a as gn, b as ri, h as wn, w as ai, i as ci, S as li, p as bn } from "./collision-debug-B2CISPB9.js";
|
|
5
|
+
import { S as xn, m as ui } from "./stage-DUC-YNhD.js";
|
|
6
6
|
import { Quaternion as K, Euler as Zt, LoadingManager as Oi, Group as lt, Mesh as N, MeshLambertMaterial as An, MeshPhongMaterial as fi, MeshStandardMaterial as He, Matrix4 as H, TextureLoader as Mn, SRGBColorSpace as vn, RepeatWrapping as Pn, BoxGeometry as Ze, SphereGeometry as Qe, CylinderGeometry as Vi, CapsuleGeometry as Wi, Vector3 as z, MathUtils as Sn, Matrix3 as di, Box3 as it, BufferAttribute as Gi, Line3 as ut, Plane as Xi, Vector2 as yt, Triangle as $t, BackSide as Tn, DoubleSide as Rn, REVISION as Ji, Ray as Bn, FrontSide as pi, LineSegments as Ye, LineLoop as Hi, Line as Ke, Points as Zi, Sphere as _n, BatchedMesh as En, AxesHelper as zn, ArrowHelper as mi, BufferGeometry as Un, LineBasicMaterial as hi, Float32BufferAttribute as Fn, MeshBasicMaterial as yi, EdgesGeometry as $n } from "three";
|
|
7
|
-
import { c as gi } from "./session-
|
|
7
|
+
import { c as gi } from "./session-BQ8eCFRL.js";
|
|
8
8
|
import { GLTFLoader as In } from "three/examples/jsm/loaders/GLTFLoader.js";
|
|
9
9
|
import { ColladaLoader as Dn } from "three/examples/jsm/loaders/ColladaLoader.js";
|
|
10
10
|
import { disposeModelResources as ft } from "./resources-CHhCm2f7.js";
|
|
@@ -3126,7 +3126,7 @@ async function Ao(n, t, i) {
|
|
|
3126
3126
|
const r = t.format === "xacro";
|
|
3127
3127
|
if (r) {
|
|
3128
3128
|
(E = t.reportProgress) == null || E.call(t, "xacro", "正在展开 Xacro 宏与依赖文件...");
|
|
3129
|
-
const { expandXacro: U } = await import("./xacro-
|
|
3129
|
+
const { expandXacro: U } = await import("./xacro-F7rdDouN.js");
|
|
3130
3130
|
s = await U(s, e, i, t.options.xacro, t.signal);
|
|
3131
3131
|
}
|
|
3132
3132
|
if (t.signal.aborted) throw Jt();
|
|
@@ -3168,7 +3168,7 @@ async function Ao(n, t, i) {
|
|
|
3168
3168
|
"dynamics-unavailable",
|
|
3169
3169
|
ci(l.code, l.source).summary
|
|
3170
3170
|
), u.attachAuxiliary(v.overlayRoot);
|
|
3171
|
-
const B = () => !y || !g ? !1 : (y.setJointValues(v.getSnapshot().jointValues), u.replaceModel(g.root, !1), u.setRuntime(y), g.sync(), x == null || x.sync(), a.root.visible = !1, g.root.visible = !0, f && (f.root.visible = !1), x && (x.root.visible = v.getSnapshot().overlays.collision), !0), S = async () => {
|
|
3171
|
+
const B = () => !y || !g ? !1 : (u.endGrab(), y.reset(), v.resetPose(), u.resetGround(), y.setJointValues(v.getSnapshot().jointValues), u.replaceModel(g.root, !1), u.setRuntime(y), g.sync(), x == null || x.sync(), a.root.visible = !1, g.root.visible = !0, f && (f.root.visible = !1), x && (x.root.visible = v.getSnapshot().overlays.collision), !0), S = async () => {
|
|
3172
3172
|
var Mt, vt, Pt, kt;
|
|
3173
3173
|
if (y || M || !c) return;
|
|
3174
3174
|
v.setMode("dynamics-initializing"), b = { status: "initializing" }, (Mt = t.reportSessionState) == null || Mt.call(t);
|
|
@@ -3176,13 +3176,16 @@ async function Ao(n, t, i) {
|
|
|
3176
3176
|
try {
|
|
3177
3177
|
const wt = await Gn(o);
|
|
3178
3178
|
if (t.signal.aborted || M) throw Jt();
|
|
3179
|
-
const nt = await import("./mujoco-runtime-
|
|
3180
|
-
if (U = new nt.MujocoRuntime(), await U.initialize(wt,
|
|
3179
|
+
const nt = await import("./mujoco-runtime-CAyK0LHM.js");
|
|
3180
|
+
if (U = new nt.MujocoRuntime(), await U.initialize(wt, {
|
|
3181
|
+
baseUrl: t.options.mujocoBaseUrl,
|
|
3182
|
+
wasmModule: t.options.mujocoWasmModule
|
|
3183
|
+
}), U.setWorldRotation(ui(u.getUpAxis())), t.signal.aborted || M || (L = new li(U, await xi(o)), t.signal.aborted || M)) throw Jt();
|
|
3181
3184
|
const Yt = await tn(o);
|
|
3182
3185
|
if (Y = Yt ? new li(U, Yt) : null, t.signal.aborted || M) throw Jt();
|
|
3183
|
-
y = U, U = null, g = L, L = null, g.root.visible = !1, x = Y, Y = null, x && (x.root.visible = !1, u.attachAuxiliary(x.root)), b = { status: "ready" }, h = m, T
|
|
3186
|
+
y = U, U = null, g = L, L = null, g.root.visible = !1, x = Y, Y = null, x && (x.root.visible = !1, u.attachAuxiliary(x.root)), b = { status: "ready" }, h = m, T ? (B(), A = !0, v.setMode("dynamics-running")) : v.setMode("kinematic"), (vt = t.reportSessionState) == null || vt.call(t), t.requestRender();
|
|
3184
3187
|
} catch (wt) {
|
|
3185
|
-
if (Y == null || Y.dispose(), L == null || L.dispose(), U == null || U.dispose(), M || t.signal.aborted || wt instanceof Error && wt.name === "AbortError") return;
|
|
3188
|
+
if (T = !1, Y == null || Y.dispose(), L == null || L.dispose(), U == null || U.dispose(), M || t.signal.aborted || wt instanceof Error && wt.name === "AbortError") return;
|
|
3186
3189
|
const nt = bn(wt, t.signal, "urdf-physics");
|
|
3187
3190
|
u.setRuntime(void 0), u.setGroundPlacement("visual"), y == null || y.dispose(), y = null, g == null || g.dispose(), g = null, x && (u.detachAuxiliary(x.root), x.dispose(), x = null), R(), h = ai(nt, "physics-fallback"), b = { status: "unavailable", issue: h }, v.setMode("dynamics-unavailable", ((Pt = h.notice) == null ? void 0 : Pt.summary) ?? h.message), (kt = t.reportSessionState) == null || kt.call(t), t.reportError(wt, { fatal: !1, stage: "physics-start", code: nt.code });
|
|
3188
3191
|
}
|
|
@@ -3206,9 +3209,9 @@ async function Ao(n, t, i) {
|
|
|
3206
3209
|
isPlaying: () => A,
|
|
3207
3210
|
play() {
|
|
3208
3211
|
var U;
|
|
3209
|
-
if (!(M || b.status === "unavailable" || b.status === "not-authored")) {
|
|
3212
|
+
if (!(M || A || T || b.status === "unavailable" || b.status === "not-authored")) {
|
|
3210
3213
|
if (T = !0, v.select(null), !y) {
|
|
3211
|
-
P ?? (P = S().finally(() => {
|
|
3214
|
+
u.endGrab(), v.resetPose(), u.resetGround(), P ?? (P = S().finally(() => {
|
|
3212
3215
|
P = null;
|
|
3213
3216
|
}));
|
|
3214
3217
|
return;
|