@shopware-ag/dive 2.0.2 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/build/chunks/{AssetCache-CuVztq_7.cjs → AssetCache-BQRROeKj.cjs} +1 -1
- package/build/chunks/{AssetCache-CiC4wZkh.mjs → AssetCache-D-tIG2cD.mjs} +1 -1
- package/build/chunks/{AssetLoader-DUhBw4FF.cjs → AssetLoader-CoPAaRfM.cjs} +1 -1
- package/build/chunks/{AssetLoader-o_4syRGj.mjs → AssetLoader-Da8hFXRL.mjs} +2 -2
- package/build/chunks/FileTypes-B2n185uW.cjs +29 -0
- package/build/chunks/FileTypes-CTHWb2IV.mjs +1878 -0
- package/build/chunks/PerspectiveCamera-8tnOn5YS.mjs +39 -0
- package/build/chunks/PerspectiveCamera-Dp8ElZGj.cjs +1 -0
- package/build/chunks/{SelectTool-6ZRGPwYE.mjs → SelectTool-Bcc2oxWf.mjs} +2 -2
- package/build/chunks/SelectTool-ut3Qwv63.cjs +1 -0
- package/build/{src/components → components}/index.d.ts +1 -0
- package/build/{src/components → components}/model/Model.d.ts +3 -2
- package/build/dive.cjs +1 -1
- package/build/dive.d.ts +1 -1
- package/build/dive.mjs +69 -68
- package/build/engine/AsciiArt.d.ts +1 -0
- package/build/engine/Dive.d.ts +98 -0
- package/build/{src/engine → engine}/camera/PerspectiveCamera.d.ts +1 -0
- package/build/{src/engine → engine}/clock/Clock.d.ts +1 -4
- package/build/{src/engine → engine}/index.d.ts +2 -1
- package/build/{src/engine → engine}/renderer/Renderer.d.ts +12 -5
- package/build/{src/engine → engine}/resize/ResizeManager.d.ts +5 -2
- package/build/engine/scene/Scene.d.ts +41 -0
- package/build/{src/engine → engine}/scene/xrroot/XRRoot.d.ts +2 -2
- package/build/{src/engine → engine}/scene/xrroot/xrlightroot/XRLightRoot.d.ts +2 -2
- package/build/engine/view/View.d.ts +24 -0
- package/build/{src/index.d.ts → index.d.ts} +1 -1
- package/build/plugins/animation/index.cjs +1 -1
- package/build/plugins/animation/index.d.ts +2 -2
- package/build/plugins/animation/index.mjs +11 -11
- package/build/plugins/ar/index.cjs +1 -1
- package/build/plugins/ar/index.d.ts +4 -2
- package/build/plugins/ar/index.mjs +27 -27
- package/build/{src/plugins → plugins}/ar/src/webxr/WebXR.d.ts +2 -2
- package/build/{src/plugins → plugins}/ar/src/webxr/controller/WebXRController.d.ts +2 -2
- package/build/{src/plugins → plugins}/ar/src/webxr/origin/WebXROrigin.d.ts +2 -2
- package/build/{src/plugins → plugins}/ar/src/webxr/raycaster/WebXRRaycaster.d.ts +2 -2
- package/build/{src/plugins → plugins}/ar/src/webxr/raycaster/ar/WebXRRaycasterAR.d.ts +2 -2
- package/build/{src/plugins → plugins}/ar/src/webxr/raycaster/three/WebXRRaycasterTHREE.d.ts +2 -2
- package/build/plugins/assetcache/index.cjs +1 -1
- package/build/plugins/assetcache/index.d.ts +1 -2
- package/build/plugins/assetcache/index.mjs +1 -1
- package/build/plugins/assetconverter/index.d.ts +1 -2
- package/build/plugins/assetexporter/index.d.ts +1 -2
- package/build/plugins/assetloader/index.cjs +1 -1
- package/build/plugins/assetloader/index.d.ts +3 -2
- package/build/plugins/assetloader/index.mjs +1 -1
- package/build/plugins/mediacreator/index.cjs +1 -1
- package/build/plugins/mediacreator/index.d.ts +2 -2
- package/build/plugins/mediacreator/index.mjs +8 -8
- package/build/{src/plugins → plugins}/mediacreator/src/MediaCreator.d.ts +2 -2
- package/build/plugins/orbitcontroller/index.cjs +1 -1
- package/build/plugins/orbitcontroller/index.d.ts +1 -2
- package/build/plugins/orbitcontroller/index.mjs +1 -1
- package/build/plugins/orbitcontroller/src/OrbitController.d.ts +195 -0
- package/build/plugins/orbitcontroller/types/OrbitControllerState.types.d.ts +9 -0
- package/build/plugins/orbitcontroller/types/index.d.ts +1 -0
- package/build/plugins/orientationdisplay/index.cjs +1 -1
- package/build/plugins/orientationdisplay/index.d.ts +2 -2
- package/build/plugins/orientationdisplay/index.mjs +1 -1
- package/build/{src/plugins → plugins}/orientationdisplay/src/OrientationDisplay.d.ts +2 -2
- package/build/plugins/quickview/index.cjs +1 -0
- package/build/plugins/quickview/index.d.ts +2 -0
- package/build/plugins/quickview/index.mjs +28 -0
- package/build/plugins/quickview/src/QuickView.d.ts +14 -0
- package/build/plugins/quickview/types/QuickViewSettings.d.ts +4 -0
- package/build/plugins/quickview/types/index.d.ts +1 -0
- package/build/plugins/state/index.cjs +7 -7
- package/build/plugins/state/index.d.ts +4 -2
- package/build/plugins/state/index.mjs +498 -500
- package/build/{src/plugins → plugins}/state/src/State.d.ts +2 -2
- package/build/{src/plugins → plugins}/state/src/actions/media/generatemedia.d.ts +1 -1
- package/build/{src/plugins → plugins}/state/types/ActionTypes.d.ts +2 -2
- package/build/plugins/systeminfo/index.d.ts +2 -2
- package/build/plugins/toolbox/index.cjs +1 -1
- package/build/plugins/toolbox/index.d.ts +5 -2
- package/build/plugins/toolbox/index.mjs +2 -2
- package/package.json +6 -1
- package/build/chunks/FileTypes-B2VTJIm5.cjs +0 -30
- package/build/chunks/FileTypes-C8pTXmiC.mjs +0 -1059
- package/build/chunks/MathUtils-CBW56ZuG.cjs +0 -1
- package/build/chunks/MathUtils-CFGjHuVF.mjs +0 -159
- package/build/chunks/OrbitController-BQ6SV1O_.mjs +0 -1159
- package/build/chunks/OrbitController-CpFQ3A1H.cjs +0 -1
- package/build/chunks/PerspectiveCamera-BByyG5R4.cjs +0 -1
- package/build/chunks/PerspectiveCamera-PMJPzAn3.mjs +0 -34
- package/build/chunks/SelectTool-B1awJ9PA.cjs +0 -1
- package/build/chunks/VisibilityLayerMask-BI7jPKdx.cjs +0 -1
- package/build/chunks/VisibilityLayerMask-CXgt1fJc.mjs +0 -8
- package/build/chunks/package-AmvzOXm_.cjs +0 -1
- package/build/chunks/package-BrpVRfq7.mjs +0 -39
- package/build/src/core/Dive.d.ts +0 -58
- package/build/src/core/index.d.ts +0 -1
- package/build/src/engine/Engine.d.ts +0 -28
- package/build/src/engine/scene/Scene.d.ts +0 -19
- package/build/src/plugins/animation/index.d.ts +0 -2
- package/build/src/plugins/ar/index.d.ts +0 -4
- package/build/src/plugins/assetcache/index.d.ts +0 -1
- package/build/src/plugins/assetconverter/index.d.ts +0 -1
- package/build/src/plugins/assetexporter/index.d.ts +0 -1
- package/build/src/plugins/assetloader/index.d.ts +0 -3
- package/build/src/plugins/mediacreator/index.d.ts +0 -2
- package/build/src/plugins/orbitcontroller/index.d.ts +0 -1
- package/build/src/plugins/orbitcontroller/src/OrbitController.d.ts +0 -45
- package/build/src/plugins/orientationdisplay/index.d.ts +0 -2
- package/build/src/plugins/state/index.d.ts +0 -4
- package/build/src/plugins/systeminfo/index.d.ts +0 -2
- package/build/src/plugins/toolbox/index.d.ts +0 -5
- /package/build/{src/components → components}/boundingbox/BoundingBox.d.ts +0 -0
- /package/build/{src/components → components}/floor/Floor.d.ts +0 -0
- /package/build/{src/components → components}/gizmo/Gizmo.d.ts +0 -0
- /package/build/{src/components → components}/gizmo/handles/AxisHandle.d.ts +0 -0
- /package/build/{src/components → components}/gizmo/handles/RadialHandle.d.ts +0 -0
- /package/build/{src/components → components}/gizmo/handles/ScaleHandle.d.ts +0 -0
- /package/build/{src/components → components}/gizmo/plane/GizmoPlane.d.ts +0 -0
- /package/build/{src/components → components}/gizmo/rotate/RotateGizmo.d.ts +0 -0
- /package/build/{src/components → components}/gizmo/scale/ScaleGizmo.d.ts +0 -0
- /package/build/{src/components → components}/gizmo/translate/TranslateGizmo.d.ts +0 -0
- /package/build/{src/components → components}/grid/Grid.d.ts +0 -0
- /package/build/{src/components → components}/group/Group.d.ts +0 -0
- /package/build/{src/components → components}/light/AmbientLight.d.ts +0 -0
- /package/build/{src/components → components}/light/PointLight.d.ts +0 -0
- /package/build/{src/components → components}/light/SceneLight.d.ts +0 -0
- /package/build/{src/components → components}/light/index.d.ts +0 -0
- /package/build/{src/components → components}/node/Node.d.ts +0 -0
- /package/build/{src/components → components}/primitive/Primitive.d.ts +0 -0
- /package/build/{src/components → components}/root/Root.d.ts +0 -0
- /package/build/{src/constants → constants}/AxisHelperColors.d.ts +0 -0
- /package/build/{src/constants → constants}/GridColors.d.ts +0 -0
- /package/build/{src/constants → constants}/VisibilityLayerMask.d.ts +0 -0
- /package/build/{src/constants → constants}/index.d.ts +0 -0
- /package/build/{src/error → error}/file-content/file-content-error.d.ts +0 -0
- /package/build/{src/error → error}/file-type/file-type-error.d.ts +0 -0
- /package/build/{src/error → error}/index.d.ts +0 -0
- /package/build/{src/error → error}/network/network-error.d.ts +0 -0
- /package/build/{src/error → error}/parse/parse-error.d.ts +0 -0
- /package/build/{src/events → events}/dispatcher/EventDispatcher.d.ts +0 -0
- /package/build/{src/events → events}/index.d.ts +0 -0
- /package/build/{src/helpers → helpers}/applyMixins/applyMixins.d.ts +0 -0
- /package/build/{src/helpers → helpers}/deepClone/deepClone.d.ts +0 -0
- /package/build/{src/helpers → helpers}/findInterface/findInterface.d.ts +0 -0
- /package/build/{src/helpers → helpers}/findSceneRecursive/findSceneRecursive.d.ts +0 -0
- /package/build/{src/helpers → helpers}/getFileTypeFromUri/getFileTypeFromUri.d.ts +0 -0
- /package/build/{src/helpers → helpers}/getObjectDelta/getObjectDelta.d.ts +0 -0
- /package/build/{src/helpers → helpers}/implementsInterface/implementsInterface.d.ts +0 -0
- /package/build/{src/helpers → helpers}/index.d.ts +0 -0
- /package/build/{src/helpers → helpers}/isFileTypeSupported/isFileTypeSupported.d.ts +0 -0
- /package/build/{src/helpers → helpers}/math/ceil/ceilExp.d.ts +0 -0
- /package/build/{src/helpers → helpers}/math/degToRad/degToRad.d.ts +0 -0
- /package/build/{src/helpers → helpers}/math/floor/floorExp.d.ts +0 -0
- /package/build/{src/helpers → helpers}/math/helper/shift.d.ts +0 -0
- /package/build/{src/helpers → helpers}/math/index.d.ts +0 -0
- /package/build/{src/helpers → helpers}/math/radToDeg/radToDeg.d.ts +0 -0
- /package/build/{src/helpers → helpers}/math/round/roundExp.d.ts +0 -0
- /package/build/{src/helpers → helpers}/math/signedAngleTo/signedAngleTo.d.ts +0 -0
- /package/build/{src/helpers → helpers}/math/toFixed/toFixedExp.d.ts +0 -0
- /package/build/{src/helpers → helpers}/math/truncate/truncateExp.d.ts +0 -0
- /package/build/{src/interfaces → interfaces}/Draggable.d.ts +0 -0
- /package/build/{src/interfaces → interfaces}/Hoverable.d.ts +0 -0
- /package/build/{src/interfaces → interfaces}/Movable.d.ts +0 -0
- /package/build/{src/interfaces → interfaces}/Rotatable.d.ts +0 -0
- /package/build/{src/interfaces → interfaces}/Scalable.d.ts +0 -0
- /package/build/{src/interfaces → interfaces}/Selectable.d.ts +0 -0
- /package/build/{src/interfaces → interfaces}/index.d.ts +0 -0
- /package/build/{src/plugins → plugins}/animation/src/animator/Animator.d.ts +0 -0
- /package/build/{src/plugins → plugins}/animation/src/index.d.ts +0 -0
- /package/build/{src/plugins → plugins}/animation/src/system/AnimationSystem.d.ts +0 -0
- /package/build/{src/plugins → plugins}/animation/src/types/AnimatorParameters.d.ts +0 -0
- /package/build/{src/plugins → plugins}/ar/src/ARSystem.d.ts +0 -0
- /package/build/{src/plugins → plugins}/ar/src/arquicklook/ARQuickLook.d.ts +0 -0
- /package/build/{src/plugins → plugins}/ar/src/error/ar-errors.d.ts +0 -0
- /package/build/{src/plugins → plugins}/ar/src/sceneviewer/SceneViewer.d.ts +0 -0
- /package/build/{src/plugins → plugins}/ar/src/webxr/crosshair/WebXRCrosshair.d.ts +0 -0
- /package/build/{src/plugins → plugins}/ar/src/webxr/overlay/Overlay.d.ts +0 -0
- /package/build/{src/plugins → plugins}/ar/src/webxr/touchscreencontrols/WebXRTouchscreenControls.d.ts +0 -0
- /package/build/{src/plugins → plugins}/assetcache/src/cache/AssetCache.d.ts +0 -0
- /package/build/{src/plugins → plugins}/assetcache/src/chunk/Chunk.d.ts +0 -0
- /package/build/{src/plugins → plugins}/assetcache/src/index.d.ts +0 -0
- /package/build/{src/plugins → plugins}/assetconverter/src/AssetConverter.d.ts +0 -0
- /package/build/{src/plugins → plugins}/assetexporter/src/AssetExporter.d.ts +0 -0
- /package/build/{src/plugins → plugins}/assetloader/src/draco/DracoLoader.d.ts +0 -0
- /package/build/{src/plugins → plugins}/assetloader/src/loader/AssetLoader.d.ts +0 -0
- /package/build/{src/plugins → plugins}/mediacreator/types/MediaGenerationById.d.ts +0 -0
- /package/build/{src/plugins → plugins}/mediacreator/types/MediaGenerationByPosition.d.ts +0 -0
- /package/build/{src/plugins → plugins}/mediacreator/types/MediaGenerationResolution.d.ts +0 -0
- /package/build/{src/plugins → plugins}/mediacreator/types/index.d.ts +0 -0
- /package/build/{src/plugins → plugins}/orientationdisplay/src/axes/Axes.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/ActionRegistry.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/action.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/ar/index.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/ar/launchar.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/camera/computeencompassingview.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/camera/getcameratransform.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/camera/index.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/camera/lockcamera.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/camera/movecamera.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/camera/setcameralayer.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/camera/setcameratransform.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/camera/zoomcamera.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/index.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/media/index.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/object/addobject.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/object/deleteobject.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/object/deselectobject.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/object/dropit.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/object/getallobjects.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/object/getobjects.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/object/index.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/object/modelloaded.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/object/placeonfloor.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/object/selectobject.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/object/setparent.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/object/updateobject.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/renderer/index.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/renderer/startrender.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/scene/exportscene.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/scene/getallscenedata.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/scene/index.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/scene/setbackground.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/scene/updatescene.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/toolbox/index.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/toolbox/setgizmomode.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/toolbox/setgizmoscalelinked.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/toolbox/setgizmovisible.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/src/actions/toolbox/usetool.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/types/StateExportFileType.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/types/StateSceneData.d.ts +0 -0
- /package/build/{src/plugins → plugins}/state/types/index.d.ts +0 -0
- /package/build/{src/plugins → plugins}/systeminfo/src/SystemInfo.d.ts +0 -0
- /package/build/{src/plugins → plugins}/systeminfo/types/index.d.ts +0 -0
- /package/build/{src/plugins → plugins}/toolbox/src/BaseTool.d.ts +0 -0
- /package/build/{src/plugins → plugins}/toolbox/src/Toolbox.d.ts +0 -0
- /package/build/{src/plugins → plugins}/toolbox/src/select/SelectTool.d.ts +0 -0
- /package/build/{src/plugins → plugins}/toolbox/src/transform/TransformTool.d.ts +0 -0
- /package/build/{src/plugins → plugins}/toolbox/types/ToolType.d.ts +0 -0
- /package/build/{src/plugins → plugins}/toolbox/types/index.d.ts +0 -0
- /package/build/{src/types → types}/components/DIVELight.d.ts +0 -0
- /package/build/{src/types → types}/components/DIVESceneObject.d.ts +0 -0
- /package/build/{src/types → types}/components/index.d.ts +0 -0
- /package/build/{src/types → types}/file/FileTypes.d.ts +0 -0
- /package/build/{src/types → types}/file/index.d.ts +0 -0
- /package/build/{src/types → types}/index.d.ts +0 -0
- /package/build/{src/types → types}/schema/BaseEntitySchema.d.ts +0 -0
- /package/build/{src/types → types}/schema/EntitySchema.d.ts +0 -0
- /package/build/{src/types → types}/schema/EntityTypeSchema.d.ts +0 -0
- /package/build/{src/types → types}/schema/GeometrySchema.d.ts +0 -0
- /package/build/{src/types → types}/schema/GeometryTypeSchema.d.ts +0 -0
- /package/build/{src/types → types}/schema/GroupSchema.d.ts +0 -0
- /package/build/{src/types → types}/schema/LightSchema.d.ts +0 -0
- /package/build/{src/types → types}/schema/MaterialSchema.d.ts +0 -0
- /package/build/{src/types → types}/schema/ModelSchema.d.ts +0 -0
- /package/build/{src/types → types}/schema/PovSchema.d.ts +0 -0
- /package/build/{src/types → types}/schema/PrimitiveSchema.d.ts +0 -0
- /package/build/{src/types → types}/schema/index.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DIVE } from '../../../index.ts';
|
|
2
2
|
import { OrbitController } from '../../orbitcontroller/index.ts';
|
|
3
3
|
import { ActionPayload, ActionReturn } from '../types/index.ts';
|
|
4
4
|
export type ActionSubscriber<ActionType extends keyof ActionTypes> = (payload: ActionPayload<ActionTypes[ActionType]>) => void;
|
|
@@ -22,7 +22,7 @@ export declare class State {
|
|
|
22
22
|
private getToolbox;
|
|
23
23
|
private registered;
|
|
24
24
|
private listeners;
|
|
25
|
-
constructor(
|
|
25
|
+
constructor(dive: DIVE, controller: OrbitController);
|
|
26
26
|
destroyInstance(): boolean;
|
|
27
27
|
performAction<ActionType extends keyof ActionTypes>(action: ActionType, ...args: ActionPayload<ActionTypes[ActionType]> extends void ? [] : [ActionPayload<ActionTypes[ActionType]>]): ActionReturn<ActionTypes[ActionType]>;
|
|
28
28
|
subscribe<ActionType extends keyof ActionTypes>(type: ActionType, listener: ActionSubscriber<ActionType>): ActionUnsubscribe;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Action } from '../action.ts';
|
|
2
2
|
import { ActionDependencies } from '../../../types/index.ts';
|
|
3
3
|
import { MediaGenerationByPosition, MediaGenerationById } from '../../../../mediacreator/index.ts';
|
|
4
|
-
export declare const GenerateMediaAction: new (payload:
|
|
4
|
+
export declare const GenerateMediaAction: new (payload: MediaGenerationById | MediaGenerationByPosition, dependencies: Pick<ActionDependencies, "registered" | "getMediaCreator">) => Action<MediaGenerationById | MediaGenerationByPosition, Pick<ActionDependencies, "registered" | "getMediaCreator">, Promise<string>>;
|
|
5
5
|
declare global {
|
|
6
6
|
interface ActionTypes {
|
|
7
7
|
GENERATE_MEDIA: typeof GenerateMediaAction;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DIVE, EntitySchema } from '../../../index.ts';
|
|
2
2
|
import { OrbitController } from '../../orbitcontroller/index.ts';
|
|
3
3
|
export type ActionPayload<T> = T extends new (payload: infer P, dependencies: infer D) => unknown ? P : never;
|
|
4
4
|
export type ActionReturn<T> = T extends new (payload: infer P, dependencies: infer D) => infer ClassInstance ? ClassInstance extends {
|
|
@@ -7,7 +7,7 @@ export type ActionReturn<T> = T extends new (payload: infer P, dependencies: inf
|
|
|
7
7
|
export type ActionDeps<T> = T extends new (payload: unknown, dependencies: infer D) => unknown ? D extends Partial<ActionDependencies> ? D : never : never;
|
|
8
8
|
export interface ActionDependencies {
|
|
9
9
|
registered: Map<string, EntitySchema>;
|
|
10
|
-
engine:
|
|
10
|
+
engine: DIVE;
|
|
11
11
|
controller: OrbitController;
|
|
12
12
|
getAnimationSystem: () => Promise<import('../../animation/index.ts').AnimationSystem>;
|
|
13
13
|
getARSystem: () => Promise<import('../../ar/index.ts').ARSystem>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export {}
|
|
1
|
+
export { SystemInfo, EBrowser } from './src/SystemInfo.ts';
|
|
2
|
+
export { ESystem, EWebXRUnsupportedReason } from './types/index.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var s=Object.defineProperty;var r=(t,e,o)=>e in t?s(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var l=(t,e,o)=>r(t,typeof e!="symbol"?e+"":e,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../chunks/SelectTool-
|
|
1
|
+
"use strict";var s=Object.defineProperty;var r=(t,e,o)=>e in t?s(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var l=(t,e,o)=>r(t,typeof e!="symbol"?e+"":e,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../chunks/SelectTool-ut3Qwv63.cjs");class i{constructor(e,o){l(this,"_scene");l(this,"_controller");l(this,"_activeTool");l(this,"_selectTool");this._scene=e,this._controller=o,this._selectTool=null,this._activeTool=null}get selectTool(){return this._selectTool||(this._selectTool=new n.DIVESelectTool(this._scene,this._controller)),this._selectTool}dispose(){this.removeEventListeners()}getActiveTool(){return this._activeTool}useTool(e){var o;switch((o=this._activeTool)==null||o.deactivate(),e){case"select":{this.addEventListeners(),this.selectTool.activate(),this._activeTool=this.selectTool;break}case"none":{this.removeEventListeners(),this._activeTool=null;break}default:console.warn(`DIVEToolBox.useTool: Unknown tool: ${e}`)}}setGizmoMode(e){this.selectTool.setGizmoMode(e)}setGizmoVisible(e){this.selectTool.setGizmoVisible(e)}setGizmoScaleLinked(e){this.selectTool.setGizmoScaleLinked(e)}onPointerMove(e){var o;(o=this._activeTool)==null||o.onPointerMove(e)}onPointerDown(e){var o;(o=this._activeTool)==null||o.onPointerDown(e)}onPointerUp(e){var o;(o=this._activeTool)==null||o.onPointerUp(e)}onWheel(e){var o;(o=this._activeTool)==null||o.onWheel(e)}addEventListeners(){this._controller.domElement.addEventListener("pointermove",e=>this.onPointerMove(e)),this._controller.domElement.addEventListener("pointerdown",e=>this.onPointerDown(e)),this._controller.domElement.addEventListener("pointerup",e=>this.onPointerUp(e)),this._controller.domElement.addEventListener("wheel",e=>this.onWheel(e))}removeEventListeners(){this._controller.domElement.removeEventListener("pointermove",e=>this.onPointerMove(e)),this._controller.domElement.removeEventListener("pointerdown",e=>this.onPointerDown(e)),this._controller.domElement.removeEventListener("pointerup",e=>this.onPointerUp(e)),this._controller.domElement.removeEventListener("wheel",e=>this.onWheel(e))}}l(i,"DefaultTool","select");exports.DIVEBaseTool=n.DIVEBaseTool;exports.DIVESelectTool=n.DIVESelectTool;exports.DIVETransformTool=n.DIVETransformTool;exports.isSelectTool=n.isSelectTool;exports.isTransformTool=n.isTransformTool;exports.Toolbox=i;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var i = Object.defineProperty;
|
|
2
2
|
var s = (t, e, o) => e in t ? i(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o;
|
|
3
3
|
var n = (t, e, o) => s(t, typeof e != "symbol" ? e + "" : e, o);
|
|
4
|
-
import { D as l } from "../../chunks/SelectTool-
|
|
5
|
-
import { a as m, c as T, i as d, b as _ } from "../../chunks/SelectTool-
|
|
4
|
+
import { D as l } from "../../chunks/SelectTool-Bcc2oxWf.mjs";
|
|
5
|
+
import { a as m, c as T, i as d, b as _ } from "../../chunks/SelectTool-Bcc2oxWf.mjs";
|
|
6
6
|
class r {
|
|
7
7
|
constructor(e, o) {
|
|
8
8
|
n(this, "_scene");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopware-ag/dive",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Shopware Spatial Framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "build/dive.cjs",
|
|
@@ -57,6 +57,11 @@
|
|
|
57
57
|
"import": "./build/plugins/orientationdisplay/index.mjs",
|
|
58
58
|
"require": "./build/plugins/orientationdisplay/index.cjs"
|
|
59
59
|
},
|
|
60
|
+
"./quickview": {
|
|
61
|
+
"types": "./build/plugins/quickview/index.d.ts",
|
|
62
|
+
"import": "./build/plugins/quickview/index.mjs",
|
|
63
|
+
"require": "./build/plugins/quickview/index.cjs"
|
|
64
|
+
},
|
|
60
65
|
"./state": {
|
|
61
66
|
"types": "./build/plugins/state/index.d.ts",
|
|
62
67
|
"import": "./build/plugins/state/index.mjs",
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";var H=Object.defineProperty;var $=(a,i,e)=>i in a?H(a,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[i]=e;var r=(a,i,e)=>$(a,typeof i!="symbol"?i+"":i,e);const m=require("./OrbitController-CpFQ3A1H.cjs"),s=require("three"),l=require("./VisibilityLayerMask-BI7jPKdx.cjs"),C=require("./PerspectiveCamera-BByyG5R4.cjs"),p=require("three-spritetext");class L extends s.Object3D{constructor(){super();r(this,"_axesHelper");this._axesHelper=new s.AxesHelper(.5),this._axesHelper.layers.mask=l.COORDINATE_LAYER_MASK,this._axesHelper.material.depthTest=!1,this._axesHelper.position.set(0,0,-1),this._axesHelper.setColors(new s.Color(Y),new s.Color(N),new s.Color(W));const e=new p("X",.2,D),t=new p("Y",.2,v),n=new p("Z",.2,b);e.layers.mask=l.COORDINATE_LAYER_MASK,t.layers.mask=l.COORDINATE_LAYER_MASK,n.layers.mask=l.COORDINATE_LAYER_MASK,e.position.set(.7,0,0),t.position.set(0,.7,0),n.position.set(0,0,.7),this._axesHelper.add(e),this._axesHelper.add(t),this._axesHelper.add(n)}setFromCameraMatrix(e){this._axesHelper.rotation.setFromRotationMatrix(new s.Matrix4().extractRotation(e).invert())}}class S{constructor(i,e,t){r(this,"uuid",s.MathUtils.generateUUID());r(this,"_axes");r(this,"_orthographicCamera");r(this,"_restoreViewport",new s.Vector4);this._renderer=i,this._scene=e,this._camera=t,this._orthographicCamera=new s.OrthographicCamera(-1,1,1,-1,.1,100),this._orthographicCamera.layers.mask=l.COORDINATE_LAYER_MASK,this._scene.add(this._orthographicCamera),this._axes=new L,this._scene.add(this._axes)}tick(){const i=this._scene.background;this._scene.background=null,this._renderer.webglrenderer.getViewport(this._restoreViewport),this._renderer.webglrenderer.setViewport(0,0,150,150),this._renderer.webglrenderer.autoClear=!1,this._axes.setFromCameraMatrix(this._camera.matrix),this._renderer.webglrenderer.render(this._scene,this._orthographicCamera),this._renderer.webglrenderer.setViewport(this._restoreViewport),this._renderer.webglrenderer.autoClear=!0,this._scene.background=i}dispose(){this._scene.remove(this._axes),this._scene.remove(this._orthographicCamera)}}class x extends s.Object3D{constructor(){super();r(this,"isDIVELight",!0);r(this,"isDIVEAmbientLight",!0);r(this,"isSelectable",!0);r(this,"_light");this.name="DIVEAmbientLight",this._light=new s.AmbientLight(16777215,1),this._light.layers.mask=l.PRODUCT_LAYER_MASK,this.add(this._light)}setColor(e){this._light.color=e}setIntensity(e){this._light.intensity=e}setEnabled(e){this._light.visible=e}}class V extends s.Object3D{constructor(){super();r(this,"isDIVELight",!0);r(this,"isDIVEPointLight",!0);r(this,"isMovable",!0);r(this,"isSelectable",!0);r(this,"gizmo",null);r(this,"light");r(this,"mesh");this.name="DIVEPointLight",this.light=new s.PointLight(16777215,1),this.light.layers.mask=l.PRODUCT_LAYER_MASK,this.light.castShadow=!0,this.light.shadow.mapSize.width=512,this.light.shadow.mapSize.height=512,this.add(this.light);const e=.1,t=new s.SphereGeometry(e,e*320,e*320),n=new s.MeshBasicMaterial({color:this.light.color,transparent:!0,opacity:.8,side:s.FrontSide});this.mesh=new s.Mesh(t,n),this.mesh.layers.mask=l.UI_LAYER_MASK,this.add(this.mesh)}setColor(e){this.light.color=e,this.mesh.material.color=e}setIntensity(e){this.light.intensity=e,this.mesh.material.opacity=e>.8?.8:e*.8}setEnabled(e){this.light.visible=e}onMove(){Promise.resolve().then(()=>require("../plugins/state/index.cjs")).then(({State:e})=>{var t;(t=e.get(this.userData.id))==null||t.performAction("UPDATE_OBJECT",{id:this.userData.id,position:this.position})})}onSelect(){Promise.resolve().then(()=>require("../plugins/state/index.cjs")).then(({State:e})=>{var t;(t=e.get(this.userData.id))==null||t.performAction("SELECT_OBJECT",{id:this.userData.id})})}onDeselect(){Promise.resolve().then(()=>require("../plugins/state/index.cjs")).then(({State:e})=>{var t;(t=e.get(this.userData.id))==null||t.performAction("DESELECT_OBJECT",{id:this.userData.id})})}}class w extends s.Object3D{constructor(){super();r(this,"isDIVELight",!0);r(this,"isDIVESceneLight",!0);r(this,"isSelectable",!0);r(this,"_hemiLight");r(this,"_dirLight");this.name="DIVESceneLight",this._hemiLight=new s.HemisphereLight(16777215,16777215,2),this._hemiLight.layers.mask=l.PRODUCT_LAYER_MASK,this._hemiLight.position.set(0,50,0),this.add(this._hemiLight),this._dirLight=new s.DirectionalLight(16777215,3),this._dirLight.layers.mask=l.PRODUCT_LAYER_MASK,this._dirLight.position.set(1,1.75,1),this._dirLight.position.multiplyScalar(30),this._dirLight.castShadow=!0,this._dirLight.shadow.mapSize.width=2048,this._dirLight.shadow.mapSize.height=2048;const e=5;this._dirLight.shadow.camera.left=-5,this._dirLight.shadow.camera.right=e,this._dirLight.shadow.camera.top=e,this._dirLight.shadow.camera.bottom=-5,this._dirLight.shadow.camera.far=3500,this.add(this._dirLight)}setColor(e){this._hemiLight.color=e,this._dirLight.color=e}setIntensity(e){this._hemiLight.intensity=e*2,this._dirLight.intensity=e*3}setEnabled(e){this._hemiLight.visible=e,this._dirLight.visible=e}}const g=a=>a.parent?g(a.parent):a;class f extends m.DIVENode{constructor(){super(...arguments);r(this,"isDIVEModel",!0);r(this,"_mesh",null);r(this,"_material",null);r(this,"_assetLoader",null)}async _getAssetLoader(){return this._assetLoader||(this._assetLoader=new(await Promise.resolve().then(()=>require("../plugins/assetloader/index.cjs"))).AssetLoader),this._assetLoader}async setFromURL(e){const n=await(await this._getAssetLoader()).load(e);this.setFromGLTF(n),Promise.resolve().then(()=>require("../plugins/state/index.cjs")).then(({State:o})=>{var h;(h=o.get(this.userData.id))==null||h.performAction("MODEL_LOADED",{id:this.userData.id})})}setFromGLTF(e){this.clear(),this._boundingBox.makeEmpty(),e.traverse(t=>{t.castShadow=!0,t.receiveShadow=!0,t.layers.mask=this.layers.mask,this._boundingBox.expandByObject(t),!this._mesh&&"isMesh"in t&&(this._mesh=t,this._material?this._mesh.material=this._material:this._material=t.material)}),this.add(e)}setMaterial(e){this._material||(this._material=new s.MeshStandardMaterial),e.vertexColors!==void 0&&(this._material.vertexColors=e.vertexColors),e.color!==void 0&&this._material.color.set(e.color),e.map!==void 0&&(this._material.map=e.map),e.normalMap!==void 0&&(this._material.normalMap=e.normalMap),e.roughness!==void 0&&(this._material.roughness=e.roughness),e.roughnessMap!==void 0&&(this._material.roughnessMap=e.roughnessMap,this._material.roughnessMap&&(this._material.roughness=1)),e.metalness!==void 0&&(this._material.metalness=e.metalness),e.metalnessMap!==void 0&&(this._material.metalnessMap=e.metalnessMap,this._material.metalnessMap&&(this._material.metalness=1)),this._mesh&&(this._mesh.material=this._material)}placeOnFloor(){var o,h,d,c;const e=this.getWorldPosition(this._positionWorldBuffer),t=e.clone();(h=(o=this._mesh)==null?void 0:o.geometry)==null||h.computeBoundingBox();const n=(c=(d=this._mesh)==null?void 0:d.geometry)==null?void 0:c.boundingBox;!n||!this._mesh||(e.y=e.y-this._mesh.localToWorld(n.min.clone()).y,e.y!==t.y&&Promise.resolve().then(()=>require("../plugins/state/index.cjs")).then(({State:u})=>{var _;(_=u.get(this.userData.id))==null||_.performAction("UPDATE_OBJECT",{id:this.userData.id,position:e,rotation:this.rotation,scale:this.scale})}))}dropIt(){if(!this.parent){console.warn("DIVEModel: dropIt() called on a model that is not in the scene.",this);return}const e=this._boundingBox.min.y*this.scale.y,t=this.localToWorld(this._boundingBox.getCenter(new s.Vector3).multiply(this.scale));t.y=e+this.position.y;const n=new s.Raycaster(t,new s.Vector3(0,-1,0));n.layers.mask=l.PRODUCT_LAYER_MASK;const o=n.intersectObjects(g(this).root.children,!0);if(o.length>0){const h=o[0].object;h.geometry.computeBoundingBox();const d=h.geometry.boundingBox,c=h.localToWorld(d.max.clone()),u=this.position.clone(),_=this.position.clone().setY(c.y).sub(new s.Vector3(0,e,0));if(this.position.copy(_),this.position.y===u.y)return;this.onMove()}}}class M extends m.DIVENode{constructor(){super();r(this,"isDIVEPrimitive",!0);r(this,"_mesh");this._mesh=new s.Mesh,this._mesh.layers.mask=l.PRODUCT_LAYER_MASK,this._mesh.castShadow=!0,this._mesh.receiveShadow=!0,this._mesh.material=new s.MeshStandardMaterial,this.add(this._mesh)}setGeometry(e){const t=this.assembleGeometry(e);t&&(this._mesh.geometry=t,this._boundingBox.setFromObject(this._mesh))}setMaterial(e){const t=this._mesh.material;e.vertexColors!==void 0&&(t.vertexColors=e.vertexColors),e.color!==void 0&&(t.color=new s.Color(e.color)),e.map!==void 0&&(t.map=e.map),e.normalMap!==void 0&&(t.normalMap=e.normalMap),e.roughness!==void 0&&(t.roughness=e.roughness),e.roughnessMap!==void 0&&(t.roughnessMap=e.roughnessMap,t.roughnessMap&&(t.roughness=1)),e.metalness!==void 0&&(t.metalness=e.metalness),e.metalnessMap!==void 0&&(t.metalnessMap=e.metalnessMap,t.metalnessMap&&(t.metalness=0)),this._mesh&&(this._mesh.material=t)}placeOnFloor(){var o,h,d,c;const e=this.getWorldPosition(this._positionWorldBuffer),t=e.clone();(h=(o=this._mesh)==null?void 0:o.geometry)==null||h.computeBoundingBox();const n=(c=(d=this._mesh)==null?void 0:d.geometry)==null?void 0:c.boundingBox;!n||!this._mesh||(e.y=e.y-this._mesh.localToWorld(n.min.clone()).y,e.y!==t.y&&Promise.resolve().then(()=>require("../plugins/state/index.cjs")).then(({State:u})=>{var _;(_=u.get(this.userData.id))==null||_.performAction("UPDATE_OBJECT",{id:this.userData.id,position:e,rotation:this.rotation,scale:this.scale})}))}dropIt(){if(!this.parent){console.warn("DIVEPrimitive: dropIt() called on a model that is not in the scene.",this);return}const e=this._boundingBox.min.y*this.scale.y,t=this.localToWorld(this._boundingBox.getCenter(new s.Vector3).multiply(this.scale));t.y=e+this.position.y;const n=new s.Raycaster(t,new s.Vector3(0,-1,0));n.layers.mask=l.PRODUCT_LAYER_MASK;const o=n.intersectObjects(g(this).root.children,!0);if(o.length>0){const h=o[0].object;h.geometry.computeBoundingBox();const d=h.geometry.boundingBox,c=h.localToWorld(d.max.clone()),u=this.position.clone(),_=this.position.clone().setY(c.y).sub(new s.Vector3(0,e,0));if(this.position.copy(_),this.position.y===u.y)return;this.onMove()}}assembleGeometry(e){switch(this._mesh.material.flatShading=!1,e.name.toLowerCase()){case"cylinder":return this.createCylinderGeometry(e);case"sphere":return this.createSphereGeometry(e);case"pyramid":return this._mesh.material.flatShading=!0,this.createPyramidGeometry(e);case"cube":case"box":return this.createBoxGeometry(e);case"cone":return this.createConeGeometry(e);case"wall":return this.createWallGeometry(e);case"plane":return this.createPlaneGeometry(e);default:return console.warn("DIVEPrimitive.assembleGeometry: Invalid geometry type:",e.name.toLowerCase()),null}}createCylinderGeometry(e){const t=new s.CylinderGeometry(e.width/2,e.width/2,e.height,64);return t.translate(0,e.height/2,0),t}createSphereGeometry(e){return new s.SphereGeometry(e.width/2,256,256)}createPyramidGeometry(e){const t=new Float32Array([-e.width/2,0,-e.depth/2,e.width/2,0,-e.depth/2,e.width/2,0,e.depth/2,-e.width/2,0,e.depth/2,0,e.height,0]),n=new Uint16Array([0,1,2,0,2,3,0,4,1,1,4,2,2,4,3,3,4,0]),o=new s.BufferGeometry;return o.setAttribute("position",new s.BufferAttribute(t,3)),o.setIndex(new s.BufferAttribute(n,1)),o.computeVertexNormals(),o.computeBoundingBox(),o.computeBoundingSphere(),o}createBoxGeometry(e){const t=new s.BoxGeometry(e.width,e.height,e.depth);return t.translate(0,e.height/2,0),t}createConeGeometry(e){const t=new s.ConeGeometry(e.width/2,e.height,256);return t.translate(0,e.height/2,0),t}createWallGeometry(e){const t=new s.BoxGeometry(e.width,e.height,e.depth||.05,16);return t.translate(0,e.height/2,0),t}createPlaneGeometry(e){const t=new s.BoxGeometry(e.width,e.height,e.depth);return t.translate(0,e.height/2,0),t}}class R extends m.DIVENode{constructor(){super();r(this,"isDIVEGroup",!0);r(this,"_members");r(this,"_lines");this.name="DIVEGroup",this._members=[],this._lines=[]}get members(){return this._members}setPosition(e){super.setPosition(e),this._members.forEach(t=>{"isDIVENode"in t&&t.onMove()})}setLinesVisibility(e,t){if(!t){this._lines.forEach(o=>{o.visible=e});return}const n=this._members.indexOf(t);n!==-1&&(this._lines[n].visible=e)}attach(e){if(this._members.includes(e))return this;const t=this.createLine();return this.add(t),this._lines.push(t),super.attach(e),this._members.push(e),this._updateLineTo(t,e),this.setLinesVisibility(!0,e),this}remove(e){const t=this._members.indexOf(e);if(t===-1)return this;const n=this._lines[t];return super.remove(n),this._lines.splice(t,1),super.remove(e),this._members.splice(t,1),this}updateLineTo(e){const t=this._members.indexOf(e);t!==-1&&this._updateLineTo(this._lines[t],e)}createLine(){const e=new s.BufferGeometry,t=new s.LineDashedMaterial({color:6710886,dashSize:.05,gapSize:.025}),n=new s.Line(e,t);return n.visible=!1,n}_updateLineTo(e,t){const n=[new s.Vector3(0,0,0),t.position.clone()];e.geometry.setFromPoints(n),e.computeLineDistances()}}class k extends s.Mesh{constructor(){const e=new s.PlaneGeometry(1,1);e.scale(1e3,1e3,1),e.rotateX(-Math.PI/2);const t=new s.MeshStandardMaterial({color:new s.Color(16777215),side:s.FrontSide});super(e,t);r(this,"isDIVEFloor",!0);this.name="Floor",this.layers.mask=l.PRODUCT_LAYER_MASK,this.receiveShadow=!0}setVisibility(e){this.visible=e}setColor(e){this.material.color=new s.Color(e)}}class P extends s.Object3D{constructor(){super();r(this,"isDIVERoot",!0);r(this,"_floor");this.name="Root",this._floor=new k,this.add(this._floor)}get floor(){return this._floor}computeSceneBB(){const e=new s.Box3;return this.children.forEach(t=>{"isDIVEFloor"in t||t.traverse(n=>{"isObject3D"in n&&e.expandByObject(n)})}),e}getSceneObject(e){let t;return this.traverse(n=>{t||n.userData.id===e.id&&(t=n)}),t}addSceneObject(e){let t=this.getSceneObject(e);if(t)return console.warn(`DIVERoot.addSceneObject: Scene object with id ${e.id} already exists`),t;switch(e.entityType){case"pov":break;case"light":{switch(e.type){case"scene":{t=new w;break}case"ambient":{t=new x;break}case"point":{t=new V;break}default:throw new Error(`DIVERoot.addSceneObject: Unknown light type: ${e.type}`)}t.name=e.name,t.userData.id=e.id,this.add(t),this._updateLight(t,e);break}case"model":{t=new f,t.name=e.name,t.userData.id=e.id,t.userData.uri=e.uri,this.add(t),this._updateModel(t,e);break}case"primitive":{t=new M,t.name=e.name,t.userData.id=e.id,this.add(t),this._updatePrimitive(t,e);break}case"group":{t=new R,t.name=e.name,t.userData.id=e.id,this.add(t),this._updateGroup(t,e);break}default:throw new Error(`DIVERoot.addSceneObject: Unknown entity type: ${e.entityType}`)}return t}updateSceneObject(e){const t=this.getSceneObject(e);if(!t){console.warn(`DIVERoot.updateSceneObject: Scene object with id ${e.id} does not exist`);return}switch(e.entityType){case"pov":break;case"light":{this._updateLight(t,e);break}case"model":{this._updateModel(t,e);break}case"primitive":{this._updatePrimitive(t,e);break}case"group":{this._updateGroup(t,e);break}default:throw new Error(`DIVERoot.updateSceneObject: Unknown entity type: ${e.entityType}`)}}deleteSceneObject(e){const t=this.getSceneObject(e);if(!t){console.warn(`DIVERoot.deleteSceneObject: Object with id ${e.id} not found`);return}switch(e.entityType){case"pov":break;case"light":{this._deleteLight(t);break}case"model":{this._deleteModel(t);break}case"primitive":{this._deletePrimitive(t);break}case"group":{this._deleteGroup(t);break}default:throw new Error(`DIVERoot.deleteSceneObject: Unknown entity type: ${e.entityType}`)}}_updateLight(e,t){t.name!==void 0&&t.name!==null&&(e.name=t.name),t.position!==void 0&&t.position!==null&&e.position.set(t.position.x,t.position.y,t.position.z),t.intensity!==void 0&&t.intensity!==null&&e.setIntensity(t.intensity),t.enabled!==void 0&&t.enabled!==null&&e.setEnabled(t.enabled),t.color!==void 0&&t.color!==null&&e.setColor(new s.Color(t.color)),t.visible!==void 0&&t.visible!==null&&(e.visible=t.visible),t.parentId!==void 0&&this._setParent({...t,parentId:t.parentId})}_updateModel(e,t){t.uri!==void 0&&e.setFromURL(t.uri),t.name!==void 0&&(e.name=t.name),t.position!==void 0&&e.setPosition(t.position),t.rotation!==void 0&&e.setRotation(t.rotation),t.scale!==void 0&&e.setScale(t.scale),t.visible!==void 0&&e.setVisibility(t.visible),t.material!==void 0&&e.setMaterial(t.material),t.parentId!==void 0&&this._setParent({...t,parentId:t.parentId})}_updatePrimitive(e,t){t.name!==void 0&&(e.name=t.name),t.geometry!==void 0&&e.setGeometry(t.geometry),t.position!==void 0&&e.setPosition(t.position),t.rotation!==void 0&&e.setRotation(t.rotation),t.scale!==void 0&&e.setScale(t.scale),t.visible!==void 0&&e.setVisibility(t.visible),t.material!==void 0&&e.setMaterial(t.material),t.parentId!==void 0&&this._setParent({...t,parentId:t.parentId})}_updateGroup(e,t){t.name!==void 0&&(e.name=t.name),t.position!==void 0&&e.setPosition(t.position),t.rotation!==void 0&&e.setRotation(t.rotation),t.scale!==void 0&&e.setScale(t.scale),t.visible!==void 0&&e.setVisibility(t.visible),t.bbVisible!==void 0&&e.setLinesVisibility(t.bbVisible),t.parentId!==void 0&&this._setParent({...t,parentId:t.parentId})}_deleteLight(e){this._detachTransformControls(e),e.parent.remove(e)}_deleteModel(e){this._detachTransformControls(e),e.parent.remove(e)}_deletePrimitive(e){this._detachTransformControls(e),e.parent.remove(e)}_deleteGroup(e){this._detachTransformControls(e);for(let t=e.members.length-1;t>=0;t--)this.attach(e.members[t]);e.parent.remove(e)}_setParent(e){const t=this.getSceneObject(e);if(e.parentId!==null){const n=this.getSceneObject({id:e.parentId,entityType:e.entityType});if(!n)return;n.attach(t)}else this.attach(t)}_detachTransformControls(e){this._findScene(e).children.find(t=>{"isTransformControls"in t&&t.detach()})}_findScene(e){return e.parent!==null?this._findScene(e.parent):e}}const A="#888888",T="#dddddd";class B extends s.Object3D{constructor(){super(),this.name="Grid";const i=new s.GridHelper(100,100,A,T);i.material.depthTest=!1,i.layers.mask=l.HELPER_LAYER_MASK,this.add(i)}setVisibility(i){this.visible=i}}class O extends s.Scene{constructor(){super();r(this,"_root");r(this,"_grid");this.background=new s.Color(16777215),this._root=new P,this.add(this._root),this._grid=new B,this.add(this._grid)}get root(){return this._root}get grid(){return this._grid}setBackground(e){this.background=new s.Color(e)}computeSceneBB(){return this.root.computeSceneBB()}}const y={canvas:void 0,antialias:!0,alpha:!0,powerPreference:"high-performance",precision:"highp",stencil:!1,depth:!0,logarithmicDepthBuffer:!1,shadows:!0,shadowQuality:"high"};class G{constructor(i,e,t){r(this,"_webglrenderer");r(this,"_settings");this._scene=i,this._camera=e,this._settings={...y,...t??{}},this._webglrenderer=new s.WebGLRenderer(this._settings),this._webglrenderer.shadowMap.enabled=this._settings.shadows,this._webglrenderer.shadowMap.type=this._settings.shadowQuality==="high"?s.PCFSoftShadowMap:this._settings.shadowQuality==="medium"?s.PCFShadowMap:s.BasicShadowMap}get webglrenderer(){return this._webglrenderer}setCanvas(i){this._webglrenderer.dispose(),this._settings.canvas=i,this._webglrenderer=new s.WebGLRenderer(this._settings)}render(){this._webglrenderer.render(this._scene,this._camera)}onResize(i,e){this._webglrenderer.setSize(i,e,!1)}dispose(){this._webglrenderer.dispose()}}class U{constructor(){r(this,"_renderer",null);r(this,"_lastTime",0);r(this,"_isRunning",!1);r(this,"_tickers",[])}start(){this._isRunning||(this._isRunning=!0,this._lastTime=performance.now(),requestAnimationFrame(this._tick.bind(this)))}stop(){this._isRunning=!1}setRenderer(i){this._renderer=i}addTicker(i){this._tickers.find(e=>e.uuid===i.uuid)||this._tickers.push(i)}hasTicker(i){return this._tickers.find(e=>e.uuid===i.uuid)!==void 0}removeTicker(i){const e=this._tickers.findIndex(t=>t.uuid===i.uuid);e!==-1&&this._tickers.splice(e,1)}dispose(){this.stop(),this._tickers.forEach(i=>{var e;return(e=i.dispose)==null?void 0:e.call(i)}),this._tickers=[],this._isRunning=!1,this._lastTime=0}_tick(i){var t;if(!this._isRunning)return;const e=(i-this._lastTime)/1e3;this._lastTime=i,this._tickers.forEach(n=>n.tick(e)),(t=this._renderer)==null||t.render(),requestAnimationFrame(this._tick.bind(this))}}class z{constructor(i,e){r(this,"_resizeObserver");r(this,"_width",0);r(this,"_height",0);this._resizeObserver=new ResizeObserver(t=>{for(const n of t){const{width:o,height:h}=n.contentRect;o===this._width&&h===this._height||(i.onResize(o,h),e.onResize(o,h),this._width=o,this._height=h)}}),this._observeCanvas(i.webglrenderer.domElement)}setCanvas(i){this._resizeObserver.disconnect(),this._observeCanvas(i)}dispose(){this._resizeObserver.disconnect()}_observeCanvas(i){if(i.parentElement)this._resizeObserver.observe(i.parentElement);else{const e=setInterval(()=>{i.parentElement&&(this._resizeObserver.observe(i.parentElement),clearInterval(e))},16)}}}const E={autoStart:!0,displayAxes:!1,...C.DIVEPerspectiveCameraDefaultSettings,...y};class F{constructor(i){r(this,"_renderer");r(this,"_scene");r(this,"_camera");r(this,"_resizeManager");r(this,"_clock");r(this,"_settings");this._settings={...E,...i??{}},this._scene=new O,this._camera=new C.DIVEPerspectiveCamera(this._settings),this._renderer=new G(this._scene,this._camera,this._settings),this._resizeManager=new z(this._renderer,this._camera),this._clock=new U,this._clock.setRenderer(this._renderer),this._settings.autoStart&&this.start()}get scene(){return this._scene}get camera(){return this._camera}get renderer(){return this._renderer}setCanvas(i){this._renderer.setCanvas(i),this._resizeManager.setCanvas(i)}get clock(){return this._clock}start(){this._clock.start()}stop(){this._clock.stop()}dispose(){this._clock.dispose(),this._resizeManager.dispose(),this._renderer.dispose()}}const D="#c20017",v="#00ab26",b="#0081d4",Y=D,N=v,W=b;window.DIVE={instances:[],get instance(){return window.DIVE.instances[0]}};const q={...E,...m.OrbitControllerDefaultSettings};class I{constructor(i){r(this,"_instanceId",s.MathUtils.generateUUID());r(this,"_settings");r(this,"_engine");r(this,"orbitController");r(this,"orientationDisplay");this._settings={...q,...i??{}},this._engine=new F(i),this.orbitController=new m.OrbitController(this._engine.camera,this._engine.renderer.webglrenderer.domElement,this._settings),this._engine.clock.addTicker(this.orbitController),this._settings.displayAxes?(this.orientationDisplay=new S(this._engine.renderer,this._engine.scene,this._engine.camera),this._engine.clock.addTicker(this.orientationDisplay)):this.orientationDisplay=null,Promise.resolve().then(()=>require("./package-AmvzOXm_.cjs")).then(e=>{console.log(`DIVE ${e.default.version} initialized successfully!`),console.log(`
|
|
2
|
-
@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@
|
|
3
|
-
@@@@+-:::::::---------------------==------------------------------=#@@@@
|
|
4
|
-
@@%=::::.......::---------------------------------------------------------+@@
|
|
5
|
-
@@+:::...........::-----------------------------------------------------------#@@
|
|
6
|
-
@@=:::.........::::::-------------------------------------------------------------%@
|
|
7
|
-
@%:::.......:::::::-----------------------------------------------------------------#@
|
|
8
|
-
@*:::.....:::::-----------------------------------------------------------------------*@
|
|
9
|
-
@%::::::.::::---------------------------------------------------------------------------@@
|
|
10
|
-
@@-:::::::::-----------------------------------------------------------------------------=@
|
|
11
|
-
@%::::::::--------------------------------------------------------------------------------%@
|
|
12
|
-
@+::::::::--------------------------------=@@@@@%-----------------------------------------%@
|
|
13
|
-
@=:::::::--------------------------------*@@ @@+---------------------------------------#@
|
|
14
|
-
@+:::::::-------------------------------*@ @*--------------------------------------%@
|
|
15
|
-
@#::::::::-----------------------------=@@ @@=-------------------------------------%@
|
|
16
|
-
@@-::::::::----------------------------@@ @@------------------------------------=@
|
|
17
|
-
@%:::::::::--------------------------*@ @*-----------------------------------@@
|
|
18
|
-
@*:::::::::-------------------------@@ @@----------------------------------%@
|
|
19
|
-
@#::::::::::----------------------%@ @%--------------------------------%@
|
|
20
|
-
@#:::::::::::-------------------=@@ @@=------------------------------%@
|
|
21
|
-
@@-::::::::::::----------------%@ @%----------------------------=@@
|
|
22
|
-
@@#::::::::::::::------------*@ @*--------------------------#@@
|
|
23
|
-
@@+::::::::::::::::--------@@ @@------------------------+@@
|
|
24
|
-
@@*:::::::::::::::::----@@ @@---------------------+@@
|
|
25
|
-
@@@-:::::::::::::::--#@ @#-----------------=%@@
|
|
26
|
-
@@%-::::::::::::-%@ @%-------------=%@@
|
|
27
|
-
@@@@+:::::::#@@ @@*-------*@@@@
|
|
28
|
-
@@@@@@@ @@@@@@
|
|
29
|
-
|
|
30
|
-
`)}),window.DIVE.instances.push(this)}static async QuickView(i,e){const t=new I(e);t.engine.scene.background=new s.Color(16777215),t.engine.scene.grid.setVisibility(!1),t.engine.scene.root.floor.setVisibility(!0),t.engine.camera.position.set(0,2,2),t.orbitController.target.set(0,.5,0);const n=new w;n.name="SceneLight",n.userData.id=s.MathUtils.generateUUID(),n.setEnabled(!0),n.visible=!0,n.setIntensity((e==null?void 0:e.lightIntensity)??1),n.setColor(new s.Color(16777215)),t.engine.scene.root.add(n);const o=new f;o.name="object",o.userData.id=s.MathUtils.generateUUID(),o.userData.uri=i,o.visible=!0,t.engine.scene.root.add(o),await o.setFromURL(i);const h=new m.BoundingBox(o);t.engine.scene.add(h);const d=t.orbitController.computeEncompassingView(h);return t.engine.camera.position.copy(d.position),t.orbitController.target.copy(d.target),t}get engine(){return this._engine}get canvas(){return this._engine.renderer.webglrenderer.domElement}setCanvas(i){this._engine.setCanvas(i),this._engine.clock.removeTicker(this.orbitController),this.orbitController.dispose(),this.orbitController=new m.OrbitController(this._engine.camera,i,this._settings),this._engine.clock.addTicker(this.orbitController)}async dispose(){return new Promise(i=>{this._engine.clock.removeTicker(this.orbitController),this.orbitController.dispose(),this.orientationDisplay&&(this._engine.clock.removeTicker(this.orientationDisplay),this.orientationDisplay.dispose()),window.DIVE.instances=window.DIVE.instances.filter(e=>e._instanceId!==this._instanceId),i()})}}const K={glb:{key:"glb",extension:"glb"},gltf:{key:"gltf",extension:"gltf"},usdz:{key:"usdz",extension:"usdz"}},J=Object.values(K).map(a=>a.extension);exports.AxesColorBlue=W;exports.AxesColorBlueLetter=b;exports.AxesColorGreen=N;exports.AxesColorGreenLetter=v;exports.AxesColorRed=Y;exports.AxesColorRedLetter=D;exports.DIVE=I;exports.DIVEAmbientLight=x;exports.DIVEClock=U;exports.DIVEDefaultSettings=q;exports.DIVEEngine=F;exports.DIVEFloor=k;exports.DIVEGrid=B;exports.DIVEGroup=R;exports.DIVEModel=f;exports.DIVEPointLight=V;exports.DIVEPrimitive=M;exports.DIVERenderPipeline=G;exports.DIVERenderPipelineDefaultSettings=y;exports.DIVEResizeManager=z;exports.DIVERoot=P;exports.DIVEScene=O;exports.DIVESceneLight=w;exports.EngineDefaultSettings=E;exports.FILE_TYPES=K;exports.GRID_CENTER_LINE_COLOR=A;exports.GRID_SIDE_LINE_COLOR=T;exports.OrientationDisplay=S;exports.OrientationDisplayAxes=L;exports.SUPPORTED_FILE_TYPES=J;exports.findSceneRecursive=g;
|