@shopware-ag/dive 3.1.0 → 4.0.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/README.md +31 -5
- package/build/chunks/{AssetCache-xpY_N7Yp.cjs → AssetCache-CUVFS7wk.cjs} +1 -1
- package/build/chunks/{AssetCache-C3YXhbaX.mjs → AssetCache-DnAAa719.mjs} +1 -1
- package/build/chunks/AssetExporter-CD2iuQce.mjs +108 -0
- package/build/chunks/AssetExporter-CoL-QXkB.cjs +1 -0
- package/build/chunks/{AssetLoader-MfH5d_Rr.mjs → AssetLoader-Bkp3fWZz.mjs} +9 -9
- package/build/chunks/{AssetLoader-CRxLq0AL.cjs → AssetLoader-DnVvCd41.cjs} +2 -2
- package/build/chunks/FileTypes-B-MjfMGd.cjs +29 -0
- package/build/chunks/FileTypes-D3Dxr2dj.mjs +2294 -0
- package/build/chunks/ModelComponent-Cmu0EX0r.cjs +1 -0
- package/build/chunks/ModelComponent-WA0kLOEY.mjs +87 -0
- package/build/chunks/OrbitController-CAJIiZeE.cjs +1 -0
- package/build/chunks/OrbitController-DxCbrQVB.mjs +612 -0
- package/build/chunks/SpriteTextComponent-BpoKLOjA.cjs +1 -0
- package/build/chunks/SpriteTextComponent-DIZFqao0.mjs +83 -0
- package/build/chunks/collectAnimations-BgYCN1le.mjs +35 -0
- package/build/chunks/collectAnimations-C3HfZHte.cjs +1 -0
- package/build/chunks/contributesToBounds-C1mva__U.cjs +1 -0
- package/build/chunks/contributesToBounds-DYmHYES4.mjs +14 -0
- package/build/chunks/detachTransformControls-B4iRF1bw.mjs +209 -0
- package/build/chunks/detachTransformControls-CZ2cd5hx.cjs +1 -0
- package/build/chunks/{isFileTypeSupported-BBU39V4u.cjs → isFileExtensionSupported-B1q2eWs7.cjs} +1 -1
- package/build/chunks/{isFileTypeSupported-9h8lrIuG.mjs → isFileExtensionSupported-BqOqU3-h.mjs} +1 -1
- package/build/chunks/isVisibleInHierarchy-D9JcLqR5.cjs +1 -0
- package/build/chunks/isVisibleInHierarchy-KzVGvDEw.mjs +21 -0
- package/build/components/boundingbox/BoundingBoxComponent.d.ts +100 -0
- package/build/components/boundingbox/index.d.ts +1 -0
- package/build/components/camera/CameraComponent.d.ts +75 -0
- package/build/components/camera/index.d.ts +2 -0
- package/build/components/camera/perspective/PerspectiveCameraComponent.d.ts +39 -0
- package/build/components/grid/GridComponent.d.ts +50 -0
- package/build/components/index.d.ts +6 -10
- package/build/components/light/LightComponent.d.ts +65 -0
- package/build/components/light/ambient/AmbientLightComponent.d.ts +10 -0
- package/build/components/light/directional/DirectionalLightComponent.d.ts +23 -0
- package/build/components/light/hemi/HemisphereLightComponent.d.ts +21 -0
- package/build/components/light/index.d.ts +5 -3
- package/build/components/light/point/PointLightComponent.d.ts +26 -0
- package/build/components/line/MultiLineComponent.d.ts +133 -0
- package/build/components/line/index.d.ts +1 -0
- package/build/components/mesh/MeshComponent.d.ts +74 -0
- package/build/components/mesh/floor/FloorComponent.d.ts +36 -0
- package/build/components/mesh/index.d.ts +4 -0
- package/build/components/mesh/model/ModelComponent.d.ts +67 -0
- package/build/components/mesh/primitive/PrimitiveComponent.d.ts +43 -0
- package/build/components/spritetext/SpriteTextComponent.d.ts +58 -0
- package/build/constants/VisibilityLayerMask.d.ts +23 -0
- package/build/dive.cjs +1 -1
- package/build/dive.mjs +252 -773
- package/build/engine/Dive.d.ts +11 -13
- package/build/engine/boundingbox/BoundingBox.d.ts +76 -0
- package/build/engine/component/Component.d.ts +236 -0
- package/build/engine/environment/Environment.d.ts +0 -18
- package/build/engine/index.d.ts +4 -1
- package/build/engine/node/Node.d.ts +189 -0
- package/build/engine/promise/abortable/AbortablePromise.d.ts +8 -0
- package/build/engine/renderer/Renderer.d.ts +43 -7
- package/build/engine/scene/Scene.d.ts +88 -4
- package/build/engine/scene/root/Root.d.ts +29 -0
- package/build/engine/scene/xrroot/XRRoot.d.ts +1 -1
- package/build/engine/view/View.d.ts +15 -4
- package/build/helpers/collectAnimations/collectAnimations.d.ts +23 -0
- package/build/helpers/computeProductBounds/computeProductBounds.d.ts +18 -0
- package/build/helpers/contributesToBounds/contributesToBounds.d.ts +17 -0
- package/build/helpers/detachTransformControls/detachTransformControls.d.ts +15 -0
- package/build/helpers/disposeComponents/disposeComponents.d.ts +20 -0
- package/build/helpers/findSceneRecursive/findSceneRecursive.d.ts +7 -3
- package/build/helpers/implementsInterface/implementsInterface.d.ts +11 -0
- package/build/helpers/index.d.ts +6 -1
- package/build/helpers/isVisibleInHierarchy/isVisibleInHierarchy.d.ts +12 -0
- package/build/index.d.ts +0 -1
- package/build/plugins/animation/index.mjs +3 -2
- package/build/plugins/animation/src/system/AnimationSystem.d.ts +3 -2
- package/build/plugins/ar/index.cjs +1 -1
- package/build/plugins/ar/index.mjs +2 -2
- package/build/plugins/ar/src/webxr/WebXR.d.ts +7 -0
- package/build/plugins/assetcache/index.cjs +1 -1
- package/build/plugins/assetcache/index.mjs +1 -1
- package/build/plugins/assetexporter/index.cjs +1 -1
- package/build/plugins/assetexporter/index.mjs +1 -1
- package/build/plugins/assetexporter/src/AssetExporter.d.ts +12 -0
- package/build/plugins/assetloader/index.cjs +1 -1
- package/build/plugins/assetloader/index.mjs +2 -2
- package/build/plugins/mediacreator/index.cjs +1 -1
- package/build/plugins/mediacreator/index.mjs +32 -30
- package/build/plugins/mediacreator/src/MediaCreator.d.ts +1 -2
- package/build/plugins/orbitcontroller/index.cjs +1 -1
- package/build/plugins/orbitcontroller/index.d.ts +1 -0
- package/build/plugins/orbitcontroller/index.mjs +1 -1
- package/build/plugins/orbitcontroller/src/OrbitController.d.ts +39 -6
- package/build/plugins/orientationdisplay/index.cjs +1 -1
- package/build/plugins/orientationdisplay/index.mjs +39 -31
- package/build/plugins/orientationdisplay/src/OrientationDisplay.d.ts +3 -3
- package/build/plugins/quickview/index.cjs +1 -1
- package/build/plugins/quickview/index.mjs +68 -45
- package/build/plugins/quickview/src/QuickView.d.ts +40 -13
- package/build/plugins/quickview/types/index.d.ts +0 -18
- package/build/plugins/state/index.cjs +1 -27
- package/build/plugins/state/index.mjs +1983 -4262
- package/build/plugins/state/src/EngineGateway.d.ts +98 -0
- package/build/plugins/state/src/EntityRegistry.d.ts +51 -0
- package/build/plugins/state/src/State.d.ts +20 -9
- package/build/plugins/state/src/actions/camera/computeencompassingview.d.ts +1 -1
- package/build/plugins/state/src/actions/camera/movecamera.d.ts +2 -2
- package/build/plugins/state/src/actions/media/generatemedia.d.ts +1 -1
- package/build/plugins/state/src/actions/object/addobject.d.ts +2 -3
- package/build/plugins/state/src/actions/object/deleteobject.d.ts +3 -4
- package/build/plugins/state/src/actions/object/deselectobject.d.ts +3 -4
- package/build/plugins/state/src/actions/object/dropit.d.ts +2 -2
- package/build/plugins/state/src/actions/object/getallobjects.d.ts +2 -3
- package/build/plugins/state/src/actions/object/getobjects.d.ts +3 -4
- package/build/plugins/state/src/actions/object/index.d.ts +0 -1
- package/build/plugins/state/src/actions/object/modelloaded.d.ts +2 -2
- package/build/plugins/state/src/actions/object/selectobject.d.ts +3 -4
- package/build/plugins/state/src/actions/object/setparent.d.ts +3 -4
- package/build/plugins/state/src/actions/object/updateobject.d.ts +3 -4
- package/build/plugins/state/src/actions/renderer/startrender.d.ts +1 -1
- package/build/plugins/state/src/actions/scene/exportscene.d.ts +2 -2
- package/build/plugins/state/src/actions/scene/index.d.ts +0 -1
- package/build/plugins/state/src/actions/scene/setbackground.d.ts +2 -2
- package/build/plugins/state/src/actions/scene/updatescene.d.ts +2 -2
- package/build/plugins/state/src/actions/state/getstate.d.ts +1 -1
- package/build/plugins/state/src/actions/state/setstate.d.ts +1 -1
- package/build/plugins/state/src/helpers/copyVectors/copyVectors.d.ts +17 -0
- package/build/plugins/state/src/helpers/updateParentLink/updateParentLink.d.ts +29 -0
- package/build/plugins/state/src/helpers/watchEntity/watchEntity.d.ts +30 -0
- package/build/plugins/state/types/ActionTypes.d.ts +18 -3
- package/build/plugins/state/types/RegisteredEntity.d.ts +27 -0
- package/build/plugins/state/types/StateData.d.ts +1 -1
- package/build/plugins/state/types/index.d.ts +2 -1
- package/build/{types → plugins/state/types}/schema/GroupSchema.d.ts +1 -1
- package/build/{types → plugins/state/types}/schema/ModelSchema.d.ts +7 -4
- package/build/{types → plugins/state/types}/schema/PrimitiveSchema.d.ts +4 -5
- package/build/{types → plugins/state/types}/schema/index.d.ts +0 -3
- package/build/plugins/toolbox/index.cjs +1 -1
- package/build/plugins/toolbox/index.mjs +193 -140
- package/build/plugins/toolbox/src/PointerContext.d.ts +7 -0
- package/build/plugins/toolbox/src/SelectionState.d.ts +21 -0
- package/build/plugins/toolbox/src/Toolbox.d.ts +9 -2
- package/build/{components → plugins/toolbox/src}/gizmo/Gizmo.d.ts +16 -2
- package/build/{components → plugins/toolbox/src}/gizmo/handles/AxisHandle.d.ts +2 -3
- package/build/{components → plugins/toolbox/src}/gizmo/handles/RadialHandle.d.ts +2 -3
- package/build/{components → plugins/toolbox/src}/gizmo/handles/ScaleHandle.d.ts +2 -3
- package/build/{components → plugins/toolbox/src}/gizmo/rotate/RotateGizmo.d.ts +2 -2
- package/build/{components → plugins/toolbox/src}/gizmo/scale/ScaleGizmo.d.ts +3 -3
- package/build/{components → plugins/toolbox/src}/gizmo/translate/TranslateGizmo.d.ts +2 -2
- package/build/types/components/DIVESceneObject.d.ts +13 -6
- package/build/types/components/index.d.ts +0 -1
- package/build/types/events/DIVEComponentEventMap.d.ts +14 -0
- package/build/types/events/DIVEEntityEventMap.d.ts +47 -0
- package/build/types/events/index.d.ts +2 -0
- package/build/types/{schema/GeometrySchema.d.ts → geometry/DIVEGeometry.d.ts} +4 -4
- package/build/types/{schema/GeometryTypeSchema.d.ts → geometry/DIVEGeometryType.d.ts} +1 -1
- package/build/types/geometry/index.d.ts +2 -0
- package/build/types/index.d.ts +3 -1
- package/build/types/{schema/MaterialSchema.d.ts → material/DIVEMaterial.d.ts} +1 -1
- package/build/types/material/index.d.ts +1 -0
- package/package.json +6 -5
- package/build/chunks/AssetExporter-C5MScs9S.mjs +0 -70
- package/build/chunks/AssetExporter-Cdxb04b3.cjs +0 -1
- package/build/chunks/CameraSchema-cgY5WBGW.mjs +0 -10
- package/build/chunks/CameraSchema-twxH-72N.cjs +0 -1
- package/build/chunks/FileTypes-Cgyf8ocm.cjs +0 -29
- package/build/chunks/FileTypes-DiYB3WBp.mjs +0 -2166
- package/build/chunks/PerspectiveCamera-B5TvUzTa.mjs +0 -39
- package/build/chunks/PerspectiveCamera-DwQUmkDv.cjs +0 -1
- package/build/chunks/SpriteText-2lCRglsw.cjs +0 -1
- package/build/chunks/SpriteText-C_CQPvUn.mjs +0 -50
- package/build/chunks/findInterface-C6mrvf_t.cjs +0 -1
- package/build/chunks/findInterface-DbJ5qzbc.mjs +0 -11
- package/build/components/boundingbox/BoundingBox.d.ts +0 -140
- package/build/components/floor/Floor.d.ts +0 -14
- package/build/components/grid/Grid.d.ts +0 -23
- package/build/components/group/Group.d.ts +0 -28
- package/build/components/light/AmbientLight.d.ts +0 -19
- package/build/components/light/PointLight.d.ts +0 -29
- package/build/components/light/SceneLight.d.ts +0 -20
- package/build/components/model/Model.d.ts +0 -26
- package/build/components/node/Node.d.ts +0 -24
- package/build/components/primitive/Primitive.d.ts +0 -27
- package/build/components/root/Root.d.ts +0 -34
- package/build/components/spritetext/SpriteText.d.ts +0 -27
- package/build/engine/camera/PerspectiveCamera.d.ts +0 -24
- package/build/helpers/isFileTypeSupported/isFileTypeSupported.d.ts +0 -9
- package/build/plugins/quickview/src/state/QuickViewState.d.ts +0 -4
- package/build/plugins/quickview/src/uri/QuickViewUri.d.ts +0 -3
- package/build/plugins/state/src/actions/object/placeonfloor.d.ts +0 -12
- package/build/plugins/state/src/actions/scene/getallscenedata.d.ts +0 -12
- package/build/plugins/state/types/StateSceneData.d.ts +0 -5
- package/build/types/components/DIVELight.d.ts +0 -4
- /package/build/{types → plugins/state/types}/schema/BaseEntitySchema.d.ts +0 -0
- /package/build/{types → plugins/state/types}/schema/CameraSchema.d.ts +0 -0
- /package/build/{types → plugins/state/types}/schema/EntitySchema.d.ts +0 -0
- /package/build/{types → plugins/state/types}/schema/EntityTypeSchema.d.ts +0 -0
- /package/build/{types → plugins/state/types}/schema/LightSchema.d.ts +0 -0
- /package/build/{components → plugins/toolbox/src}/gizmo/plane/GizmoPlane.d.ts +0 -0
|
@@ -1,58 +1,60 @@
|
|
|
1
|
-
var
|
|
2
|
-
var p = (
|
|
3
|
-
var
|
|
4
|
-
import { RenderTarget as
|
|
5
|
-
import { D as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
this
|
|
1
|
+
var l = Object.defineProperty;
|
|
2
|
+
var p = (a, t, r) => t in a ? l(a, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : a[t] = r;
|
|
3
|
+
var h = (a, t, r) => p(a, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { RenderTarget as w, SRGBColorSpace as y } from "three/webgpu";
|
|
5
|
+
import { D as C } from "../../chunks/FileTypes-D3Dxr2dj.mjs";
|
|
6
|
+
import "three/examples/jsm/loaders/HDRLoader.js";
|
|
7
|
+
import "three/tsl";
|
|
8
|
+
class M {
|
|
9
|
+
constructor(t, r, e) {
|
|
10
|
+
h(this, "_renderer");
|
|
11
|
+
h(this, "_scene");
|
|
12
|
+
h(this, "_controller");
|
|
13
|
+
this._renderer = t, this._scene = r, this._controller = e;
|
|
12
14
|
}
|
|
13
15
|
async generateMedia(t) {
|
|
14
|
-
const { position:
|
|
16
|
+
const { position: r, target: e, resolution: i } = t, { width: o, height: s } = i, d = this._controller.object.owner.position.clone(), n = this._controller.target.clone(), _ = this._renderer.canvas.clientWidth || o, g = this._renderer.canvas.clientHeight || s;
|
|
15
17
|
try {
|
|
16
|
-
return
|
|
18
|
+
return this._controller.object.onResize(o, s), this._controller.object.owner.position.copy(r), this._controller.target.copy(e), this._controller.update(), (await this.drawCanvas(void 0, i)).toDataURL();
|
|
17
19
|
} finally {
|
|
18
|
-
this._controller.object.position.copy(
|
|
20
|
+
this._controller.object.owner.position.copy(d), this._controller.target.copy(n), this._controller.update(), this._controller.object.onResize(_, g);
|
|
19
21
|
}
|
|
20
22
|
}
|
|
21
|
-
async drawCanvas(t,
|
|
23
|
+
async drawCanvas(t, r) {
|
|
22
24
|
await this._renderer.initAsync();
|
|
23
|
-
const
|
|
25
|
+
const e = this._renderer.webgpurenderer, i = Math.max(
|
|
24
26
|
1,
|
|
25
|
-
(
|
|
27
|
+
(r == null ? void 0 : r.width) ?? (t == null ? void 0 : t.width) ?? (t == null ? void 0 : t.clientWidth) ?? this._renderer.canvas.clientWidth
|
|
26
28
|
), o = Math.max(
|
|
27
29
|
1,
|
|
28
|
-
(
|
|
29
|
-
), s = new
|
|
30
|
-
colorSpace:
|
|
31
|
-
}),
|
|
30
|
+
(r == null ? void 0 : r.height) ?? (t == null ? void 0 : t.height) ?? (t == null ? void 0 : t.clientHeight) ?? this._renderer.canvas.clientHeight
|
|
31
|
+
), s = new w(i, o, {
|
|
32
|
+
colorSpace: y
|
|
33
|
+
}), d = e.getRenderTarget(), n = this._controller.object.camera, _ = n.layers.mask;
|
|
32
34
|
try {
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
+
e.setRenderTarget(s), n.layers.mask = C.LIVE_VIEW_LAYER_MASK, e.render(this._scene, n);
|
|
36
|
+
const g = await e.readRenderTargetPixelsAsync(
|
|
35
37
|
s,
|
|
36
38
|
0,
|
|
37
39
|
0,
|
|
38
40
|
i,
|
|
39
41
|
o
|
|
40
|
-
),
|
|
41
|
-
return
|
|
42
|
+
), c = t ?? document.createElement("canvas");
|
|
43
|
+
return c.width = i, c.height = o, this._writePixelsToCanvas(c, g, i, o), c;
|
|
42
44
|
} finally {
|
|
43
|
-
|
|
45
|
+
n.layers.mask = _, e.setRenderTarget(d), s.dispose();
|
|
44
46
|
}
|
|
45
47
|
}
|
|
46
|
-
_writePixelsToCanvas(t,
|
|
48
|
+
_writePixelsToCanvas(t, r, e, i) {
|
|
47
49
|
const o = t.getContext("2d");
|
|
48
50
|
if (!o)
|
|
49
51
|
throw new Error(
|
|
50
52
|
"MediaCreator.drawCanvas: 2D canvas context is not available."
|
|
51
53
|
);
|
|
52
|
-
const s = o.createImageData(
|
|
53
|
-
s.data.set(new Uint8ClampedArray(Array.from(
|
|
54
|
+
const s = o.createImageData(e, i);
|
|
55
|
+
s.data.set(new Uint8ClampedArray(Array.from(r))), o.putImageData(s, 0, 0);
|
|
54
56
|
}
|
|
55
57
|
}
|
|
56
58
|
export {
|
|
57
|
-
|
|
59
|
+
M as MediaCreator
|
|
58
60
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { DIVEScene } from '../../../
|
|
2
|
-
import { DIVERenderer } from '../../../engine/renderer/Renderer.ts';
|
|
1
|
+
import { DIVEScene, DIVERenderer } from '../../../index.ts';
|
|
3
2
|
import { OrbitController } from '../../orbitcontroller/index.ts';
|
|
4
3
|
import { MediaGenerationByPosition, MediaGenerationResolution } from '../types/index.ts';
|
|
5
4
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../chunks/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../chunks/OrbitController-CAJIiZeE.cjs");exports.OrbitController=t.OrbitController;exports.OrbitControllerDefaultSettings=t.OrbitControllerDefaultSettings;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EventDispatcher, MOUSE,
|
|
2
|
-
import {
|
|
1
|
+
import { EventDispatcher, MOUSE, Sphere, TOUCH, Vector3, Vector3Like } from 'three/webgpu';
|
|
2
|
+
import { DIVENode, DIVETicker, DIVECameraComponent } from '../../../index.ts';
|
|
3
3
|
import { OrbitControllerState } from '../types/index.ts';
|
|
4
4
|
export type OrbitControllerSettings = {
|
|
5
5
|
enableDamping?: boolean;
|
|
@@ -57,7 +57,21 @@ type EventMap = {
|
|
|
57
57
|
};
|
|
58
58
|
export declare class OrbitController extends EventDispatcher<EventMap> implements DIVETicker {
|
|
59
59
|
static readonly DEFAULT_ZOOM_FACTOR = 1;
|
|
60
|
-
|
|
60
|
+
/**
|
|
61
|
+
* The camera component this controller drives.
|
|
62
|
+
*
|
|
63
|
+
* The component rather than the camera: `setCameraLayer` and `onResize` live
|
|
64
|
+
* there, and handing out the bare camera meant every caller had to search its
|
|
65
|
+
* way back. What orbiting moves is `object.owner`, the node it sits on.
|
|
66
|
+
*/
|
|
67
|
+
object: DIVECameraComponent;
|
|
68
|
+
/**
|
|
69
|
+
* The camera, narrowed to the two kinds whose projection this can pan.
|
|
70
|
+
*
|
|
71
|
+
* `DIVECameraComponent` types its camera as the base `Camera`, which has no
|
|
72
|
+
* `zoom` or `fov`; the branches below narrow it further.
|
|
73
|
+
*/
|
|
74
|
+
private get _camera();
|
|
61
75
|
get domElement(): HTMLCanvasElement;
|
|
62
76
|
domElements: HTMLCanvasElement[];
|
|
63
77
|
enabled: boolean;
|
|
@@ -125,7 +139,7 @@ export declare class OrbitController extends EventDispatcher<EventMap> implement
|
|
|
125
139
|
private readonly lastPosition;
|
|
126
140
|
private readonly lastQuaternion;
|
|
127
141
|
private readonly lastTarget;
|
|
128
|
-
constructor(
|
|
142
|
+
constructor(cameraComponent: DIVECameraComponent, domElements: HTMLCanvasElement | HTMLCanvasElement[], settings?: OrbitControllerSettings);
|
|
129
143
|
tick(): void;
|
|
130
144
|
getPolarAngle(): number;
|
|
131
145
|
getAzimuthalAngle(): number;
|
|
@@ -137,11 +151,30 @@ export declare class OrbitController extends EventDispatcher<EventMap> implement
|
|
|
137
151
|
addDomElements(...domElements: HTMLCanvasElement[]): void;
|
|
138
152
|
removeDomElements(...domElements: HTMLCanvasElement[]): void;
|
|
139
153
|
setDomElements(...domElements: HTMLCanvasElement[]): void;
|
|
140
|
-
|
|
154
|
+
/**
|
|
155
|
+
* Where to put the camera so a sphere fills the view.
|
|
156
|
+
*
|
|
157
|
+
* Takes a `Sphere` rather than a bounding box: framing needs a centre and a
|
|
158
|
+
* radius, and nothing else. Build one with `new BoundingBox().enclose(...)`,
|
|
159
|
+
* or read `sphere` off a `BoundingBoxComponent` that already measures a node.
|
|
160
|
+
*
|
|
161
|
+
* @param sphere - What to frame, in world space.
|
|
162
|
+
* @param padding - Extra distance as a fraction of the fitted one.
|
|
163
|
+
*/
|
|
164
|
+
computeEncompassingView(sphere: Sphere, padding?: number): {
|
|
141
165
|
position: Vector3Like;
|
|
142
166
|
target: Vector3Like;
|
|
143
167
|
};
|
|
144
|
-
|
|
168
|
+
/**
|
|
169
|
+
* Puts the camera where the whole node fits in the view.
|
|
170
|
+
*
|
|
171
|
+
* One node, not a list: a node already is the handle for everything below it,
|
|
172
|
+
* so anything worth framing together belongs under a common parent.
|
|
173
|
+
*
|
|
174
|
+
* @param node - What to frame.
|
|
175
|
+
* @param padding - Extra distance as a fraction of the fitted one.
|
|
176
|
+
*/
|
|
177
|
+
focusObject(node: DIVENode, padding?: number): void;
|
|
145
178
|
zoomIn(by?: number): void;
|
|
146
179
|
zoomOut(by?: number): void;
|
|
147
180
|
getState(): OrbitControllerState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var _=Object.defineProperty;var c=(t,e,r)=>e in t?_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var o=(t,e,r)=>c(t,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("three/webgpu"),d=require("../../chunks/FileTypes-B-MjfMGd.cjs"),h=require("../../chunks/contributesToBounds-C1mva__U.cjs");require("three/examples/jsm/loaders/HDRLoader.js");require("three/tsl");const a=require("../../chunks/AxisHelperColors-BrGqktN5.cjs"),x=require("../../chunks/SpriteTextComponent-BpoKLOjA.cjs"),n=(t,e,r)=>{const i=new d.DIVENode;return i.position.set(r.x,r.y,r.z),i.layers.mask=h.COORDINATE_LAYER_MASK,i.addComponent(new x.SpriteTextComponent).setText(t).setTextHeight(.2).setColor(e),i};class p extends s.Object3D{constructor(){super();o(this,"_axesHelper");this._axesHelper=new s.AxesHelper(.5),this._axesHelper.layers.mask=h.COORDINATE_LAYER_MASK,this._axesHelper.material.depthTest=!1,this._axesHelper.position.set(0,0,-1),this._axesHelper.setColors(new s.Color(a.AxesColorRed),new s.Color(a.AxesColorGreen),new s.Color(a.AxesColorBlue)),this._axesHelper.add(n("X",a.AxesColorRedLetter,{x:.7,y:0,z:0}),n("Y",a.AxesColorGreenLetter,{x:0,y:.7,z:0}),n("Z",a.AxesColorBlueLetter,{x:0,y:0,z:.7})),this.add(this._axesHelper)}setFromCameraMatrix(r){this._axesHelper.rotation.setFromRotationMatrix(new s.Matrix4().extractRotation(r).invert())}}class u{constructor(e,r,i){o(this,"uuid",s.MathUtils.generateUUID());o(this,"_axes");o(this,"_orthographicCamera");o(this,"_restoreViewport",new s.Vector4);this._renderer=e,this._scene=r,this._cameraComponent=i,this._orthographicCamera=new s.OrthographicCamera(-1,1,1,-1,.1,100),this._orthographicCamera.name="OrientationDisplayCamera",this._orthographicCamera.layers.mask=h.COORDINATE_LAYER_MASK,this._scene.add(this._orthographicCamera),this._axes=new p,this._axes.name="OrientationDisplayAxes",this._scene.add(this._axes)}tick(){var l;if(!this._renderer.webgpurenderer.initialized)return;const e=this._scene.background??null,r=this._renderer.webgpurenderer.autoClear;this._scene.background=null,this._renderer.webgpurenderer.getViewport(this._restoreViewport);const i=((l=this._renderer.webgpurenderer.domElement)==null?void 0:l.clientHeight)??this._restoreViewport.w;this._renderer.webgpurenderer.setViewport(0,Math.max(0,i-150),150,150),this._renderer.webgpurenderer.autoClear=!1,this._axes.setFromCameraMatrix(this._cameraComponent.camera.matrixWorld),this._renderer.webgpurenderer.render(this._scene,this._orthographicCamera),this._renderer.webgpurenderer.setViewport(this._restoreViewport),this._renderer.webgpurenderer.autoClear=r,this._scene.background=e}dispose(){this._scene.remove(this._axes),this._scene.remove(this._orthographicCamera)}}exports.OrientationDisplay=u;exports.OrientationDisplayAxes=p;
|
|
@@ -1,61 +1,69 @@
|
|
|
1
1
|
var p = Object.defineProperty;
|
|
2
|
-
var _ = (t,
|
|
3
|
-
var
|
|
4
|
-
import { Object3D as
|
|
5
|
-
import "../../chunks/FileTypes-
|
|
6
|
-
import { C as
|
|
2
|
+
var _ = (t, e, r) => e in t ? p(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var a = (t, e, r) => _(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { Object3D as d, AxesHelper as l, Color as o, Matrix4 as m, OrthographicCamera as c, MathUtils as x, Vector4 as C } from "three/webgpu";
|
|
5
|
+
import { d as u } from "../../chunks/FileTypes-D3Dxr2dj.mjs";
|
|
6
|
+
import { C as n } from "../../chunks/contributesToBounds-DYmHYES4.mjs";
|
|
7
7
|
import "three/examples/jsm/loaders/HDRLoader.js";
|
|
8
8
|
import "three/tsl";
|
|
9
|
-
import { A as
|
|
10
|
-
import {
|
|
11
|
-
|
|
9
|
+
import { A as w, a as g, b, c as A, d as H, e as y } from "../../chunks/AxisHelperColors-JLBHYQDi.mjs";
|
|
10
|
+
import { S as V } from "../../chunks/SpriteTextComponent-DIZFqao0.mjs";
|
|
11
|
+
const i = (t, e, r) => {
|
|
12
|
+
const s = new u();
|
|
13
|
+
return s.position.set(r.x, r.y, r.z), s.layers.mask = n, s.addComponent(new V()).setText(t).setTextHeight(0.2).setColor(e), s;
|
|
14
|
+
};
|
|
15
|
+
class f extends d {
|
|
12
16
|
constructor() {
|
|
13
17
|
super();
|
|
14
|
-
|
|
15
|
-
this._axesHelper = new
|
|
16
|
-
new
|
|
17
|
-
new
|
|
18
|
-
new
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
a(this, "_axesHelper");
|
|
19
|
+
this._axesHelper = new l(0.5), this._axesHelper.layers.mask = n, this._axesHelper.material.depthTest = !1, this._axesHelper.position.set(0, 0, -1), this._axesHelper.setColors(
|
|
20
|
+
new o(w),
|
|
21
|
+
new o(g),
|
|
22
|
+
new o(b)
|
|
23
|
+
), this._axesHelper.add(
|
|
24
|
+
i("X", A, { x: 0.7, y: 0, z: 0 }),
|
|
25
|
+
i("Y", H, { x: 0, y: 0.7, z: 0 }),
|
|
26
|
+
i("Z", y, { x: 0, y: 0, z: 0.7 })
|
|
27
|
+
), this.add(this._axesHelper);
|
|
22
28
|
}
|
|
23
|
-
setFromCameraMatrix(
|
|
29
|
+
setFromCameraMatrix(r) {
|
|
24
30
|
this._axesHelper.rotation.setFromRotationMatrix(
|
|
25
|
-
new
|
|
31
|
+
new m().extractRotation(r).invert()
|
|
26
32
|
);
|
|
27
33
|
}
|
|
28
34
|
}
|
|
29
35
|
class E {
|
|
30
|
-
constructor(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
this._renderer =
|
|
36
|
+
constructor(e, r, s) {
|
|
37
|
+
a(this, "uuid", x.generateUUID());
|
|
38
|
+
a(this, "_axes");
|
|
39
|
+
a(this, "_orthographicCamera");
|
|
40
|
+
a(this, "_restoreViewport", new C());
|
|
41
|
+
this._renderer = e, this._scene = r, this._cameraComponent = s, this._orthographicCamera = new c(
|
|
36
42
|
-1,
|
|
37
43
|
1,
|
|
38
44
|
1,
|
|
39
45
|
-1,
|
|
40
46
|
0.1,
|
|
41
47
|
100
|
|
42
|
-
), this._orthographicCamera.name = "OrientationDisplayCamera", this._orthographicCamera.layers.mask =
|
|
48
|
+
), this._orthographicCamera.name = "OrientationDisplayCamera", this._orthographicCamera.layers.mask = n, this._scene.add(this._orthographicCamera), this._axes = new f(), this._axes.name = "OrientationDisplayAxes", this._scene.add(this._axes);
|
|
43
49
|
}
|
|
44
50
|
tick() {
|
|
45
|
-
var
|
|
51
|
+
var h;
|
|
46
52
|
if (!this._renderer.webgpurenderer.initialized) return;
|
|
47
|
-
const
|
|
53
|
+
const e = this._scene.background ?? null, r = this._renderer.webgpurenderer.autoClear;
|
|
48
54
|
this._scene.background = null, this._renderer.webgpurenderer.getViewport(this._restoreViewport);
|
|
49
|
-
const s = ((
|
|
55
|
+
const s = ((h = this._renderer.webgpurenderer.domElement) == null ? void 0 : h.clientHeight) ?? this._restoreViewport.w;
|
|
50
56
|
this._renderer.webgpurenderer.setViewport(
|
|
51
57
|
0,
|
|
52
58
|
Math.max(0, s - 150),
|
|
53
59
|
150,
|
|
54
60
|
150
|
|
55
|
-
), this._renderer.webgpurenderer.autoClear = !1, this._axes.setFromCameraMatrix(
|
|
61
|
+
), this._renderer.webgpurenderer.autoClear = !1, this._axes.setFromCameraMatrix(
|
|
62
|
+
this._cameraComponent.camera.matrixWorld
|
|
63
|
+
), this._renderer.webgpurenderer.render(
|
|
56
64
|
this._scene,
|
|
57
65
|
this._orthographicCamera
|
|
58
|
-
), this._renderer.webgpurenderer.setViewport(this._restoreViewport), this._renderer.webgpurenderer.autoClear =
|
|
66
|
+
), this._renderer.webgpurenderer.setViewport(this._restoreViewport), this._renderer.webgpurenderer.autoClear = r, this._scene.background = e;
|
|
59
67
|
}
|
|
60
68
|
dispose() {
|
|
61
69
|
this._scene.remove(this._axes), this._scene.remove(this._orthographicCamera);
|
|
@@ -63,5 +71,5 @@ class E {
|
|
|
63
71
|
}
|
|
64
72
|
export {
|
|
65
73
|
E as OrientationDisplay,
|
|
66
|
-
|
|
74
|
+
f as OrientationDisplayAxes
|
|
67
75
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DIVERenderer, DIVETicker, DIVEScene
|
|
1
|
+
import { DIVECameraComponent, DIVERenderer, DIVETicker, DIVEScene } from '../../../index.ts';
|
|
2
2
|
/**
|
|
3
3
|
* Shows the scene axes in the bottom left corner of the screen.
|
|
4
4
|
*
|
|
@@ -7,12 +7,12 @@ import { DIVERenderer, DIVETicker, DIVEScene, DIVEPerspectiveCamera } from '../.
|
|
|
7
7
|
export declare class OrientationDisplay implements DIVETicker {
|
|
8
8
|
private _renderer;
|
|
9
9
|
private _scene;
|
|
10
|
-
private
|
|
10
|
+
private _cameraComponent;
|
|
11
11
|
uuid: string;
|
|
12
12
|
private _axes;
|
|
13
13
|
private _orthographicCamera;
|
|
14
14
|
private _restoreViewport;
|
|
15
|
-
constructor(_renderer: DIVERenderer, _scene: DIVEScene,
|
|
15
|
+
constructor(_renderer: DIVERenderer, _scene: DIVEScene, _cameraComponent: DIVECameraComponent);
|
|
16
16
|
tick(): void;
|
|
17
17
|
dispose(): void;
|
|
18
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../chunks/FileTypes-B-MjfMGd.cjs");require("three/webgpu");require("three/examples/jsm/loaders/HDRLoader.js");require("three/tsl");const C=require("../../chunks/ModelComponent-Cmu0EX0r.cjs"),S=require("../../chunks/OrbitController-CAJIiZeE.cjs"),v={...i.DIVEDefaultSettings},w=c=>{i.disposeComponents(c),c.removeFromParent()};async function E(c,l){let s=!1;const e=new i.DIVE({...l,autoStart:!1});try{e.mainView.cameraComponent.owner.position.set(0,1,2);const{clientWidth:u,clientHeight:d}=e.mainView.canvas;u>0&&d>0&&e.mainView.cameraComponent.onResize(u,d);const a=new S.OrbitController(e.mainView.cameraComponent,e.mainView.canvas);e.clock.addTicker(a);let t=null,r=null,m=0,f=Promise.resolve();const b=()=>{const o=t??e.scene.root;new i.BoundingBox().enclose(o).isEmpty||a.focusObject(o)},p=()=>{t&&(w(t),t=null),r&&(r.destroyInstance(),r=null,e.scene.root.nodes.forEach(w))},g=e.disposeAsync.bind(e);e.disposeAsync=async()=>{s=!0,m++,a.dispose(),p(),await g()};const k=async o=>{r&&p(),t||(t=new i.DIVENode,t.name="QuickViewModel",t.addComponent(new C.ModelComponent),e.scene.root.add(t));const n=t;if(await n.requireComponent(C.ModelComponent).setFromURL(o),s){i.disposeComponents(n),n.removeFromParent();return}n.dropIt()},q=async o=>{p();const n=new(await Promise.resolve().then(()=>require("../state/index.cjs"))).State(e,a);if(r=n,await n.performAction("SET_STATE",o),s){n.destroyInstance(),e.scene.root.nodes.forEach(w);return}},y=o=>{const n=++m,h=f.then(()=>{if(!(n!==m||s))return typeof o=="string"?k(o):q(o)});return f=h.then(()=>{},()=>{}),h},V=Object.assign(e,{orbitController:a,load:y});return Object.defineProperties(V,{model:{get:()=>t,enumerable:!0},state:{get:()=>r,enumerable:!0}}),await y(c),b(),((l==null?void 0:l.autoStart)??!0)&&await e.startAsync(),V}catch(u){s=!0;try{await e.disposeAsync()}catch(d){console.error("Failed to clean up a QuickView:",d)}throw u}}exports.QuickView=E;exports.QuickViewDefaultSettings=v;
|
|
@@ -1,55 +1,78 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as v, c as A, B as D, d as I, e as b } from "../../chunks/FileTypes-D3Dxr2dj.mjs";
|
|
2
2
|
import "three/webgpu";
|
|
3
3
|
import "three/examples/jsm/loaders/HDRLoader.js";
|
|
4
4
|
import "three/tsl";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
i.clock.addTicker(t);
|
|
16
|
-
const r = Object.assign(i, { orbitController: t, model: o }), c = i.disposeAsync.bind(i);
|
|
17
|
-
return r.disposeAsync = async () => {
|
|
18
|
-
t.dispose(), await c();
|
|
19
|
-
}, ((e == null ? void 0 : e.autoStart) ?? !0) && (await i.startAsync(), t.focusObject(o)), r;
|
|
20
|
-
} catch (i) {
|
|
21
|
-
return console.error("Failed to initialize QuickView:", i), Promise.reject(i);
|
|
22
|
-
}
|
|
23
|
-
}, p = async (a, e) => {
|
|
5
|
+
import { M as h } from "../../chunks/ModelComponent-WA0kLOEY.mjs";
|
|
6
|
+
import { O as S } from "../../chunks/OrbitController-DxCbrQVB.mjs";
|
|
7
|
+
const q = {
|
|
8
|
+
...v
|
|
9
|
+
}, p = (s) => {
|
|
10
|
+
b(s), s.removeFromParent();
|
|
11
|
+
};
|
|
12
|
+
async function B(s, c) {
|
|
13
|
+
let a = !1;
|
|
14
|
+
const e = new A({ ...c, autoStart: !1 });
|
|
24
15
|
try {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
16
|
+
e.mainView.cameraComponent.owner.position.set(0, 1, 2);
|
|
17
|
+
const { clientWidth: l, clientHeight: m } = e.mainView.canvas;
|
|
18
|
+
l > 0 && m > 0 && e.mainView.cameraComponent.onResize(l, m);
|
|
19
|
+
const i = new S(
|
|
20
|
+
e.mainView.cameraComponent,
|
|
21
|
+
e.mainView.canvas
|
|
30
22
|
);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
o
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
23
|
+
e.clock.addTicker(i);
|
|
24
|
+
let t = null, r = null, d = 0, f = Promise.resolve();
|
|
25
|
+
const C = () => {
|
|
26
|
+
const o = t ?? e.scene.root;
|
|
27
|
+
new D().enclose(o).isEmpty || i.focusObject(o);
|
|
28
|
+
}, u = () => {
|
|
29
|
+
t && (p(t), t = null), r && (r.destroyInstance(), r = null, e.scene.root.nodes.forEach(p));
|
|
30
|
+
}, k = e.disposeAsync.bind(e);
|
|
31
|
+
e.disposeAsync = async () => {
|
|
32
|
+
a = !0, d++, i.dispose(), u(), await k();
|
|
38
33
|
};
|
|
39
|
-
const
|
|
40
|
-
(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
34
|
+
const E = async (o) => {
|
|
35
|
+
r && u(), t || (t = new I(), t.name = "QuickViewModel", t.addComponent(new h()), e.scene.root.add(t));
|
|
36
|
+
const n = t;
|
|
37
|
+
if (await n.requireComponent(h).setFromURL(o), a) {
|
|
38
|
+
b(n), n.removeFromParent();
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
n.dropIt();
|
|
42
|
+
}, g = async (o) => {
|
|
43
|
+
u();
|
|
44
|
+
const n = new (await import("../state/index.mjs")).State(e, i);
|
|
45
|
+
if (r = n, await n.performAction("SET_STATE", o), a) {
|
|
46
|
+
n.destroyInstance(), e.scene.root.nodes.forEach(p);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
}, w = (o) => {
|
|
50
|
+
const n = ++d, V = f.then(() => {
|
|
51
|
+
if (!(n !== d || a))
|
|
52
|
+
return typeof o == "string" ? E(o) : g(o);
|
|
53
|
+
});
|
|
54
|
+
return f = V.then(
|
|
55
|
+
() => {
|
|
56
|
+
},
|
|
57
|
+
() => {
|
|
58
|
+
}
|
|
59
|
+
), V;
|
|
60
|
+
}, y = Object.assign(e, { orbitController: i, load: w });
|
|
61
|
+
return Object.defineProperties(y, {
|
|
62
|
+
model: { get: () => t, enumerable: !0 },
|
|
63
|
+
state: { get: () => r, enumerable: !0 }
|
|
64
|
+
}), await w(s), C(), ((c == null ? void 0 : c.autoStart) ?? !0) && await e.startAsync(), y;
|
|
65
|
+
} catch (l) {
|
|
66
|
+
a = !0;
|
|
67
|
+
try {
|
|
68
|
+
await e.disposeAsync();
|
|
69
|
+
} catch (m) {
|
|
70
|
+
console.error("Failed to clean up a QuickView:", m);
|
|
71
|
+
}
|
|
72
|
+
throw l;
|
|
45
73
|
}
|
|
46
|
-
}, D = {
|
|
47
|
-
...d
|
|
48
|
-
};
|
|
49
|
-
function S(a, e) {
|
|
50
|
-
return typeof a == "string" ? m(a, e) : p(a, e);
|
|
51
74
|
}
|
|
52
75
|
export {
|
|
53
|
-
|
|
54
|
-
|
|
76
|
+
B as QuickView,
|
|
77
|
+
q as QuickViewDefaultSettings
|
|
55
78
|
};
|
|
@@ -1,19 +1,46 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { DIVE, DIVENode } from '../../../index.ts';
|
|
2
|
+
import { OrbitController } from '../../orbitcontroller/index.ts';
|
|
3
|
+
import { State, StateData } from '../../state/index.ts';
|
|
4
|
+
import { QuickViewSettings } from '../types/index.ts';
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
+
* What {@link QuickView} hands back.
|
|
7
|
+
*
|
|
8
|
+
* Named after the factory, and declared in the same module so it can be: a
|
|
9
|
+
* function lives in the value namespace and a type in the type one, so one
|
|
10
|
+
* import and no `type` keyword covers both.
|
|
6
11
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
12
|
+
* import { QuickView } from '@shopware-ag/dive/quickview';
|
|
13
|
+
* const view: Ref<QuickView | null> = ref(null);
|
|
14
|
+
*
|
|
15
|
+
* One type, because a QuickView can hold either kind of source and can be handed
|
|
16
|
+
* the other one later -- {@link load} takes whatever {@link QuickView} takes. So
|
|
17
|
+
* which of {@link model} and {@link state} is there is a question about right
|
|
18
|
+
* now, not about how the view was built, and both are therefore nullable rather
|
|
19
|
+
* than promised.
|
|
10
20
|
*/
|
|
11
|
-
export
|
|
21
|
+
export type QuickView = DIVE & {
|
|
22
|
+
orbitController: OrbitController;
|
|
23
|
+
/** The node the model sits on, or `null` while a scene state is loaded. */
|
|
24
|
+
readonly model: DIVENode | null;
|
|
25
|
+
/** The state driving the scene, or `null` while a single model is loaded. */
|
|
26
|
+
readonly state: State | null;
|
|
27
|
+
/**
|
|
28
|
+
* Puts something else in front of the viewer.
|
|
29
|
+
*
|
|
30
|
+
* Takes the same sources the factory does, and replaces whatever is loaded --
|
|
31
|
+
* including across kinds: a QuickView built from a URI can be handed scene
|
|
32
|
+
* state and the other way round. The previous source is torn down first, its
|
|
33
|
+
* GPU resources included.
|
|
34
|
+
*
|
|
35
|
+
* @param source - A model URI, or the scene data to apply.
|
|
36
|
+
*/
|
|
37
|
+
load: (source: string | StateData) => Promise<void>;
|
|
38
|
+
};
|
|
39
|
+
export declare const QuickViewDefaultSettings: Omit<Required<QuickViewSettings>, 'hdr'>;
|
|
12
40
|
/**
|
|
13
|
-
* Creates a QuickView from scene
|
|
41
|
+
* Creates a QuickView from a model URI or from scene data.
|
|
14
42
|
*
|
|
15
|
-
* @param
|
|
16
|
-
* @param settings - The settings for the QuickView
|
|
17
|
-
* @returns The DIVE instance with the orbit controller and hdr environment - { ...DIVE, orbitController: OrbitController, hdr: HDREnvironment }
|
|
43
|
+
* @param source - A model URI, or the scene data to display.
|
|
44
|
+
* @param settings - The settings for the QuickView.
|
|
18
45
|
*/
|
|
19
|
-
export declare function QuickView(
|
|
46
|
+
export declare function QuickView(source: string | StateData, settings?: Partial<QuickViewSettings>): Promise<QuickView>;
|
|
@@ -1,19 +1 @@
|
|
|
1
|
-
import { DIVE, DIVEModel } from '../../../index.ts';
|
|
2
|
-
import { OrbitController } from '../../orbitcontroller/index.ts';
|
|
3
|
-
import { State } from '../../state/index.ts';
|
|
4
1
|
export * from './QuickViewSettings.ts';
|
|
5
|
-
/** A QuickView built from a single model URI. */
|
|
6
|
-
export type QuickViewWithModel = DIVE & {
|
|
7
|
-
orbitController: OrbitController;
|
|
8
|
-
model: DIVEModel;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* A QuickView built from scene state.
|
|
12
|
-
*
|
|
13
|
-
* Carries no single `model`, because a scene state describes any number of
|
|
14
|
-
* objects. The State instance is exposed so the scene can be driven further.
|
|
15
|
-
*/
|
|
16
|
-
export type QuickViewWithState = DIVE & {
|
|
17
|
-
orbitController: OrbitController;
|
|
18
|
-
state: State;
|
|
19
|
-
};
|