@shopware-ag/dive 1.18.4 → 1.18.5-beta.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.
Files changed (139) hide show
  1. package/build/AR-B6LRgTEL.js +1482 -0
  2. package/build/AR-B6LRgTEL.js.map +1 -0
  3. package/build/AR-YJZL1lm5.cjs +170 -0
  4. package/build/AR-YJZL1lm5.cjs.map +1 -0
  5. package/build/dive-BmDCwQRo.js +24811 -0
  6. package/build/dive-BmDCwQRo.js.map +1 -0
  7. package/build/dive-C-5_QywE.cjs +3857 -0
  8. package/build/dive-C-5_QywE.cjs.map +1 -0
  9. package/build/dive.cjs +2 -4860
  10. package/build/dive.cjs.map +1 -1
  11. package/build/dive.d.ts +6 -1186
  12. package/build/dive.js +7 -4889
  13. package/build/dive.js.map +1 -1
  14. package/build/src/animation/AnimationSystem.d.ts +16 -0
  15. package/build/src/ar/AR.d.ts +21 -0
  16. package/build/src/ar/arquicklook/ARQuickLook.d.ts +8 -0
  17. package/build/src/ar/sceneviewer/SceneViewer.d.ts +7 -0
  18. package/build/src/ar/webxr/WebXR.d.ts +21 -0
  19. package/build/src/ar/webxr/controller/WebXRController.d.ts +46 -0
  20. package/build/src/ar/webxr/crosshair/WebXRCrosshair.d.ts +7 -0
  21. package/build/src/ar/webxr/origin/WebXROrigin.d.ts +31 -0
  22. package/build/src/ar/webxr/overlay/Overlay.d.ts +8 -0
  23. package/build/src/ar/webxr/raycaster/WebXRRaycaster.d.ts +40 -0
  24. package/build/src/ar/webxr/raycaster/ar/WebXRRaycasterAR.d.ts +15 -0
  25. package/build/src/ar/webxr/raycaster/three/WebXRRaycasterTHREE.d.ts +12 -0
  26. package/build/src/ar/webxr/touchscreencontrols/WebXRTouchscreenControls.d.ts +73 -0
  27. package/build/src/axiscamera/AxisCamera.d.ts +18 -0
  28. package/build/src/camera/PerspectiveCamera.d.ts +20 -0
  29. package/build/src/com/Communication.d.ts +77 -0
  30. package/build/src/com/actions/camera/computeencompassingview.d.ts +9 -0
  31. package/build/src/com/actions/camera/getcameratransform.d.ts +9 -0
  32. package/build/src/com/actions/camera/movecamera.d.ts +15 -0
  33. package/build/src/com/actions/camera/resetcamera.d.ts +7 -0
  34. package/build/src/com/actions/camera/setcameralayer.d.ts +7 -0
  35. package/build/src/com/actions/camera/setcameratransform.d.ts +9 -0
  36. package/build/src/com/actions/camera/zoomcamera.d.ts +8 -0
  37. package/build/src/com/actions/index.d.ts +58 -0
  38. package/build/src/com/actions/media/generatemedia.d.ts +15 -0
  39. package/build/src/com/actions/object/addobject.d.ts +6 -0
  40. package/build/src/com/actions/object/deleteobject.d.ts +8 -0
  41. package/build/src/com/actions/object/deselectobject.d.ts +8 -0
  42. package/build/src/com/actions/object/getallobjects.d.ts +6 -0
  43. package/build/src/com/actions/object/getobjects.d.ts +8 -0
  44. package/build/src/com/actions/object/model/dropit.d.ts +7 -0
  45. package/build/src/com/actions/object/model/modelloaded.d.ts +7 -0
  46. package/build/src/com/actions/object/model/placeonfloor.d.ts +7 -0
  47. package/build/src/com/actions/object/selectobject.d.ts +8 -0
  48. package/build/src/com/actions/object/setparent.d.ts +13 -0
  49. package/build/src/com/actions/object/updateobject.d.ts +8 -0
  50. package/build/src/com/actions/scene/exportscene.d.ts +8 -0
  51. package/build/src/com/actions/scene/getallscenedata.d.ts +6 -0
  52. package/build/src/com/actions/scene/launchar.d.ts +6 -0
  53. package/build/src/com/actions/scene/setbackground.d.ts +7 -0
  54. package/build/src/com/actions/scene/updatescene.d.ts +11 -0
  55. package/build/src/com/actions/toolbox/select/setgizmomode.d.ts +7 -0
  56. package/build/src/com/actions/toolbox/transform/setgizmoscalelinked.d.ts +5 -0
  57. package/build/src/com/actions/toolbox/transform/setgizmovisible.d.ts +5 -0
  58. package/build/src/com/actions/toolbox/usetool.d.ts +8 -0
  59. package/build/src/com/types/COMBaseEntity.d.ts +8 -0
  60. package/build/src/com/types/COMEntity.d.ts +6 -0
  61. package/build/src/com/types/COMEntityType.d.ts +1 -0
  62. package/build/src/com/types/COMGeometry.d.ts +7 -0
  63. package/build/src/com/types/COMGeometryType.d.ts +1 -0
  64. package/build/src/com/types/COMGroup.d.ts +8 -0
  65. package/build/src/com/types/COMLight.d.ts +10 -0
  66. package/build/src/com/types/COMMaterial.d.ts +11 -0
  67. package/build/src/com/types/COMModel.d.ts +11 -0
  68. package/build/src/com/types/COMPov.d.ts +7 -0
  69. package/build/src/com/types/COMPrimitive.d.ts +11 -0
  70. package/build/src/com/types/index.d.ts +11 -0
  71. package/build/src/constant/AxisHelperColors.d.ts +6 -0
  72. package/build/src/constant/GridColors.d.ts +2 -0
  73. package/build/src/constant/VisibilityLayerMask.d.ts +5 -0
  74. package/build/src/controls/OrbitControls.d.ts +38 -0
  75. package/build/src/dive.d.ts +64 -0
  76. package/build/src/events/EventExecutor.d.ts +5 -0
  77. package/build/src/exporters/usdz/USDZExporter.d.ts +15 -0
  78. package/build/src/gizmo/Gizmo.d.ts +27 -0
  79. package/build/src/gizmo/handles/AxisHandle.d.ts +30 -0
  80. package/build/src/gizmo/handles/RadialHandle.d.ts +30 -0
  81. package/build/src/gizmo/handles/ScaleHandle.d.ts +33 -0
  82. package/build/src/gizmo/plane/GizmoPlane.d.ts +12 -0
  83. package/build/src/gizmo/rotate/RotateGizmo.d.ts +17 -0
  84. package/build/src/gizmo/scale/ScaleGizmo.d.ts +20 -0
  85. package/build/src/gizmo/translate/TranslateGizmo.d.ts +17 -0
  86. package/build/src/grid/Grid.d.ts +10 -0
  87. package/build/src/group/Group.d.ts +23 -0
  88. package/build/src/helper/applyMixins/applyMixins.d.ts +8 -0
  89. package/build/src/helper/findInterface/findInterface.d.ts +2 -0
  90. package/build/src/helper/findSceneRecursive/findSceneRecursive.d.ts +9 -0
  91. package/build/src/helper/getObjectDelta/getObjectDelta.d.ts +4 -0
  92. package/build/src/helper/isInterface/implementsInterface.d.ts +2 -0
  93. package/build/src/info/Info.d.ts +39 -0
  94. package/build/src/interface/Draggable.d.ts +7 -0
  95. package/build/src/interface/Hoverable.d.ts +7 -0
  96. package/build/src/interface/Movable.d.ts +11 -0
  97. package/build/src/interface/Rotatable.d.ts +9 -0
  98. package/build/src/interface/Scalable.d.ts +9 -0
  99. package/build/src/interface/Selectable.d.ts +10 -0
  100. package/build/src/io/IO.d.ts +10 -0
  101. package/build/src/io/gltf/GLTFIO.d.ts +12 -0
  102. package/build/src/light/AmbientLight.d.ts +17 -0
  103. package/build/src/light/PointLight.d.ts +29 -0
  104. package/build/src/light/SceneLight.d.ts +18 -0
  105. package/build/src/loadingmanager/LoadingManager.d.ts +14 -0
  106. package/build/src/math/ceil/ceilExp.d.ts +1 -0
  107. package/build/src/math/degToRad/degToRad.d.ts +1 -0
  108. package/build/src/math/floor/floorExp.d.ts +1 -0
  109. package/build/src/math/helper/shift.d.ts +1 -0
  110. package/build/src/math/index.d.ts +18 -0
  111. package/build/src/math/radToDeg/radToDeg.d.ts +1 -0
  112. package/build/src/math/round/roundExp.d.ts +1 -0
  113. package/build/src/math/signedAngleTo/signedAngleTo.d.ts +9 -0
  114. package/build/src/math/toFixed/toFixedExp.d.ts +1 -0
  115. package/build/src/math/truncate/truncateExp.d.ts +1 -0
  116. package/build/src/mediacreator/MediaCreator.d.ts +17 -0
  117. package/build/src/model/Model.d.ts +21 -0
  118. package/build/src/node/Node.d.ts +24 -0
  119. package/build/src/primitive/Primitive.d.ts +28 -0
  120. package/build/src/primitive/floor/Floor.d.ts +14 -0
  121. package/build/src/renderer/Renderer.d.ts +69 -0
  122. package/build/src/scene/Scene.d.ts +46 -0
  123. package/build/src/scene/root/Root.d.ts +42 -0
  124. package/build/src/scene/xrroot/XRRoot.d.ts +17 -0
  125. package/build/src/scene/xrroot/xrlightroot/XRLightRoot.d.ts +13 -0
  126. package/build/src/toolbox/BaseTool.d.ts +48 -0
  127. package/build/src/toolbox/Toolbox.d.ts +31 -0
  128. package/build/src/toolbox/select/SelectTool.d.ts +26 -0
  129. package/build/src/toolbox/transform/TransformTool.d.ts +27 -0
  130. package/build/src/types/SceneData.d.ts +19 -0
  131. package/build/src/types/SceneObjects.d.ts +7 -0
  132. package/build/src/types/SceneType.d.ts +4 -0
  133. package/build/src/types/index.d.ts +4 -0
  134. package/package.json +9 -8
  135. package/src/camera/PerspectiveCamera.ts +1 -1
  136. package/src/com/Communication.ts +33 -8
  137. package/src/com/__test__/Communication.test.ts +2 -1
  138. package/src/dive.ts +0 -3
  139. package/build/dive.d.cts +0 -1186
@@ -0,0 +1,39 @@
1
+ export declare enum WebXRUnsupportedReason {
2
+ 'UNKNWON_ERROR' = 0,
3
+ 'NO_HTTPS' = 1,
4
+ 'IMMERSIVE_AR_NOT_SUPPORTED_BY_DEVICE' = 2,
5
+ 'AR_SESSION_NOT_ALLOWED' = 3
6
+ }
7
+ export declare class DIVEInfo {
8
+ private static _supportsWebXR;
9
+ private static _webXRUnsupportedReason;
10
+ /**
11
+ *
12
+ * @returns The system the user is using. Possible values are "Android", "iOS", "Windows", "MacOS", "Linux" or "Unknown".
13
+ */
14
+ static GetSystem(): string;
15
+ /**
16
+ * @returns A promise that resolves to a boolean indicating whether the user's device supports WebXR.
17
+ */
18
+ static GetSupportsWebXR(): Promise<boolean>;
19
+ /**
20
+ * @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.
21
+ */
22
+ static GetWebXRUnsupportedReason(): WebXRUnsupportedReason | null;
23
+ /**
24
+ * @returns A boolean indicating whether the user's device supports AR Quick Look.
25
+ */
26
+ static GetSupportsARQuickLook(): boolean;
27
+ /**
28
+ * @returns A boolean indicating whether the user's device is a mobile device.
29
+ */
30
+ static get isMobile(): boolean;
31
+ /**
32
+ * @returns A boolean indicating whether the user's device is a desktop device.
33
+ */
34
+ static get isDesktop(): boolean;
35
+ /**
36
+ * @returns A promise that resolves to a boolean indicating whether the user's device is capable of AR.
37
+ */
38
+ static GetIsARCapable(): Promise<boolean>;
39
+ }
@@ -0,0 +1,7 @@
1
+ import { DraggableEvent } from '../toolbox/BaseTool';
2
+ export interface DIVEDraggable {
3
+ isDraggable: true;
4
+ onDragStart?: (e: DraggableEvent) => void;
5
+ onDrag?: (e: DraggableEvent) => void;
6
+ onDragEnd?: (e: DraggableEvent) => void;
7
+ }
@@ -0,0 +1,7 @@
1
+ import { Intersection } from 'three';
2
+ export interface DIVEHoverable {
3
+ isHoverable: true;
4
+ onPointerEnter?: (i: Intersection) => void;
5
+ onPointerOver?: (i: Intersection) => void;
6
+ onPointerLeave?: () => void;
7
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Interface for objects that can be moved in the scene.
3
+ *
4
+ * @module
5
+ */
6
+ export interface DIVEMovable {
7
+ isMovable: true;
8
+ onMoveStart?: () => void;
9
+ onMove?: () => void;
10
+ onMoveEnd?: () => void;
11
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Interface for objects that can be rotated in the scene.
3
+ *
4
+ * @module
5
+ */
6
+ export interface DIVERotatable {
7
+ isRotatable: true;
8
+ onRotate?: () => void;
9
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Interface for objects that can be scaled in the scene.
3
+ *
4
+ * @module
5
+ */
6
+ export interface DIVEScalable {
7
+ isScalable: true;
8
+ onScale?: () => void;
9
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Interface for objects that can be selected in the scene.
3
+ *
4
+ * @module
5
+ */
6
+ export interface DIVESelectable {
7
+ isSelectable: true;
8
+ onSelect?: () => void;
9
+ onDeselect?: () => void;
10
+ }
@@ -0,0 +1,10 @@
1
+ import { DIVESceneFileType } from '../types';
2
+ import { DIVEScene } from '../scene/Scene';
3
+ export declare class DIVEIO {
4
+ private _scene;
5
+ private _gltfIO;
6
+ constructor(scene: DIVEScene);
7
+ Import<FileType extends keyof DIVESceneFileType>(type: FileType, url: string): Promise<DIVESceneFileType[FileType] | null>;
8
+ Export<FileType extends keyof DIVESceneFileType>(type: FileType): Promise<string | null>;
9
+ private _createBlobURL;
10
+ }
@@ -0,0 +1,12 @@
1
+ import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader';
2
+ import { Object3D } from 'three';
3
+ export declare class DIVEGLTFIO {
4
+ private _importer;
5
+ private _exporter;
6
+ constructor();
7
+ Import(url: string, onProgress?: (progress: number) => void): Promise<GLTF>;
8
+ Export(object: Object3D, binary: true, onlyVisible: boolean): Promise<ArrayBuffer>;
9
+ Export(object: Object3D, binary: false, onlyVisible: boolean): Promise<{
10
+ [key: string]: unknown;
11
+ }>;
12
+ }
@@ -0,0 +1,17 @@
1
+ import { Color, Object3D } from 'three';
2
+ /**
3
+ * A basic ambient light.
4
+ *
5
+ * Can change the color, intensity, and visibility of the light.
6
+ *
7
+ * @module
8
+ */
9
+ export default class DIVEAmbientLight extends Object3D {
10
+ readonly isDIVELight: true;
11
+ readonly isDIVEAmbientLight: true;
12
+ private _light;
13
+ constructor();
14
+ SetColor(color: Color): void;
15
+ SetIntensity(intensity: number): void;
16
+ SetEnabled(enabled: boolean): void;
17
+ }
@@ -0,0 +1,29 @@
1
+ import { Color, Object3D } from 'three';
2
+ import { DIVEMovable } from '../interface/Movable';
3
+ import { DIVESelectable } from '../interface/Selectable';
4
+ import { TransformControls } from 'three/examples/jsm/controls/TransformControls';
5
+ /**
6
+ * A basic point light.
7
+ *
8
+ * Can change the color, intensity, and visibility of the light.
9
+ *
10
+ * Can be moved and selected.
11
+ *
12
+ * @module
13
+ */
14
+ export default class DIVEPointLight extends Object3D implements DIVESelectable, DIVEMovable {
15
+ readonly isDIVELight: true;
16
+ readonly isDIVEPointLight: true;
17
+ readonly isMovable: true;
18
+ readonly isSelectable: true;
19
+ gizmo: TransformControls | null;
20
+ private light;
21
+ private mesh;
22
+ constructor();
23
+ SetColor(color: Color): void;
24
+ SetIntensity(intensity: number): void;
25
+ SetEnabled(enabled: boolean): void;
26
+ onMove(): void;
27
+ onSelect(): void;
28
+ onDeselect(): void;
29
+ }
@@ -0,0 +1,18 @@
1
+ import { Color, Object3D } from 'three';
2
+ /**
3
+ * A complex scene light.
4
+ *
5
+ * Can change the color, intensity, and visibility of the light.
6
+ *
7
+ * @module
8
+ */
9
+ export default class DIVESceneLight extends Object3D {
10
+ readonly isDIVELight: true;
11
+ readonly isDIVESceneLight: true;
12
+ private _hemiLight;
13
+ private _dirLight;
14
+ constructor();
15
+ SetColor(color: Color): void;
16
+ SetIntensity(intensity: number): void;
17
+ SetEnabled(enabled: boolean): void;
18
+ }
@@ -0,0 +1,14 @@
1
+ import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader';
2
+ /**
3
+ * A basic loading manager.
4
+ *
5
+ * @module
6
+ */
7
+ export declare class DIVELoadingManager {
8
+ private gltfloader;
9
+ private dracoloader;
10
+ constructor();
11
+ private progress;
12
+ LoadGLTF(uri: string): Promise<GLTF>;
13
+ PollProgress(): number;
14
+ }
@@ -0,0 +1 @@
1
+ export default function ceilExp(number: number, decimals?: number): number;
@@ -0,0 +1 @@
1
+ export default function degToRad(degrees: number): number;
@@ -0,0 +1 @@
1
+ export default function floorExp(number: number, decimals?: number): number;
@@ -0,0 +1 @@
1
+ export default function shift(value: number, exponent: number): number;
@@ -0,0 +1,18 @@
1
+ import { default as ceilExp } from './ceil/ceilExp.ts';
2
+ import { default as floorExp } from './floor/floorExp.ts';
3
+ import { default as roundExp } from './round/roundExp.ts';
4
+ import { default as signedAngleTo } from './signedAngleTo/signedAngleTo.ts';
5
+ import { default as toFixedExp } from './toFixed/toFixedExp.ts';
6
+ import { default as truncateExp } from './truncate/truncateExp.ts';
7
+ import { default as radToDeg } from './radToDeg/radToDeg.ts';
8
+ import { default as degToRad } from './degToRad/degToRad.ts';
9
+ export declare const DIVEMath: {
10
+ ceilExp: typeof ceilExp;
11
+ floorExp: typeof floorExp;
12
+ roundExp: typeof roundExp;
13
+ toFixedExp: typeof toFixedExp;
14
+ truncateExp: typeof truncateExp;
15
+ signedAngleTo: typeof signedAngleTo;
16
+ radToDeg: typeof radToDeg;
17
+ degToRad: typeof degToRad;
18
+ };
@@ -0,0 +1 @@
1
+ export default function radToDeg(radians: number): number;
@@ -0,0 +1 @@
1
+ export default function roundExponential(number: number, decimals?: number): number;
@@ -0,0 +1,9 @@
1
+ import { Vector3 } from 'three';
2
+ /**
3
+ * Calculate the signed angle between two vectors. Only works when the vectors are on the same plane.
4
+ * @param vecB Start Vector
5
+ * @param vecA Target Vector
6
+ * @param planeNormal The vector's plane normal
7
+ * @returns Signed angle in radians
8
+ */
9
+ export default function signedAngleTo(vecA: Vector3, vecB: Vector3, planeNormal: Vector3): number;
@@ -0,0 +1 @@
1
+ export default function toFixedExp(number: number, decimals?: number): string;
@@ -0,0 +1 @@
1
+ export default function truncateExp(number: number, decimals?: number): number;
@@ -0,0 +1,17 @@
1
+ import { DIVEScene } from '../scene/Scene.ts';
2
+ import { DIVERenderer } from '../renderer/Renderer.ts';
3
+ import { default as DIVEOrbitControls } from '../controls/OrbitControls.ts';
4
+ import { Vector3Like } from 'three';
5
+ /**
6
+ * Creates renderings of the current scene
7
+ *
8
+ * @module
9
+ */
10
+ export declare class DIVEMediaCreator {
11
+ private renderer;
12
+ private scene;
13
+ private controller;
14
+ constructor(renderer: DIVERenderer, scene: DIVEScene, controller: DIVEOrbitControls);
15
+ GenerateMedia(position: Vector3Like, target: Vector3Like, width: number, height: number): string;
16
+ DrawCanvas(canvasElement?: HTMLCanvasElement): HTMLCanvasElement;
17
+ }
@@ -0,0 +1,21 @@
1
+ import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader';
2
+ import { COMMaterial } from '../com/types';
3
+ import { DIVENode } from '../node/Node';
4
+ /**
5
+ * A basic model class.
6
+ *
7
+ * It does calculate it's own bounding box which is used for positioning on the floor.
8
+ *
9
+ * Can be moved and selected.
10
+ *
11
+ * @module
12
+ */
13
+ export declare class DIVEModel extends DIVENode {
14
+ readonly isDIVEModel: true;
15
+ private _mesh;
16
+ private _material;
17
+ SetModel(gltf: GLTF): void;
18
+ SetMaterial(material: Partial<COMMaterial>): void;
19
+ PlaceOnFloor(): void;
20
+ DropIt(): void;
21
+ }
@@ -0,0 +1,24 @@
1
+ import { Box3, Object3D, Vector3, Vector3Like } from 'three';
2
+ import { DIVEMovable } from '../interface/Movable';
3
+ import { DIVESelectable } from '../interface/Selectable';
4
+ import { TransformControls } from 'three/examples/jsm/controls/TransformControls';
5
+ export declare class DIVENode extends Object3D implements DIVESelectable, DIVEMovable {
6
+ readonly isDIVENode: true;
7
+ readonly isSelectable: true;
8
+ readonly isMovable: true;
9
+ gizmo: TransformControls | null;
10
+ protected _positionWorldBuffer: Vector3;
11
+ protected _boundingBox: Box3;
12
+ constructor();
13
+ SetPosition(position: Vector3Like): void;
14
+ SetRotation(rotation: Vector3Like): void;
15
+ SetScale(scale: Vector3Like): void;
16
+ SetVisibility(visible: boolean): void;
17
+ SetToWorldOrigin(): void;
18
+ /**
19
+ * Can be called when the object is moved from a foreign object (gizmo, parent, etc.) to update the object's position.
20
+ */
21
+ onMove(): void;
22
+ onSelect(): void;
23
+ onDeselect(): void;
24
+ }
@@ -0,0 +1,28 @@
1
+ import { DIVENode } from '../node/Node';
2
+ import { COMGeometry, COMMaterial } from '../com/types';
3
+ /**
4
+ * A basic model class.
5
+ *
6
+ * It does calculate it's own bounding box which is used for positioning on the floor.
7
+ *
8
+ * Can be moved and selected.
9
+ *
10
+ * @module
11
+ */
12
+ export declare class DIVEPrimitive extends DIVENode {
13
+ readonly isDIVEPrimitive: true;
14
+ private _mesh;
15
+ constructor();
16
+ SetGeometry(geometry: COMGeometry): void;
17
+ SetMaterial(material: Partial<COMMaterial>): void;
18
+ PlaceOnFloor(): void;
19
+ DropIt(): void;
20
+ private assembleGeometry;
21
+ private createCylinderGeometry;
22
+ private createSphereGeometry;
23
+ private createPyramidGeometry;
24
+ private createBoxGeometry;
25
+ private createConeGeometry;
26
+ private createWallGeometry;
27
+ private createPlaneGeometry;
28
+ }
@@ -0,0 +1,14 @@
1
+ import { ColorRepresentation, Mesh } from 'three';
2
+ /**
3
+ * A basic floor geometry.
4
+ *
5
+ * Can change the color and visibility of the floor.
6
+ *
7
+ * @module
8
+ */
9
+ export declare class DIVEFloor extends Mesh {
10
+ isFloor: true;
11
+ constructor();
12
+ SetVisibility(visible: boolean): void;
13
+ SetColor(color: ColorRepresentation): void;
14
+ }
@@ -0,0 +1,69 @@
1
+ import { Camera, Scene, ShadowMapType, ToneMapping, WebGLRenderer } from 'three';
2
+ export type DIVERendererSettings = {
3
+ antialias: boolean;
4
+ alpha: boolean;
5
+ stencil: boolean;
6
+ shadowMapEnabled: boolean;
7
+ shadowMapType: ShadowMapType;
8
+ toneMapping: ToneMapping;
9
+ canvas?: HTMLCanvasElement;
10
+ };
11
+ export declare const DIVERendererDefaultSettings: DIVERendererSettings;
12
+ export type DIVERenderCallback = (time: DOMHighResTimeStamp, frame: XRFrame) => void;
13
+ /**
14
+ * A changed version of the WebGLRenderer.
15
+ *
16
+ * Has to be started manually by calling StartRenderer().
17
+ *
18
+ * @module
19
+ */
20
+ export declare class DIVERenderer extends WebGLRenderer {
21
+ private paused;
22
+ private running;
23
+ private force;
24
+ private preRenderCallbacks;
25
+ private postRenderCallbacks;
26
+ constructor(rendererSettings?: Partial<DIVERendererSettings>);
27
+ Dispose(): void;
28
+ StartRenderer(scene: Scene, cam: Camera): void;
29
+ PauseRenderer(): void;
30
+ ResumeRenderer(): void;
31
+ StopRenderer(): void;
32
+ OnResize(width: number, height: number): void;
33
+ /**
34
+ * Adds a callback to the render loop before actual render call.
35
+ * @param callback Executed before rendering.
36
+ * @returns uuid to remove the callback.
37
+ */
38
+ AddPreRenderCallback(callback: DIVERenderCallback): string;
39
+ /**
40
+ * Removes a callback from the render loop before actual render call.
41
+ * @param uuid of callback to remove.
42
+ * @returns if removing was successful.
43
+ */
44
+ RemovePreRenderCallback(uuid: string): boolean;
45
+ /**
46
+ * Adds a callback to the render loop after actual render call.
47
+ * @param callback Executed after rendering.
48
+ * @returns uuid to remove the callback.
49
+ */
50
+ AddPostRenderCallback(callback: DIVERenderCallback): string;
51
+ /**
52
+ * Removes a callback from the render loop after actual render call.
53
+ * @param uuid of callback to remove.
54
+ * @returns if removing was successful.
55
+ */
56
+ RemovePostRenderCallback(uuid: string): boolean;
57
+ /**
58
+ * Forces the renderer to render the next frame.
59
+ */
60
+ ForceRendering(): void;
61
+ /**
62
+ * Internal render loop.
63
+ *
64
+ * To control renderloop you can add callbacks via AddPreRenderCallback() and AddPostRenderCallback().
65
+ * @param scene Scene to render.
66
+ * @param cam Camera to render with.
67
+ */
68
+ private internal_render;
69
+ }
@@ -0,0 +1,46 @@
1
+ import { Scene, Box3, ColorRepresentation } from 'three';
2
+ import { COMModel, COMEntity } from '../com/types';
3
+ import { DIVERoot } from './root/Root';
4
+ import { DIVEGrid } from '../grid/Grid';
5
+ import { DIVEFloor } from '../primitive/floor/Floor';
6
+ import { DIVESceneObject } from '../types';
7
+ import { DIVEXRRoot } from './xrroot/XRRoot';
8
+ import { DIVERenderer } from '../renderer/Renderer';
9
+ /**
10
+ * A basic scene class.
11
+ *
12
+ * Comes with a root object that contains all the scene objects.
13
+ *
14
+ * @module
15
+ */
16
+ export declare class DIVEScene extends Scene {
17
+ private _root;
18
+ private _floor;
19
+ private _grid;
20
+ get Root(): DIVERoot;
21
+ private _xrRoot;
22
+ get XRRoot(): DIVEXRRoot;
23
+ get Floor(): DIVEFloor;
24
+ get Grid(): DIVEGrid;
25
+ constructor();
26
+ InitXR(renderer: DIVERenderer): void;
27
+ DisposeXR(): void;
28
+ SetBackground(color: ColorRepresentation): void;
29
+ ComputeSceneBB(): Box3;
30
+ GetSceneObject<T extends DIVESceneObject>(object: Partial<COMEntity> & {
31
+ id: string;
32
+ }): T | undefined;
33
+ AddSceneObject(object: COMEntity): void;
34
+ UpdateSceneObject(object: Partial<COMEntity> & {
35
+ id: string;
36
+ entityType: string;
37
+ }): void;
38
+ DeleteSceneObject(object: Partial<COMEntity> & {
39
+ id: string;
40
+ entityType: string;
41
+ }): void;
42
+ PlaceOnFloor(object: Partial<COMModel> & {
43
+ id: string;
44
+ entityType: string;
45
+ }): void;
46
+ }
@@ -0,0 +1,42 @@
1
+ import { Box3, Object3D } from 'three';
2
+ import { COMEntity } from '../../com/types';
3
+ import { DIVESceneObject } from '../../types';
4
+ /**
5
+ * A basic scene node to hold grid, floor and all lower level roots.
6
+ *
7
+ * @module
8
+ */
9
+ export declare class DIVERoot extends Object3D {
10
+ readonly isDIVERoot: true;
11
+ private loadingManager;
12
+ constructor();
13
+ ComputeSceneBB(): Box3;
14
+ GetSceneObject<T extends DIVESceneObject>(object: Partial<COMEntity> & {
15
+ id: string;
16
+ }): T | undefined;
17
+ AddSceneObject(object: COMEntity): void;
18
+ UpdateSceneObject(object: Partial<COMEntity> & {
19
+ id: string;
20
+ entityType: string;
21
+ }): void;
22
+ DeleteSceneObject(object: Partial<COMEntity> & {
23
+ id: string;
24
+ entityType: string;
25
+ }): void;
26
+ PlaceOnFloor(object: Partial<COMEntity> & {
27
+ id: string;
28
+ entityType: string;
29
+ }): void;
30
+ private updateLight;
31
+ private updateModel;
32
+ private updatePrimitive;
33
+ private updateGroup;
34
+ private deleteLight;
35
+ private deleteModel;
36
+ private deletePrimitive;
37
+ private deleteGroup;
38
+ private placeOnFloor;
39
+ private setParent;
40
+ private detachTransformControls;
41
+ private findScene;
42
+ }
@@ -0,0 +1,17 @@
1
+ import { Object3D } from 'three';
2
+ import { DIVERoot } from '../root/Root';
3
+ import { DIVERenderer } from '../../renderer/Renderer';
4
+ import { DIVEXRLightRoot } from './xrlightroot/XRLightRoot';
5
+ import { DIVEScene } from '../Scene';
6
+ export declare class DIVEXRRoot extends Object3D {
7
+ private _xrLightRoot;
8
+ private _xrModelRoot;
9
+ private _xrHandNode;
10
+ get XRModelRoot(): DIVERoot;
11
+ get XRLightRoot(): DIVEXRLightRoot;
12
+ get XRHandNode(): Object3D;
13
+ private _xrShadowPlane;
14
+ constructor(scene: DIVEScene);
15
+ InitLightEstimation(renderer: DIVERenderer): void;
16
+ DisposeLightEstimation(): void;
17
+ }
@@ -0,0 +1,13 @@
1
+ import { DIVERenderer } from '../../../renderer/Renderer';
2
+ import { Object3D } from 'three';
3
+ import { DIVEScene } from '../../Scene';
4
+ export declare class DIVEXRLightRoot extends Object3D {
5
+ private _scene;
6
+ private _xrLight;
7
+ private _lightRoot;
8
+ constructor(scene: DIVEScene);
9
+ InitLightEstimation(renderer: DIVERenderer): void;
10
+ DisposeLightEstimation(): void;
11
+ private onEstimationStart;
12
+ private onEstimationEnd;
13
+ }
@@ -0,0 +1,48 @@
1
+ import { Intersection, Object3D, Raycaster, Vector2, Vector3 } from 'three';
2
+ import { DIVEScene } from '../scene/Scene';
3
+ import { default as DIVEOrbitControls } from '../controls/OrbitControls';
4
+ import { DIVEDraggable } from '../interface/Draggable';
5
+ import { DIVEHoverable } from '../interface/Hoverable';
6
+ export type DraggableEvent = {
7
+ dragStart: Vector3;
8
+ dragCurrent: Vector3;
9
+ dragEnd: Vector3;
10
+ dragDelta: Vector3;
11
+ };
12
+ export declare abstract class DIVEBaseTool {
13
+ readonly POINTER_DRAG_THRESHOLD: number;
14
+ name: string;
15
+ protected _canvas: HTMLElement;
16
+ protected _scene: DIVEScene;
17
+ protected _controller: DIVEOrbitControls;
18
+ protected _pointer: Vector2;
19
+ protected get _pointerAnyDown(): boolean;
20
+ protected _pointerPrimaryDown: boolean;
21
+ protected _pointerMiddleDown: boolean;
22
+ protected _pointerSecondaryDown: boolean;
23
+ protected _lastPointerDown: Vector2;
24
+ protected _lastPointerUp: Vector2;
25
+ protected _raycaster: Raycaster;
26
+ protected _intersects: Intersection[];
27
+ protected _hovered: (Object3D & DIVEHoverable) | null;
28
+ protected _dragging: boolean;
29
+ protected _dragStart: Vector3;
30
+ protected _dragCurrent: Vector3;
31
+ protected _dragEnd: Vector3;
32
+ protected _dragDelta: Vector3;
33
+ protected _draggable: DIVEDraggable | null;
34
+ protected _dragRaycastOnObjects: Object3D[] | null;
35
+ protected constructor(scene: DIVEScene, controller: DIVEOrbitControls);
36
+ Activate(): void;
37
+ Deactivate(): void;
38
+ onPointerDown(e: PointerEvent): void;
39
+ onDragStart(e: PointerEvent): void;
40
+ onPointerMove(e: PointerEvent): void;
41
+ onDrag(e: PointerEvent): void;
42
+ onPointerUp(e: PointerEvent): void;
43
+ onClick(e: PointerEvent): void;
44
+ onDragEnd(e: PointerEvent): void;
45
+ onWheel(e: WheelEvent): void;
46
+ protected raycast(objects?: Object3D[]): Intersection[];
47
+ private pointerWasDragged;
48
+ }
@@ -0,0 +1,31 @@
1
+ import { default as DIVEOrbitControls } from '../controls/OrbitControls.ts';
2
+ import { DIVEScene } from '../scene/Scene.ts';
3
+ import { DIVEBaseTool } from './BaseTool.ts';
4
+ import { DIVESelectTool } from './select/SelectTool.ts';
5
+ export type ToolType = 'select' | 'none';
6
+ /**
7
+ * A Toolbox to activate and deactivate tools to use with the pointer.
8
+ *
9
+ * @module
10
+ */
11
+ export default class DIVEToolbox {
12
+ static readonly DefaultTool = "select";
13
+ private _scene;
14
+ private _controller;
15
+ private _activeTool;
16
+ private _selectTool;
17
+ get selectTool(): DIVESelectTool;
18
+ constructor(scene: DIVEScene, controller: DIVEOrbitControls);
19
+ Dispose(): void;
20
+ GetActiveTool(): DIVEBaseTool | null;
21
+ UseTool(tool: ToolType): void;
22
+ SetGizmoMode(mode: 'translate' | 'rotate' | 'scale'): void;
23
+ SetGizmoVisibility(active: boolean): void;
24
+ SetGizmoScaleLinked(linked: boolean): void;
25
+ onPointerMove(e: PointerEvent): void;
26
+ onPointerDown(e: PointerEvent): void;
27
+ onPointerUp(e: PointerEvent): void;
28
+ onWheel(e: WheelEvent): void;
29
+ private addEventListeners;
30
+ private removeEventListeners;
31
+ }