@shopware-ag/dive 2.3.7 → 3.0.0-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/chunks/Animator-DHnpWRt_.mjs +16 -0
- package/build/chunks/Animator-YDE8aFEd.cjs +1 -0
- package/build/chunks/{AssetCache-DSpWOp3n.mjs → AssetCache-C2DuXcmp.mjs} +6 -5
- package/build/chunks/AssetCache-CnbDDhU8.cjs +1 -0
- package/build/chunks/AssetExporter-Cdxb04b3.cjs +1 -0
- package/build/chunks/AssetExporter-DLL_vJae.mjs +67 -0
- package/build/chunks/AssetLoader-DO7xlbC3.mjs +499 -0
- package/build/chunks/AssetLoader-h2uyFEfZ.cjs +3 -0
- package/build/chunks/{ClipAnimator-keFLDMNZ.mjs → ClipAnimator-D8Gho4Ec.mjs} +2 -2
- package/build/chunks/ClipAnimator-SdDq2wk1.cjs +1 -0
- package/build/chunks/FileTypes-BB4_1gBJ.mjs +1975 -0
- package/build/chunks/FileTypes-Bvt5QTJC.cjs +29 -0
- package/build/chunks/GridNode-0R5ZnzR6.mjs +30 -0
- package/build/chunks/GridNode-iqnu86_v.cjs +1 -0
- package/build/chunks/{PerspectiveCamera-BFzE2TQU.mjs → PerspectiveCamera-B5TvUzTa.mjs} +1 -1
- package/build/chunks/PerspectiveCamera-DwQUmkDv.cjs +1 -0
- package/build/chunks/{TargetAnimator-DuqPk2eq.cjs → TargetAnimator-D37bWNKD.cjs} +1 -1
- package/build/chunks/{TargetAnimator-DUqkkdVb.mjs → TargetAnimator-DL_9b921.mjs} +1 -1
- package/build/chunks/{isFileTypeSupported-zLrD710P.mjs → isFileTypeSupported-D1z0zckw.mjs} +1 -1
- package/build/chunks/{isFileTypeSupported-Bh5Scxis.cjs → isFileTypeSupported-MJWHcUsR.cjs} +1 -1
- package/build/components/boundingbox/BoundingBox.d.ts +1 -1
- package/build/components/floor/Floor.d.ts +1 -1
- package/build/components/gizmo/Gizmo.d.ts +1 -1
- package/build/components/gizmo/handles/AxisHandle.d.ts +1 -1
- package/build/components/gizmo/handles/RadialHandle.d.ts +1 -1
- package/build/components/gizmo/handles/ScaleHandle.d.ts +1 -1
- package/build/components/gizmo/plane/GizmoPlane.d.ts +1 -1
- package/build/components/gizmo/rotate/RotateGizmo.d.ts +1 -1
- package/build/components/gizmo/scale/ScaleGizmo.d.ts +1 -1
- package/build/components/gizmo/translate/TranslateGizmo.d.ts +1 -1
- package/build/components/grid/Grid.d.ts +2 -1
- package/build/components/group/Group.d.ts +1 -1
- package/build/components/light/AmbientLight.d.ts +1 -1
- package/build/components/light/PointLight.d.ts +1 -1
- package/build/components/light/SceneLight.d.ts +1 -1
- package/build/components/model/Model.d.ts +1 -1
- package/build/components/node/Node.d.ts +1 -1
- package/build/components/primitive/Primitive.d.ts +1 -1
- package/build/components/root/Root.d.ts +1 -1
- package/build/dive.cjs +1 -1
- package/build/dive.mjs +58 -60
- package/build/engine/Dive.d.ts +3 -31
- package/build/engine/camera/PerspectiveCamera.d.ts +1 -1
- package/build/engine/environment/Environment.d.ts +12 -27
- package/build/engine/renderer/Renderer.d.ts +7 -8
- package/build/engine/scene/Scene.d.ts +1 -1
- package/build/engine/scene/xrroot/XRRoot.d.ts +2 -3
- package/build/engine/scene/xrroot/xrlightroot/XRLightRoot.d.ts +3 -3
- package/build/helpers/findInterface/findInterface.d.ts +1 -1
- package/build/helpers/findSceneRecursive/findSceneRecursive.d.ts +1 -1
- package/build/helpers/implementsInterface/implementsInterface.d.ts +1 -1
- package/build/helpers/math/signedAngleTo/signedAngleTo.d.ts +1 -1
- package/build/interfaces/Hoverable.d.ts +1 -1
- package/build/plugins/animation/index.cjs +1 -1
- package/build/plugins/animation/index.mjs +12 -20
- package/build/plugins/animation/src/animator/Animator.d.ts +1 -1
- package/build/plugins/animation/src/animator/ClipAnimator.d.ts +1 -1
- package/build/plugins/animation/src/system/AnimationSystem.d.ts +1 -6
- package/build/plugins/animation/src/types/AnimatorTypes.d.ts +1 -1
- package/build/plugins/ar/index.cjs +1 -1
- package/build/plugins/ar/index.mjs +5 -4
- package/build/plugins/ar/src/webxr/controller/WebXRController.d.ts +1 -1
- package/build/plugins/ar/src/webxr/crosshair/WebXRCrosshair.d.ts +1 -1
- package/build/plugins/ar/src/webxr/origin/WebXROrigin.d.ts +1 -1
- package/build/plugins/ar/src/webxr/raycaster/WebXRRaycaster.d.ts +1 -1
- package/build/plugins/ar/src/webxr/touchscreencontrols/WebXRTouchscreenControls.d.ts +1 -1
- package/build/plugins/assetcache/index.cjs +1 -1
- package/build/plugins/assetcache/index.mjs +1 -1
- package/build/plugins/assetexporter/index.cjs +1 -1
- package/build/plugins/assetexporter/index.mjs +1 -1
- package/build/plugins/assetexporter/src/AssetExporter.d.ts +1 -1
- package/build/plugins/assetloader/index.cjs +1 -1
- package/build/plugins/assetloader/index.mjs +2 -2
- package/build/plugins/assetloader/src/loader/AssetLoader.d.ts +2 -2
- package/build/plugins/assetloader/src/step/STEPLoader.d.ts +1 -1
- package/build/plugins/mediacreator/index.cjs +1 -1
- package/build/plugins/mediacreator/index.mjs +52 -24
- package/build/plugins/mediacreator/src/MediaCreator.d.ts +4 -3
- package/build/plugins/mediacreator/types/MediaGenerationByPosition.d.ts +1 -1
- package/build/plugins/orbitcontroller/index.cjs +1 -1
- package/build/plugins/orbitcontroller/index.mjs +1 -1
- package/build/plugins/orbitcontroller/src/OrbitController.d.ts +1 -1
- package/build/plugins/orbitcontroller/types/OrbitControllerState.types.d.ts +1 -1
- package/build/plugins/orientationdisplay/index.cjs +1 -1
- package/build/plugins/orientationdisplay/index.mjs +17 -16
- package/build/plugins/orientationdisplay/src/axes/Axes.d.ts +1 -1
- package/build/plugins/quickview/index.cjs +1 -1
- package/build/plugins/quickview/index.mjs +9 -8
- package/build/plugins/shader/index.cjs +1 -1
- package/build/plugins/shader/index.mjs +2 -3
- package/build/plugins/shader/src/index.d.ts +1 -3
- package/build/plugins/shader/src/shaders/GridNode.d.ts +16 -0
- package/build/plugins/state/index.cjs +11 -11
- package/build/plugins/state/index.mjs +1538 -1537
- package/build/plugins/state/src/actions/camera/computeencompassingview.d.ts +1 -1
- package/build/plugins/state/src/actions/camera/getcameratransform.d.ts +1 -1
- package/build/plugins/state/src/actions/camera/movecamera.d.ts +1 -1
- package/build/plugins/state/src/actions/camera/setcameratransform.d.ts +1 -1
- package/build/plugins/state/types/StateSceneData.d.ts +1 -1
- package/build/plugins/toolbox/index.cjs +1 -1
- package/build/plugins/toolbox/index.d.ts +0 -1
- package/build/plugins/toolbox/index.mjs +224 -853
- package/build/plugins/toolbox/src/PointerContext.d.ts +1 -1
- package/build/plugins/toolbox/src/SelectionState.d.ts +1 -1
- package/build/plugins/toolbox/src/Toolbox.d.ts +0 -10
- package/build/plugins/toolbox/src/drag/DragTool.d.ts +1 -1
- package/build/plugins/toolbox/src/drag/DraggableEvent.d.ts +1 -1
- package/build/plugins/toolbox/src/hover/HoverTool.d.ts +1 -1
- package/build/plugins/toolbox/src/select/SelectTool.d.ts +1 -1
- package/build/plugins/toolbox/src/transform/TransformTool.d.ts +2 -1
- package/build/types/schema/GroupSchema.d.ts +1 -1
- package/build/types/schema/LightSchema.d.ts +1 -1
- package/build/types/schema/MaterialSchema.d.ts +1 -1
- package/build/types/schema/ModelSchema.d.ts +1 -1
- package/build/types/schema/PovSchema.d.ts +1 -1
- package/build/types/schema/PrimitiveSchema.d.ts +1 -1
- package/package.json +5 -4
- package/build/chunks/Animator-BGFdF70Z.mjs +0 -47
- package/build/chunks/Animator-Cu7NIkVg.cjs +0 -1
- package/build/chunks/AssetCache-DJyYrAdR.cjs +0 -1
- package/build/chunks/AssetExporter-PFiNYi50.mjs +0 -1628
- package/build/chunks/AssetExporter-yVhYmVXW.cjs +0 -164
- package/build/chunks/AssetLoader-BA_QwJMR.mjs +0 -2590
- package/build/chunks/AssetLoader-DJb8P6eB.cjs +0 -5
- package/build/chunks/ClipAnimator-tjhLo851.cjs +0 -1
- package/build/chunks/DIVEShaderMaterial-Bt0d8oJB.mjs +0 -3468
- package/build/chunks/DIVEShaderMaterial-DE8YRWj9.cjs +0 -1554
- package/build/chunks/FileTypes-BSJhZREN.cjs +0 -33
- package/build/chunks/FileTypes-CUf24rq6.mjs +0 -2155
- package/build/chunks/PerspectiveCamera-iAsZqrnY.cjs +0 -1
- package/build/chunks/draco_decoder-Bh9flJPu.cjs +0 -1
- package/build/chunks/draco_decoder-CEzwqP9o.mjs +0 -38
- package/build/chunks/draco_decoder-DtHHc5d0.mjs +0 -4
- package/build/chunks/draco_decoder-DvYjcLz_.cjs +0 -35
- package/build/chunks/draco_wasm_wrapper-FoEVV9af.cjs +0 -118
- package/build/chunks/draco_wasm_wrapper-yQy2VLhb.mjs +0 -121
- package/build/chunks/fflate.module-DHdJvhNh.cjs +0 -6
- package/build/chunks/fflate.module-xyO_T3Zm.mjs +0 -602
- package/build/plugins/shader/src/material/DIVEShaderMaterial.d.ts +0 -5
- package/build/plugins/shader/src/shaders/DIVEShaderLib.d.ts +0 -2
- package/build/plugins/shader/src/shaders/grid/index.d.ts +0 -40
- package/build/plugins/toolbox/src/BaseTool.d.ts +0 -59
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var l=Object.defineProperty;var d=(r,o,t)=>o in r?l(r,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[o]=t;var s=(r,o,t)=>d(r,typeof o!="symbol"?o+"":o,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("@tweenjs/tween.js"),g=require("./Animator-
|
|
1
|
+
"use strict";var l=Object.defineProperty;var d=(r,o,t)=>o in r?l(r,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[o]=t;var s=(r,o,t)=>d(r,typeof o!="symbol"?o+"":o,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("@tweenjs/tween.js"),g=require("./Animator-YDE8aFEd.cjs");class y extends g.Animator{constructor(t,i,n){super();s(this,"_group",new p.Group);s(this,"_tweens",[]);s(this,"_snapshots",[]);s(this,"_state","idle");s(this,"_duration");s(this,"_loop","once");s(this,"_options");s(this,"_completedCount",0);this._duration=i,this._options=n;const u=Array.isArray(t)?t:[t];for(const h of u){const _={};for(const e of Object.keys(h.to))_[e]=h.object[e];this._snapshots.push({object:h.object,values:_});const c=new p.Tween(h.object,this._group).to(h.to,i).easing((n==null?void 0:n.easing)??p.Easing.Quadratic.Out).onUpdate(()=>{var e,a;(a=(e=this._options)==null?void 0:e.onUpdate)==null||a.call(e),this.dispatchEvent({type:"update",target:this})}).onComplete(()=>{var e,a;this._completedCount++,this._completedCount>=this._tweens.length&&(this._state="idle",(a=(e=this._options)==null?void 0:e.onComplete)==null||a.call(e),this.dispatchEvent({type:"complete",target:this}))});this._tweens.push(c)}}get state(){return this._state}get duration(){return this._duration}get loop(){return this._loop}set loop(t){this._loop=t,this._tweens.forEach(i=>{i.repeat(t==="once"?0:1/0),i.yoyo(t==="pingpong")})}get time(){return this._tweens.length>0?this._tweens[0].getDuration():0}set time(t){}play(){return this._tweens.forEach(t=>t.stop()),this._state="playing",this._completedCount=0,this._restoreSnapshots(),this._tweens.forEach(t=>t.start()),this.dispatchEvent({type:"play",target:this}),this}pause(){return this._state="paused",this._tweens.forEach(t=>t.pause()),this.dispatchEvent({type:"pause",target:this}),this}resume(){return this._state="playing",this._tweens.forEach(t=>t.resume()),this.dispatchEvent({type:"resume",target:this}),this}stop(){return this._state="idle",this._tweens.forEach(t=>t.stop()),this._restoreSnapshots(),this.dispatchEvent({type:"stop",target:this}),this}update(){this._state!=="idle"&&this._group.update()}_restoreSnapshots(){for(const{object:t,values:i}of this._snapshots)for(const n of Object.keys(i))t[n]=i[n]}dispose(){this._tweens.forEach(t=>t.stop()),this._tweens=[],this._group.removeAll(),this._state="idle"}}exports.TargetAnimator=y;
|
|
@@ -2,7 +2,7 @@ var c = Object.defineProperty;
|
|
|
2
2
|
var d = (n, o, t) => o in n ? c(n, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[o] = t;
|
|
3
3
|
var s = (n, o, t) => d(n, typeof o != "symbol" ? o + "" : o, t);
|
|
4
4
|
import { Group as l, Tween as g, Easing as f } from "@tweenjs/tween.js";
|
|
5
|
-
import { A as y } from "./Animator-
|
|
5
|
+
import { A as y } from "./Animator-DHnpWRt_.mjs";
|
|
6
6
|
class v extends y {
|
|
7
7
|
constructor(t, i, h) {
|
|
8
8
|
super();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("./FileTypes-
|
|
1
|
+
"use strict";const n=require("./FileTypes-Bvt5QTJC.cjs");function o(e){var t;const i=e.split("/").pop()||"";return!i.includes(".")||i.endsWith(".")?"":((t=i.split(".").pop())==null?void 0:t.toLowerCase().split("?")[0])||""}function r(e){return e.toLowerCase()in n.FILE_TYPES}exports.getFileTypeFromUri=o;exports.isFileTypeSupported=r;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Box3, Object3D, Sphere, Vector3, ColorRepresentation } from 'three';
|
|
1
|
+
import { Box3, Object3D, Sphere, Vector3, ColorRepresentation } from 'three/webgpu';
|
|
2
2
|
import { DIVENode } from '../node/Node.ts';
|
|
3
3
|
/**
|
|
4
4
|
* A bounding box component that provides both axis-aligned and oriented bounding boxes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Euler, Object3D, Vector3 } from 'three';
|
|
1
|
+
import { Euler, Object3D, Vector3 } from 'three/webgpu';
|
|
2
2
|
import { OrbitController } from '../../plugins/orbitcontroller/index.ts';
|
|
3
3
|
import { DIVEGizmoPlane as DIVEGizmoPlane } from './plane/GizmoPlane.ts';
|
|
4
4
|
import { DIVESelectable } from '../../interfaces/Selectable.ts';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColorRepresentation, Object3D, Vector3 } from 'three';
|
|
1
|
+
import { ColorRepresentation, Object3D, Vector3 } from 'three/webgpu';
|
|
2
2
|
import { DIVEHoverable } from '../../../interfaces/Hoverable.ts';
|
|
3
3
|
import { DIVETranslateGizmo } from '../translate/TranslateGizmo.ts';
|
|
4
4
|
import { DIVEDraggable } from '../../../interfaces/Draggable.ts';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColorRepresentation, Object3D, Vector3 } from 'three';
|
|
1
|
+
import { ColorRepresentation, Object3D, Vector3 } from 'three/webgpu';
|
|
2
2
|
import { DIVEHoverable } from '../../../interfaces/Hoverable.ts';
|
|
3
3
|
import { DraggableEvent } from '../../../plugins/toolbox/index.ts';
|
|
4
4
|
import { DIVERotateGizmo } from '../rotate/RotateGizmo.ts';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColorRepresentation, Object3D, Vector3 } from 'three';
|
|
1
|
+
import { ColorRepresentation, Object3D, Vector3 } from 'three/webgpu';
|
|
2
2
|
import { DIVEHoverable } from '../../../interfaces/Hoverable.ts';
|
|
3
3
|
import { DIVEScaleGizmo } from '../scale/ScaleGizmo.ts';
|
|
4
4
|
import { DIVEDraggable } from '../../../interfaces/Draggable.ts';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Object3D } from 'three';
|
|
1
|
+
import { Object3D } from 'three/webgpu';
|
|
2
2
|
import { OrbitController } from '../../../plugins/orbitcontroller/index.ts';
|
|
3
3
|
import { DIVERadialHandle } from '../handles/RadialHandle.ts';
|
|
4
4
|
import { DraggableEvent } from '../../../plugins/toolbox/index.ts';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Object3D, Vector3 } from 'three';
|
|
1
|
+
import { Object3D, Vector3 } from 'three/webgpu';
|
|
2
2
|
import { DIVEHoverable } from '../../../interfaces/Hoverable.ts';
|
|
3
3
|
import { OrbitController } from '../../../plugins/orbitcontroller/index.ts';
|
|
4
4
|
import { DIVEScaleHandle } from '../handles/ScaleHandle.ts';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Object3D } from 'three';
|
|
1
|
+
import { Object3D } from 'three/webgpu';
|
|
2
2
|
import { OrbitController } from '../../../plugins/orbitcontroller/index.ts';
|
|
3
3
|
import { DIVEAxisHandle } from '../handles/AxisHandle.ts';
|
|
4
4
|
import { DraggableEvent } from '../../../plugins/toolbox/index.ts';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Object3D } from 'three';
|
|
1
|
+
import { Object3D } from 'three/webgpu';
|
|
2
2
|
export interface DIVEGridSettings {
|
|
3
3
|
/** Distance between minor grid lines in meters. @default 1 */
|
|
4
4
|
gridSize?: number;
|
|
@@ -13,6 +13,7 @@ export interface DIVEGridSettings {
|
|
|
13
13
|
export declare class DIVEGrid extends Object3D {
|
|
14
14
|
private _mesh;
|
|
15
15
|
private _material;
|
|
16
|
+
private _uniforms;
|
|
16
17
|
private _gridSize;
|
|
17
18
|
constructor(settings?: DIVEGridSettings);
|
|
18
19
|
setVisibility(visible: boolean): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Color, Object3D } from 'three';
|
|
1
|
+
import { Color, Object3D } from 'three/webgpu';
|
|
2
2
|
import { DIVEMovable } from '../../interfaces/Movable.ts';
|
|
3
3
|
import { DIVESelectable } from '../../interfaces/Selectable.ts';
|
|
4
4
|
import { TransformControls } from 'three/examples/jsm/controls/TransformControls.ts';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Box3, Object3D, Vector3, Vector3Like } from 'three';
|
|
1
|
+
import { Box3, Object3D, Vector3, Vector3Like } from 'three/webgpu';
|
|
2
2
|
import { DIVEMovable } from '../../interfaces/Movable.ts';
|
|
3
3
|
import { DIVESelectable } from '../../interfaces/Selectable.ts';
|
|
4
4
|
import { TransformControls } from 'three/examples/jsm/controls/TransformControls.ts';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Box3, Object3D } from 'three';
|
|
1
|
+
import { Box3, Object3D } from 'three/webgpu';
|
|
2
2
|
import { EntitySchema, EntityTypeSchema, MinimalSchema, PartialSchema } from '../../index.ts';
|
|
3
3
|
import { DIVESceneObject } from '../../types/index.ts';
|
|
4
4
|
import { DIVEFloor } from '../floor/Floor.ts';
|
package/build/dive.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var b=Object.defineProperty;var R=(r,i,e)=>i in r?b(r,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[i]=e;var n=(r,i,e)=>R(r,typeof i!="symbol"?i+"":i,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./chunks/FileTypes-BSJhZREN.cjs"),u=require("./chunks/PerspectiveCamera-iAsZqrnY.cjs"),_=require("./chunks/AxisHelperColors-BrGqktN5.cjs"),s=require("three"),V=require("./chunks/findInterface-C6mrvf_t.cjs"),y=require("./chunks/isFileTypeSupported-Bh5Scxis.cjs"),w=require("./chunks/network-error-CdDXil5g.cjs"),A=require("./chunks/parse-error-Dy_EE4rL.cjs"),P=require("./chunks/PovSchema-Co9FznEz.cjs");class m extends s.Object3D{constructor(e,t,o,h,a){super();n(this,"isHoverable",!0);n(this,"isDraggable",!0);n(this,"parent",null);n(this,"axis");n(this,"_color",new s.Color(16711935));n(this,"_colorHover");n(this,"_hovered");n(this,"_highlight");n(this,"_lineMaterial");n(this,"_colliderMesh");this.name="DIVERadialHandle",this.axis=e,this._color.set(a),this._colorHover=this._color.clone().multiplyScalar(2),this._hovered=!1,this._highlight=!1;const l=new s.TorusGeometry(t,.01,13,48,o);this._lineMaterial=new s.MeshBasicMaterial({color:a,depthTest:!1,depthWrite:!1});const d=new s.Mesh(l,this._lineMaterial);d.layers.mask=u.UI_LAYER_MASK,d.renderOrder=1/0,this.add(d);const g=new s.TorusGeometry(t,.1,3,48,o),E=new s.MeshBasicMaterial({color:16711935,transparent:!0,opacity:.15,depthTest:!1,depthWrite:!1});this._colliderMesh=new s.Mesh(g,E),this._colliderMesh.visible=!1,this._colliderMesh.layers.mask=u.UI_LAYER_MASK,this._colliderMesh.renderOrder=1/0,this.add(this._colliderMesh),this.lookAt(h)}set debug(e){this._colliderMesh.visible=e}get highlight(){return this._highlight}set highlight(e){this._highlight=e,this._lineMaterial.color=this._highlight||this._hovered?this._colorHover:this._color}get forwardVector(){return new s.Vector3(0,0,1).applyQuaternion(this.quaternion).normalize()}get rightVector(){return new s.Vector3(1,0,0).applyQuaternion(this.quaternion).normalize()}get upVector(){return new s.Vector3(0,1,0).applyQuaternion(this.quaternion).normalize()}reset(){this._lineMaterial.color=this._color}onPointerEnter(){this._hovered=!0,this.parent&&this.parent.onHandleHover(this,!0)}onPointerLeave(){this._hovered=!1,this.parent&&this.parent.onHandleHover(this,!1)}onDragStart(){this.parent&&this.parent.onHandleDragStart(this)}onDrag(e){this.parent&&this.parent.onHandleDrag(this,e)}onDragEnd(){this.parent&&this.parent.onHandleDragEnd(this)}}function p(r,i){const e=(r+"e").split("e");return+(e[0]+"e"+(+e[1]+(i||0)))}function O(r,i=0){const e=p(r,+i);return p(Math.ceil(e),-i)}function v(r,i=0){const e=p(r,+i);return p(Math.floor(e),-i)}function x(r,i=0){if(r<0)return-x(-r,i);const e=p(r,+i);return p(Math.round(e),-i)}function H(r,i,e){return Math.atan2(r.clone().cross(i).dot(e),i.clone().dot(r))}function z(r,i=0){const e=p(r,+i);return p(Math.round(e),-i).toFixed(i)}function G(r,i=0){const e=p(r,+i);return p(Math.trunc(e),-i)}function L(r){return(s.MathUtils.radToDeg(r)+360)%360}function C(r){return s.MathUtils.degToRad(r)}const S={ceilExp:O,floorExp:v,roundExp:x,toFixedExp:z,truncateExp:G,signedAngleTo:H,radToDeg:L,degToRad:C};class Y extends s.Object3D{constructor(e){super();n(this,"children");n(this,"_controller");n(this,"_startRot");this.name="DIVERotateGizmo",this.children=[],this._startRot=null,this._controller=e,this.add(new m("x",1,Math.PI/2,new s.Vector3(1,0,0),_.AxesColorRed)),this.add(new m("y",1,-Math.PI/2,new s.Vector3(0,1,0),_.AxesColorGreen)),this.add(new m("z",1,Math.PI/2,new s.Vector3(0,0,1),_.AxesColorBlue))}set debug(e){this.children.forEach(t=>{t.debug=e})}reset(){this.children.forEach(e=>{e.reset()})}handleHighlight(e,t,o){this.children.forEach(h=>{o?h.highlight=h.axis===e&&o:h.highlight=h.axis===e&&t})}onHandleHover(e,t){this._startRot||this.parent&&this.parent.parent&&(this.parent.parent.onHover("rotate",e.axis,t),this.handleHighlight(e.axis,t,!1))}onHandleDragStart(e){if(!this.parent||!this.parent.parent)return;const t=this.parent.parent.object;t&&(this._startRot=t.rotation.clone(),this.handleHighlight(e.axis,!0,!0))}onHandleDrag(e,t){if(!this._startRot||!this.parent||!this.parent.parent||!("onChange"in this.parent.parent))return;const o=t.dragCurrent.clone().sub(this.parent.parent.position).normalize(),h=t.dragStart.clone().sub(this.parent.parent.position).normalize(),a=S.signedAngleTo(h,o,e.forwardVector),l=new s.Euler(this._startRot.x+e.forwardVector.x*a,this._startRot.y+e.forwardVector.y*a,this._startRot.z+e.forwardVector.z*a);this.parent.parent.onChange(void 0,l)}onHandleDragEnd(e){this._startRot=null,this.handleHighlight(e.axis,!1,!1)}}class D extends s.Object3D{constructor(e,t,o,h){super();n(this,"isHoverable",!0);n(this,"isDraggable",!0);n(this,"parent",null);n(this,"axis");n(this,"_color",new s.Color(16711935));n(this,"_colorHover");n(this,"_hovered");n(this,"_highlight");n(this,"_lineMaterial");n(this,"_colliderMesh");this.name="DIVEAxisHandle",this.axis=e,this._color.set(h),this._colorHover=this._color.clone().multiplyScalar(2),this._highlight=!1,this._hovered=!1;const a=new s.CylinderGeometry(.01,.01,t,13);this._lineMaterial=new s.MeshBasicMaterial({color:h,depthTest:!1,depthWrite:!1});const l=new s.Mesh(a,this._lineMaterial);l.layers.mask=u.UI_LAYER_MASK,l.renderOrder=1/0,l.rotateX(Math.PI/2),l.translateY(t/2),this.add(l);const d=new s.CylinderGeometry(.1,.1,t,3),g=new s.MeshBasicMaterial({color:16711935,transparent:!0,opacity:.15,depthTest:!1,depthWrite:!1});this._colliderMesh=new s.Mesh(d,g),this._colliderMesh.visible=!1,this._colliderMesh.layers.mask=u.UI_LAYER_MASK,this._colliderMesh.renderOrder=1/0,this._colliderMesh.rotateX(Math.PI/2),this._colliderMesh.translateY(t/2),this.add(this._colliderMesh),this.rotateX(o.y*-Math.PI/2),this.rotateY(o.x*Math.PI/2)}set debug(e){this._colliderMesh.visible=e}get highlight(){return this._highlight}set highlight(e){this._highlight=e,this._lineMaterial.color=this._highlight||this._hovered?this._colorHover:this._color}get forwardVector(){return new s.Vector3(0,0,1).applyQuaternion(this.quaternion).normalize()}get rightVector(){return new s.Vector3(1,0,0).applyQuaternion(this.quaternion).normalize()}get upVector(){return new s.Vector3(0,1,0).applyQuaternion(this.quaternion).normalize()}reset(){this._lineMaterial.color=this._color}onPointerEnter(){this._hovered=!0,this.parent&&this.parent.onHandleHover(this,!0)}onPointerLeave(){this._hovered=!1,this.parent&&this.parent.onHandleHover(this,!1)}onDragStart(){this.parent&&this.parent.onHandleDragStart(this)}onDrag(e){this.parent&&this.parent.onHandleDrag(this,e)}onDragEnd(){this.parent&&this.parent.onHandleDragEnd(this)}}class T extends s.Object3D{constructor(e){super();n(this,"_controller");n(this,"children");n(this,"_startPos");this.name="DIVETranslateGizmo",this.children=[],this._startPos=null,this._controller=e,this.add(new D("x",1,new s.Vector3(1,0,0),_.AxesColorRed)),this.add(new D("y",1,new s.Vector3(0,1,0),_.AxesColorGreen)),this.add(new D("z",1,new s.Vector3(0,0,1),_.AxesColorBlue))}set debug(e){this.children.forEach(t=>{t.debug=e})}reset(){this.children.forEach(e=>{e.reset()})}handleHighlight(e,t,o){this.children.forEach(h=>{o?h.highlight=h.axis===e&&o:h.highlight=h.axis===e&&t})}onHandleHover(e,t){this._startPos||this.parent&&this.parent.parent&&(this.parent.parent.onHover("translate",e.axis,t),this.handleHighlight(e.axis,t,!1))}onHandleDragStart(e){if(!this.parent||!this.parent.parent)return;const t=this.parent.parent.object;t&&(this._startPos=t.position.clone(),this.handleHighlight(e.axis,!0,!0))}onHandleDrag(e,t){if(!this._startPos||!this.parent||!this.parent.parent||!("onChange"in this.parent.parent))return;const o=t.dragDelta.clone().projectOnVector(e.forwardVector);this.parent.parent.onChange(this._startPos.clone().add(o))}onHandleDragEnd(e){this._startPos=null,this.handleHighlight(e.axis,!1,!1)}}class M extends s.Object3D{constructor(e,t,o,h,a=.05){super();n(this,"isHoverable",!0);n(this,"isDraggable",!0);n(this,"parent",null);n(this,"axis");n(this,"_color",new s.Color(16711935));n(this,"_colorHover");n(this,"_hovered");n(this,"_highlight");n(this,"_lineMaterial");n(this,"_colliderMesh");n(this,"_box");n(this,"_boxSize");this.name="DIVEScaleHandle",this.axis=e,this._color.set(h),this._colorHover=this._color.clone().multiplyScalar(2),this._hovered=!1,this._highlight=!1,this._boxSize=a;const l=new s.CylinderGeometry(.01,.01,t-a/2,13);this._lineMaterial=new s.MeshBasicMaterial({color:h,depthTest:!1,depthWrite:!1});const d=new s.Mesh(l,this._lineMaterial);d.layers.mask=u.UI_LAYER_MASK,d.renderOrder=1/0,d.rotateX(Math.PI/2),d.translateY(t/2-a/4),this.add(d),this._box=new s.Mesh(new s.BoxGeometry(a,a,a),this._lineMaterial),this._box.layers.mask=u.UI_LAYER_MASK,this._box.renderOrder=1/0,this._box.rotateX(Math.PI/2),this._box.translateY(t-a/2),this._box.rotateZ(o.x*Math.PI/2),this._box.rotateX(o.z*Math.PI/2),this.add(this._box);const g=new s.CylinderGeometry(.1,.1,t+a/2,3),E=new s.MeshBasicMaterial({color:16711935,transparent:!0,opacity:.15,depthTest:!1,depthWrite:!1});this._colliderMesh=new s.Mesh(g,E),this._colliderMesh.visible=!1,this._colliderMesh.layers.mask=u.UI_LAYER_MASK,this._colliderMesh.renderOrder=1/0,this._colliderMesh.rotateX(Math.PI/2),this._colliderMesh.translateY(t/2),this.add(this._colliderMesh),this.rotateX(o.y*-Math.PI/2),this.rotateY(o.x*Math.PI/2)}set debug(e){this._colliderMesh.visible=e}get highlight(){return this._highlight}set highlight(e){this._highlight=e,this._lineMaterial.color=this._highlight||this._hovered?this._colorHover:this._color}get forwardVector(){return new s.Vector3(0,0,1).applyQuaternion(this.quaternion).normalize()}get rightVector(){return new s.Vector3(1,0,0).applyQuaternion(this.quaternion).normalize()}get upVector(){return new s.Vector3(0,1,0).applyQuaternion(this.quaternion).normalize()}reset(){this._lineMaterial.color=this._color}update(e){this._box.scale.copy(new s.Vector3(1,1,1).sub(this.forwardVector).add(e.clone().multiply(this.forwardVector)))}onPointerEnter(){this._hovered=!0,this.parent&&this.parent.onHoverAxis(this,!0)}onPointerLeave(){this._hovered=!1,this.parent&&this.parent.onHoverAxis(this,!1)}onDragStart(){this.parent&&this.parent.onAxisDragStart(this)}onDrag(e){this.parent&&this.parent.onAxisDrag(this,e)}onDragEnd(){this.parent&&this.parent.onAxisDragEnd(this)}}class j extends s.Object3D{constructor(e){super();n(this,"isHoverable",!0);n(this,"children");n(this,"_controller");n(this,"_startScale");this.name="DIVEScaleGizmo",this.children=[],this._startScale=null,this._controller=e,this.add(new M("x",1,new s.Vector3(1,0,0),_.AxesColorRed)),this.add(new M("y",1,new s.Vector3(0,1,0),_.AxesColorGreen)),this.add(new M("z",1,new s.Vector3(0,0,1),_.AxesColorBlue))}set debug(e){this.children.forEach(t=>{t.debug=e})}reset(){this.children.forEach(e=>{e.reset()})}update(e){this.children.forEach(t=>{t.update(e)})}handleHighlight(e,t,o){this.children.forEach(h=>{o?h.highlight=h.axis===e&&o:h.highlight=h.axis===e&&t})}onHoverAxis(e,t){this._startScale||this.parent&&this.parent.parent&&(this.parent.parent.onHover("translate",e.axis,t),this.handleHighlight(e.axis,t,!1))}onAxisDragStart(e){if(!this.parent||!this.parent.parent)return;const t=this.parent.parent.object;t&&(this._startScale=t.scale.clone(),this.handleHighlight(e.axis,!0,!0))}onAxisDrag(e,t){if(!this._startScale||!this.parent||!this.parent.parent||!("onChange"in this.parent.parent))return;const o=t.dragDelta.clone().projectOnVector(e.forwardVector);this.parent.parent.onChange(void 0,void 0,this._startScale.clone().add(o))}onAxisDragEnd(e){this._startScale=null,this.handleHighlight(e.axis,!1,!1)}}class N extends s.Object3D{constructor(){super();n(this,"_meshX");n(this,"_meshY");n(this,"_meshZ");this.name="DIVEGizmoPlane";const e=new s.MeshBasicMaterial({transparent:!0,opacity:.15,depthTest:!1,depthWrite:!1,side:2}),t=new s.PlaneGeometry(100,100,2,2),o=e.clone();o.color.set(16711680),this._meshX=new s.Mesh(t,o),this._meshX.layers.mask=u.UI_LAYER_MASK,this._meshX.rotateY(Math.PI/2);const h=new s.PlaneGeometry(100,100,2,2),a=e.clone();a.color.set(65280),this._meshY=new s.Mesh(h,a),this._meshY.layers.mask=u.UI_LAYER_MASK,this._meshY.rotateX(-Math.PI/2);const l=new s.PlaneGeometry(100,100,2,2),d=e.clone();d.color.set(255),this._meshZ=new s.Mesh(l,d),this._meshZ.layers.mask=u.UI_LAYER_MASK}get XPlane(){return this._meshX}get YPlane(){return this._meshY}get ZPlane(){return this._meshZ}assemble(e,t){if(this.clear(),e==="translate"||e==="scale")switch(t){case"x":this.add(this._meshY),this.add(this._meshZ);break;case"y":this.add(this._meshX),this.add(this._meshZ);break;case"z":this.add(this._meshX),this.add(this._meshY);break}else if(e==="rotate")switch(t){case"x":this.add(this._meshX);break;case"y":this.add(this._meshY);break;case"z":this.add(this._meshZ);break}}}class F extends s.Object3D{constructor(e){super();n(this,"_mode");n(this,"_gizmoNode");n(this,"_translateGizmo");n(this,"_rotateGizmo");n(this,"_scaleGizmo");n(this,"_gizmoPlane");n(this,"_object");this.name="DIVEGizmo",e.addEventListener("change",()=>{const t=e.getDistance()/2.5;this.scale.set(t,t,t)}),this._mode="translate",this._gizmoNode=new s.Object3D,this.add(this._gizmoNode),this._translateGizmo=new T(e),this._rotateGizmo=new Y(e),this._scaleGizmo=new j(e),this._gizmoPlane=new N,this._gizmoPlane.visible=!1,this._object=null}get mode(){return this._mode}set mode(e){this._mode=e,this.assemble()}set debug(e){this._translateGizmo.debug=e,this._rotateGizmo.debug=e,this._scaleGizmo.debug=e}get gizmoNode(){return this._gizmoNode}get gizmoPlane(){return this._gizmoPlane}get object(){return this._object}attach(e){return this._object=e,this.assemble(),this}detach(){return this._object=null,this.assemble(),this}onHover(e,t,o){o&&this._gizmoPlane.assemble(e,t)}onChange(e,t,o){this.object!==null&&(e&&(this.position.copy(e),this.object.position.copy(e)),t&&this.object.rotation.copy(t),o&&(this.object.scale.copy(o),this._scaleGizmo.update(o)))}assemble(){this._gizmoNode.clear(),this._gizmoPlane.clear(),this._translateGizmo.reset(),this._rotateGizmo.reset(),this._scaleGizmo.reset(),this.object!==null&&(this._mode==="translate"&&this._gizmoNode.add(this._translateGizmo),this._mode==="rotate"&&this._gizmoNode.add(this._rotateGizmo),this._mode==="scale"&&this._gizmoNode.add(this._scaleGizmo),this.add(this._gizmoPlane))}}class U{constructor(){n(this,"isMovable",!0)}}class K{constructor(){n(this,"isSelectable",!0)}}function X(r,i){return i.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(o=>{if(o==="constructor")return;const h=Object.getOwnPropertyDescriptor(e.prototype,o);Object.defineProperty(r.prototype,o,h)});const t=new e;Object.getOwnPropertyNames(t).forEach(o=>{const h=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(r.prototype,o,h)})}),r}function f(r,i=new WeakMap){if(r===null||typeof r!="object")return r;if(i.has(r))return i.get(r);if(r instanceof Date)return new Date(r.getTime());if(r instanceof RegExp)return new RegExp(r.source,r.flags);if(Array.isArray(r)){const a=[];i.set(r,a);for(let l=0;l<r.length;l++)a[l]=f(r[l],i);return a}if(r instanceof Map){const a=new Map;i.set(r,a);for(const[l,d]of r)a.set(f(l,i),f(d,i));return a}if(r instanceof Set){const a=new Set;i.set(r,a);for(const l of r)a.add(f(l,i));return a}const e=r;if(typeof e.clone=="function"){const a=e.clone();return i.set(r,a),a}const t=Object.create(Object.getPrototypeOf(r));i.set(r,t);const o=Object.getOwnPropertyNames(r);for(const a of o){const l=Object.getOwnPropertyDescriptor(r,a);if(l)if(l.value!==void 0){const d=f(l.value,i);Object.defineProperty(t,a,{...l,value:d})}else Object.defineProperty(t,a,l)}const h=Object.getOwnPropertySymbols(r);for(const a of h){const l=Object.getOwnPropertyDescriptor(r,a);if(l)if(l.value!==void 0){const d=f(l.value,i);Object.defineProperty(t,a,{...l,value:d})}else Object.defineProperty(t,a,l)}return t}const I=(r,i)=>{if(Object.keys(r).length===0&&Object.keys(i).length===0)return{};if(typeof r!="object"||typeof i!="object")return i;let e={};return Object.keys(i).forEach(t=>{if(!Object.keys(r).includes(t)){e={...e,[t]:i[t]};return}if(Array.isArray(i[t])){if(!Array.isArray(r[t])){e={...e,[t]:i[t]};return}const o=r[t],h=i[t];if(o.length===0&&h.length===0){e={...e};return}if(o.length!==h.length){e={...e,[t]:i[t]};return}const a=[];if(h.forEach((l,d)=>{const g=I(o[d],h[d]);Object.keys(g).length&&a.push(h[d])}),Object.keys(a).length){e={...e,[t]:a};return}return}if(typeof i[t]=="object"){if(typeof r[t]!="object"){e={...e,[t]:i[t]};return}const o=I(r[t],i[t]);if(Object.keys(o).length){e={...e,[t]:o};return}}r[t]!==i[t]&&(e={...e,[t]:i[t]})}),e};function q(r){return r.entityType==="group"}function B(r){return r.entityType==="light"}function Z(r){return r.entityType==="primitive"}exports.BoundingBox=c.BoundingBox;exports.DIVE=c.DIVE;exports.DIVEAmbientLight=c.DIVEAmbientLight;exports.DIVEClock=c.DIVEClock;exports.DIVEDefaultSettings=c.DIVEDefaultSettings;exports.DIVEEngine=c.DIVEEngine;exports.DIVEEnvironment=c.DIVEEnvironment;exports.DIVEEnvironmentDefaultSettings=c.DIVEEnvironmentDefaultSettings;exports.DIVEFloor=c.DIVEFloor;exports.DIVEGrid=c.DIVEGrid;exports.DIVEGroup=c.DIVEGroup;exports.DIVEModel=c.DIVEModel;exports.DIVENode=c.DIVENode;exports.DIVEPointLight=c.DIVEPointLight;exports.DIVEPrimitive=c.DIVEPrimitive;exports.DIVERenderPipeline=c.DIVERenderPipeline;exports.DIVERenderer=c.DIVERenderer;exports.DIVERendererDefaultSettings=c.DIVERendererDefaultSettings;exports.DIVEResizeManager=c.DIVEResizeManager;exports.DIVERoot=c.DIVERoot;exports.DIVEScene=c.DIVEScene;exports.DIVESceneDefaultSettings=c.DIVESceneDefaultSettings;exports.DIVESceneLight=c.DIVESceneLight;exports.DIVEView=c.DIVEView;exports.FILE_TYPES=c.FILE_TYPES;exports.GRID_MAJOR_LINE_COLOR=c.GRID_MAJOR_LINE_COLOR;exports.GRID_MINOR_LINE_COLOR=c.GRID_MINOR_LINE_COLOR;exports.SUPPORTED_FILE_TYPES=c.SUPPORTED_FILE_TYPES;exports.findSceneRecursive=c.findSceneRecursive;exports.COORDINATE_LAYER_MASK=u.COORDINATE_LAYER_MASK;exports.DEFAULT_LAYER_MASK=u.DEFAULT_LAYER_MASK;exports.DIVEPerspectiveCamera=u.DIVEPerspectiveCamera;exports.DIVEPerspectiveCameraDefaultSettings=u.DIVEPerspectiveCameraDefaultSettings;exports.HELPER_LAYER_MASK=u.HELPER_LAYER_MASK;exports.PRODUCT_LAYER_MASK=u.PRODUCT_LAYER_MASK;exports.UI_LAYER_MASK=u.UI_LAYER_MASK;exports.AxesColorBlue=_.AxesColorBlue;exports.AxesColorBlueLetter=_.AxesColorBlueLetter;exports.AxesColorGreen=_.AxesColorGreen;exports.AxesColorGreenLetter=_.AxesColorGreenLetter;exports.AxesColorRed=_.AxesColorRed;exports.AxesColorRedLetter=_.AxesColorRedLetter;exports.findInterface=V.findInterface;exports.implementsInterface=V.implementsInterface;exports.getFileTypeFromUri=y.getFileTypeFromUri;exports.isFileTypeSupported=y.isFileTypeSupported;exports.FileContentError=w.FileContentError;exports.NetworkError=w.NetworkError;exports.FileTypeError=A.FileTypeError;exports.ParseError=A.ParseError;exports.isModelSchema=P.isModelSchema;exports.isPovSchema=P.isPovSchema;exports.DIVEGizmo=F;exports.DIVEMath=S;exports.DIVEMovable=U;exports.DIVESelectable=K;exports.applyMixins=X;exports.deepClone=f;exports.getObjectDelta=I;exports.isGroupSchema=q;exports.isLightSchema=B;exports.isPrimitiveSchema=Z;
|
|
1
|
+
"use strict";var b=Object.defineProperty;var R=(r,i,e)=>i in r?b(r,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[i]=e;var n=(r,i,e)=>R(r,typeof i!="symbol"?i+"":i,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./chunks/FileTypes-Bvt5QTJC.cjs"),u=require("./chunks/PerspectiveCamera-DwQUmkDv.cjs"),_=require("./chunks/AxisHelperColors-BrGqktN5.cjs"),s=require("three/webgpu"),V=require("./chunks/findInterface-C6mrvf_t.cjs"),y=require("./chunks/isFileTypeSupported-MJWHcUsR.cjs"),w=require("./chunks/network-error-CdDXil5g.cjs"),A=require("./chunks/parse-error-Dy_EE4rL.cjs"),x=require("./chunks/PovSchema-Co9FznEz.cjs");class m extends s.Object3D{constructor(e,t,o,h,a){super();n(this,"isHoverable",!0);n(this,"isDraggable",!0);n(this,"parent",null);n(this,"axis");n(this,"_color",new s.Color(16711935));n(this,"_colorHover");n(this,"_hovered");n(this,"_highlight");n(this,"_lineMaterial");n(this,"_colliderMesh");this.name="DIVERadialHandle",this.axis=e,this._color.set(a),this._colorHover=this._color.clone().multiplyScalar(2),this._hovered=!1,this._highlight=!1;const l=new s.TorusGeometry(t,.01,13,48,o);this._lineMaterial=new s.MeshBasicMaterial({color:a,depthTest:!1,depthWrite:!1});const d=new s.Mesh(l,this._lineMaterial);d.layers.mask=u.UI_LAYER_MASK,d.renderOrder=1/0,this.add(d);const g=new s.TorusGeometry(t,.1,3,48,o),E=new s.MeshBasicMaterial({color:16711935,transparent:!0,opacity:.15,depthTest:!1,depthWrite:!1});this._colliderMesh=new s.Mesh(g,E),this._colliderMesh.visible=!1,this._colliderMesh.layers.mask=u.UI_LAYER_MASK,this._colliderMesh.renderOrder=1/0,this.add(this._colliderMesh),this.lookAt(h)}set debug(e){this._colliderMesh.visible=e}get highlight(){return this._highlight}set highlight(e){this._highlight=e,this._lineMaterial.color=this._highlight||this._hovered?this._colorHover:this._color}get forwardVector(){return new s.Vector3(0,0,1).applyQuaternion(this.quaternion).normalize()}get rightVector(){return new s.Vector3(1,0,0).applyQuaternion(this.quaternion).normalize()}get upVector(){return new s.Vector3(0,1,0).applyQuaternion(this.quaternion).normalize()}reset(){this._lineMaterial.color=this._color}onPointerEnter(){this._hovered=!0,this.parent&&this.parent.onHandleHover(this,!0)}onPointerLeave(){this._hovered=!1,this.parent&&this.parent.onHandleHover(this,!1)}onDragStart(){this.parent&&this.parent.onHandleDragStart(this)}onDrag(e){this.parent&&this.parent.onHandleDrag(this,e)}onDragEnd(){this.parent&&this.parent.onHandleDragEnd(this)}}function p(r,i){const e=(r+"e").split("e");return+(e[0]+"e"+(+e[1]+(i||0)))}function O(r,i=0){const e=p(r,+i);return p(Math.ceil(e),-i)}function v(r,i=0){const e=p(r,+i);return p(Math.floor(e),-i)}function P(r,i=0){if(r<0)return-P(-r,i);const e=p(r,+i);return p(Math.round(e),-i)}function H(r,i,e){return Math.atan2(r.clone().cross(i).dot(e),i.clone().dot(r))}function z(r,i=0){const e=p(r,+i);return p(Math.round(e),-i).toFixed(i)}function G(r,i=0){const e=p(r,+i);return p(Math.trunc(e),-i)}function L(r){return(s.MathUtils.radToDeg(r)+360)%360}function C(r){return s.MathUtils.degToRad(r)}const S={ceilExp:O,floorExp:v,roundExp:P,toFixedExp:z,truncateExp:G,signedAngleTo:H,radToDeg:L,degToRad:C};class Y extends s.Object3D{constructor(e){super();n(this,"children");n(this,"_controller");n(this,"_startRot");this.name="DIVERotateGizmo",this.children=[],this._startRot=null,this._controller=e,this.add(new m("x",1,Math.PI/2,new s.Vector3(1,0,0),_.AxesColorRed)),this.add(new m("y",1,-Math.PI/2,new s.Vector3(0,1,0),_.AxesColorGreen)),this.add(new m("z",1,Math.PI/2,new s.Vector3(0,0,1),_.AxesColorBlue))}set debug(e){this.children.forEach(t=>{t.debug=e})}reset(){this.children.forEach(e=>{e.reset()})}handleHighlight(e,t,o){this.children.forEach(h=>{o?h.highlight=h.axis===e&&o:h.highlight=h.axis===e&&t})}onHandleHover(e,t){this._startRot||this.parent&&this.parent.parent&&(this.parent.parent.onHover("rotate",e.axis,t),this.handleHighlight(e.axis,t,!1))}onHandleDragStart(e){if(!this.parent||!this.parent.parent)return;const t=this.parent.parent.object;t&&(this._startRot=t.rotation.clone(),this.handleHighlight(e.axis,!0,!0))}onHandleDrag(e,t){if(!this._startRot||!this.parent||!this.parent.parent||!("onChange"in this.parent.parent))return;const o=t.dragCurrent.clone().sub(this.parent.parent.position).normalize(),h=t.dragStart.clone().sub(this.parent.parent.position).normalize(),a=S.signedAngleTo(h,o,e.forwardVector),l=new s.Euler(this._startRot.x+e.forwardVector.x*a,this._startRot.y+e.forwardVector.y*a,this._startRot.z+e.forwardVector.z*a);this.parent.parent.onChange(void 0,l)}onHandleDragEnd(e){this._startRot=null,this.handleHighlight(e.axis,!1,!1)}}class D extends s.Object3D{constructor(e,t,o,h){super();n(this,"isHoverable",!0);n(this,"isDraggable",!0);n(this,"parent",null);n(this,"axis");n(this,"_color",new s.Color(16711935));n(this,"_colorHover");n(this,"_hovered");n(this,"_highlight");n(this,"_lineMaterial");n(this,"_colliderMesh");this.name="DIVEAxisHandle",this.axis=e,this._color.set(h),this._colorHover=this._color.clone().multiplyScalar(2),this._highlight=!1,this._hovered=!1;const a=new s.CylinderGeometry(.01,.01,t,13);this._lineMaterial=new s.MeshBasicMaterial({color:h,depthTest:!1,depthWrite:!1});const l=new s.Mesh(a,this._lineMaterial);l.layers.mask=u.UI_LAYER_MASK,l.renderOrder=1/0,l.rotateX(Math.PI/2),l.translateY(t/2),this.add(l);const d=new s.CylinderGeometry(.1,.1,t,3),g=new s.MeshBasicMaterial({color:16711935,transparent:!0,opacity:.15,depthTest:!1,depthWrite:!1});this._colliderMesh=new s.Mesh(d,g),this._colliderMesh.visible=!1,this._colliderMesh.layers.mask=u.UI_LAYER_MASK,this._colliderMesh.renderOrder=1/0,this._colliderMesh.rotateX(Math.PI/2),this._colliderMesh.translateY(t/2),this.add(this._colliderMesh),this.rotateX(o.y*-Math.PI/2),this.rotateY(o.x*Math.PI/2)}set debug(e){this._colliderMesh.visible=e}get highlight(){return this._highlight}set highlight(e){this._highlight=e,this._lineMaterial.color=this._highlight||this._hovered?this._colorHover:this._color}get forwardVector(){return new s.Vector3(0,0,1).applyQuaternion(this.quaternion).normalize()}get rightVector(){return new s.Vector3(1,0,0).applyQuaternion(this.quaternion).normalize()}get upVector(){return new s.Vector3(0,1,0).applyQuaternion(this.quaternion).normalize()}reset(){this._lineMaterial.color=this._color}onPointerEnter(){this._hovered=!0,this.parent&&this.parent.onHandleHover(this,!0)}onPointerLeave(){this._hovered=!1,this.parent&&this.parent.onHandleHover(this,!1)}onDragStart(){this.parent&&this.parent.onHandleDragStart(this)}onDrag(e){this.parent&&this.parent.onHandleDrag(this,e)}onDragEnd(){this.parent&&this.parent.onHandleDragEnd(this)}}class T extends s.Object3D{constructor(e){super();n(this,"_controller");n(this,"children");n(this,"_startPos");this.name="DIVETranslateGizmo",this.children=[],this._startPos=null,this._controller=e,this.add(new D("x",1,new s.Vector3(1,0,0),_.AxesColorRed)),this.add(new D("y",1,new s.Vector3(0,1,0),_.AxesColorGreen)),this.add(new D("z",1,new s.Vector3(0,0,1),_.AxesColorBlue))}set debug(e){this.children.forEach(t=>{t.debug=e})}reset(){this.children.forEach(e=>{e.reset()})}handleHighlight(e,t,o){this.children.forEach(h=>{o?h.highlight=h.axis===e&&o:h.highlight=h.axis===e&&t})}onHandleHover(e,t){this._startPos||this.parent&&this.parent.parent&&(this.parent.parent.onHover("translate",e.axis,t),this.handleHighlight(e.axis,t,!1))}onHandleDragStart(e){if(!this.parent||!this.parent.parent)return;const t=this.parent.parent.object;t&&(this._startPos=t.position.clone(),this.handleHighlight(e.axis,!0,!0))}onHandleDrag(e,t){if(!this._startPos||!this.parent||!this.parent.parent||!("onChange"in this.parent.parent))return;const o=t.dragDelta.clone().projectOnVector(e.forwardVector);this.parent.parent.onChange(this._startPos.clone().add(o))}onHandleDragEnd(e){this._startPos=null,this.handleHighlight(e.axis,!1,!1)}}class M extends s.Object3D{constructor(e,t,o,h,a=.05){super();n(this,"isHoverable",!0);n(this,"isDraggable",!0);n(this,"parent",null);n(this,"axis");n(this,"_color",new s.Color(16711935));n(this,"_colorHover");n(this,"_hovered");n(this,"_highlight");n(this,"_lineMaterial");n(this,"_colliderMesh");n(this,"_box");n(this,"_boxSize");this.name="DIVEScaleHandle",this.axis=e,this._color.set(h),this._colorHover=this._color.clone().multiplyScalar(2),this._hovered=!1,this._highlight=!1,this._boxSize=a;const l=new s.CylinderGeometry(.01,.01,t-a/2,13);this._lineMaterial=new s.MeshBasicMaterial({color:h,depthTest:!1,depthWrite:!1});const d=new s.Mesh(l,this._lineMaterial);d.layers.mask=u.UI_LAYER_MASK,d.renderOrder=1/0,d.rotateX(Math.PI/2),d.translateY(t/2-a/4),this.add(d),this._box=new s.Mesh(new s.BoxGeometry(a,a,a),this._lineMaterial),this._box.layers.mask=u.UI_LAYER_MASK,this._box.renderOrder=1/0,this._box.rotateX(Math.PI/2),this._box.translateY(t-a/2),this._box.rotateZ(o.x*Math.PI/2),this._box.rotateX(o.z*Math.PI/2),this.add(this._box);const g=new s.CylinderGeometry(.1,.1,t+a/2,3),E=new s.MeshBasicMaterial({color:16711935,transparent:!0,opacity:.15,depthTest:!1,depthWrite:!1});this._colliderMesh=new s.Mesh(g,E),this._colliderMesh.visible=!1,this._colliderMesh.layers.mask=u.UI_LAYER_MASK,this._colliderMesh.renderOrder=1/0,this._colliderMesh.rotateX(Math.PI/2),this._colliderMesh.translateY(t/2),this.add(this._colliderMesh),this.rotateX(o.y*-Math.PI/2),this.rotateY(o.x*Math.PI/2)}set debug(e){this._colliderMesh.visible=e}get highlight(){return this._highlight}set highlight(e){this._highlight=e,this._lineMaterial.color=this._highlight||this._hovered?this._colorHover:this._color}get forwardVector(){return new s.Vector3(0,0,1).applyQuaternion(this.quaternion).normalize()}get rightVector(){return new s.Vector3(1,0,0).applyQuaternion(this.quaternion).normalize()}get upVector(){return new s.Vector3(0,1,0).applyQuaternion(this.quaternion).normalize()}reset(){this._lineMaterial.color=this._color}update(e){this._box.scale.copy(new s.Vector3(1,1,1).sub(this.forwardVector).add(e.clone().multiply(this.forwardVector)))}onPointerEnter(){this._hovered=!0,this.parent&&this.parent.onHoverAxis(this,!0)}onPointerLeave(){this._hovered=!1,this.parent&&this.parent.onHoverAxis(this,!1)}onDragStart(){this.parent&&this.parent.onAxisDragStart(this)}onDrag(e){this.parent&&this.parent.onAxisDrag(this,e)}onDragEnd(){this.parent&&this.parent.onAxisDragEnd(this)}}class j extends s.Object3D{constructor(e){super();n(this,"isHoverable",!0);n(this,"children");n(this,"_controller");n(this,"_startScale");this.name="DIVEScaleGizmo",this.children=[],this._startScale=null,this._controller=e,this.add(new M("x",1,new s.Vector3(1,0,0),_.AxesColorRed)),this.add(new M("y",1,new s.Vector3(0,1,0),_.AxesColorGreen)),this.add(new M("z",1,new s.Vector3(0,0,1),_.AxesColorBlue))}set debug(e){this.children.forEach(t=>{t.debug=e})}reset(){this.children.forEach(e=>{e.reset()})}update(e){this.children.forEach(t=>{t.update(e)})}handleHighlight(e,t,o){this.children.forEach(h=>{o?h.highlight=h.axis===e&&o:h.highlight=h.axis===e&&t})}onHoverAxis(e,t){this._startScale||this.parent&&this.parent.parent&&(this.parent.parent.onHover("translate",e.axis,t),this.handleHighlight(e.axis,t,!1))}onAxisDragStart(e){if(!this.parent||!this.parent.parent)return;const t=this.parent.parent.object;t&&(this._startScale=t.scale.clone(),this.handleHighlight(e.axis,!0,!0))}onAxisDrag(e,t){if(!this._startScale||!this.parent||!this.parent.parent||!("onChange"in this.parent.parent))return;const o=t.dragDelta.clone().projectOnVector(e.forwardVector);this.parent.parent.onChange(void 0,void 0,this._startScale.clone().add(o))}onAxisDragEnd(e){this._startScale=null,this.handleHighlight(e.axis,!1,!1)}}class N extends s.Object3D{constructor(){super();n(this,"_meshX");n(this,"_meshY");n(this,"_meshZ");this.name="DIVEGizmoPlane";const e=new s.MeshBasicMaterial({transparent:!0,opacity:.15,depthTest:!1,depthWrite:!1,side:2}),t=new s.PlaneGeometry(100,100,2,2),o=e.clone();o.color.set(16711680),this._meshX=new s.Mesh(t,o),this._meshX.layers.mask=u.UI_LAYER_MASK,this._meshX.rotateY(Math.PI/2);const h=new s.PlaneGeometry(100,100,2,2),a=e.clone();a.color.set(65280),this._meshY=new s.Mesh(h,a),this._meshY.layers.mask=u.UI_LAYER_MASK,this._meshY.rotateX(-Math.PI/2);const l=new s.PlaneGeometry(100,100,2,2),d=e.clone();d.color.set(255),this._meshZ=new s.Mesh(l,d),this._meshZ.layers.mask=u.UI_LAYER_MASK}get XPlane(){return this._meshX}get YPlane(){return this._meshY}get ZPlane(){return this._meshZ}assemble(e,t){if(this.clear(),e==="translate"||e==="scale")switch(t){case"x":this.add(this._meshY),this.add(this._meshZ);break;case"y":this.add(this._meshX),this.add(this._meshZ);break;case"z":this.add(this._meshX),this.add(this._meshY);break}else if(e==="rotate")switch(t){case"x":this.add(this._meshX);break;case"y":this.add(this._meshY);break;case"z":this.add(this._meshZ);break}}}class F extends s.Object3D{constructor(e){super();n(this,"_mode");n(this,"_gizmoNode");n(this,"_translateGizmo");n(this,"_rotateGizmo");n(this,"_scaleGizmo");n(this,"_gizmoPlane");n(this,"_object");this.name="DIVEGizmo",e.addEventListener("change",()=>{const t=e.getDistance()/2.5;this.scale.set(t,t,t)}),this._mode="translate",this._gizmoNode=new s.Object3D,this.add(this._gizmoNode),this._translateGizmo=new T(e),this._rotateGizmo=new Y(e),this._scaleGizmo=new j(e),this._gizmoPlane=new N,this._gizmoPlane.visible=!1,this._object=null}get mode(){return this._mode}set mode(e){this._mode=e,this.assemble()}set debug(e){this._translateGizmo.debug=e,this._rotateGizmo.debug=e,this._scaleGizmo.debug=e}get gizmoNode(){return this._gizmoNode}get gizmoPlane(){return this._gizmoPlane}get object(){return this._object}attach(e){return this._object=e,this.assemble(),this}detach(){return this._object=null,this.assemble(),this}onHover(e,t,o){o&&this._gizmoPlane.assemble(e,t)}onChange(e,t,o){this.object!==null&&(e&&(this.position.copy(e),this.object.position.copy(e)),t&&this.object.rotation.copy(t),o&&(this.object.scale.copy(o),this._scaleGizmo.update(o)))}assemble(){this._gizmoNode.clear(),this._gizmoPlane.clear(),this._translateGizmo.reset(),this._rotateGizmo.reset(),this._scaleGizmo.reset(),this.object!==null&&(this._mode==="translate"&&this._gizmoNode.add(this._translateGizmo),this._mode==="rotate"&&this._gizmoNode.add(this._rotateGizmo),this._mode==="scale"&&this._gizmoNode.add(this._scaleGizmo),this.add(this._gizmoPlane))}}class U{constructor(){n(this,"isMovable",!0)}}class K{constructor(){n(this,"isSelectable",!0)}}function X(r,i){return i.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(o=>{if(o==="constructor")return;const h=Object.getOwnPropertyDescriptor(e.prototype,o);Object.defineProperty(r.prototype,o,h)});const t=new e;Object.getOwnPropertyNames(t).forEach(o=>{const h=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(r.prototype,o,h)})}),r}function f(r,i=new WeakMap){if(r===null||typeof r!="object")return r;if(i.has(r))return i.get(r);if(r instanceof Date)return new Date(r.getTime());if(r instanceof RegExp)return new RegExp(r.source,r.flags);if(Array.isArray(r)){const a=[];i.set(r,a);for(let l=0;l<r.length;l++)a[l]=f(r[l],i);return a}if(r instanceof Map){const a=new Map;i.set(r,a);for(const[l,d]of r)a.set(f(l,i),f(d,i));return a}if(r instanceof Set){const a=new Set;i.set(r,a);for(const l of r)a.add(f(l,i));return a}const e=r;if(typeof e.clone=="function"){const a=e.clone();return i.set(r,a),a}const t=Object.create(Object.getPrototypeOf(r));i.set(r,t);const o=Object.getOwnPropertyNames(r);for(const a of o){const l=Object.getOwnPropertyDescriptor(r,a);if(l)if(l.value!==void 0){const d=f(l.value,i);Object.defineProperty(t,a,{...l,value:d})}else Object.defineProperty(t,a,l)}const h=Object.getOwnPropertySymbols(r);for(const a of h){const l=Object.getOwnPropertyDescriptor(r,a);if(l)if(l.value!==void 0){const d=f(l.value,i);Object.defineProperty(t,a,{...l,value:d})}else Object.defineProperty(t,a,l)}return t}const I=(r,i)=>{if(Object.keys(r).length===0&&Object.keys(i).length===0)return{};if(typeof r!="object"||typeof i!="object")return i;let e={};return Object.keys(i).forEach(t=>{if(!Object.keys(r).includes(t)){e={...e,[t]:i[t]};return}if(Array.isArray(i[t])){if(!Array.isArray(r[t])){e={...e,[t]:i[t]};return}const o=r[t],h=i[t];if(o.length===0&&h.length===0){e={...e};return}if(o.length!==h.length){e={...e,[t]:i[t]};return}const a=[];if(h.forEach((l,d)=>{const g=I(o[d],h[d]);Object.keys(g).length&&a.push(h[d])}),Object.keys(a).length){e={...e,[t]:a};return}return}if(typeof i[t]=="object"){if(typeof r[t]!="object"){e={...e,[t]:i[t]};return}const o=I(r[t],i[t]);if(Object.keys(o).length){e={...e,[t]:o};return}}r[t]!==i[t]&&(e={...e,[t]:i[t]})}),e};function q(r){return r.entityType==="group"}function B(r){return r.entityType==="light"}function Z(r){return r.entityType==="primitive"}exports.BoundingBox=c.BoundingBox;exports.DIVE=c.DIVE;exports.DIVEAmbientLight=c.DIVEAmbientLight;exports.DIVEClock=c.DIVEClock;exports.DIVEDefaultSettings=c.DIVEDefaultSettings;exports.DIVEEnvironment=c.DIVEEnvironment;exports.DIVEEnvironmentDefaultSettings=c.DIVEEnvironmentDefaultSettings;exports.DIVEFloor=c.DIVEFloor;exports.DIVEGrid=c.DIVEGrid;exports.DIVEGroup=c.DIVEGroup;exports.DIVEModel=c.DIVEModel;exports.DIVENode=c.DIVENode;exports.DIVEPointLight=c.DIVEPointLight;exports.DIVEPrimitive=c.DIVEPrimitive;exports.DIVERenderer=c.DIVERenderer;exports.DIVERendererDefaultSettings=c.DIVERendererDefaultSettings;exports.DIVEResizeManager=c.DIVEResizeManager;exports.DIVERoot=c.DIVERoot;exports.DIVEScene=c.DIVEScene;exports.DIVESceneDefaultSettings=c.DIVESceneDefaultSettings;exports.DIVESceneLight=c.DIVESceneLight;exports.DIVEView=c.DIVEView;exports.FILE_TYPES=c.FILE_TYPES;exports.GRID_MAJOR_LINE_COLOR=c.GRID_MAJOR_LINE_COLOR;exports.GRID_MINOR_LINE_COLOR=c.GRID_MINOR_LINE_COLOR;exports.SUPPORTED_FILE_TYPES=c.SUPPORTED_FILE_TYPES;exports.findSceneRecursive=c.findSceneRecursive;exports.COORDINATE_LAYER_MASK=u.COORDINATE_LAYER_MASK;exports.DEFAULT_LAYER_MASK=u.DEFAULT_LAYER_MASK;exports.DIVEPerspectiveCamera=u.DIVEPerspectiveCamera;exports.DIVEPerspectiveCameraDefaultSettings=u.DIVEPerspectiveCameraDefaultSettings;exports.HELPER_LAYER_MASK=u.HELPER_LAYER_MASK;exports.PRODUCT_LAYER_MASK=u.PRODUCT_LAYER_MASK;exports.UI_LAYER_MASK=u.UI_LAYER_MASK;exports.AxesColorBlue=_.AxesColorBlue;exports.AxesColorBlueLetter=_.AxesColorBlueLetter;exports.AxesColorGreen=_.AxesColorGreen;exports.AxesColorGreenLetter=_.AxesColorGreenLetter;exports.AxesColorRed=_.AxesColorRed;exports.AxesColorRedLetter=_.AxesColorRedLetter;exports.findInterface=V.findInterface;exports.implementsInterface=V.implementsInterface;exports.getFileTypeFromUri=y.getFileTypeFromUri;exports.isFileTypeSupported=y.isFileTypeSupported;exports.FileContentError=w.FileContentError;exports.NetworkError=w.NetworkError;exports.FileTypeError=A.FileTypeError;exports.ParseError=A.ParseError;exports.isModelSchema=x.isModelSchema;exports.isPovSchema=x.isPovSchema;exports.DIVEGizmo=F;exports.DIVEMath=S;exports.DIVEMovable=U;exports.DIVESelectable=K;exports.applyMixins=X;exports.deepClone=f;exports.getObjectDelta=I;exports.isGroupSchema=q;exports.isLightSchema=B;exports.isPrimitiveSchema=Z;
|
package/build/dive.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
var S = Object.defineProperty;
|
|
2
2
|
var A = (r, s, t) => s in r ? S(r, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[s] = t;
|
|
3
3
|
var i = (r, s, t) => A(r, typeof s != "symbol" ? s + "" : s, t);
|
|
4
|
-
import { B as ot, b as ht, d as lt, e as ct, D as dt, f as pt, g as ut, h as ft, i as _t, j as gt,
|
|
5
|
-
import { U as d } from "./chunks/PerspectiveCamera-
|
|
6
|
-
import { C as
|
|
4
|
+
import { B as ot, b as ht, d as lt, e as ct, D as dt, f as pt, g as ut, h as ft, i as _t, j as gt, c as mt, k as Dt, l as Et, m as wt, n as yt, o as Mt, p as xt, q as It, r as Pt, s as Vt, t as bt, u as Ht, F as zt, G as vt, v as Ot, S as St, w as At } from "./chunks/FileTypes-BB4_1gBJ.mjs";
|
|
5
|
+
import { U as d } from "./chunks/PerspectiveCamera-B5TvUzTa.mjs";
|
|
6
|
+
import { C as Rt, b as Tt, D as Yt, a as jt, H as Lt, P as Ct } from "./chunks/PerspectiveCamera-B5TvUzTa.mjs";
|
|
7
7
|
import { A as I, a as P, b as V } from "./chunks/AxisHelperColors-JLBHYQDi.mjs";
|
|
8
|
-
import { e as
|
|
9
|
-
import { Object3D as f, Color as b, Vector3 as c, TorusGeometry as H, MeshBasicMaterial as g, Mesh as p, MathUtils as v, Euler as G, CylinderGeometry as
|
|
10
|
-
import { f as
|
|
11
|
-
import { g as
|
|
12
|
-
import { F as
|
|
13
|
-
import { F as
|
|
14
|
-
import { i as
|
|
8
|
+
import { e as Xt, d as Ft, c as Zt } from "./chunks/AxisHelperColors-JLBHYQDi.mjs";
|
|
9
|
+
import { Object3D as f, Color as b, Vector3 as c, TorusGeometry as H, MeshBasicMaterial as g, Mesh as p, MathUtils as v, Euler as G, CylinderGeometry as D, BoxGeometry as R, PlaneGeometry as w } from "three/webgpu";
|
|
10
|
+
import { f as Qt, i as Wt } from "./chunks/findInterface-DbJ5qzbc.mjs";
|
|
11
|
+
import { g as Ut, i as Bt } from "./chunks/isFileTypeSupported-D1z0zckw.mjs";
|
|
12
|
+
import { F as Jt, N as $t } from "./chunks/network-error-BONfHWQq.mjs";
|
|
13
|
+
import { F as ee, P as re } from "./chunks/parse-error-DfOPyLWM.mjs";
|
|
14
|
+
import { i as ie, a as ne } from "./chunks/PovSchema-DWWvr_ED.mjs";
|
|
15
15
|
class y extends f {
|
|
16
16
|
constructor(t, e, n, o, a) {
|
|
17
17
|
super();
|
|
@@ -34,14 +34,14 @@ class y extends f {
|
|
|
34
34
|
});
|
|
35
35
|
const l = new p(h, this._lineMaterial);
|
|
36
36
|
l.layers.mask = d, l.renderOrder = 1 / 0, this.add(l);
|
|
37
|
-
const _ = new H(e, 0.1, 3, 48, n),
|
|
37
|
+
const _ = new H(e, 0.1, 3, 48, n), E = new g({
|
|
38
38
|
color: 16711935,
|
|
39
39
|
transparent: !0,
|
|
40
40
|
opacity: 0.15,
|
|
41
41
|
depthTest: !1,
|
|
42
42
|
depthWrite: !1
|
|
43
43
|
});
|
|
44
|
-
this._colliderMesh = new p(_,
|
|
44
|
+
this._colliderMesh = new p(_, E), this._colliderMesh.visible = !1, this._colliderMesh.layers.mask = d, this._colliderMesh.renderOrder = 1 / 0, this.add(this._colliderMesh), this.lookAt(o);
|
|
45
45
|
}
|
|
46
46
|
set debug(t) {
|
|
47
47
|
this._colliderMesh.visible = t;
|
|
@@ -213,7 +213,7 @@ class M extends f {
|
|
|
213
213
|
i(this, "_lineMaterial");
|
|
214
214
|
i(this, "_colliderMesh");
|
|
215
215
|
this.name = "DIVEAxisHandle", this.axis = t, this._color.set(o), this._colorHover = this._color.clone().multiplyScalar(2), this._highlight = !1, this._hovered = !1;
|
|
216
|
-
const a = new
|
|
216
|
+
const a = new D(0.01, 0.01, e, 13);
|
|
217
217
|
this._lineMaterial = new g({
|
|
218
218
|
color: o,
|
|
219
219
|
depthTest: !1,
|
|
@@ -221,7 +221,7 @@ class M extends f {
|
|
|
221
221
|
});
|
|
222
222
|
const h = new p(a, this._lineMaterial);
|
|
223
223
|
h.layers.mask = d, h.renderOrder = 1 / 0, h.rotateX(Math.PI / 2), h.translateY(e / 2), this.add(h);
|
|
224
|
-
const l = new
|
|
224
|
+
const l = new D(0.1, 0.1, e, 3), _ = new g({
|
|
225
225
|
color: 16711935,
|
|
226
226
|
transparent: !0,
|
|
227
227
|
opacity: 0.15,
|
|
@@ -335,7 +335,7 @@ class x extends f {
|
|
|
335
335
|
i(this, "_box");
|
|
336
336
|
i(this, "_boxSize");
|
|
337
337
|
this.name = "DIVEScaleHandle", this.axis = t, this._color.set(o), this._colorHover = this._color.clone().multiplyScalar(2), this._hovered = !1, this._highlight = !1, this._boxSize = a;
|
|
338
|
-
const h = new
|
|
338
|
+
const h = new D(
|
|
339
339
|
0.01,
|
|
340
340
|
0.01,
|
|
341
341
|
e - a / 2,
|
|
@@ -351,19 +351,19 @@ class x extends f {
|
|
|
351
351
|
new R(a, a, a),
|
|
352
352
|
this._lineMaterial
|
|
353
353
|
), this._box.layers.mask = d, this._box.renderOrder = 1 / 0, this._box.rotateX(Math.PI / 2), this._box.translateY(e - a / 2), this._box.rotateZ(n.x * Math.PI / 2), this._box.rotateX(n.z * Math.PI / 2), this.add(this._box);
|
|
354
|
-
const _ = new
|
|
354
|
+
const _ = new D(
|
|
355
355
|
0.1,
|
|
356
356
|
0.1,
|
|
357
357
|
e + a / 2,
|
|
358
358
|
3
|
|
359
|
-
),
|
|
359
|
+
), E = new g({
|
|
360
360
|
color: 16711935,
|
|
361
361
|
transparent: !0,
|
|
362
362
|
opacity: 0.15,
|
|
363
363
|
depthTest: !1,
|
|
364
364
|
depthWrite: !1
|
|
365
365
|
});
|
|
366
|
-
this._colliderMesh = new p(_,
|
|
366
|
+
this._colliderMesh = new p(_, E), this._colliderMesh.visible = !1, this._colliderMesh.layers.mask = d, this._colliderMesh.renderOrder = 1 / 0, this._colliderMesh.rotateX(Math.PI / 2), this._colliderMesh.translateY(e / 2), this.add(this._colliderMesh), this.rotateX(n.y * -Math.PI / 2), this.rotateY(n.x * Math.PI / 2);
|
|
367
367
|
}
|
|
368
368
|
set debug(t) {
|
|
369
369
|
this._colliderMesh.visible = t;
|
|
@@ -742,65 +742,63 @@ function it(r) {
|
|
|
742
742
|
}
|
|
743
743
|
export {
|
|
744
744
|
V as AxesColorBlue,
|
|
745
|
-
|
|
745
|
+
Xt as AxesColorBlueLetter,
|
|
746
746
|
P as AxesColorGreen,
|
|
747
|
-
|
|
747
|
+
Ft as AxesColorGreenLetter,
|
|
748
748
|
I as AxesColorRed,
|
|
749
|
-
|
|
749
|
+
Zt as AxesColorRedLetter,
|
|
750
750
|
ot as BoundingBox,
|
|
751
|
-
|
|
752
|
-
|
|
751
|
+
Rt as COORDINATE_LAYER_MASK,
|
|
752
|
+
Tt as DEFAULT_LAYER_MASK,
|
|
753
753
|
ht as DIVE,
|
|
754
754
|
lt as DIVEAmbientLight,
|
|
755
755
|
ct as DIVEClock,
|
|
756
756
|
dt as DIVEDefaultSettings,
|
|
757
|
-
pt as
|
|
758
|
-
ut as
|
|
759
|
-
ft as
|
|
760
|
-
_t as DIVEFloor,
|
|
757
|
+
pt as DIVEEnvironment,
|
|
758
|
+
ut as DIVEEnvironmentDefaultSettings,
|
|
759
|
+
ft as DIVEFloor,
|
|
761
760
|
J as DIVEGizmo,
|
|
762
|
-
|
|
763
|
-
|
|
761
|
+
_t as DIVEGrid,
|
|
762
|
+
gt as DIVEGroup,
|
|
764
763
|
F as DIVEMath,
|
|
765
|
-
|
|
764
|
+
mt as DIVEModel,
|
|
766
765
|
$ as DIVEMovable,
|
|
767
766
|
Dt as DIVENode,
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
zt as DIVESceneLight,
|
|
767
|
+
Yt as DIVEPerspectiveCamera,
|
|
768
|
+
jt as DIVEPerspectiveCameraDefaultSettings,
|
|
769
|
+
Et as DIVEPointLight,
|
|
770
|
+
wt as DIVEPrimitive,
|
|
771
|
+
yt as DIVERenderer,
|
|
772
|
+
Mt as DIVERendererDefaultSettings,
|
|
773
|
+
xt as DIVEResizeManager,
|
|
774
|
+
It as DIVERoot,
|
|
775
|
+
Pt as DIVEScene,
|
|
776
|
+
Vt as DIVESceneDefaultSettings,
|
|
777
|
+
bt as DIVESceneLight,
|
|
780
778
|
tt as DIVESelectable,
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
779
|
+
Ht as DIVEView,
|
|
780
|
+
zt as FILE_TYPES,
|
|
781
|
+
Jt as FileContentError,
|
|
782
|
+
ee as FileTypeError,
|
|
783
|
+
vt as GRID_MAJOR_LINE_COLOR,
|
|
784
|
+
Ot as GRID_MINOR_LINE_COLOR,
|
|
785
|
+
Lt as HELPER_LAYER_MASK,
|
|
786
|
+
$t as NetworkError,
|
|
787
|
+
Ct as PRODUCT_LAYER_MASK,
|
|
788
|
+
re as ParseError,
|
|
789
|
+
St as SUPPORTED_FILE_TYPES,
|
|
792
790
|
d as UI_LAYER_MASK,
|
|
793
791
|
et as applyMixins,
|
|
794
792
|
m as deepClone,
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
793
|
+
Qt as findInterface,
|
|
794
|
+
At as findSceneRecursive,
|
|
795
|
+
Ut as getFileTypeFromUri,
|
|
798
796
|
z as getObjectDelta,
|
|
799
|
-
|
|
800
|
-
|
|
797
|
+
Wt as implementsInterface,
|
|
798
|
+
Bt as isFileTypeSupported,
|
|
801
799
|
rt as isGroupSchema,
|
|
802
800
|
st as isLightSchema,
|
|
803
|
-
|
|
804
|
-
|
|
801
|
+
ie as isModelSchema,
|
|
802
|
+
ne as isPovSchema,
|
|
805
803
|
it as isPrimitiveSchema
|
|
806
804
|
};
|
package/build/engine/Dive.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DIVEClock } from './clock/Clock.ts';
|
|
2
2
|
import { DIVEView } from './view/View.ts';
|
|
3
3
|
import { DIVEScene, DIVESceneSettings } from './scene/Scene.ts';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { DIVEPerspectiveCameraSettings } from './camera/PerspectiveCamera.ts';
|
|
5
|
+
import { DIVERendererSettings } from './renderer/Renderer.ts';
|
|
6
6
|
import { OrbitControllerSettings } from '../plugins/orbitcontroller/index.ts';
|
|
7
7
|
declare global {
|
|
8
8
|
interface Window {
|
|
@@ -56,10 +56,6 @@ export declare const DIVEDefaultSettings: Required<DIVESettings>;
|
|
|
56
56
|
* @module
|
|
57
57
|
*/
|
|
58
58
|
export declare class DIVE {
|
|
59
|
-
/**
|
|
60
|
-
* @deprecated This static method will be removed in a future version. Please use `import { QuickView, QuickViewSettings, QuickViewDefaultSettings } from '@shopware-ag/dive/quickview'` instead.
|
|
61
|
-
*/
|
|
62
|
-
static QuickView(uri: string, settings?: Partial<import('../plugins/quickview/index.ts').QuickViewSettings>): Promise<import('../plugins/quickview/index.ts').QuickView>;
|
|
63
59
|
private _instanceId;
|
|
64
60
|
private _settings;
|
|
65
61
|
private _views;
|
|
@@ -68,37 +64,13 @@ export declare class DIVE {
|
|
|
68
64
|
private _clock;
|
|
69
65
|
private _orientationDisplay;
|
|
70
66
|
constructor(settings?: Partial<DIVESettings>);
|
|
71
|
-
/**
|
|
72
|
-
* @deprecated This property will be removed in a future version. Please use properties on the DIVE instance and mainView directly.
|
|
73
|
-
*/
|
|
74
|
-
get engine(): {
|
|
75
|
-
scene: DIVEScene;
|
|
76
|
-
camera: DIVEPerspectiveCamera;
|
|
77
|
-
renderer: DIVERenderer;
|
|
78
|
-
setCanvas: (canvas: HTMLCanvasElement) => void;
|
|
79
|
-
clock: DIVEClock;
|
|
80
|
-
start: () => void;
|
|
81
|
-
stop: () => void;
|
|
82
|
-
dispose: () => void;
|
|
83
|
-
};
|
|
84
67
|
get views(): DIVEView[];
|
|
85
68
|
get mainView(): DIVEView;
|
|
86
69
|
get canvas(): HTMLCanvasElement;
|
|
87
70
|
get scene(): DIVEScene;
|
|
88
71
|
get clock(): DIVEClock;
|
|
89
72
|
start(): void;
|
|
73
|
+
startAsync(): Promise<void>;
|
|
90
74
|
stop(): void;
|
|
91
75
|
dispose(): Promise<void>;
|
|
92
|
-
/**
|
|
93
|
-
* @deprecated This method will be removed in a future version. To create a new view, use `QuickView` instead.
|
|
94
|
-
*/
|
|
95
|
-
createView(camera?: DIVEPerspectiveCamera): DIVEView;
|
|
96
|
-
/**
|
|
97
|
-
* @deprecated This method will be removed in a future version.
|
|
98
|
-
*/
|
|
99
|
-
disposeView(view: DIVEView): void;
|
|
100
76
|
}
|
|
101
|
-
/**
|
|
102
|
-
* @deprecated Use `import { DIVE } from '@shopware-ag/dive'` instead.
|
|
103
|
-
*/
|
|
104
|
-
export declare const DIVEEngine: typeof DIVE;
|