@shopware-ag/dive 1.18.3 → 1.18.5-beta.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/build/dive.cjs +3764 -4768
- package/build/dive.cjs.map +1 -1
- package/build/dive.d.ts +6 -1186
- package/build/dive.js +24006 -4174
- package/build/dive.js.map +1 -1
- package/build/src/animation/AnimationSystem.d.ts +16 -0
- package/build/src/ar/AR.d.ts +21 -0
- package/build/src/ar/arquicklook/ARQuickLook.d.ts +8 -0
- package/build/src/ar/sceneviewer/SceneViewer.d.ts +7 -0
- package/build/src/ar/webxr/WebXR.d.ts +21 -0
- package/build/src/ar/webxr/controller/WebXRController.d.ts +46 -0
- package/build/src/ar/webxr/crosshair/WebXRCrosshair.d.ts +7 -0
- package/build/src/ar/webxr/origin/WebXROrigin.d.ts +31 -0
- package/build/src/ar/webxr/overlay/Overlay.d.ts +8 -0
- package/build/src/ar/webxr/raycaster/WebXRRaycaster.d.ts +40 -0
- package/build/src/ar/webxr/raycaster/ar/WebXRRaycasterAR.d.ts +15 -0
- package/build/src/ar/webxr/raycaster/three/WebXRRaycasterTHREE.d.ts +12 -0
- package/build/src/ar/webxr/touchscreencontrols/WebXRTouchscreenControls.d.ts +73 -0
- package/build/src/axiscamera/AxisCamera.d.ts +18 -0
- package/build/src/camera/PerspectiveCamera.d.ts +20 -0
- package/build/src/com/Communication.d.ts +77 -0
- package/build/src/com/actions/camera/computeencompassingview.d.ts +9 -0
- package/build/src/com/actions/camera/getcameratransform.d.ts +9 -0
- package/build/src/com/actions/camera/movecamera.d.ts +15 -0
- package/build/src/com/actions/camera/resetcamera.d.ts +7 -0
- package/build/src/com/actions/camera/setcameralayer.d.ts +7 -0
- package/build/src/com/actions/camera/setcameratransform.d.ts +9 -0
- package/build/src/com/actions/camera/zoomcamera.d.ts +8 -0
- package/build/src/com/actions/index.d.ts +58 -0
- package/build/src/com/actions/media/generatemedia.d.ts +15 -0
- package/build/src/com/actions/object/addobject.d.ts +6 -0
- package/build/src/com/actions/object/deleteobject.d.ts +8 -0
- package/build/src/com/actions/object/deselectobject.d.ts +8 -0
- package/build/src/com/actions/object/getallobjects.d.ts +6 -0
- package/build/src/com/actions/object/getobjects.d.ts +8 -0
- package/build/src/com/actions/object/model/dropit.d.ts +7 -0
- package/build/src/com/actions/object/model/modelloaded.d.ts +7 -0
- package/build/src/com/actions/object/model/placeonfloor.d.ts +7 -0
- package/build/src/com/actions/object/selectobject.d.ts +8 -0
- package/build/src/com/actions/object/setparent.d.ts +13 -0
- package/build/src/com/actions/object/updateobject.d.ts +8 -0
- package/build/src/com/actions/scene/exportscene.d.ts +8 -0
- package/build/src/com/actions/scene/getallscenedata.d.ts +6 -0
- package/build/src/com/actions/scene/launchar.d.ts +6 -0
- package/build/src/com/actions/scene/setbackground.d.ts +7 -0
- package/build/src/com/actions/scene/updatescene.d.ts +11 -0
- package/build/src/com/actions/toolbox/select/setgizmomode.d.ts +7 -0
- package/build/src/com/actions/toolbox/transform/setgizmoscalelinked.d.ts +5 -0
- package/build/src/com/actions/toolbox/transform/setgizmovisible.d.ts +5 -0
- package/build/src/com/actions/toolbox/usetool.d.ts +8 -0
- package/build/src/com/types/COMBaseEntity.d.ts +8 -0
- package/build/src/com/types/COMEntity.d.ts +6 -0
- package/build/src/com/types/COMEntityType.d.ts +1 -0
- package/build/src/com/types/COMGeometry.d.ts +7 -0
- package/build/src/com/types/COMGeometryType.d.ts +1 -0
- package/build/src/com/types/COMGroup.d.ts +8 -0
- package/build/src/com/types/COMLight.d.ts +10 -0
- package/build/src/com/types/COMMaterial.d.ts +11 -0
- package/build/src/com/types/COMModel.d.ts +11 -0
- package/build/src/com/types/COMPov.d.ts +7 -0
- package/build/src/com/types/COMPrimitive.d.ts +11 -0
- package/build/src/com/types/index.d.ts +11 -0
- package/build/src/constant/AxisHelperColors.d.ts +6 -0
- package/build/src/constant/GridColors.d.ts +2 -0
- package/build/src/constant/VisibilityLayerMask.d.ts +5 -0
- package/build/src/controls/OrbitControls.d.ts +38 -0
- package/build/src/dive.d.ts +64 -0
- package/build/src/events/EventExecutor.d.ts +5 -0
- package/build/src/exporters/usdz/USDZExporter.d.ts +15 -0
- package/build/src/gizmo/Gizmo.d.ts +27 -0
- package/build/src/gizmo/handles/AxisHandle.d.ts +30 -0
- package/build/src/gizmo/handles/RadialHandle.d.ts +30 -0
- package/build/src/gizmo/handles/ScaleHandle.d.ts +33 -0
- package/build/src/gizmo/plane/GizmoPlane.d.ts +12 -0
- package/build/src/gizmo/rotate/RotateGizmo.d.ts +17 -0
- package/build/src/gizmo/scale/ScaleGizmo.d.ts +20 -0
- package/build/src/gizmo/translate/TranslateGizmo.d.ts +17 -0
- package/build/src/grid/Grid.d.ts +10 -0
- package/build/src/group/Group.d.ts +23 -0
- package/build/src/helper/applyMixins/applyMixins.d.ts +8 -0
- package/build/src/helper/findInterface/findInterface.d.ts +2 -0
- package/build/src/helper/findSceneRecursive/findSceneRecursive.d.ts +9 -0
- package/build/src/helper/getObjectDelta/getObjectDelta.d.ts +4 -0
- package/build/src/helper/isInterface/implementsInterface.d.ts +2 -0
- package/build/src/info/Info.d.ts +39 -0
- package/build/src/interface/Draggable.d.ts +7 -0
- package/build/src/interface/Hoverable.d.ts +7 -0
- package/build/src/interface/Movable.d.ts +11 -0
- package/build/src/interface/Rotatable.d.ts +9 -0
- package/build/src/interface/Scalable.d.ts +9 -0
- package/build/src/interface/Selectable.d.ts +10 -0
- package/build/src/io/IO.d.ts +10 -0
- package/build/src/io/gltf/GLTFIO.d.ts +12 -0
- package/build/src/light/AmbientLight.d.ts +17 -0
- package/build/src/light/PointLight.d.ts +29 -0
- package/build/src/light/SceneLight.d.ts +18 -0
- package/build/src/loadingmanager/LoadingManager.d.ts +14 -0
- package/build/src/math/ceil/ceilExp.d.ts +1 -0
- package/build/src/math/degToRad/degToRad.d.ts +1 -0
- package/build/src/math/floor/floorExp.d.ts +1 -0
- package/build/src/math/helper/shift.d.ts +1 -0
- package/build/src/math/index.d.ts +18 -0
- package/build/src/math/radToDeg/radToDeg.d.ts +1 -0
- package/build/src/math/round/roundExp.d.ts +1 -0
- package/build/src/math/signedAngleTo/signedAngleTo.d.ts +9 -0
- package/build/src/math/toFixed/toFixedExp.d.ts +1 -0
- package/build/src/math/truncate/truncateExp.d.ts +1 -0
- package/build/src/mediacreator/MediaCreator.d.ts +17 -0
- package/build/src/model/Model.d.ts +21 -0
- package/build/src/node/Node.d.ts +24 -0
- package/build/src/primitive/Primitive.d.ts +28 -0
- package/build/src/primitive/floor/Floor.d.ts +14 -0
- package/build/src/renderer/Renderer.d.ts +69 -0
- package/build/src/scene/Scene.d.ts +46 -0
- package/build/src/scene/root/Root.d.ts +42 -0
- package/build/src/scene/xrroot/XRRoot.d.ts +17 -0
- package/build/src/scene/xrroot/xrlightroot/XRLightRoot.d.ts +13 -0
- package/build/src/toolbox/BaseTool.d.ts +48 -0
- package/build/src/toolbox/Toolbox.d.ts +31 -0
- package/build/src/toolbox/select/SelectTool.d.ts +26 -0
- package/build/src/toolbox/transform/TransformTool.d.ts +27 -0
- package/build/src/types/SceneData.d.ts +19 -0
- package/build/src/types/SceneObjects.d.ts +7 -0
- package/build/src/types/SceneType.d.ts +4 -0
- package/build/src/types/index.d.ts +4 -0
- package/package.json +9 -8
- package/src/com/Communication.ts +0 -1
- package/src/dive.ts +0 -3
- package/build/dive.d.cts +0 -1186
package/build/dive.d.ts
CHANGED
|
@@ -1,1186 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
type DIVERendererSettings = {
|
|
8
|
-
antialias: boolean;
|
|
9
|
-
alpha: boolean;
|
|
10
|
-
stencil: boolean;
|
|
11
|
-
shadowMapEnabled: boolean;
|
|
12
|
-
shadowMapType: ShadowMapType;
|
|
13
|
-
toneMapping: ToneMapping;
|
|
14
|
-
canvas?: HTMLCanvasElement;
|
|
15
|
-
};
|
|
16
|
-
type DIVERenderCallback = (time: DOMHighResTimeStamp, frame: XRFrame) => void;
|
|
17
|
-
/**
|
|
18
|
-
* A changed version of the WebGLRenderer.
|
|
19
|
-
*
|
|
20
|
-
* Has to be started manually by calling StartRenderer().
|
|
21
|
-
*
|
|
22
|
-
* @module
|
|
23
|
-
*/
|
|
24
|
-
declare class DIVERenderer extends WebGLRenderer {
|
|
25
|
-
private paused;
|
|
26
|
-
private running;
|
|
27
|
-
private force;
|
|
28
|
-
private preRenderCallbacks;
|
|
29
|
-
private postRenderCallbacks;
|
|
30
|
-
constructor(rendererSettings?: Partial<DIVERendererSettings>);
|
|
31
|
-
Dispose(): void;
|
|
32
|
-
StartRenderer(scene: Scene, cam: Camera): void;
|
|
33
|
-
PauseRenderer(): void;
|
|
34
|
-
ResumeRenderer(): void;
|
|
35
|
-
StopRenderer(): void;
|
|
36
|
-
OnResize(width: number, height: number): void;
|
|
37
|
-
/**
|
|
38
|
-
* Adds a callback to the render loop before actual render call.
|
|
39
|
-
* @param callback Executed before rendering.
|
|
40
|
-
* @returns uuid to remove the callback.
|
|
41
|
-
*/
|
|
42
|
-
AddPreRenderCallback(callback: DIVERenderCallback): string;
|
|
43
|
-
/**
|
|
44
|
-
* Removes a callback from the render loop before actual render call.
|
|
45
|
-
* @param uuid of callback to remove.
|
|
46
|
-
* @returns if removing was successful.
|
|
47
|
-
*/
|
|
48
|
-
RemovePreRenderCallback(uuid: string): boolean;
|
|
49
|
-
/**
|
|
50
|
-
* Adds a callback to the render loop after actual render call.
|
|
51
|
-
* @param callback Executed after rendering.
|
|
52
|
-
* @returns uuid to remove the callback.
|
|
53
|
-
*/
|
|
54
|
-
AddPostRenderCallback(callback: DIVERenderCallback): string;
|
|
55
|
-
/**
|
|
56
|
-
* Removes a callback from the render loop after actual render call.
|
|
57
|
-
* @param uuid of callback to remove.
|
|
58
|
-
* @returns if removing was successful.
|
|
59
|
-
*/
|
|
60
|
-
RemovePostRenderCallback(uuid: string): boolean;
|
|
61
|
-
/**
|
|
62
|
-
* Forces the renderer to render the next frame.
|
|
63
|
-
*/
|
|
64
|
-
ForceRendering(): void;
|
|
65
|
-
/**
|
|
66
|
-
* Internal render loop.
|
|
67
|
-
*
|
|
68
|
-
* To control renderloop you can add callbacks via AddPreRenderCallback() and AddPostRenderCallback().
|
|
69
|
-
* @param scene Scene to render.
|
|
70
|
-
* @param cam Camera to render with.
|
|
71
|
-
*/
|
|
72
|
-
private internal_render;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
type DIVEPerspectiveCameraSettings = {
|
|
76
|
-
fov: number;
|
|
77
|
-
near: number;
|
|
78
|
-
far: number;
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
* A Perspective camera. Can change the layer mask to show different objects.
|
|
82
|
-
*
|
|
83
|
-
* @module
|
|
84
|
-
*/
|
|
85
|
-
declare class DIVEPerspectiveCamera extends PerspectiveCamera {
|
|
86
|
-
static readonly EDITOR_VIEW_LAYER_MASK: number;
|
|
87
|
-
static readonly LIVE_VIEW_LAYER_MASK = 16;
|
|
88
|
-
onSetCameraLayer: (mask: number) => void;
|
|
89
|
-
constructor(settings?: Partial<DIVEPerspectiveCameraSettings>);
|
|
90
|
-
OnResize(width: number, height: number): void;
|
|
91
|
-
SetCameraLayer(layer: 'LIVE' | 'EDITOR'): void;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Updates all animations.
|
|
96
|
-
* DIVE uses Tween.js to handle animations.
|
|
97
|
-
*
|
|
98
|
-
* @module
|
|
99
|
-
*/
|
|
100
|
-
declare class DIVEAnimationSystem {
|
|
101
|
-
private _renderer;
|
|
102
|
-
private _rendererCallbackId;
|
|
103
|
-
constructor(renderer: DIVERenderer);
|
|
104
|
-
Dispose(): void;
|
|
105
|
-
Update(): void;
|
|
106
|
-
Animate<T extends object>(object: T): Tween<T>;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
type DIVEOrbitControlsSettings = {
|
|
110
|
-
enableDamping: boolean;
|
|
111
|
-
dampingFactor: number;
|
|
112
|
-
};
|
|
113
|
-
/**
|
|
114
|
-
* Orbit Controls. Basic functionality to orbit around a given target point in the scene.
|
|
115
|
-
*
|
|
116
|
-
* @module
|
|
117
|
-
*/
|
|
118
|
-
declare class DIVEOrbitControls extends OrbitControls {
|
|
119
|
-
static readonly DEFAULT_ZOOM_FACTOR = 1;
|
|
120
|
-
private _animationSystem;
|
|
121
|
-
private last;
|
|
122
|
-
private animating;
|
|
123
|
-
private locked;
|
|
124
|
-
private stopMoveTo;
|
|
125
|
-
private stopRevertLast;
|
|
126
|
-
object: DIVEPerspectiveCamera;
|
|
127
|
-
domElement: HTMLCanvasElement;
|
|
128
|
-
private _removePreRenderCallback;
|
|
129
|
-
constructor(camera: DIVEPerspectiveCamera, renderer: DIVERenderer, animationSystem: DIVEAnimationSystem, settings?: Partial<DIVEOrbitControlsSettings>);
|
|
130
|
-
Dispose(): void;
|
|
131
|
-
ComputeEncompassingView(bb: Box3): {
|
|
132
|
-
position: Vector3Like;
|
|
133
|
-
target: Vector3Like;
|
|
134
|
-
};
|
|
135
|
-
ZoomIn(by?: number): void;
|
|
136
|
-
ZoomOut(by?: number): void;
|
|
137
|
-
MoveTo(pos: Vector3Like | undefined, target: Vector3Like | undefined, duration: number, lock: boolean): void;
|
|
138
|
-
RevertLast(duration: number): void;
|
|
139
|
-
private preRenderCallback;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
interface SET_BACKGROUND {
|
|
143
|
-
DESCRIPTION: 'Set the background color of the scene.';
|
|
144
|
-
PAYLOAD: {
|
|
145
|
-
color: string | number;
|
|
146
|
-
};
|
|
147
|
-
RETURN: boolean;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
interface RESET_CAMERA {
|
|
151
|
-
DESCRIPTION: 'Reset the camera to its initial position and rotation.';
|
|
152
|
-
PAYLOAD: {
|
|
153
|
-
duration: number;
|
|
154
|
-
};
|
|
155
|
-
RETURN: boolean;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
interface SET_CAMERA_LAYER {
|
|
159
|
-
DESCRIPTION: 'Sets the camera layer to a certain layer.';
|
|
160
|
-
PAYLOAD: {
|
|
161
|
-
layer: 'LIVE' | 'EDITOR';
|
|
162
|
-
};
|
|
163
|
-
RETURN: boolean;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
interface ZOOM_CAMERA {
|
|
167
|
-
DESCRIPTION: 'Zooms the camera in or out by a certain amount.';
|
|
168
|
-
PAYLOAD: {
|
|
169
|
-
direction: 'IN' | 'OUT';
|
|
170
|
-
by: number;
|
|
171
|
-
};
|
|
172
|
-
RETURN: boolean;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
interface SET_GIZMO_MODE {
|
|
176
|
-
DESCRIPTION: "Sets the gizmo's mode.";
|
|
177
|
-
PAYLOAD: {
|
|
178
|
-
mode: 'translate' | 'rotate' | 'scale';
|
|
179
|
-
};
|
|
180
|
-
RETURN: boolean;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
interface SET_CAMERA_TRANSFORM {
|
|
184
|
-
DESCRIPTION: 'Sets the camera position and target.';
|
|
185
|
-
PAYLOAD: {
|
|
186
|
-
position: Vector3Like;
|
|
187
|
-
target: Vector3Like;
|
|
188
|
-
};
|
|
189
|
-
RETURN: boolean;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
interface MOVE_CAMERA {
|
|
193
|
-
DESCRIPTION: 'Moves the camera to a new position and target.';
|
|
194
|
-
PAYLOAD: {
|
|
195
|
-
position: Vector3Like;
|
|
196
|
-
target: Vector3Like;
|
|
197
|
-
locked: boolean;
|
|
198
|
-
duration: number;
|
|
199
|
-
} | {
|
|
200
|
-
id: string;
|
|
201
|
-
locked: boolean;
|
|
202
|
-
duration: number;
|
|
203
|
-
};
|
|
204
|
-
RETURN: boolean;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
interface PLACE_ON_FLOOR {
|
|
208
|
-
DESCRIPTION: 'Places an object on the floor.';
|
|
209
|
-
PAYLOAD: {
|
|
210
|
-
id: string;
|
|
211
|
-
};
|
|
212
|
-
RETURN: boolean;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
type COMEntityType = 'pov' | 'light' | 'model' | 'primitive' | 'group';
|
|
216
|
-
|
|
217
|
-
type COMBaseEntity = {
|
|
218
|
-
id: string;
|
|
219
|
-
name: string;
|
|
220
|
-
entityType: COMEntityType;
|
|
221
|
-
visible: boolean;
|
|
222
|
-
parentId?: string | null;
|
|
223
|
-
};
|
|
224
|
-
|
|
225
|
-
type COMPov = COMBaseEntity & {
|
|
226
|
-
position: Vector3Like;
|
|
227
|
-
target: Vector3Like;
|
|
228
|
-
locked?: boolean;
|
|
229
|
-
};
|
|
230
|
-
|
|
231
|
-
type COMLight = COMBaseEntity & {
|
|
232
|
-
type: 'ambient' | 'point' | 'scene';
|
|
233
|
-
intensity: number;
|
|
234
|
-
color: string | number;
|
|
235
|
-
enabled: boolean;
|
|
236
|
-
position?: Vector3Like;
|
|
237
|
-
rotation?: Vector3Like;
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
type COMMaterial = {
|
|
241
|
-
vertexColors: boolean;
|
|
242
|
-
color: string | number;
|
|
243
|
-
map: Texture | null;
|
|
244
|
-
normalMap: Texture | null;
|
|
245
|
-
roughness: number;
|
|
246
|
-
roughnessMap: Texture | null;
|
|
247
|
-
metalness: number;
|
|
248
|
-
metalnessMap: Texture | null;
|
|
249
|
-
};
|
|
250
|
-
|
|
251
|
-
type COMModel = COMBaseEntity & {
|
|
252
|
-
uri: string;
|
|
253
|
-
position: Vector3Like;
|
|
254
|
-
rotation: Vector3Like;
|
|
255
|
-
scale: Vector3Like;
|
|
256
|
-
loaded: boolean;
|
|
257
|
-
material?: Partial<COMMaterial>;
|
|
258
|
-
};
|
|
259
|
-
|
|
260
|
-
type COMGeometryType = 'cylinder' | 'sphere' | 'pyramid' | 'cube' | 'box' | 'cone' | 'wall' | 'plane';
|
|
261
|
-
|
|
262
|
-
type COMGeometry = {
|
|
263
|
-
name: COMGeometryType;
|
|
264
|
-
width: number;
|
|
265
|
-
height: number;
|
|
266
|
-
depth: number;
|
|
267
|
-
};
|
|
268
|
-
|
|
269
|
-
type COMPrimitive = COMBaseEntity & {
|
|
270
|
-
position: Vector3Like;
|
|
271
|
-
rotation: Vector3Like;
|
|
272
|
-
scale: Vector3Like;
|
|
273
|
-
geometry: COMGeometry;
|
|
274
|
-
material?: Partial<COMMaterial>;
|
|
275
|
-
};
|
|
276
|
-
|
|
277
|
-
type COMGroup = COMBaseEntity & {
|
|
278
|
-
position: Vector3Like;
|
|
279
|
-
rotation: Vector3Like;
|
|
280
|
-
scale: Vector3Like;
|
|
281
|
-
bbVisible?: boolean;
|
|
282
|
-
};
|
|
283
|
-
|
|
284
|
-
type COMEntity = COMPov | COMLight | COMModel | COMPrimitive | COMGroup;
|
|
285
|
-
|
|
286
|
-
interface GET_ALL_OBJECTS {
|
|
287
|
-
readonly DESCRIPTION: 'Retrieves all objects in the scene.';
|
|
288
|
-
PAYLOAD: Map<string, COMEntity>;
|
|
289
|
-
RETURN: Map<string, COMEntity>;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
interface GET_OBJECTS {
|
|
293
|
-
DESCRIPTION: 'Returns a list of objects of given IDs.';
|
|
294
|
-
PAYLOAD: {
|
|
295
|
-
ids: string[];
|
|
296
|
-
};
|
|
297
|
-
RETURN: COMEntity[];
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
interface ADD_OBJECT {
|
|
301
|
-
DESCRIPTION: 'Adds an object to the scene.';
|
|
302
|
-
PAYLOAD: COMEntity;
|
|
303
|
-
RETURN: boolean;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
interface DELETE_OBJECT {
|
|
307
|
-
DESCRIPTION: 'Deletes an object from the scene.';
|
|
308
|
-
PAYLOAD: Partial<COMEntity> & {
|
|
309
|
-
id: string;
|
|
310
|
-
};
|
|
311
|
-
RETURN: boolean;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
interface UPDATE_OBJECT {
|
|
315
|
-
DESCRIPTION: 'Updates an existing object.';
|
|
316
|
-
PAYLOAD: Partial<COMEntity> & {
|
|
317
|
-
id: string;
|
|
318
|
-
};
|
|
319
|
-
RETURN: boolean;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
interface MODEL_LOADED {
|
|
323
|
-
DESCRIPTION: 'Is triggered when a model is loaded.';
|
|
324
|
-
PAYLOAD: {
|
|
325
|
-
id: string;
|
|
326
|
-
};
|
|
327
|
-
RETURN: boolean;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
interface UPDATE_SCENE {
|
|
331
|
-
DESCRIPTION: 'Updates global scene data.';
|
|
332
|
-
PAYLOAD: {
|
|
333
|
-
name?: string;
|
|
334
|
-
backgroundColor?: string | number;
|
|
335
|
-
gridEnabled?: boolean;
|
|
336
|
-
floorEnabled?: boolean;
|
|
337
|
-
floorColor?: string | number;
|
|
338
|
-
};
|
|
339
|
-
RETURN: boolean;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
interface GENERATE_MEDIA {
|
|
343
|
-
DESCRIPTION: 'Generates a screenshot, stores it in a Blob and writes the URL into the payload.';
|
|
344
|
-
PAYLOAD: ({
|
|
345
|
-
position: Vector3Like;
|
|
346
|
-
target: Vector3Like;
|
|
347
|
-
} | {
|
|
348
|
-
id: string;
|
|
349
|
-
}) & {
|
|
350
|
-
width: number;
|
|
351
|
-
height: number;
|
|
352
|
-
dataUri: string;
|
|
353
|
-
};
|
|
354
|
-
RETURN: boolean;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
/**
|
|
358
|
-
* Interface for objects that can be moved in the scene.
|
|
359
|
-
*
|
|
360
|
-
* @module
|
|
361
|
-
*/
|
|
362
|
-
interface DIVEMovable {
|
|
363
|
-
isMovable: true;
|
|
364
|
-
onMoveStart?: () => void;
|
|
365
|
-
onMove?: () => void;
|
|
366
|
-
onMoveEnd?: () => void;
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
/**
|
|
370
|
-
* Interface for objects that can be selected in the scene.
|
|
371
|
-
*
|
|
372
|
-
* @module
|
|
373
|
-
*/
|
|
374
|
-
interface DIVESelectable {
|
|
375
|
-
isSelectable: true;
|
|
376
|
-
onSelect?: () => void;
|
|
377
|
-
onDeselect?: () => void;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
declare class DIVENode extends Object3D implements DIVESelectable, DIVEMovable {
|
|
381
|
-
readonly isDIVENode: true;
|
|
382
|
-
readonly isSelectable: true;
|
|
383
|
-
readonly isMovable: true;
|
|
384
|
-
gizmo: TransformControls | null;
|
|
385
|
-
protected _positionWorldBuffer: Vector3;
|
|
386
|
-
protected _boundingBox: Box3;
|
|
387
|
-
constructor();
|
|
388
|
-
SetPosition(position: Vector3Like): void;
|
|
389
|
-
SetRotation(rotation: Vector3Like): void;
|
|
390
|
-
SetScale(scale: Vector3Like): void;
|
|
391
|
-
SetVisibility(visible: boolean): void;
|
|
392
|
-
SetToWorldOrigin(): void;
|
|
393
|
-
/**
|
|
394
|
-
* Can be called when the object is moved from a foreign object (gizmo, parent, etc.) to update the object's position.
|
|
395
|
-
*/
|
|
396
|
-
onMove(): void;
|
|
397
|
-
onSelect(): void;
|
|
398
|
-
onDeselect(): void;
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
declare class DIVEGroup extends DIVENode {
|
|
402
|
-
readonly isDIVEGroup: true;
|
|
403
|
-
private _members;
|
|
404
|
-
get members(): Object3D[];
|
|
405
|
-
private _lines;
|
|
406
|
-
constructor();
|
|
407
|
-
SetPosition(position: Vector3Like): void;
|
|
408
|
-
SetLinesVisibility(visible: boolean, object?: Object3D): void;
|
|
409
|
-
attach(object: DIVESceneObject): this;
|
|
410
|
-
remove(object: DIVESceneObject): this;
|
|
411
|
-
UpdateLineTo(object: Object3D): void;
|
|
412
|
-
/**
|
|
413
|
-
* Adds a line to this grouo as last child.
|
|
414
|
-
*/
|
|
415
|
-
private createLine;
|
|
416
|
-
/**
|
|
417
|
-
* Updates a line to the object.
|
|
418
|
-
*/
|
|
419
|
-
private updateLineTo;
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
/**
|
|
423
|
-
* A basic ambient light.
|
|
424
|
-
*
|
|
425
|
-
* Can change the color, intensity, and visibility of the light.
|
|
426
|
-
*
|
|
427
|
-
* @module
|
|
428
|
-
*/
|
|
429
|
-
declare class DIVEAmbientLight extends Object3D {
|
|
430
|
-
readonly isDIVELight: true;
|
|
431
|
-
readonly isDIVEAmbientLight: true;
|
|
432
|
-
private _light;
|
|
433
|
-
constructor();
|
|
434
|
-
SetColor(color: Color): void;
|
|
435
|
-
SetIntensity(intensity: number): void;
|
|
436
|
-
SetEnabled(enabled: boolean): void;
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
/**
|
|
440
|
-
* A basic point light.
|
|
441
|
-
*
|
|
442
|
-
* Can change the color, intensity, and visibility of the light.
|
|
443
|
-
*
|
|
444
|
-
* Can be moved and selected.
|
|
445
|
-
*
|
|
446
|
-
* @module
|
|
447
|
-
*/
|
|
448
|
-
declare class DIVEPointLight extends Object3D implements DIVESelectable, DIVEMovable {
|
|
449
|
-
readonly isDIVELight: true;
|
|
450
|
-
readonly isDIVEPointLight: true;
|
|
451
|
-
readonly isMovable: true;
|
|
452
|
-
readonly isSelectable: true;
|
|
453
|
-
gizmo: TransformControls | null;
|
|
454
|
-
private light;
|
|
455
|
-
private mesh;
|
|
456
|
-
constructor();
|
|
457
|
-
SetColor(color: Color): void;
|
|
458
|
-
SetIntensity(intensity: number): void;
|
|
459
|
-
SetEnabled(enabled: boolean): void;
|
|
460
|
-
onMove(): void;
|
|
461
|
-
onSelect(): void;
|
|
462
|
-
onDeselect(): void;
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
/**
|
|
466
|
-
* A complex scene light.
|
|
467
|
-
*
|
|
468
|
-
* Can change the color, intensity, and visibility of the light.
|
|
469
|
-
*
|
|
470
|
-
* @module
|
|
471
|
-
*/
|
|
472
|
-
declare class DIVESceneLight extends Object3D {
|
|
473
|
-
readonly isDIVELight: true;
|
|
474
|
-
readonly isDIVESceneLight: true;
|
|
475
|
-
private _hemiLight;
|
|
476
|
-
private _dirLight;
|
|
477
|
-
constructor();
|
|
478
|
-
SetColor(color: Color): void;
|
|
479
|
-
SetIntensity(intensity: number): void;
|
|
480
|
-
SetEnabled(enabled: boolean): void;
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
/**
|
|
484
|
-
* A basic model class.
|
|
485
|
-
*
|
|
486
|
-
* It does calculate it's own bounding box which is used for positioning on the floor.
|
|
487
|
-
*
|
|
488
|
-
* Can be moved and selected.
|
|
489
|
-
*
|
|
490
|
-
* @module
|
|
491
|
-
*/
|
|
492
|
-
declare class DIVEModel extends DIVENode {
|
|
493
|
-
readonly isDIVEModel: true;
|
|
494
|
-
private _mesh;
|
|
495
|
-
private _material;
|
|
496
|
-
SetModel(gltf: GLTF): void;
|
|
497
|
-
SetMaterial(material: Partial<COMMaterial>): void;
|
|
498
|
-
PlaceOnFloor(): void;
|
|
499
|
-
DropIt(): void;
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
/**
|
|
503
|
-
* A basic model class.
|
|
504
|
-
*
|
|
505
|
-
* It does calculate it's own bounding box which is used for positioning on the floor.
|
|
506
|
-
*
|
|
507
|
-
* Can be moved and selected.
|
|
508
|
-
*
|
|
509
|
-
* @module
|
|
510
|
-
*/
|
|
511
|
-
declare class DIVEPrimitive extends DIVENode {
|
|
512
|
-
readonly isDIVEPrimitive: true;
|
|
513
|
-
private _mesh;
|
|
514
|
-
constructor();
|
|
515
|
-
SetGeometry(geometry: COMGeometry): void;
|
|
516
|
-
SetMaterial(material: Partial<COMMaterial>): void;
|
|
517
|
-
PlaceOnFloor(): void;
|
|
518
|
-
DropIt(): void;
|
|
519
|
-
private assembleGeometry;
|
|
520
|
-
private createCylinderGeometry;
|
|
521
|
-
private createSphereGeometry;
|
|
522
|
-
private createPyramidGeometry;
|
|
523
|
-
private createBoxGeometry;
|
|
524
|
-
private createConeGeometry;
|
|
525
|
-
private createWallGeometry;
|
|
526
|
-
private createPlaneGeometry;
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
type DIVESceneObject = DIVEModel | DIVEGroup | DIVEPrimitive | DIVEAmbientLight | DIVEPointLight | DIVESceneLight;
|
|
530
|
-
|
|
531
|
-
type DIVESceneFileType = {
|
|
532
|
-
glb: GLTF;
|
|
533
|
-
};
|
|
534
|
-
|
|
535
|
-
type DIVESceneData = {
|
|
536
|
-
name: string;
|
|
537
|
-
mediaItem: null;
|
|
538
|
-
backgroundColor: string;
|
|
539
|
-
floorEnabled: boolean;
|
|
540
|
-
floorColor: string;
|
|
541
|
-
userCamera: {
|
|
542
|
-
position: Vector3Like;
|
|
543
|
-
target: Vector3Like;
|
|
544
|
-
};
|
|
545
|
-
spotmarks: object[];
|
|
546
|
-
lights: COMLight[];
|
|
547
|
-
objects: COMModel[];
|
|
548
|
-
cameras: COMPov[];
|
|
549
|
-
primitives: COMPrimitive[];
|
|
550
|
-
groups: COMGroup[];
|
|
551
|
-
};
|
|
552
|
-
|
|
553
|
-
interface GET_ALL_SCENE_DATA {
|
|
554
|
-
DESCRIPTION: 'Retrieves all current scene data.';
|
|
555
|
-
PAYLOAD: object;
|
|
556
|
-
RETURN: DIVESceneData;
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
interface SELECT_OBJECT {
|
|
560
|
-
DESCRIPTION: 'Selects an existing object.';
|
|
561
|
-
PAYLOAD: Partial<COMEntity> & {
|
|
562
|
-
id: string;
|
|
563
|
-
};
|
|
564
|
-
RETURN: boolean;
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
interface DESELECT_OBJECT {
|
|
568
|
-
DESCRIPTION: 'Deselects an existing object.';
|
|
569
|
-
PAYLOAD: Partial<COMEntity> & {
|
|
570
|
-
id: string;
|
|
571
|
-
};
|
|
572
|
-
RETURN: boolean;
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
interface GET_CAMERA_TRANSFORM {
|
|
576
|
-
DESCRIPTION: 'Returns the current camera position and target.';
|
|
577
|
-
PAYLOAD: object;
|
|
578
|
-
RETURN: {
|
|
579
|
-
position: Vector3Like;
|
|
580
|
-
target: Vector3Like;
|
|
581
|
-
};
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
interface DROP_IT {
|
|
585
|
-
DESCRIPTION: 'Places an object on top of an underlying object or the floor.';
|
|
586
|
-
PAYLOAD: {
|
|
587
|
-
id: string;
|
|
588
|
-
};
|
|
589
|
-
RETURN: boolean;
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
interface SET_GIZMO_VISIBILITY {
|
|
593
|
-
DESCRIPTION: "Sets the gizmo's visibility.";
|
|
594
|
-
PAYLOAD: boolean;
|
|
595
|
-
RETURN: boolean;
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
interface SET_GIZMO_SCALE_LINKED {
|
|
599
|
-
DESCRIPTION: "Sets the gizmo's unified scale mode.";
|
|
600
|
-
PAYLOAD: boolean;
|
|
601
|
-
RETURN: boolean;
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
interface COMPUTE_ENCOMPASSING_VIEW {
|
|
605
|
-
DESCRIPTION: 'Calculates the camera position and target to view the whole scene. (experimental)';
|
|
606
|
-
PAYLOAD: object;
|
|
607
|
-
RETURN: {
|
|
608
|
-
position: Vector3Like;
|
|
609
|
-
target: Vector3Like;
|
|
610
|
-
};
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
/**
|
|
614
|
-
* A basic scene node to hold grid, floor and all lower level roots.
|
|
615
|
-
*
|
|
616
|
-
* @module
|
|
617
|
-
*/
|
|
618
|
-
declare class DIVERoot extends Object3D {
|
|
619
|
-
readonly isDIVERoot: true;
|
|
620
|
-
private loadingManager;
|
|
621
|
-
constructor();
|
|
622
|
-
ComputeSceneBB(): Box3;
|
|
623
|
-
GetSceneObject<T extends DIVESceneObject>(object: Partial<COMEntity> & {
|
|
624
|
-
id: string;
|
|
625
|
-
}): T | undefined;
|
|
626
|
-
AddSceneObject(object: COMEntity): void;
|
|
627
|
-
UpdateSceneObject(object: Partial<COMEntity> & {
|
|
628
|
-
id: string;
|
|
629
|
-
entityType: string;
|
|
630
|
-
}): void;
|
|
631
|
-
DeleteSceneObject(object: Partial<COMEntity> & {
|
|
632
|
-
id: string;
|
|
633
|
-
entityType: string;
|
|
634
|
-
}): void;
|
|
635
|
-
PlaceOnFloor(object: Partial<COMEntity> & {
|
|
636
|
-
id: string;
|
|
637
|
-
entityType: string;
|
|
638
|
-
}): void;
|
|
639
|
-
private updateLight;
|
|
640
|
-
private updateModel;
|
|
641
|
-
private updatePrimitive;
|
|
642
|
-
private updateGroup;
|
|
643
|
-
private deleteLight;
|
|
644
|
-
private deleteModel;
|
|
645
|
-
private deletePrimitive;
|
|
646
|
-
private deleteGroup;
|
|
647
|
-
private placeOnFloor;
|
|
648
|
-
private setParent;
|
|
649
|
-
private detachTransformControls;
|
|
650
|
-
private findScene;
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
/**
|
|
654
|
-
* A basic grid for the scene.
|
|
655
|
-
*
|
|
656
|
-
* @module
|
|
657
|
-
*/
|
|
658
|
-
declare class DIVEGrid extends Object3D {
|
|
659
|
-
constructor();
|
|
660
|
-
SetVisibility(visible: boolean): void;
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
/**
|
|
664
|
-
* A basic floor geometry.
|
|
665
|
-
*
|
|
666
|
-
* Can change the color and visibility of the floor.
|
|
667
|
-
*
|
|
668
|
-
* @module
|
|
669
|
-
*/
|
|
670
|
-
declare class DIVEFloor extends Mesh {
|
|
671
|
-
isFloor: true;
|
|
672
|
-
constructor();
|
|
673
|
-
SetVisibility(visible: boolean): void;
|
|
674
|
-
SetColor(color: ColorRepresentation): void;
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
declare class DIVEXRLightRoot extends Object3D {
|
|
678
|
-
private _scene;
|
|
679
|
-
private _xrLight;
|
|
680
|
-
private _lightRoot;
|
|
681
|
-
constructor(scene: DIVEScene);
|
|
682
|
-
InitLightEstimation(renderer: DIVERenderer): void;
|
|
683
|
-
DisposeLightEstimation(): void;
|
|
684
|
-
private onEstimationStart;
|
|
685
|
-
private onEstimationEnd;
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
declare class DIVEXRRoot extends Object3D {
|
|
689
|
-
private _xrLightRoot;
|
|
690
|
-
private _xrModelRoot;
|
|
691
|
-
private _xrHandNode;
|
|
692
|
-
get XRModelRoot(): DIVERoot;
|
|
693
|
-
get XRLightRoot(): DIVEXRLightRoot;
|
|
694
|
-
get XRHandNode(): Object3D;
|
|
695
|
-
private _xrShadowPlane;
|
|
696
|
-
constructor(scene: DIVEScene);
|
|
697
|
-
InitLightEstimation(renderer: DIVERenderer): void;
|
|
698
|
-
DisposeLightEstimation(): void;
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
/**
|
|
702
|
-
* A basic scene class.
|
|
703
|
-
*
|
|
704
|
-
* Comes with a root object that contains all the scene objects.
|
|
705
|
-
*
|
|
706
|
-
* @module
|
|
707
|
-
*/
|
|
708
|
-
declare class DIVEScene extends Scene {
|
|
709
|
-
private _root;
|
|
710
|
-
private _floor;
|
|
711
|
-
private _grid;
|
|
712
|
-
get Root(): DIVERoot;
|
|
713
|
-
private _xrRoot;
|
|
714
|
-
get XRRoot(): DIVEXRRoot;
|
|
715
|
-
get Floor(): DIVEFloor;
|
|
716
|
-
get Grid(): DIVEGrid;
|
|
717
|
-
constructor();
|
|
718
|
-
InitXR(renderer: DIVERenderer): void;
|
|
719
|
-
DisposeXR(): void;
|
|
720
|
-
SetBackground(color: ColorRepresentation): void;
|
|
721
|
-
ComputeSceneBB(): Box3;
|
|
722
|
-
GetSceneObject<T extends DIVESceneObject>(object: Partial<COMEntity> & {
|
|
723
|
-
id: string;
|
|
724
|
-
}): T | undefined;
|
|
725
|
-
AddSceneObject(object: COMEntity): void;
|
|
726
|
-
UpdateSceneObject(object: Partial<COMEntity> & {
|
|
727
|
-
id: string;
|
|
728
|
-
entityType: string;
|
|
729
|
-
}): void;
|
|
730
|
-
DeleteSceneObject(object: Partial<COMEntity> & {
|
|
731
|
-
id: string;
|
|
732
|
-
entityType: string;
|
|
733
|
-
}): void;
|
|
734
|
-
PlaceOnFloor(object: Partial<COMModel> & {
|
|
735
|
-
id: string;
|
|
736
|
-
entityType: string;
|
|
737
|
-
}): void;
|
|
738
|
-
}
|
|
739
|
-
|
|
740
|
-
/**
|
|
741
|
-
* Interface for objects that can be hovered in the scene.
|
|
742
|
-
*
|
|
743
|
-
* @module
|
|
744
|
-
*/
|
|
745
|
-
|
|
746
|
-
interface DIVEDraggable {
|
|
747
|
-
isDraggable: true;
|
|
748
|
-
onDragStart?: (e: DraggableEvent) => void;
|
|
749
|
-
onDrag?: (e: DraggableEvent) => void;
|
|
750
|
-
onDragEnd?: (e: DraggableEvent) => void;
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
/**
|
|
754
|
-
* Interface for objects that can be hovered in the scene.
|
|
755
|
-
*
|
|
756
|
-
* @module
|
|
757
|
-
*/
|
|
758
|
-
|
|
759
|
-
interface DIVEHoverable {
|
|
760
|
-
isHoverable: true;
|
|
761
|
-
onPointerEnter?: (i: Intersection) => void;
|
|
762
|
-
onPointerOver?: (i: Intersection) => void;
|
|
763
|
-
onPointerLeave?: () => void;
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
type DraggableEvent = {
|
|
767
|
-
dragStart: Vector3;
|
|
768
|
-
dragCurrent: Vector3;
|
|
769
|
-
dragEnd: Vector3;
|
|
770
|
-
dragDelta: Vector3;
|
|
771
|
-
};
|
|
772
|
-
declare abstract class DIVEBaseTool {
|
|
773
|
-
readonly POINTER_DRAG_THRESHOLD: number;
|
|
774
|
-
name: string;
|
|
775
|
-
protected _canvas: HTMLElement;
|
|
776
|
-
protected _scene: DIVEScene;
|
|
777
|
-
protected _controller: DIVEOrbitControls;
|
|
778
|
-
protected _pointer: Vector2;
|
|
779
|
-
protected get _pointerAnyDown(): boolean;
|
|
780
|
-
protected _pointerPrimaryDown: boolean;
|
|
781
|
-
protected _pointerMiddleDown: boolean;
|
|
782
|
-
protected _pointerSecondaryDown: boolean;
|
|
783
|
-
protected _lastPointerDown: Vector2;
|
|
784
|
-
protected _lastPointerUp: Vector2;
|
|
785
|
-
protected _raycaster: Raycaster;
|
|
786
|
-
protected _intersects: Intersection[];
|
|
787
|
-
protected _hovered: (Object3D & DIVEHoverable) | null;
|
|
788
|
-
protected _dragging: boolean;
|
|
789
|
-
protected _dragStart: Vector3;
|
|
790
|
-
protected _dragCurrent: Vector3;
|
|
791
|
-
protected _dragEnd: Vector3;
|
|
792
|
-
protected _dragDelta: Vector3;
|
|
793
|
-
protected _draggable: DIVEDraggable | null;
|
|
794
|
-
protected _dragRaycastOnObjects: Object3D[] | null;
|
|
795
|
-
protected constructor(scene: DIVEScene, controller: DIVEOrbitControls);
|
|
796
|
-
Activate(): void;
|
|
797
|
-
Deactivate(): void;
|
|
798
|
-
onPointerDown(e: PointerEvent): void;
|
|
799
|
-
onDragStart(e: PointerEvent): void;
|
|
800
|
-
onPointerMove(e: PointerEvent): void;
|
|
801
|
-
onDrag(e: PointerEvent): void;
|
|
802
|
-
onPointerUp(e: PointerEvent): void;
|
|
803
|
-
onClick(e: PointerEvent): void;
|
|
804
|
-
onDragEnd(e: PointerEvent): void;
|
|
805
|
-
onWheel(e: WheelEvent): void;
|
|
806
|
-
protected raycast(objects?: Object3D[]): Intersection[];
|
|
807
|
-
private pointerWasDragged;
|
|
808
|
-
}
|
|
809
|
-
|
|
810
|
-
declare class DIVEGizmoPlane extends Object3D {
|
|
811
|
-
private _meshX;
|
|
812
|
-
get XPlane(): Mesh;
|
|
813
|
-
private _meshY;
|
|
814
|
-
get YPlane(): Mesh;
|
|
815
|
-
private _meshZ;
|
|
816
|
-
get ZPlane(): Mesh;
|
|
817
|
-
constructor();
|
|
818
|
-
assemble(mode: DIVEGizmoMode, axis: DIVEGizmoAxis): void;
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
type DIVEGizmoMode = 'translate' | 'rotate' | 'scale';
|
|
822
|
-
type DIVEGizmoAxis = 'x' | 'y' | 'z';
|
|
823
|
-
declare class DIVEGizmo extends Object3D {
|
|
824
|
-
private _mode;
|
|
825
|
-
get mode(): DIVEGizmoMode;
|
|
826
|
-
set mode(value: DIVEGizmoMode);
|
|
827
|
-
set debug(value: boolean);
|
|
828
|
-
private _gizmoNode;
|
|
829
|
-
get gizmoNode(): Object3D;
|
|
830
|
-
private _translateGizmo;
|
|
831
|
-
private _rotateGizmo;
|
|
832
|
-
private _scaleGizmo;
|
|
833
|
-
private _gizmoPlane;
|
|
834
|
-
get gizmoPlane(): DIVEGizmoPlane;
|
|
835
|
-
private _object;
|
|
836
|
-
get object(): (Object3D & DIVESelectable) | null;
|
|
837
|
-
constructor(controller: DIVEOrbitControls);
|
|
838
|
-
attach(object: Object3D & DIVESelectable): this;
|
|
839
|
-
detach(): this;
|
|
840
|
-
onHover(mode: DIVEGizmoMode, axis: DIVEGizmoAxis, value: boolean): void;
|
|
841
|
-
onChange(position?: Vector3, rotation?: Euler, scale?: Vector3): void;
|
|
842
|
-
private assemble;
|
|
843
|
-
}
|
|
844
|
-
|
|
845
|
-
/**
|
|
846
|
-
* A Tool to select and move objects in the scene.
|
|
847
|
-
*
|
|
848
|
-
* Objects have to implement the DIVESelectable interface to be selectable and DIVEMovable to be movable.
|
|
849
|
-
*
|
|
850
|
-
* @module
|
|
851
|
-
*/
|
|
852
|
-
declare class DIVETransformTool extends DIVEBaseTool {
|
|
853
|
-
readonly isTransformTool: boolean;
|
|
854
|
-
private _scaleLinked;
|
|
855
|
-
protected _gizmo: TransformControls | DIVEGizmo;
|
|
856
|
-
constructor(scene: DIVEScene, controller: DIVEOrbitControls);
|
|
857
|
-
Activate(): void;
|
|
858
|
-
SetGizmoMode(mode: 'translate' | 'rotate' | 'scale'): void;
|
|
859
|
-
SetGizmoVisibility(active: boolean): void;
|
|
860
|
-
SetGizmoScaleLinked(linked: boolean): void;
|
|
861
|
-
private initGizmo;
|
|
862
|
-
}
|
|
863
|
-
|
|
864
|
-
/**
|
|
865
|
-
* A Tool to select and move objects in the scene.
|
|
866
|
-
*
|
|
867
|
-
* Objects have to implement the DIVESelectable interface to be selectable and DIVEMovable to be movable.
|
|
868
|
-
*
|
|
869
|
-
* @module
|
|
870
|
-
*/
|
|
871
|
-
declare class DIVESelectTool extends DIVETransformTool {
|
|
872
|
-
readonly isSelectTool: boolean;
|
|
873
|
-
constructor(scene: DIVEScene, controller: DIVEOrbitControls);
|
|
874
|
-
Activate(): void;
|
|
875
|
-
Select(selectable: DIVESelectable): void;
|
|
876
|
-
Deselect(selectable: DIVESelectable): void;
|
|
877
|
-
AttachGizmo(selectable: DIVESelectable): void;
|
|
878
|
-
DetachGizmo(): void;
|
|
879
|
-
onClick(e: PointerEvent): void;
|
|
880
|
-
}
|
|
881
|
-
|
|
882
|
-
type ToolType = 'select' | 'none';
|
|
883
|
-
/**
|
|
884
|
-
* A Toolbox to activate and deactivate tools to use with the pointer.
|
|
885
|
-
*
|
|
886
|
-
* @module
|
|
887
|
-
*/
|
|
888
|
-
declare class DIVEToolbox {
|
|
889
|
-
static readonly DefaultTool = "select";
|
|
890
|
-
private _scene;
|
|
891
|
-
private _controller;
|
|
892
|
-
private _activeTool;
|
|
893
|
-
private _selectTool;
|
|
894
|
-
get selectTool(): DIVESelectTool;
|
|
895
|
-
constructor(scene: DIVEScene, controller: DIVEOrbitControls);
|
|
896
|
-
Dispose(): void;
|
|
897
|
-
GetActiveTool(): DIVEBaseTool | null;
|
|
898
|
-
UseTool(tool: ToolType): void;
|
|
899
|
-
SetGizmoMode(mode: 'translate' | 'rotate' | 'scale'): void;
|
|
900
|
-
SetGizmoVisibility(active: boolean): void;
|
|
901
|
-
SetGizmoScaleLinked(linked: boolean): void;
|
|
902
|
-
onPointerMove(e: PointerEvent): void;
|
|
903
|
-
onPointerDown(e: PointerEvent): void;
|
|
904
|
-
onPointerUp(e: PointerEvent): void;
|
|
905
|
-
onWheel(e: WheelEvent): void;
|
|
906
|
-
private addEventListeners;
|
|
907
|
-
private removeEventListeners;
|
|
908
|
-
}
|
|
909
|
-
|
|
910
|
-
interface USE_TOOL {
|
|
911
|
-
DESCRIPTION: 'Activates a specific tool from the toolbox.';
|
|
912
|
-
PAYLOAD: {
|
|
913
|
-
tool: ToolType;
|
|
914
|
-
};
|
|
915
|
-
RETURN: boolean;
|
|
916
|
-
}
|
|
917
|
-
|
|
918
|
-
interface SET_PARENT {
|
|
919
|
-
DESCRIPTION: 'Attach an object to another object.';
|
|
920
|
-
PAYLOAD: {
|
|
921
|
-
object: Partial<COMEntity> & {
|
|
922
|
-
id: string;
|
|
923
|
-
};
|
|
924
|
-
parent: (Partial<COMEntity> & {
|
|
925
|
-
id: string;
|
|
926
|
-
}) | null;
|
|
927
|
-
};
|
|
928
|
-
RETURN: boolean;
|
|
929
|
-
}
|
|
930
|
-
|
|
931
|
-
interface EXPORT_SCENE {
|
|
932
|
-
DESCRIPTION: 'Exports the current scene to a blob and returns the URL.';
|
|
933
|
-
PAYLOAD: {
|
|
934
|
-
type: keyof DIVESceneFileType;
|
|
935
|
-
};
|
|
936
|
-
RETURN: Promise<string | null>;
|
|
937
|
-
}
|
|
938
|
-
|
|
939
|
-
type DIVEAROptions = {
|
|
940
|
-
arPlacement: 'horizontal' | 'vertical';
|
|
941
|
-
arScale: 'auto' | 'fixed';
|
|
942
|
-
/**
|
|
943
|
-
* experimental, currently deactivated
|
|
944
|
-
*/
|
|
945
|
-
useWebXR: false;
|
|
946
|
-
};
|
|
947
|
-
|
|
948
|
-
interface LAUNCH_AR {
|
|
949
|
-
DESCRIPTION: 'Launches AR mode in native capabilities. (iOS: AR Quick Look, Android: Google Scene Viewer)';
|
|
950
|
-
PAYLOAD?: DIVEAROptions;
|
|
951
|
-
RETURN: Promise<void>;
|
|
952
|
-
}
|
|
953
|
-
|
|
954
|
-
interface Actions {
|
|
955
|
-
GET_ALL_SCENE_DATA: GET_ALL_SCENE_DATA;
|
|
956
|
-
GET_ALL_OBJECTS: GET_ALL_OBJECTS;
|
|
957
|
-
GET_OBJECTS: GET_OBJECTS;
|
|
958
|
-
ADD_OBJECT: ADD_OBJECT;
|
|
959
|
-
UPDATE_OBJECT: UPDATE_OBJECT;
|
|
960
|
-
DELETE_OBJECT: DELETE_OBJECT;
|
|
961
|
-
SELECT_OBJECT: SELECT_OBJECT;
|
|
962
|
-
DESELECT_OBJECT: DESELECT_OBJECT;
|
|
963
|
-
SET_BACKGROUND: SET_BACKGROUND;
|
|
964
|
-
DROP_IT: DROP_IT;
|
|
965
|
-
PLACE_ON_FLOOR: PLACE_ON_FLOOR;
|
|
966
|
-
SET_CAMERA_TRANSFORM: SET_CAMERA_TRANSFORM;
|
|
967
|
-
GET_CAMERA_TRANSFORM: GET_CAMERA_TRANSFORM;
|
|
968
|
-
MOVE_CAMERA: MOVE_CAMERA;
|
|
969
|
-
RESET_CAMERA: RESET_CAMERA;
|
|
970
|
-
COMPUTE_ENCOMPASSING_VIEW: COMPUTE_ENCOMPASSING_VIEW;
|
|
971
|
-
SET_CAMERA_LAYER: SET_CAMERA_LAYER;
|
|
972
|
-
ZOOM_CAMERA: ZOOM_CAMERA;
|
|
973
|
-
SET_GIZMO_MODE: SET_GIZMO_MODE;
|
|
974
|
-
SET_GIZMO_VISIBILITY: SET_GIZMO_VISIBILITY;
|
|
975
|
-
SET_GIZMO_SCALE_LINKED: SET_GIZMO_SCALE_LINKED;
|
|
976
|
-
USE_TOOL: USE_TOOL;
|
|
977
|
-
MODEL_LOADED: MODEL_LOADED;
|
|
978
|
-
UPDATE_SCENE: UPDATE_SCENE;
|
|
979
|
-
GENERATE_MEDIA: GENERATE_MEDIA;
|
|
980
|
-
SET_PARENT: SET_PARENT;
|
|
981
|
-
EXPORT_SCENE: EXPORT_SCENE;
|
|
982
|
-
LAUNCH_AR: LAUNCH_AR;
|
|
983
|
-
}
|
|
984
|
-
|
|
985
|
-
type EventListener<Action extends keyof Actions> = (payload: Actions[Action]['PAYLOAD']) => void;
|
|
986
|
-
type Unsubscribe = () => boolean;
|
|
987
|
-
/**
|
|
988
|
-
* Main class for communicating with DIVE.
|
|
989
|
-
*
|
|
990
|
-
* You can subscribe to actions and perform them from outside and inside DIVE.
|
|
991
|
-
*
|
|
992
|
-
* ```ts
|
|
993
|
-
* import { DIVE } from "@shopware-ag/dive";
|
|
994
|
-
*
|
|
995
|
-
* const dive = new DIVE();
|
|
996
|
-
*
|
|
997
|
-
* dive.Communication.Subscribe('GET_ALL_SCENE_DATA', () => {
|
|
998
|
-
* // do something
|
|
999
|
-
* }));
|
|
1000
|
-
*
|
|
1001
|
-
* dive.Communication.PerformAction('GET_ALL_SCENE_DATA', {});
|
|
1002
|
-
* ```
|
|
1003
|
-
*
|
|
1004
|
-
* @module
|
|
1005
|
-
*/
|
|
1006
|
-
declare class DIVECommunication {
|
|
1007
|
-
private static __instances;
|
|
1008
|
-
static get(id: string): DIVECommunication | undefined;
|
|
1009
|
-
private _id;
|
|
1010
|
-
get id(): string;
|
|
1011
|
-
private renderer;
|
|
1012
|
-
private scene;
|
|
1013
|
-
private controller;
|
|
1014
|
-
private toolbox;
|
|
1015
|
-
private _mediaGenerator;
|
|
1016
|
-
private get mediaGenerator();
|
|
1017
|
-
private _io;
|
|
1018
|
-
private get io();
|
|
1019
|
-
private _ar;
|
|
1020
|
-
private get ar();
|
|
1021
|
-
private registered;
|
|
1022
|
-
private listeners;
|
|
1023
|
-
constructor(renderer: DIVERenderer, scene: DIVEScene, controls: DIVEOrbitControls, toolbox: DIVEToolbox);
|
|
1024
|
-
DestroyInstance(): boolean;
|
|
1025
|
-
PerformAction<Action extends keyof Actions>(action: Action, payload: Actions[Action]['PAYLOAD']): Actions[Action]['RETURN'];
|
|
1026
|
-
Subscribe<Action extends keyof Actions>(type: Action, listener: EventListener<Action>): Unsubscribe;
|
|
1027
|
-
private dispatch;
|
|
1028
|
-
private getAllSceneData;
|
|
1029
|
-
private getAllObjects;
|
|
1030
|
-
private getObjects;
|
|
1031
|
-
private addObject;
|
|
1032
|
-
private updateObject;
|
|
1033
|
-
private deleteObject;
|
|
1034
|
-
private selectObject;
|
|
1035
|
-
private deselectObject;
|
|
1036
|
-
private setBackground;
|
|
1037
|
-
private dropIt;
|
|
1038
|
-
private placeOnFloor;
|
|
1039
|
-
private setCameraTransform;
|
|
1040
|
-
private getCameraTransform;
|
|
1041
|
-
private moveCamera;
|
|
1042
|
-
private setCameraLayer;
|
|
1043
|
-
private resetCamera;
|
|
1044
|
-
private computeEncompassingView;
|
|
1045
|
-
private zoomCamera;
|
|
1046
|
-
private setGizmoMode;
|
|
1047
|
-
private setGizmoVisibility;
|
|
1048
|
-
private setGizmoScaleLinked;
|
|
1049
|
-
private useTool;
|
|
1050
|
-
private modelLoaded;
|
|
1051
|
-
private updateScene;
|
|
1052
|
-
private generateMedia;
|
|
1053
|
-
private setParent;
|
|
1054
|
-
private exportScene;
|
|
1055
|
-
}
|
|
1056
|
-
|
|
1057
|
-
declare enum WebXRUnsupportedReason {
|
|
1058
|
-
'UNKNWON_ERROR' = 0,
|
|
1059
|
-
'NO_HTTPS' = 1,
|
|
1060
|
-
'IMMERSIVE_AR_NOT_SUPPORTED_BY_DEVICE' = 2,
|
|
1061
|
-
'AR_SESSION_NOT_ALLOWED' = 3
|
|
1062
|
-
}
|
|
1063
|
-
declare class DIVEInfo {
|
|
1064
|
-
private static _supportsWebXR;
|
|
1065
|
-
private static _webXRUnsupportedReason;
|
|
1066
|
-
/**
|
|
1067
|
-
*
|
|
1068
|
-
* @returns The system the user is using. Possible values are "Android", "iOS", "Windows", "MacOS", "Linux" or "Unknown".
|
|
1069
|
-
*/
|
|
1070
|
-
static GetSystem(): string;
|
|
1071
|
-
/**
|
|
1072
|
-
* @returns A promise that resolves to a boolean indicating whether the user's device supports WebXR.
|
|
1073
|
-
*/
|
|
1074
|
-
static GetSupportsWebXR(): Promise<boolean>;
|
|
1075
|
-
/**
|
|
1076
|
-
* @returns The reason why WebXR is not supported on the user's device. Returns null if WebXR is supported nor not has been checked yet.
|
|
1077
|
-
*/
|
|
1078
|
-
static GetWebXRUnsupportedReason(): WebXRUnsupportedReason | null;
|
|
1079
|
-
/**
|
|
1080
|
-
* @returns A boolean indicating whether the user's device supports AR Quick Look.
|
|
1081
|
-
*/
|
|
1082
|
-
static GetSupportsARQuickLook(): boolean;
|
|
1083
|
-
/**
|
|
1084
|
-
* @returns A boolean indicating whether the user's device is a mobile device.
|
|
1085
|
-
*/
|
|
1086
|
-
static get isMobile(): boolean;
|
|
1087
|
-
/**
|
|
1088
|
-
* @returns A boolean indicating whether the user's device is a desktop device.
|
|
1089
|
-
*/
|
|
1090
|
-
static get isDesktop(): boolean;
|
|
1091
|
-
/**
|
|
1092
|
-
* @returns A promise that resolves to a boolean indicating whether the user's device is capable of AR.
|
|
1093
|
-
*/
|
|
1094
|
-
static GetIsARCapable(): Promise<boolean>;
|
|
1095
|
-
}
|
|
1096
|
-
|
|
1097
|
-
declare function ceilExp(number: number, decimals?: number): number;
|
|
1098
|
-
|
|
1099
|
-
declare function floorExp(number: number, decimals?: number): number;
|
|
1100
|
-
|
|
1101
|
-
declare function roundExponential(number: number, decimals?: number): number;
|
|
1102
|
-
|
|
1103
|
-
/**
|
|
1104
|
-
* Calculate the signed angle between two vectors. Only works when the vectors are on the same plane.
|
|
1105
|
-
* @param vecB Start Vector
|
|
1106
|
-
* @param vecA Target Vector
|
|
1107
|
-
* @param planeNormal The vector's plane normal
|
|
1108
|
-
* @returns Signed angle in radians
|
|
1109
|
-
*/
|
|
1110
|
-
declare function signedAngleTo(vecA: Vector3, vecB: Vector3, planeNormal: Vector3): number;
|
|
1111
|
-
|
|
1112
|
-
declare function toFixedExp(number: number, decimals?: number): string;
|
|
1113
|
-
|
|
1114
|
-
declare function truncateExp(number: number, decimals?: number): number;
|
|
1115
|
-
|
|
1116
|
-
declare function radToDeg(radians: number): number;
|
|
1117
|
-
|
|
1118
|
-
declare function degToRad(degrees: number): number;
|
|
1119
|
-
|
|
1120
|
-
declare const DIVEMath: {
|
|
1121
|
-
ceilExp: typeof ceilExp;
|
|
1122
|
-
floorExp: typeof floorExp;
|
|
1123
|
-
roundExp: typeof roundExponential;
|
|
1124
|
-
toFixedExp: typeof toFixedExp;
|
|
1125
|
-
truncateExp: typeof truncateExp;
|
|
1126
|
-
signedAngleTo: typeof signedAngleTo;
|
|
1127
|
-
radToDeg: typeof radToDeg;
|
|
1128
|
-
degToRad: typeof degToRad;
|
|
1129
|
-
};
|
|
1130
|
-
|
|
1131
|
-
type DIVESettings = {
|
|
1132
|
-
autoResize: boolean;
|
|
1133
|
-
displayAxes: boolean;
|
|
1134
|
-
renderer: Partial<DIVERendererSettings>;
|
|
1135
|
-
perspectiveCamera: Partial<DIVEPerspectiveCameraSettings>;
|
|
1136
|
-
orbitControls: Partial<DIVEOrbitControlsSettings>;
|
|
1137
|
-
};
|
|
1138
|
-
declare const DIVEDefaultSettings: DIVESettings;
|
|
1139
|
-
/**
|
|
1140
|
-
* #### DIVE
|
|
1141
|
-
* is the main class of the DIVE framework.
|
|
1142
|
-
*
|
|
1143
|
-
* An instance of this class delivers a complete 3D environment with a perspective camera, orbit controls, a toolbox, and a communication system.
|
|
1144
|
-
* ```ts
|
|
1145
|
-
* import { DIVE } from "@shopware-ag/dive";
|
|
1146
|
-
*
|
|
1147
|
-
* const myWrapper = document.getElementById('myWrapper');
|
|
1148
|
-
*
|
|
1149
|
-
* const dive = new DIVE();
|
|
1150
|
-
*
|
|
1151
|
-
* myWrapper.appendChild(dive.Canvas);
|
|
1152
|
-
*
|
|
1153
|
-
* dive.Communication.Subscribe('GET_ALL_SCENE_DATA', () => {
|
|
1154
|
-
* // do something
|
|
1155
|
-
* }));
|
|
1156
|
-
*
|
|
1157
|
-
* dive.Communication.PerformAction('GET_ALL_SCENE_DATA', {});
|
|
1158
|
-
* ```
|
|
1159
|
-
* @module
|
|
1160
|
-
*/
|
|
1161
|
-
declare class DIVE {
|
|
1162
|
-
static QuickView(uri: string, settings?: Partial<DIVESettings>): DIVE;
|
|
1163
|
-
private _settings;
|
|
1164
|
-
private _resizeObserverId;
|
|
1165
|
-
private _width;
|
|
1166
|
-
private _height;
|
|
1167
|
-
private renderer;
|
|
1168
|
-
private scene;
|
|
1169
|
-
private perspectiveCamera;
|
|
1170
|
-
private orbitControls;
|
|
1171
|
-
private toolbox;
|
|
1172
|
-
private communication;
|
|
1173
|
-
private animationSystem;
|
|
1174
|
-
private axisCamera;
|
|
1175
|
-
get Communication(): DIVECommunication;
|
|
1176
|
-
get Canvas(): HTMLCanvasElement;
|
|
1177
|
-
get Info(): DIVEInfo;
|
|
1178
|
-
set Settings(settings: Partial<DIVESettings>);
|
|
1179
|
-
constructor(settings?: Partial<DIVESettings>);
|
|
1180
|
-
Dispose(): void;
|
|
1181
|
-
OnResize(width: number, height: number): void;
|
|
1182
|
-
private addResizeObserver;
|
|
1183
|
-
private removeResizeObserver;
|
|
1184
|
-
}
|
|
1185
|
-
|
|
1186
|
-
export { type Actions, type COMEntity, type COMEntityType, type COMGeometry, type COMGeometryType, type COMGroup, type COMLight, type COMMaterial, type COMModel, type COMPov, type COMPrimitive, DIVE, DIVECommunication, DIVEDefaultSettings, DIVEMath, type DIVESceneData, type DIVESceneFileType, type DIVESceneObject, type DIVESettings, DIVE as default };
|
|
1
|
+
export * from './src/dive'
|
|
2
|
+
export {}
|
|
3
|
+
import _default from './src/dive'
|
|
4
|
+
export default _default
|
|
5
|
+
export * from './src/dive'
|
|
6
|
+
export {}
|