@nebula-spatial/studio 0.0.0-stage → 0.1.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/README.md +206 -3
- package/dist/ai/contract.d.ts +73 -0
- package/dist/ai/host.d.ts +28 -0
- package/dist/asset/dependency-scan.d.ts +78 -0
- package/dist/asset/intake.d.ts +84 -0
- package/dist/asset/layout-detect.d.ts +40 -0
- package/dist/asset/media-type.d.ts +10 -0
- package/dist/asset/model-inspection.d.ts +127 -0
- package/dist/asset/record.d.ts +35 -0
- package/dist/asset/remote-asset-resolver.d.ts +36 -0
- package/dist/asset/repairs.d.ts +53 -0
- package/dist/asset/resource-locator.d.ts +15 -0
- package/dist/asset/revision-diff.d.ts +33 -0
- package/dist/asset/source-contracts.d.ts +21 -0
- package/dist/asset/source-paths.d.ts +15 -0
- package/dist/asset/usd-inspection.d.ts +39 -0
- package/dist/asset/usd-source-metadata.d.ts +142 -0
- package/dist/asset/visual-intake.d.ts +27 -0
- package/dist/asset/visual-record.d.ts +22 -0
- package/dist/asset/web-intake.d.ts +46 -0
- package/dist/asset-source-BExlEcRt.js +444 -0
- package/dist/assets/usd-export-worker-BsGubtAE.js +1 -0
- package/dist/builders-BAXRR5o5.js +1854 -0
- package/dist/core/asset-task.d.ts +105 -0
- package/dist/core/context.d.ts +23 -0
- package/dist/core/host.d.ts +432 -0
- package/dist/core/persistence-controller.d.ts +58 -0
- package/dist/core/plugins.d.ts +139 -0
- package/dist/core/scene-tree.d.ts +62 -0
- package/dist/core/versions.d.ts +2 -0
- package/dist/core/when.d.ts +13 -0
- package/dist/core/write-policy.d.ts +29 -0
- package/dist/delivery/build-plan.d.ts +2 -0
- package/dist/delivery/contracts.d.ts +362 -0
- package/dist/delivery/digest.d.ts +3 -0
- package/dist/delivery/evidence.d.ts +10 -0
- package/dist/delivery/export-evidence.d.ts +3 -0
- package/dist/delivery/index.d.ts +9 -0
- package/dist/delivery/prim-name.d.ts +17 -0
- package/dist/delivery/profile.d.ts +4 -0
- package/dist/doc/builders.d.ts +99 -0
- package/dist/doc/command.d.ts +195 -0
- package/dist/doc/domain-extensions.d.ts +34 -0
- package/dist/doc/node-facts.d.ts +87 -0
- package/dist/doc/physics-facts.d.ts +74 -0
- package/dist/doc/placement-policy.d.ts +71 -0
- package/dist/doc/random-placement.d.ts +30 -0
- package/dist/doc/scene-graph.d.ts +80 -0
- package/dist/doc/scene-regions.d.ts +29 -0
- package/dist/doc/schema.d.ts +452 -0
- package/dist/doc/task.d.ts +71 -0
- package/dist/doc/validate.d.ts +68 -0
- package/dist/editor/asset-source.d.ts +15 -0
- package/dist/editor/editor.d.ts +246 -0
- package/dist/editor/index.d.ts +22 -0
- package/dist/editor/shortcuts.d.ts +2 -0
- package/dist/editor/types.d.ts +143 -0
- package/dist/editor/ui-plugins.d.ts +64 -0
- package/dist/editor.js +1755 -0
- package/dist/editorial-BkAFWfbg.js +83 -0
- package/dist/export-evidence-B_0zRmb8.js +5027 -0
- package/dist/generalization/domain.d.ts +10 -0
- package/dist/generalization/generalization.d.ts +371 -0
- package/dist/generalization/index.d.ts +11 -0
- package/dist/generalization.js +1659 -0
- package/dist/history/undo-stack.d.ts +74 -0
- package/dist/index.d.ts +91 -0
- package/dist/index.js +2839 -0
- package/dist/persist/content-addressed.d.ts +11 -0
- package/dist/persist/create-scene-package-from-host.d.ts +7 -0
- package/dist/persist/indexeddb-store.d.ts +69 -0
- package/dist/persist/scene-file.d.ts +52 -0
- package/dist/persist/scene-package.d.ts +8 -0
- package/dist/persist/snapshot.d.ts +5 -0
- package/dist/physics-facts-tfQYyNTD.js +337 -0
- package/dist/placement-policy-DY_FNRDu.js +405 -0
- package/dist/ports/asset-ingestor.d.ts +41 -0
- package/dist/ports/asset-source.d.ts +57 -0
- package/dist/ports/delivery.d.ts +13 -0
- package/dist/ports/persistence.d.ts +29 -0
- package/dist/project/asset-catalog.d.ts +21 -0
- package/dist/project/contracts.d.ts +272 -0
- package/dist/project/editorial.d.ts +16 -0
- package/dist/project/identity.d.ts +20 -0
- package/dist/project/index.d.ts +9 -0
- package/dist/project/scene-document.d.ts +5 -0
- package/dist/project/source-dependencies.d.ts +7 -0
- package/dist/remote-asset-resolver-Cb8cfNmw.js +136 -0
- package/dist/scene/index.d.ts +12 -0
- package/dist/scene-graph-DBLKAhxa.js +681 -0
- package/dist/scene-session-BV1HnxNh.js +3506 -0
- package/dist/scene.js +244 -0
- package/dist/studio/delivery-catalog.d.ts +28 -0
- package/dist/studio/in-memory-asset-source.d.ts +15 -0
- package/dist/studio/index.d.ts +31 -0
- package/dist/studio/indexeddb-asset-source.d.ts +32 -0
- package/dist/studio/indexeddb-persistence.d.ts +13 -0
- package/dist/studio/remote-asset-importer.d.ts +56 -0
- package/dist/studio/source-package.d.ts +9 -0
- package/dist/studio/usd-export-client.d.ts +13 -0
- package/dist/studio/usd-export-protocol.d.ts +98 -0
- package/dist/studio/usd-export-worker.d.ts +1 -0
- package/dist/studio/usd-zip-reader.d.ts +14 -0
- package/dist/studio/web-asset-ingestor.d.ts +10 -0
- package/dist/studio/web-host.d.ts +8 -0
- package/dist/studio.js +5544 -0
- package/dist/util/asset-facts.d.ts +3 -0
- package/dist/util/data.d.ts +17 -0
- package/dist/util/diagnostics.d.ts +38 -0
- package/dist/util/geometry.d.ts +11 -0
- package/dist/util/hash.d.ts +9 -0
- package/dist/util/ids.d.ts +20 -0
- package/dist/util/math.d.ts +47 -0
- package/dist/util/ply-metadata.d.ts +19 -0
- package/dist/util/studio-source.d.ts +23 -0
- package/dist/version.d.ts +5 -0
- package/dist/view/appearance.d.ts +13 -0
- package/dist/view/authoring-appearance.d.ts +25 -0
- package/dist/view/bounds-preview.d.ts +34 -0
- package/dist/view/bounds.d.ts +11 -0
- package/dist/view/camera-zoom.d.ts +3 -0
- package/dist/view/geometry-anchors.d.ts +20 -0
- package/dist/view/gizmo-appearance.d.ts +5 -0
- package/dist/view/gizmo.d.ts +81 -0
- package/dist/view/group-selection.d.ts +13 -0
- package/dist/view/node-features.d.ts +39 -0
- package/dist/view/picking.d.ts +49 -0
- package/dist/view/placement.d.ts +48 -0
- package/dist/view/region-editing.d.ts +25 -0
- package/dist/view/rotation-guide.d.ts +36 -0
- package/dist/view/runtime-capabilities.d.ts +22 -0
- package/dist/view/scene-session.d.ts +258 -0
- package/dist/view/screen-bounds.d.ts +17 -0
- package/dist/view/selection-transform.d.ts +20 -0
- package/node_modules/@nebula-spatial/cad-loader/CHANGELOG.md +48 -0
- package/node_modules/@nebula-spatial/cad-loader/README.md +108 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/cad-types.d.ts +26 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/errors.d.ts +5 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/index.d.ts +24 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/index.js +2354 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/bin-group-reader.d.ts +9 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/bin-parser.d.ts +78 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/dxbs-sidecar.d.ts +24 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/geometry-segments.d.ts +20 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/text-roundtrip.d.ts +4 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/types.d.ts +81 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/runtime-text-decoder.d.ts +8 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/types.d.ts +153 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/utils/insert-bbox.d.ts +10 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/utils/viewport-rect.d.ts +21 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/index.d.ts +36 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/index.js +5829 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/geo-loader.d.ts +59 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/automatic-external-resources.d.ts +26 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/external-variant-sidecar-fetch.d.ts +13 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/flow-control.d.ts +29 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/frame-budget-scheduler.d.ts +21 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-compact-executor.d.ts +19 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-loader-local-adapter.d.ts +2 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-loader-pipeline.d.ts +92 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-loader-worker-adapter.d.ts +13 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-node-builder.d.ts +34 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-node-load-sink.d.ts +28 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-node.d.ts +304 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-prepare-worker-types.d.ts +94 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-prepare.d.ts +38 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-prepare.worker.d.ts +1 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/insert-model-builder.d.ts +10 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/insert-runtime-geometry.d.ts +15 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/line-canonical.d.ts +37 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/line-quality.d.ts +9 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/prepare-credit-gate.d.ts +20 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/transport.d.ts +2 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/render-resource/cad-render-node.d.ts +80 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/render-resource/geo-node-cad-render-node.d.ts +12 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/scene/geo-cad-line-geometry.d.ts +28 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/scene/geo-cad-line-material.d.ts +18 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/scene/instancing/block-geometry-registry.d.ts +35 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/scene/instancing/insert-instance-table.d.ts +23 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/scene/instancing/viewport-instance-presenter.d.ts +66 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/selection/cad-insert-selection.d.ts +35 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/selection/cad-text-selection.d.ts +31 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/annotation-idle-gate.d.ts +14 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-document-session.d.ts +187 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-font-runtime.d.ts +11 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-insert-id.d.ts +6 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-text-warmup.d.ts +38 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/create-cad-document-session.d.ts +5 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/load-session.d.ts +90 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/viewport-coverage.d.ts +32 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/abort.d.ts +3 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/cad-display-color.d.ts +55 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/cad-load-source.d.ts +8 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/color-buffer.d.ts +6 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/constants.d.ts +11 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/display-color-buffer.d.ts +27 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/errors.d.ts +2 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/text-builder.d.ts +25 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/text-font.d.ts +12 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/types.d.ts +57 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/utils/insert-bbox.d.ts +1 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/utils/timing.d.ts +2 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/utils/viewport-rect.d.ts +1 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/viewer-theme.d.ts +2 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/workers/geo-prepare.worker.js +2264 -0
- package/node_modules/@nebula-spatial/cad-loader/package.json +62 -0
- package/node_modules/@nebula-spatial/viewer/CHANGELOG.md +426 -0
- package/node_modules/@nebula-spatial/viewer/FBX-MATERIAL-CONVERSION.md +97 -0
- package/node_modules/@nebula-spatial/viewer/README.md +1056 -0
- package/node_modules/@nebula-spatial/viewer/USD-VISUAL-MATERIAL-SUPPORT.md +89 -0
- package/node_modules/@nebula-spatial/viewer/basis/basis_transcoder.js +19 -0
- package/node_modules/@nebula-spatial/viewer/basis/basis_transcoder.wasm +0 -0
- package/node_modules/@nebula-spatial/viewer/dist/asset-ir-DEOK9SqE.js +382 -0
- package/node_modules/@nebula-spatial/viewer/dist/assets/ground-grid.d.ts +6 -0
- package/node_modules/@nebula-spatial/viewer/dist/assets/source-types.d.ts +19 -0
- package/node_modules/@nebula-spatial/viewer/dist/assets/types.d.ts +393 -0
- package/node_modules/@nebula-spatial/viewer/dist/assets/usd-worker-Bom5cjz3.js +1392 -0
- package/node_modules/@nebula-spatial/viewer/dist/cad/text.d.ts +2 -0
- package/node_modules/@nebula-spatial/viewer/dist/cad/types.d.ts +368 -0
- package/node_modules/@nebula-spatial/viewer/dist/index-ByBlfVc0.js +12132 -0
- package/node_modules/@nebula-spatial/viewer/dist/index.d.ts +32 -0
- package/node_modules/@nebula-spatial/viewer/dist/index.js +26 -0
- package/node_modules/@nebula-spatial/viewer/dist/inspection/types.d.ts +112 -0
- package/node_modules/@nebula-spatial/viewer/dist/mjcf-visual-DVRa0w90.js +72 -0
- package/node_modules/@nebula-spatial/viewer/dist/mujoco-runtime-Dhx6Ua2u.js +463 -0
- package/node_modules/@nebula-spatial/viewer/dist/plugins.d.ts +179 -0
- package/node_modules/@nebula-spatial/viewer/dist/scene/instances.d.ts +36 -0
- package/node_modules/@nebula-spatial/viewer/dist/scene/types.d.ts +258 -0
- package/node_modules/@nebula-spatial/viewer/dist/session-B-j6KdA-.js +389 -0
- package/node_modules/@nebula-spatial/viewer/dist/session-B4AICTeJ.js +963 -0
- package/node_modules/@nebula-spatial/viewer/dist/session-BAG5cDYe.js +9153 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/mujoco-runtime.d.ts +118 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/mujoco-wasm-module.d.ts +11 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/openusd-wasm-module.d.ts +10 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/physics-runtime-state.d.ts +75 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/types.d.ts +129 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/usd-inspection.d.ts +66 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/usd-query.d.ts +50 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/usd-resource-policy.d.ts +28 -0
- package/node_modules/@nebula-spatial/viewer/dist/types.d.ts +278 -0
- package/node_modules/@nebula-spatial/viewer/dist/ui/types.d.ts +48 -0
- package/node_modules/@nebula-spatial/viewer/dist/urdf-session-kemAnBn8.js +3231 -0
- package/node_modules/@nebula-spatial/viewer/dist/usd-session-QtwGKI7v.js +6771 -0
- package/node_modules/@nebula-spatial/viewer/dist/version.d.ts +5 -0
- package/node_modules/@nebula-spatial/viewer/dist/viewer.d.ts +2 -0
- package/node_modules/@nebula-spatial/viewer/dist/xacro-CYTPS7mh.js +1537 -0
- package/node_modules/@nebula-spatial/viewer/openusd/openusd-runtime-manifest.json +15 -0
- package/node_modules/@nebula-spatial/viewer/openusd/openusd_probe.js +14 -0
- package/node_modules/@nebula-spatial/viewer/openusd/openusd_probe.wasm +0 -0
- package/node_modules/@nebula-spatial/viewer/package.json +66 -0
- package/package.json +87 -6
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import loadMujoco from '@mujoco/mujoco';
|
|
2
|
+
import { Quaternion } from 'three';
|
|
3
|
+
import type { PhysicsAsset } from './types';
|
|
4
|
+
type MujocoModule = Awaited<ReturnType<typeof loadMujoco>>;
|
|
5
|
+
export interface GrabOptions {
|
|
6
|
+
bodyId: number;
|
|
7
|
+
localPoint: readonly [number, number, number] | readonly number[];
|
|
8
|
+
target: readonly [number, number, number] | readonly number[];
|
|
9
|
+
stiffness?: number;
|
|
10
|
+
damping?: number;
|
|
11
|
+
maxForce?: number;
|
|
12
|
+
dampingRatio?: number;
|
|
13
|
+
maxTargetSpeed?: number;
|
|
14
|
+
targetResponse?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface GrabState {
|
|
17
|
+
bodyId: number;
|
|
18
|
+
localPoint: [number, number, number];
|
|
19
|
+
target: [number, number, number];
|
|
20
|
+
requestedTarget?: [number, number, number];
|
|
21
|
+
stiffness: number;
|
|
22
|
+
damping: number;
|
|
23
|
+
maxForce: number;
|
|
24
|
+
strength: number;
|
|
25
|
+
maxTargetSpeed?: number;
|
|
26
|
+
targetResponse?: number;
|
|
27
|
+
}
|
|
28
|
+
export interface MujocoRuntimeInitializeOptions {
|
|
29
|
+
readonly baseUrl?: string;
|
|
30
|
+
readonly wasmModule?: WebAssembly.Module | Promise<WebAssembly.Module>;
|
|
31
|
+
}
|
|
32
|
+
export declare class MujocoRuntime {
|
|
33
|
+
mujoco: MujocoModule | null;
|
|
34
|
+
model: InstanceType<MujocoModule['MjModel']> | null;
|
|
35
|
+
data: InstanceType<MujocoModule['MjData']> | null;
|
|
36
|
+
grab: GrabState | null;
|
|
37
|
+
lastGrabForce: [number, number, number];
|
|
38
|
+
private initialControls;
|
|
39
|
+
private initialJoints;
|
|
40
|
+
private accumulator;
|
|
41
|
+
private stepTotal;
|
|
42
|
+
private timestep;
|
|
43
|
+
/** Timestep compiled from the physics asset; grabs may temporarily refine it. */
|
|
44
|
+
private baseTimestep;
|
|
45
|
+
/** Authored ground pose, captured before any seating. Re-seats start here. */
|
|
46
|
+
private initialGround;
|
|
47
|
+
/** Ground pose currently in the model; restored verbatim by reset(). */
|
|
48
|
+
private seatedGround;
|
|
49
|
+
private readonly worldRotation;
|
|
50
|
+
private topLevelBodies;
|
|
51
|
+
private initialVelocities;
|
|
52
|
+
initialize(source: PhysicsAsset, options?: MujocoRuntimeInitializeOptions): Promise<void>;
|
|
53
|
+
get defaultGroundHeight(): number | undefined;
|
|
54
|
+
get stepCount(): number;
|
|
55
|
+
/** Pin the viewer-owned floor to a world-frame height, overriding auto-seating. */
|
|
56
|
+
setDefaultGroundHeight(height: number): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Re-orients the compiled physics to the given authored up axis by rotating
|
|
59
|
+
* every top-level body about the world origin. Gravity stays -Z and the
|
|
60
|
+
* viewer ground stays the authored horizontal plane, so a cup that was
|
|
61
|
+
* standing now genuinely topples and settles on its side — the alternative,
|
|
62
|
+
* rotating only the rendered scene graph, would leave the visuals and the
|
|
63
|
+
* simulation in different frames.
|
|
64
|
+
*
|
|
65
|
+
* The full current state (free-joint positions, orientations and velocities)
|
|
66
|
+
* is rotated by the same delta, so a paused or running simulation is carried
|
|
67
|
+
* over instead of being re-seeded.
|
|
68
|
+
*/
|
|
69
|
+
setWorldRotation(rotation: Quaternion): void;
|
|
70
|
+
private captureTopLevelBodies;
|
|
71
|
+
/** Writes the rotated reference pose, which reset() and fixed bases follow. */
|
|
72
|
+
private rotateReferenceFrames;
|
|
73
|
+
/** Rotates the live free-joint state so the simulation keeps its progress. */
|
|
74
|
+
private rotateState;
|
|
75
|
+
/** Lower only the viewer-owned plane, never authored bodies or authored floors.
|
|
76
|
+
* Run after forward kinematics, not during stepping (the floor must not follow falling bodies).
|
|
77
|
+
* `baseHeight` re-seats from a stable reference; omitting it lowers from the current pose.
|
|
78
|
+
*/
|
|
79
|
+
private seatDefaultGround;
|
|
80
|
+
/**
|
|
81
|
+
* Resolve the lowest world-space point directly from MuJoCo's primitive
|
|
82
|
+
* parameters. Rotating a mesh's local AABB into world space is conservative:
|
|
83
|
+
* for a long, rotated shape it can sit far below the actual geometry. Use the
|
|
84
|
+
* compiled vertices for mesh-backed geoms so the ground reflects the real
|
|
85
|
+
* lowest point rather than the corners of its local bounding box.
|
|
86
|
+
*/
|
|
87
|
+
private geomBottom;
|
|
88
|
+
beginGrab({ bodyId, localPoint, target, stiffness, damping, maxForce, dampingRatio, maxTargetSpeed, targetResponse, }: GrabOptions): void;
|
|
89
|
+
updateGrabTarget(target: readonly [number, number, number] | readonly number[]): void;
|
|
90
|
+
updateGrabStrength(strength: number): void;
|
|
91
|
+
applyGrabForce(): void;
|
|
92
|
+
endGrab(): void;
|
|
93
|
+
step(deltaSeconds: number): boolean;
|
|
94
|
+
private updateGrabTargetForStep;
|
|
95
|
+
setJointValues(values: Readonly<Record<string, number>>): void;
|
|
96
|
+
getJointValues(names: readonly string[]): Record<string, number>;
|
|
97
|
+
reset(): void;
|
|
98
|
+
/**
|
|
99
|
+
* Runs an exact number of fixed-size steps for a deterministic probe. The
|
|
100
|
+
* compiled timestep is restored afterwards so the interactive runtime keeps
|
|
101
|
+
* its authored cadence.
|
|
102
|
+
*/
|
|
103
|
+
advanceFixed(timestep: number, steps: number): boolean;
|
|
104
|
+
dispose(): void;
|
|
105
|
+
private applyInitialControls;
|
|
106
|
+
private applyCenterOfMassOverrides;
|
|
107
|
+
/**
|
|
108
|
+
* A point force on a light body can excite a much higher rotational
|
|
109
|
+
* frequency than its translational mass suggests. Refine physics only while
|
|
110
|
+
* that body is grabbed instead of adding global damping to hide the error.
|
|
111
|
+
*/
|
|
112
|
+
private grabTimestep;
|
|
113
|
+
private setTimestep;
|
|
114
|
+
private applyInitialJoints;
|
|
115
|
+
private applyInitialVelocities;
|
|
116
|
+
private disposeModel;
|
|
117
|
+
}
|
|
118
|
+
export {};
|
|
@@ -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>;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { MujocoRuntime } from './mujoco-runtime';
|
|
2
|
+
export type PhysicsBodyMotionType = 'dynamic' | 'static' | 'kinematic' | 'visual-only' | 'unsupported';
|
|
3
|
+
export interface PhysicsRuntimeBodyState {
|
|
4
|
+
readonly id: number;
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly sourcePath: string | null;
|
|
7
|
+
readonly instanceId: string | null;
|
|
8
|
+
readonly motionType: PhysicsBodyMotionType;
|
|
9
|
+
readonly mass: number;
|
|
10
|
+
readonly centerOfMass: readonly number[];
|
|
11
|
+
readonly inertia: readonly number[];
|
|
12
|
+
/** Row-major orientation of the principal inertia frame in world coordinates. */
|
|
13
|
+
readonly inertiaOrientationWorld?: readonly number[] | null;
|
|
14
|
+
readonly position: readonly number[];
|
|
15
|
+
readonly quaternion: readonly number[];
|
|
16
|
+
readonly linearVelocity: readonly number[];
|
|
17
|
+
readonly angularVelocity: readonly number[];
|
|
18
|
+
readonly awake: boolean | null;
|
|
19
|
+
}
|
|
20
|
+
export interface PhysicsRuntimeJointState {
|
|
21
|
+
readonly instanceId?: string | null;
|
|
22
|
+
readonly axisWorld?: readonly number[] | null;
|
|
23
|
+
readonly id: number;
|
|
24
|
+
readonly name: string;
|
|
25
|
+
readonly type: string;
|
|
26
|
+
readonly position: number | null;
|
|
27
|
+
readonly velocity: number | null;
|
|
28
|
+
readonly range: readonly [number, number] | null;
|
|
29
|
+
}
|
|
30
|
+
export interface PhysicsRuntimeContactState {
|
|
31
|
+
readonly index: number;
|
|
32
|
+
readonly geom1: string;
|
|
33
|
+
readonly geom2: string;
|
|
34
|
+
readonly body1: number;
|
|
35
|
+
readonly body2: number;
|
|
36
|
+
readonly instance1: string | null;
|
|
37
|
+
readonly instance2: string | null;
|
|
38
|
+
readonly distance: number;
|
|
39
|
+
readonly penetration: number;
|
|
40
|
+
readonly position: readonly number[];
|
|
41
|
+
readonly friction: readonly number[];
|
|
42
|
+
}
|
|
43
|
+
export interface PhysicsRuntimeGrabState {
|
|
44
|
+
readonly bodyId: number;
|
|
45
|
+
readonly instanceId: string | null;
|
|
46
|
+
readonly force: readonly number[];
|
|
47
|
+
readonly forceMagnitude: number;
|
|
48
|
+
readonly maxForce: number;
|
|
49
|
+
readonly stiffness: number;
|
|
50
|
+
readonly damping: number;
|
|
51
|
+
readonly strength: number;
|
|
52
|
+
readonly target: readonly number[];
|
|
53
|
+
}
|
|
54
|
+
export interface PhysicsRuntimeSnapshot {
|
|
55
|
+
readonly status: 'running' | 'paused' | 'ready';
|
|
56
|
+
readonly worldKind: 'asset-session' | 'scene-unified';
|
|
57
|
+
readonly time: number;
|
|
58
|
+
readonly timestep: number;
|
|
59
|
+
readonly steps: number;
|
|
60
|
+
readonly qpos: readonly number[];
|
|
61
|
+
readonly qvel: readonly number[];
|
|
62
|
+
readonly bodies: readonly PhysicsRuntimeBodyState[];
|
|
63
|
+
readonly joints: readonly PhysicsRuntimeJointState[];
|
|
64
|
+
readonly contacts: readonly PhysicsRuntimeContactState[];
|
|
65
|
+
readonly contactCount: number;
|
|
66
|
+
readonly maxPenetration: number;
|
|
67
|
+
readonly grab: PhysicsRuntimeGrabState | null;
|
|
68
|
+
}
|
|
69
|
+
export interface PhysicsRuntimeCaptureOptions {
|
|
70
|
+
readonly worldKind: PhysicsRuntimeSnapshot['worldKind'];
|
|
71
|
+
readonly status?: PhysicsRuntimeSnapshot['status'];
|
|
72
|
+
readonly instanceIdForBody?: (bodyId: number, sourceName: string | null) => string | null;
|
|
73
|
+
readonly sourcePathForBody?: (bodyId: number, name: string) => string | null;
|
|
74
|
+
}
|
|
75
|
+
export declare function captureMujocoRuntimeState(runtime: MujocoRuntime, options: PhysicsRuntimeCaptureOptions): PhysicsRuntimeSnapshot | null;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import type { AnimationClip, Group, Object3D } from 'three';
|
|
2
|
+
import type { AssetNoticeSnapshot } from '../assets/types';
|
|
3
|
+
export interface SimulationDiagnostic {
|
|
4
|
+
readonly code: string;
|
|
5
|
+
readonly message: string;
|
|
6
|
+
readonly source?: string;
|
|
7
|
+
readonly notice?: AssetNoticeSnapshot;
|
|
8
|
+
}
|
|
9
|
+
export interface SimulationDiagnostics {
|
|
10
|
+
readonly errors: SimulationDiagnostic[];
|
|
11
|
+
readonly warnings: SimulationDiagnostic[];
|
|
12
|
+
readonly approximations: SimulationDiagnostic[];
|
|
13
|
+
readonly droppedFeatures: SimulationDiagnostic[];
|
|
14
|
+
}
|
|
15
|
+
export interface TransformSpec {
|
|
16
|
+
readonly position: readonly number[];
|
|
17
|
+
readonly rotationRpy: readonly number[];
|
|
18
|
+
/** URDF 1.1 origin quaternion in xyzw order. */
|
|
19
|
+
readonly rotationQuaternion?: readonly number[];
|
|
20
|
+
}
|
|
21
|
+
export type GeometrySpec = {
|
|
22
|
+
readonly type: 'box';
|
|
23
|
+
readonly size: readonly number[];
|
|
24
|
+
} | {
|
|
25
|
+
readonly type: 'sphere';
|
|
26
|
+
readonly radius: number;
|
|
27
|
+
} | {
|
|
28
|
+
readonly type: 'cylinder';
|
|
29
|
+
readonly radius: number;
|
|
30
|
+
readonly length: number;
|
|
31
|
+
} | {
|
|
32
|
+
readonly type: 'capsule';
|
|
33
|
+
readonly radius: number;
|
|
34
|
+
readonly length: number;
|
|
35
|
+
} | {
|
|
36
|
+
readonly type: 'mesh';
|
|
37
|
+
readonly resourcePath: string;
|
|
38
|
+
readonly scale: readonly number[];
|
|
39
|
+
};
|
|
40
|
+
export interface VisualSpec {
|
|
41
|
+
readonly origin: TransformSpec;
|
|
42
|
+
readonly geometry: GeometrySpec;
|
|
43
|
+
readonly color?: readonly number[];
|
|
44
|
+
readonly texturePath?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface CollisionSpec {
|
|
47
|
+
readonly origin: TransformSpec;
|
|
48
|
+
readonly geometry: GeometrySpec;
|
|
49
|
+
}
|
|
50
|
+
export interface LinkSpec {
|
|
51
|
+
readonly inertial?: {
|
|
52
|
+
readonly origin: TransformSpec;
|
|
53
|
+
readonly mass: number;
|
|
54
|
+
readonly tensor: readonly number[];
|
|
55
|
+
};
|
|
56
|
+
readonly id: string;
|
|
57
|
+
readonly name: string;
|
|
58
|
+
readonly visuals: readonly VisualSpec[];
|
|
59
|
+
readonly collisions: readonly CollisionSpec[];
|
|
60
|
+
}
|
|
61
|
+
export interface JointMimicSpec {
|
|
62
|
+
readonly joint: string;
|
|
63
|
+
readonly multiplier: number;
|
|
64
|
+
readonly offset: number;
|
|
65
|
+
}
|
|
66
|
+
export interface JointSpec {
|
|
67
|
+
readonly id: string;
|
|
68
|
+
readonly type: string;
|
|
69
|
+
readonly parent: string;
|
|
70
|
+
readonly child: string;
|
|
71
|
+
readonly origin: TransformSpec;
|
|
72
|
+
readonly axis: readonly number[];
|
|
73
|
+
readonly limits?: {
|
|
74
|
+
readonly lower: number;
|
|
75
|
+
readonly upper: number;
|
|
76
|
+
};
|
|
77
|
+
readonly effort?: number;
|
|
78
|
+
readonly velocity?: number;
|
|
79
|
+
readonly dynamics?: {
|
|
80
|
+
readonly damping?: number;
|
|
81
|
+
readonly friction?: number;
|
|
82
|
+
};
|
|
83
|
+
readonly mimic?: JointMimicSpec;
|
|
84
|
+
}
|
|
85
|
+
export interface AssetIr {
|
|
86
|
+
readonly schemaVersion: 1;
|
|
87
|
+
readonly id: string;
|
|
88
|
+
readonly name: string;
|
|
89
|
+
readonly source: {
|
|
90
|
+
readonly format: 'urdf' | 'mjcf' | 'usd';
|
|
91
|
+
readonly uri: string;
|
|
92
|
+
};
|
|
93
|
+
readonly links: readonly LinkSpec[];
|
|
94
|
+
readonly joints: readonly JointSpec[];
|
|
95
|
+
readonly diagnostics: SimulationDiagnostics;
|
|
96
|
+
readonly extension: Record<string, unknown>;
|
|
97
|
+
}
|
|
98
|
+
export interface PhysicsAsset {
|
|
99
|
+
readonly format: 'mjcf';
|
|
100
|
+
readonly xml: string;
|
|
101
|
+
readonly files: ReadonlyMap<string, Uint8Array>;
|
|
102
|
+
/** Initial actuator controls in MJCF actuator declaration order. */
|
|
103
|
+
readonly initialControls?: readonly number[];
|
|
104
|
+
/** Explicit reset pose for scalar joints; source joint references remain unchanged. */
|
|
105
|
+
readonly initialJoints?: Readonly<Record<string, number>>;
|
|
106
|
+
/** Preserve authored mass, scaling geom-inferred inertia at fixed density distribution. */
|
|
107
|
+
readonly massOverrides?: readonly {
|
|
108
|
+
readonly body: string;
|
|
109
|
+
readonly mass: number;
|
|
110
|
+
}[];
|
|
111
|
+
/** Body-local COM translation applied after MuJoCo derives inertia from authored geometry. */
|
|
112
|
+
readonly centerOfMassOverrides?: readonly {
|
|
113
|
+
readonly body: string;
|
|
114
|
+
readonly position: readonly number[];
|
|
115
|
+
}[];
|
|
116
|
+
/** Free-joint qvel: world linear m/s followed by body-local angular rad/s. */
|
|
117
|
+
readonly initialVelocities?: readonly {
|
|
118
|
+
readonly body: string;
|
|
119
|
+
readonly velocity: readonly number[];
|
|
120
|
+
}[];
|
|
121
|
+
}
|
|
122
|
+
export interface VisualAsset {
|
|
123
|
+
readonly root: Group;
|
|
124
|
+
readonly bindings: ReadonlyMap<string, Object3D>;
|
|
125
|
+
readonly expectedLinkCount: number;
|
|
126
|
+
/** USD/Three animation clips retained for a future playback controller. */
|
|
127
|
+
readonly animations?: readonly AnimationClip[];
|
|
128
|
+
readonly disposeSource?: () => void;
|
|
129
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { USDJointInfo, USDLoadedModel, USDPhysicsInfo, USDVariantSetInfo } from '@openusd-wasm/three-loader';
|
|
2
|
+
import type { SimulationDiagnostics } from './types';
|
|
3
|
+
export interface UsdInspectionStage {
|
|
4
|
+
readonly sourcePath: string;
|
|
5
|
+
readonly rootLayerIdentifier: string;
|
|
6
|
+
readonly defaultPrim: string | null;
|
|
7
|
+
readonly upAxis: string;
|
|
8
|
+
readonly metersPerUnit: number;
|
|
9
|
+
readonly kilogramsPerUnit: number;
|
|
10
|
+
readonly startTimeCode: number;
|
|
11
|
+
readonly endTimeCode: number;
|
|
12
|
+
readonly timeCodesPerSecond: number;
|
|
13
|
+
}
|
|
14
|
+
export interface UsdInspectionPrim {
|
|
15
|
+
readonly path: string;
|
|
16
|
+
readonly parentPath: string | null;
|
|
17
|
+
readonly name: string;
|
|
18
|
+
readonly typeName: string;
|
|
19
|
+
readonly visibility: string;
|
|
20
|
+
readonly resetsXformStack: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface UsdInspectionMesh {
|
|
23
|
+
readonly path: string;
|
|
24
|
+
readonly vertexCount: number;
|
|
25
|
+
readonly triangleCount: number;
|
|
26
|
+
readonly normalCount: number;
|
|
27
|
+
readonly uvCount: number;
|
|
28
|
+
readonly doubleSided: boolean;
|
|
29
|
+
readonly materialPath: string | null;
|
|
30
|
+
readonly bounds: {
|
|
31
|
+
readonly min: readonly [number, number, number];
|
|
32
|
+
readonly max: readonly [number, number, number];
|
|
33
|
+
readonly size: readonly [number, number, number];
|
|
34
|
+
} | null;
|
|
35
|
+
readonly degenerateTriangles: number;
|
|
36
|
+
readonly nonFinitePositions: number;
|
|
37
|
+
}
|
|
38
|
+
export interface UsdInspectionMaterial {
|
|
39
|
+
readonly path: string;
|
|
40
|
+
readonly shaderIds: readonly string[];
|
|
41
|
+
readonly texturePaths: readonly string[];
|
|
42
|
+
readonly inputs: Readonly<Record<string, unknown>>;
|
|
43
|
+
}
|
|
44
|
+
export type UsdInspectionJoint = USDJointInfo;
|
|
45
|
+
export type UsdInspectionVariantSet = USDVariantSetInfo;
|
|
46
|
+
export interface UsdInspectionSnapshot {
|
|
47
|
+
readonly schemaVersion: 1;
|
|
48
|
+
readonly stage: UsdInspectionStage;
|
|
49
|
+
readonly prims: readonly UsdInspectionPrim[];
|
|
50
|
+
readonly meshes: readonly UsdInspectionMesh[];
|
|
51
|
+
readonly materials: readonly UsdInspectionMaterial[];
|
|
52
|
+
readonly physics: {
|
|
53
|
+
readonly scenes: USDPhysicsInfo['scenes'];
|
|
54
|
+
readonly rigidBodies: USDPhysicsInfo['rigidBodies'];
|
|
55
|
+
readonly colliders: USDPhysicsInfo['colliders'];
|
|
56
|
+
readonly materials: USDPhysicsInfo['materials'];
|
|
57
|
+
readonly articulationRoots: USDPhysicsInfo['articulationRoots'];
|
|
58
|
+
readonly joints: readonly UsdInspectionJoint[];
|
|
59
|
+
};
|
|
60
|
+
readonly variants: readonly UsdInspectionVariantSet[];
|
|
61
|
+
readonly diagnostics: SimulationDiagnostics;
|
|
62
|
+
}
|
|
63
|
+
export declare function createUsdInspectionSnapshot(model: USDLoadedModel, units: {
|
|
64
|
+
readonly metersPerUnit: number;
|
|
65
|
+
readonly kilogramsPerUnit: number;
|
|
66
|
+
}, diagnostics: SimulationDiagnostics): UsdInspectionSnapshot;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { USDLoadedModel } from '@openusd-wasm/three-loader';
|
|
2
|
+
export interface UsdPrimInfo {
|
|
3
|
+
valid: boolean;
|
|
4
|
+
name: string;
|
|
5
|
+
path: string;
|
|
6
|
+
typeName: string;
|
|
7
|
+
instance: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface UsdAttributeValue {
|
|
10
|
+
valid: boolean;
|
|
11
|
+
authored: boolean;
|
|
12
|
+
value: unknown;
|
|
13
|
+
}
|
|
14
|
+
export interface UsdMetadataValue {
|
|
15
|
+
valid: boolean;
|
|
16
|
+
found: boolean;
|
|
17
|
+
value?: unknown;
|
|
18
|
+
text?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface UsdBoundMaterial {
|
|
21
|
+
found: boolean;
|
|
22
|
+
materialPath: string;
|
|
23
|
+
resolvedTargetPath: string;
|
|
24
|
+
bindingRelationshipPath: string;
|
|
25
|
+
}
|
|
26
|
+
export interface UsdAttributeRequest {
|
|
27
|
+
path: string;
|
|
28
|
+
names: readonly string[];
|
|
29
|
+
}
|
|
30
|
+
export type UsdAttributeValuesByPath = Record<string, Record<string, UsdAttributeValue>>;
|
|
31
|
+
/** Synchronous-in-process and asynchronous-in-worker access to a live USD stage. */
|
|
32
|
+
export interface UsdQuery {
|
|
33
|
+
stageMetadata(name: string): Promise<UsdMetadataValue>;
|
|
34
|
+
primInfo(path: string): Promise<UsdPrimInfo>;
|
|
35
|
+
primChildren(path: string): Promise<string[]>;
|
|
36
|
+
primDescendants(path: string, typeName?: string): Promise<string[]>;
|
|
37
|
+
primAttributes(path: string): Promise<string[]>;
|
|
38
|
+
primMetadata(path: string, name: string): Promise<UsdMetadataValue>;
|
|
39
|
+
relationshipTargets(path: string, name: string): Promise<string[]>;
|
|
40
|
+
attributeValue(path: string, name: string): Promise<UsdAttributeValue>;
|
|
41
|
+
attributeValues(requests: readonly UsdAttributeRequest[]): Promise<UsdAttributeValuesByPath>;
|
|
42
|
+
attributeMetadata(path: string, name: string, field: string): Promise<UsdMetadataValue>;
|
|
43
|
+
attributeConnections(path: string, name: string): Promise<string[]>;
|
|
44
|
+
boundMaterial(path: string): Promise<UsdBoundMaterial>;
|
|
45
|
+
}
|
|
46
|
+
export interface QueryableUsdModel extends USDLoadedModel {
|
|
47
|
+
usdQuery?: UsdQuery;
|
|
48
|
+
}
|
|
49
|
+
export declare function createStageQuery(stage: any, pxr: any): UsdQuery;
|
|
50
|
+
export declare function getUsdQuery(model: USDLoadedModel): UsdQuery | null;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read policy for USD composition resources.
|
|
3
|
+
*
|
|
4
|
+
* The viewer never inspects host error messages: only stable `code` values (or
|
|
5
|
+
* the HTTP status those messages carry) decide whether a failed reference is a
|
|
6
|
+
* degraded visual resource or a real load failure. Denial, authentication
|
|
7
|
+
* failure, cancellation and unclassified faults always stay fatal.
|
|
8
|
+
*/
|
|
9
|
+
export type UsdResourceFailureKind = 'missing' | 'invalid' | 'unavailable' | 'denied' | 'aborted' | 'unknown';
|
|
10
|
+
/** Stable codes a host resolver may attach to a rejected resource read. */
|
|
11
|
+
export declare const USD_RESOURCE_NOT_FOUND = "E_ASSET_RESOURCE_NOT_FOUND";
|
|
12
|
+
export declare const USD_RESOURCE_INVALID = "E_ASSET_RESOURCE_INVALID";
|
|
13
|
+
export declare const USD_RESOURCE_FETCH = "E_ASSET_FETCH";
|
|
14
|
+
export declare const USD_RESOURCE_EXTERNAL_DENIED = "E_ASSET_EXTERNAL_DENIED";
|
|
15
|
+
export declare const USD_RESOURCE_AUTH = "E_ASSET_AUTH";
|
|
16
|
+
/**
|
|
17
|
+
* Only recognized visual resources may degrade. Everything else — USD layers,
|
|
18
|
+
* MDL modules, unknown file types — keeps its failure.
|
|
19
|
+
*/
|
|
20
|
+
export declare function isDegradableUsdResource(identifier: string): boolean;
|
|
21
|
+
export declare function codedUsdResourceError(message: string, code: string): Error;
|
|
22
|
+
export declare function classifyUsdResourceFailure(error: unknown): UsdResourceFailureKind;
|
|
23
|
+
/** Host denial, auth failure, cancellation and unknown faults are never swallowed. */
|
|
24
|
+
export declare function isDegradableUsdResourceFailure(error: unknown): boolean;
|
|
25
|
+
/** A 2xx status does not make an HTML error page or an empty body a usable resource. */
|
|
26
|
+
export declare function invalidUsdResourceContent(contentType: string | null, bytes: Uint8Array): string | null;
|
|
27
|
+
/** Blob equivalent of {@link invalidUsdResourceContent}, reading only a short prefix. */
|
|
28
|
+
export declare function invalidUsdResourceBlob(blob: Blob): Promise<string | null>;
|