@nebula-spatial/viewer 0.5.0 → 0.5.1
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 +24 -0
- package/README.md +2 -0
- package/USD-VISUAL-MATERIAL-SUPPORT.md +50 -50
- package/dist/assets/source-types.d.ts +9 -0
- package/dist/{index-D2vtjYht.js → index-CXdFFc74.js} +424 -393
- package/dist/index.js +1 -1
- package/dist/{mjcf-visual-NkIASi_6.js → mjcf-visual-BnZWMjcp.js} +2 -2
- package/dist/{session-DHPMjyl3.js → session-BhTeAhTq.js} +4 -4
- package/dist/{session-di9BueA_.js → session-BvgzEStG.js} +2 -2
- package/dist/{stage-D-BewE6x.js → stage-DBmU5D0V.js} +1 -1
- package/dist/{urdf-session-DsE5uC-u.js → urdf-session-BtARifnH.js} +3 -3
- package/dist/{usd-session-yEFMGOIp.js → usd-session-DmO4QMLH.js} +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/{xacro-D8OfZ2xw.js → xacro-B8n3d29Q.js} +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { e as v, s as E } from "./session-
|
|
1
|
+
import { e as v, s as E } from "./session-BhTeAhTq.js";
|
|
2
2
|
import { Group as q, Euler as z, BoxGeometry as G, SphereGeometry as N, CylinderGeometry as P, CapsuleGeometry as $, PlaneGeometry as I, Mesh as X } from "three";
|
|
3
|
-
import { b as j } from "./stage-
|
|
3
|
+
import { b as j } from "./stage-DBmU5D0V.js";
|
|
4
4
|
function U(f) {
|
|
5
5
|
const y = f.extension.documents, l = new q();
|
|
6
6
|
l.name = f.name;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Ae = Object.defineProperty;
|
|
2
2
|
var Oe = (o, e, s) => e in o ? Ae(o, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : o[e] = s;
|
|
3
3
|
var B = (o, e, s) => Oe(o, typeof e != "symbol" ? e + "" : e, s);
|
|
4
|
-
import { b as W, S as K } from "./stage-
|
|
4
|
+
import { b as W, S as K } from "./stage-DBmU5D0V.js";
|
|
5
5
|
import { LineBasicMaterial as Ge, WireframeGeometry as Ce, LineSegments as Re, EdgesGeometry as Z, Vector3 as ce, Color as Pe, LinearSRGBColorSpace as Ue, SRGBColorSpace as be, MeshPhysicalMaterial as Le, Float32BufferAttribute as H, DataTexture as Te, RGBAFormat as Fe, UnsignedByteType as Ne, NoColorSpace as De, RepeatWrapping as Ie, LinearFilter as $e, LinearMipmapLinearFilter as Be, BufferGeometry as oe, Group as fe, Mesh as me, PlaneGeometry as Ee, BoxGeometry as we, SphereGeometry as Q, Matrix4 as ke, CylinderGeometry as je, CapsuleGeometry as Se, BufferAttribute as ee } from "three";
|
|
6
6
|
function de(o, e, s) {
|
|
7
7
|
if (e.throwIfAborted(), o instanceof Error && (o.name === "AbortError" || ["E_ABORTED", "E_SUPERSEDED"].includes(String(o.code)))) throw o;
|
|
@@ -584,7 +584,7 @@ function wt(o, e) {
|
|
|
584
584
|
const N = e.format;
|
|
585
585
|
if (N === "usd" || N === "usda" || N === "usdc" || N === "usdz") {
|
|
586
586
|
(g = e.reportProgress) == null || g.call(e, "usd", "正在解析 USD 场景与物理刚体...");
|
|
587
|
-
const p = await (await import("./usd-session-
|
|
587
|
+
const p = await (await import("./usd-session-DmO4QMLH.js")).loadUsdSimulation(o, e, s);
|
|
588
588
|
if (h || e.signal.aborted)
|
|
589
589
|
throw p.dispose(), se();
|
|
590
590
|
v = p.asset, r = p.binding, l = p.dispose, _ = p.hasAnimation === !0, n = p.hasPhysics || _ ? p.step : null, c = p.reset, w = p.hasPhysics || _, d = p.hasPhysics, y = p.fallback ? { ...p.fallback, stage: "physics-fallback" } : p.visualWarning ? { ...p.visualWarning, stage: "visual-adaptation" } : null, (M = e.reportProgress) == null || M.call(e, "stage", "正在构建三维场景与环境光影..."), u = new K(r.root, e.options.simulationTheme, p.runtime), p.runtime && (t = p.runtime), f = p.collision ?? null, f && (f.root.visible = !1, u.attachAuxiliary(f.root)), G();
|
|
@@ -592,7 +592,7 @@ function wt(o, e) {
|
|
|
592
592
|
}
|
|
593
593
|
if (N === "urdf" || N === "xacro") {
|
|
594
594
|
(R = e.reportProgress) == null || R.call(e, "urdf", "正在解析 URDF 场景与运动学结构...");
|
|
595
|
-
const p = await (await import("./urdf-session-
|
|
595
|
+
const p = await (await import("./urdf-session-BtARifnH.js")).loadUrdfSimulation(o, e, s);
|
|
596
596
|
if (h || e.signal.aborted)
|
|
597
597
|
throw p.dispose(), se();
|
|
598
598
|
v = p.asset, u = p.stage, b = p.inspection, l = p.dispose, n = p.step, c = p.reset, i = p.play, a = p.pause, m = p.isPlaying, S = () => p.capabilities, E = () => p.physics, w = !1, d = !1, y = p.warning ?? null, G();
|
|
@@ -621,7 +621,7 @@ function wt(o, e) {
|
|
|
621
621
|
} catch (D) {
|
|
622
622
|
const p = de(D, e.signal, "mjcf-physics");
|
|
623
623
|
t == null || t.dispose(), t = null;
|
|
624
|
-
const { compileMjcfPreview: q } = await import("./mjcf-visual-
|
|
624
|
+
const { compileMjcfPreview: q } = await import("./mjcf-visual-BnZWMjcp.js");
|
|
625
625
|
let $;
|
|
626
626
|
try {
|
|
627
627
|
$ = q(v);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DataTexture as N, LinearMipmapLinearFilter as re, LinearFilter as se, LoadingManager as oe, Loader as ae, Texture as X, TextureLoader as ie, LinearSRGBColorSpace as G, 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 C, 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 Y, a as q, S as ye, b as j } from "./stage-
|
|
4
|
+
import { d as Y, a as q, S as ye, b as j } from "./stage-DBmU5D0V.js";
|
|
5
5
|
import { TGALoader as we } from "three/examples/jsm/loaders/TGALoader.js";
|
|
6
6
|
import { FBXLoader as be } from "three/examples/jsm/loaders/FBXLoader.js";
|
|
7
7
|
import { unzlibSync as xe } from "three/examples/jsm/libs/fflate.module.js";
|
|
@@ -177,7 +177,7 @@ async function Te(e, t, n) {
|
|
|
177
177
|
return l = new be(m).parse(e, ""), await Promise.all(p), t.signal.throwIfAborted(), { root: l, textures: d };
|
|
178
178
|
} catch (u) {
|
|
179
179
|
if (s.abort(u), await Promise.allSettled(p), l) {
|
|
180
|
-
const { disposeModelResources: w } = await import("./stage-
|
|
180
|
+
const { disposeModelResources: w } = await import("./stage-DBmU5D0V.js").then((f) => f.r);
|
|
181
181
|
w(l, d);
|
|
182
182
|
} else for (const w of d) w.dispose();
|
|
183
183
|
throw u;
|
|
@@ -3,7 +3,7 @@ var P = (n, e, t) => e in n ? w(n, e, { enumerable: !0, configurable: !0, writab
|
|
|
3
3
|
var a = (n, e, t) => P(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import * as r from "three";
|
|
5
5
|
import { Quaternion as y, Vector3 as C } from "three";
|
|
6
|
-
import { V as x } from "./index-
|
|
6
|
+
import { V as x } from "./index-CXdFFc74.js";
|
|
7
7
|
const m = 1, S = (
|
|
8
8
|
/* glsl */
|
|
9
9
|
`
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var un = Object.defineProperty;
|
|
2
2
|
var fn = (n, t, i) => t in n ? un(n, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : n[t] = i;
|
|
3
3
|
var $ = (n, t, i) => fn(n, typeof t != "symbol" ? t + "" : t, i);
|
|
4
|
-
import { d as dn, b as pn, e as oi, c as mn, a as ri, r as hn, S as ai, p as yn } from "./session-
|
|
5
|
-
import { b as ft, S as gn, m as ci } from "./stage-
|
|
4
|
+
import { d as dn, b as pn, e as oi, c as mn, a as ri, r as hn, S as ai, p as yn } from "./session-BhTeAhTq.js";
|
|
5
|
+
import { b as ft, S as gn, m as ci } from "./stage-DBmU5D0V.js";
|
|
6
6
|
import { Quaternion as K, Euler as Zt, LoadingManager as Ci, Group as ut, Mesh as C, MeshLambertMaterial as wn, MeshPhongMaterial as li, MeshStandardMaterial as Je, Matrix4 as H, TextureLoader as bn, SRGBColorSpace as xn, RepeatWrapping as An, BoxGeometry as He, SphereGeometry as Ze, CylinderGeometry as Ni, CapsuleGeometry as qi, Vector3 as z, MathUtils as Mn, Matrix3 as ui, Box3 as it, BufferAttribute as Oi, Line3 as dt, Plane as Vi, Vector2 as gt, Triangle as $t, BackSide as vn, DoubleSide as Pn, REVISION as Wi, Ray as Sn, FrontSide as fi, LineSegments as Qe, LineLoop as Gi, Line as Ye, Points as Xi, Sphere as Tn, BatchedMesh as Rn, AxesHelper as Bn, ArrowHelper as di, BufferGeometry as _n, LineBasicMaterial as pi, Float32BufferAttribute as En, MeshBasicMaterial as mi, EdgesGeometry as zn } from "three";
|
|
7
7
|
import { GLTFLoader as Un } from "three/examples/jsm/loaders/GLTFLoader.js";
|
|
8
8
|
import { ColladaLoader as Fn } from "three/examples/jsm/loaders/ColladaLoader.js";
|
|
@@ -3124,7 +3124,7 @@ async function yo(n, t, i) {
|
|
|
3124
3124
|
const r = t.format === "xacro";
|
|
3125
3125
|
if (r) {
|
|
3126
3126
|
(E = t.reportProgress) == null || E.call(t, "xacro", "正在展开 Xacro 宏与依赖文件...");
|
|
3127
|
-
const { expandXacro: U } = await import("./xacro-
|
|
3127
|
+
const { expandXacro: U } = await import("./xacro-B8n3d29Q.js");
|
|
3128
3128
|
s = await U(s, e, i, t.options.xacro, t.signal);
|
|
3129
3129
|
}
|
|
3130
3130
|
if (t.signal.aborted) throw Jt();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Mesh as te, FrontSide as vt, DoubleSide as Pt, MeshPhysicalMaterial as ie, DataTexture as Je, UnsignedByteType as Ze, RGBAFormat as Ke, NoColorSpace as K, Float32BufferAttribute as At, SRGBColorSpace as Qe, RepeatWrapping as q, Color as ut, Texture as lt, MeshStandardMaterial as He, TextureLoader as pt, MirroredRepeatWrapping as ft, ClampToEdgeWrapping as dt, Group as Ee, Vector3 as N, Quaternion as ee, Matrix4 as pe, Box3 as Te, Sphere as Dt, SphereGeometry as Mt, BoxGeometry as Rt, SkinnedMesh as Me, Skeleton as It, AnimationMixer as Ot, LoopRepeat as Tt } from "three";
|
|
2
|
-
import { n as Nt, c as $t, a as Re, b as Lt, d as Ct, p as Gt, S as et } from "./session-
|
|
2
|
+
import { n as Nt, c as $t, a as Re, b as Lt, d as Ct, p as Gt, S as et } from "./session-BhTeAhTq.js";
|
|
3
3
|
import { ConvexGeometry as Bt } from "three/examples/jsm/geometries/ConvexGeometry.js";
|
|
4
4
|
import { createUSDLoadedModel as Ft, buildUSDScene as kt } from "@openusd-wasm/three-loader";
|
|
5
|
-
import { b as mt } from "./stage-
|
|
5
|
+
import { b as mt } from "./stage-DBmU5D0V.js";
|
|
6
6
|
function Vt(e) {
|
|
7
7
|
var s, d;
|
|
8
8
|
const t = e.stage;
|
package/dist/version.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nebula-spatial/viewer",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Read-only Three.js viewer facade",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"engines": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@mujoco/mujoco": "^3.12.0",
|
|
44
|
-
"@nebula-spatial/cad-loader": "^0.3.
|
|
44
|
+
"@nebula-spatial/cad-loader": "^0.3.1",
|
|
45
45
|
"@openusd-wasm/three-loader": "^0.0.13",
|
|
46
46
|
"three-mesh-bvh": "^0.9.5",
|
|
47
47
|
"xacro-parser": "0.3.11"
|