@shopware-ag/dive 1.19.1-beta.9 → 2.0.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/chunks/FileTypes-BjZ0rrIV.cjs +1 -0
- package/build/chunks/FileTypes-qgYnI0Jg.mjs +30 -0
- package/build/chunks/ModuleRegistry-NyNtjHb2.cjs +1 -0
- package/build/chunks/ModuleRegistry-RSub8W0G.mjs +13 -0
- package/build/chunks/PerspectiveCamera-BByyG5R4.cjs +1 -0
- package/build/chunks/PerspectiveCamera-sm4_81KJ.mjs +34 -0
- package/build/chunks/SelectTool-BAXTVyWs.cjs +1 -0
- package/build/chunks/SelectTool-Bd8cC9nb.mjs +712 -0
- package/build/chunks/{SystemInfo-DYq9x4Ch.mjs → SystemInfo-DPAQG-S5.mjs} +37 -40
- package/build/chunks/SystemInfo-oX-NNneO.cjs +1 -0
- package/build/chunks/VisibilityLayerMask-BI7jPKdx.cjs +1 -0
- package/build/chunks/VisibilityLayerMask-CXgt1fJc.mjs +8 -0
- package/build/chunks/findInterface-BEdL2iUQ.cjs +1 -0
- package/build/chunks/findInterface-OrXgmwxj.mjs +18 -0
- package/build/chunks/index-C_uFFwT2.mjs +5 -0
- package/build/chunks/index-DAwIH9xh.cjs +1 -0
- package/build/chunks/package-BHjZWYD6.mjs +39 -0
- package/build/chunks/package-JHvTSNgQ.cjs +1 -0
- package/build/chunks/{fflate.module-Chbb_O8w.cjs → parse-error-2f5qpXP5.cjs} +2 -3
- package/build/chunks/{fflate.module-BQhIETD7.mjs → parse-error-DRBVHL9E.mjs} +16 -17
- package/build/dive.cjs +30 -0
- package/build/dive.mjs +1663 -0
- package/build/src/components/floor/Floor.d.ts +2 -2
- package/build/src/components/gizmo/Gizmo.d.ts +4 -4
- package/build/src/components/gizmo/handles/AxisHandle.d.ts +4 -4
- package/build/src/components/gizmo/handles/RadialHandle.d.ts +4 -4
- package/build/src/components/gizmo/handles/ScaleHandle.d.ts +4 -4
- package/build/src/components/gizmo/plane/GizmoPlane.d.ts +1 -1
- package/build/src/components/gizmo/rotate/RotateGizmo.d.ts +4 -4
- package/build/src/components/gizmo/scale/ScaleGizmo.d.ts +5 -5
- package/build/src/components/gizmo/translate/TranslateGizmo.d.ts +4 -4
- package/build/src/components/grid/Grid.d.ts +1 -1
- package/build/src/components/light/AmbientLight.d.ts +3 -3
- package/build/src/components/light/PointLight.d.ts +6 -6
- package/build/src/components/light/SceneLight.d.ts +3 -3
- package/build/src/components/model/Model.d.ts +9 -6
- package/build/src/components/node/Node.d.ts +4 -4
- package/build/src/components/primitive/Primitive.d.ts +4 -4
- package/build/src/components/root/Root.d.ts +20 -29
- package/build/src/core/Dive.d.ts +26 -14
- package/build/src/engine/Engine.d.ts +7 -11
- package/build/src/engine/clock/Clock.d.ts +4 -0
- package/build/src/engine/renderer/Renderer.d.ts +12 -8
- package/build/src/engine/resize/ResizeManager.d.ts +4 -2
- package/build/src/engine/scene/Scene.d.ts +6 -24
- package/build/src/engine/scene/xrroot/XRRoot.d.ts +5 -5
- package/build/src/engine/scene/xrroot/xrlightroot/XRLightRoot.d.ts +3 -3
- package/build/src/helpers/findSceneRecursive/findSceneRecursive.d.ts +1 -1
- package/build/src/helpers/isFileTypeSupported/isFileTypeSupported.d.ts +1 -1
- package/build/src/index.d.ts +6 -9
- package/build/src/interfaces/Draggable.d.ts +1 -1
- package/build/src/modules/ModuleRegistry.d.ts +19 -0
- package/build/src/modules/animation/AnimationSystem.cjs +1 -0
- package/build/src/modules/animation/AnimationSystem.d.ts +28 -4
- package/build/src/modules/animation/AnimationSystem.mjs +95 -0
- package/build/src/modules/animation/animator/Animator.d.ts +26 -0
- package/build/src/modules/animation/types/AnimatorParameters.d.ts +7 -0
- package/build/src/modules/ar/ARSystem.cjs +1 -2
- package/build/src/modules/ar/ARSystem.mjs +5 -5
- package/build/src/modules/ar/arquicklook/ARQuickLook.d.ts +1 -1
- package/build/src/modules/ar/sceneviewer/SceneViewer.d.ts +1 -1
- package/build/src/modules/ar/webxr/WebXR.d.ts +3 -3
- package/build/src/modules/ar/webxr/controller/WebXRController.d.ts +3 -3
- package/build/src/modules/ar/webxr/origin/WebXROrigin.d.ts +2 -2
- package/build/src/modules/ar/webxr/raycaster/WebXRRaycaster.d.ts +4 -4
- package/build/src/modules/ar/webxr/raycaster/ar/WebXRRaycasterAR.d.ts +3 -3
- package/build/src/modules/ar/webxr/raycaster/three/WebXRRaycasterTHREE.d.ts +4 -4
- package/build/src/modules/ar/webxr/touchscreencontrols/WebXRTouchscreenControls.d.ts +1 -1
- package/build/src/modules/asset/converter/AssetConverter.cjs +0 -1
- package/build/src/modules/asset/converter/AssetConverter.d.ts +3 -3
- package/build/src/modules/asset/converter/AssetConverter.mjs +0 -1
- package/build/src/modules/asset/draco/README.md +32 -0
- package/build/src/modules/asset/draco/draco_decoder.js +33 -0
- package/build/src/modules/asset/draco/draco_decoder.wasm +0 -0
- package/build/src/modules/asset/draco/draco_encoder.js +33 -0
- package/build/src/modules/asset/draco/draco_wasm_wrapper.js +116 -0
- package/build/src/modules/asset/draco/gltf/draco_decoder.js +33 -0
- package/build/src/modules/asset/draco/gltf/draco_decoder.wasm +0 -0
- package/build/src/modules/asset/draco/gltf/draco_encoder.js +33 -0
- package/build/src/modules/asset/draco/gltf/draco_wasm_wrapper.js +116 -0
- package/build/src/modules/asset/exporter/AssetExporter.cjs +1 -2
- package/build/src/modules/asset/exporter/AssetExporter.d.ts +3 -3
- package/build/src/modules/asset/exporter/AssetExporter.mjs +1 -2
- package/build/src/modules/asset/loader/AssetLoader.cjs +3 -2
- package/build/src/modules/asset/loader/AssetLoader.mjs +2152 -5
- package/build/src/modules/axiscamera/AxisCamera.d.ts +8 -9
- package/build/src/modules/controller/orbit/OrbitController.d.ts +13 -24
- package/build/src/modules/mediacreator/MediaCreator.cjs +1 -2
- package/build/src/modules/mediacreator/MediaCreator.d.ts +4 -4
- package/build/src/modules/mediacreator/MediaCreator.mjs +28 -3
- package/build/src/modules/state/ActionRegistry.d.ts +26 -0
- package/build/src/modules/state/State.cjs +27 -0
- package/build/src/modules/state/State.d.ts +58 -0
- package/build/src/modules/state/State.mjs +4296 -0
- package/build/src/modules/state/actions/action.d.ts +36 -0
- package/build/src/modules/state/actions/ar/index.d.ts +1 -0
- package/build/src/modules/state/actions/ar/launchar.d.ts +15 -0
- package/build/src/modules/state/actions/camera/computeencompassingview.d.ts +12 -0
- package/build/src/modules/state/actions/camera/getcameratransform.d.ts +12 -0
- package/build/src/modules/state/actions/camera/index.d.ts +6 -0
- package/build/src/modules/state/actions/camera/lockcamera.d.ts +8 -0
- package/build/src/modules/state/actions/camera/movecamera.d.ts +29 -0
- package/build/src/modules/state/actions/camera/setcameralayer.d.ts +12 -0
- package/build/src/modules/state/actions/camera/setcameratransform.d.ts +15 -0
- package/build/src/modules/state/actions/camera/zoomcamera.d.ts +14 -0
- package/build/src/modules/state/actions/index.d.ts +7 -0
- package/build/src/modules/state/actions/media/generatemedia.d.ts +25 -0
- package/build/src/modules/state/actions/media/index.d.ts +1 -0
- package/build/src/modules/state/actions/object/addobject.d.ts +8 -0
- package/build/src/modules/state/actions/object/deleteobject.d.ts +12 -0
- package/build/src/modules/state/actions/object/deselectobject.d.ts +12 -0
- package/build/src/modules/state/actions/object/dropit.d.ts +12 -0
- package/build/src/modules/state/actions/object/getallobjects.d.ts +8 -0
- package/build/src/modules/state/actions/object/getobjects.d.ts +12 -0
- package/build/src/modules/state/actions/object/index.d.ts +11 -0
- package/build/src/modules/state/actions/object/modelloaded.d.ts +12 -0
- package/build/src/modules/state/actions/object/placeonfloor.d.ts +12 -0
- package/build/src/modules/state/actions/object/selectobject.d.ts +12 -0
- package/build/src/modules/state/actions/object/setparent.d.ts +22 -0
- package/build/src/modules/state/actions/object/updateobject.d.ts +12 -0
- package/build/src/modules/state/actions/renderer/index.d.ts +1 -0
- package/build/src/modules/state/actions/renderer/startrender.d.ts +8 -0
- package/build/src/modules/state/actions/scene/exportscene.d.ts +13 -0
- package/build/src/modules/state/actions/scene/getallscenedata.d.ts +9 -0
- package/build/src/modules/state/actions/scene/index.d.ts +4 -0
- package/build/src/modules/state/actions/scene/setbackground.d.ts +12 -0
- package/build/src/modules/state/actions/scene/updatescene.d.ts +20 -0
- package/build/src/modules/state/actions/toolbox/index.d.ts +4 -0
- package/build/src/modules/state/actions/toolbox/setgizmomode.d.ts +12 -0
- package/build/src/modules/state/actions/toolbox/setgizmoscalelinked.d.ts +8 -0
- package/build/src/modules/state/actions/toolbox/setgizmovisible.d.ts +8 -0
- package/build/src/modules/state/actions/toolbox/usetool.d.ts +13 -0
- package/build/src/modules/state/types/ActionTypes.d.ts +18 -0
- package/build/src/modules/{com → state}/types/COMBaseEntity.d.ts +1 -1
- package/build/src/modules/state/types/COMEntity.d.ts +11 -0
- package/build/src/modules/{com → state}/types/COMGeometry.d.ts +1 -1
- package/build/src/modules/state/types/COMGroup.d.ts +11 -0
- package/build/src/modules/state/types/COMLight.d.ts +28 -0
- package/build/src/modules/state/types/COMModel.d.ts +14 -0
- package/build/src/modules/state/types/COMPov.d.ts +10 -0
- package/build/src/modules/state/types/COMPrimitive.d.ts +14 -0
- package/build/src/modules/state/types/index.d.ts +11 -0
- package/build/src/modules/systeminfo/SystemInfo.cjs +1 -2
- package/build/src/modules/systeminfo/SystemInfo.d.ts +1 -1
- package/build/src/modules/systeminfo/SystemInfo.mjs +3 -3
- package/build/src/modules/toolbox/BaseTool.d.ts +6 -6
- package/build/src/modules/toolbox/Toolbox.cjs +1 -0
- package/build/src/modules/toolbox/Toolbox.d.ts +12 -8
- package/build/src/modules/toolbox/Toolbox.mjs +99 -0
- package/build/src/modules/toolbox/select/SelectTool.d.ts +6 -6
- package/build/src/modules/toolbox/transform/TransformTool.d.ts +6 -6
- package/build/src/types/SceneData.d.ts +1 -1
- package/build/src/types/SceneObjects.d.ts +9 -7
- package/build/src/types/SceneType.d.ts +1 -1
- package/build/src/types/UUID.d.ts +1 -0
- package/build/src/types/file/index.d.ts +1 -1
- package/build/src/types/index.d.ts +6 -6
- package/package.json +34 -23
- package/build/chunks/AssetLoader-BYhwzCxs.cjs +0 -3
- package/build/chunks/AssetLoader-BYhwzCxs.cjs.map +0 -1
- package/build/chunks/AssetLoader-Bmcx40wo.mjs +0 -1948
- package/build/chunks/AssetLoader-Bmcx40wo.mjs.map +0 -1
- package/build/chunks/MediaCreator-CAXBbn15.mjs +0 -59
- package/build/chunks/MediaCreator-CAXBbn15.mjs.map +0 -1
- package/build/chunks/MediaCreator-DDXQIlRv.cjs +0 -2
- package/build/chunks/MediaCreator-DDXQIlRv.cjs.map +0 -1
- package/build/chunks/SystemInfo--669uW1p.cjs +0 -2
- package/build/chunks/SystemInfo--669uW1p.cjs.map +0 -1
- package/build/chunks/SystemInfo-DYq9x4Ch.mjs.map +0 -1
- package/build/chunks/fflate.module-BQhIETD7.mjs.map +0 -1
- package/build/chunks/fflate.module-Chbb_O8w.cjs.map +0 -1
- package/build/index.cjs +0 -57
- package/build/index.cjs.map +0 -1
- package/build/index.mjs +0 -6793
- package/build/index.mjs.map +0 -1
- package/build/src/engine/index.d.ts +0 -1
- package/build/src/engine/pipeline/RenderPipeline.d.ts +0 -26
- package/build/src/error/index.d.ts +0 -4
- package/build/src/modules/_system/ModuleImporter.d.ts +0 -43
- package/build/src/modules/ar/ARSystem.cjs.map +0 -1
- package/build/src/modules/ar/ARSystem.mjs.map +0 -1
- package/build/src/modules/asset/converter/AssetConverter.cjs.map +0 -1
- package/build/src/modules/asset/converter/AssetConverter.mjs.map +0 -1
- package/build/src/modules/asset/exporter/AssetExporter.cjs.map +0 -1
- package/build/src/modules/asset/exporter/AssetExporter.mjs.map +0 -1
- package/build/src/modules/asset/loader/AssetLoader.cjs.map +0 -1
- package/build/src/modules/asset/loader/AssetLoader.mjs.map +0 -1
- package/build/src/modules/com/Communication.d.ts +0 -72
- package/build/src/modules/com/actions/camera/computeencompassingview.d.ts +0 -9
- package/build/src/modules/com/actions/camera/getcameratransform.d.ts +0 -9
- package/build/src/modules/com/actions/camera/movecamera.d.ts +0 -15
- package/build/src/modules/com/actions/camera/resetcamera.d.ts +0 -7
- package/build/src/modules/com/actions/camera/setcameralayer.d.ts +0 -7
- package/build/src/modules/com/actions/camera/setcameratransform.d.ts +0 -9
- package/build/src/modules/com/actions/camera/zoomcamera.d.ts +0 -8
- package/build/src/modules/com/actions/index.d.ts +0 -60
- package/build/src/modules/com/actions/media/generatemedia.d.ts +0 -14
- package/build/src/modules/com/actions/object/addobject.d.ts +0 -6
- package/build/src/modules/com/actions/object/deleteobject.d.ts +0 -8
- package/build/src/modules/com/actions/object/deselectobject.d.ts +0 -8
- package/build/src/modules/com/actions/object/getallobjects.d.ts +0 -6
- package/build/src/modules/com/actions/object/getobjects.d.ts +0 -8
- package/build/src/modules/com/actions/object/model/dropit.d.ts +0 -7
- package/build/src/modules/com/actions/object/model/modelloaded.d.ts +0 -7
- package/build/src/modules/com/actions/object/model/placeonfloor.d.ts +0 -7
- package/build/src/modules/com/actions/object/selectobject.d.ts +0 -8
- package/build/src/modules/com/actions/object/setparent.d.ts +0 -13
- package/build/src/modules/com/actions/object/updateobject.d.ts +0 -8
- package/build/src/modules/com/actions/renderer/startrender.d.ts +0 -5
- package/build/src/modules/com/actions/scene/exportscene.d.ts +0 -8
- package/build/src/modules/com/actions/scene/getallscenedata.d.ts +0 -6
- package/build/src/modules/com/actions/scene/launchar.d.ts +0 -9
- package/build/src/modules/com/actions/scene/setbackground.d.ts +0 -7
- package/build/src/modules/com/actions/scene/updatescene.d.ts +0 -11
- package/build/src/modules/com/actions/toolbox/select/setgizmomode.d.ts +0 -7
- package/build/src/modules/com/actions/toolbox/transform/setgizmoscalelinked.d.ts +0 -5
- package/build/src/modules/com/actions/toolbox/transform/setgizmovisible.d.ts +0 -5
- package/build/src/modules/com/actions/toolbox/usetool.d.ts +0 -8
- package/build/src/modules/com/types/COMEntity.d.ts +0 -6
- package/build/src/modules/com/types/COMGroup.d.ts +0 -8
- package/build/src/modules/com/types/COMLight.d.ts +0 -10
- package/build/src/modules/com/types/COMModel.d.ts +0 -11
- package/build/src/modules/com/types/COMPov.d.ts +0 -7
- package/build/src/modules/com/types/COMPrimitive.d.ts +0 -11
- package/build/src/modules/com/types/index.d.ts +0 -11
- package/build/src/modules/index.d.ts +0 -2
- package/build/src/modules/mediacreator/MediaCreator.cjs.map +0 -1
- package/build/src/modules/mediacreator/MediaCreator.mjs.map +0 -1
- package/build/src/modules/systeminfo/SystemInfo.cjs.map +0 -1
- package/build/src/modules/systeminfo/SystemInfo.mjs.map +0 -1
- /package/build/{index.d.ts → dive.d.ts} +0 -0
- /package/build/src/modules/{com → state}/types/COMEntityType.d.ts +0 -0
- /package/build/src/modules/{com → state}/types/COMGeometryType.d.ts +0 -0
- /package/build/src/modules/{com → state}/types/COMMaterial.d.ts +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Central export point for the module system.
|
|
3
|
+
* This is the only place where ModuleRegistry should be imported from.
|
|
4
|
+
*/
|
|
5
|
+
declare const ModuleRegistry: {
|
|
6
|
+
readonly AnimationSystem: () => Promise<typeof import('./animation/AnimationSystem.ts').AnimationSystem>;
|
|
7
|
+
readonly ARSystem: () => Promise<typeof import('./ar/ARSystem.ts').ARSystem>;
|
|
8
|
+
readonly AssetConverter: () => Promise<typeof import('./asset/converter/AssetConverter.ts').AssetConverter>;
|
|
9
|
+
readonly AssetExporter: () => Promise<typeof import('./asset/exporter/AssetExporter.ts').AssetExporter>;
|
|
10
|
+
readonly AssetLoader: () => Promise<typeof import('./asset/loader/AssetLoader.ts').AssetLoader>;
|
|
11
|
+
readonly MediaCreator: () => Promise<typeof import('./mediacreator/MediaCreator.ts').MediaCreator>;
|
|
12
|
+
readonly State: () => Promise<typeof import('./state/State.ts').State>;
|
|
13
|
+
readonly Toolbox: () => Promise<typeof import('./toolbox/Toolbox.ts').Toolbox>;
|
|
14
|
+
};
|
|
15
|
+
type ModuleRegistry = typeof ModuleRegistry;
|
|
16
|
+
type ModuleName = keyof ModuleRegistry;
|
|
17
|
+
type ModuleType<T extends keyof ModuleRegistry> = ReturnType<ModuleRegistry[T]> extends Promise<infer U> ? U : never;
|
|
18
|
+
export declare const getModule: <T extends ModuleName>(moduleName: T) => Promise<ModuleType<T>>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var h=Object.defineProperty;var u=(n,e,t)=>e in n?h(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var i=(n,e,t)=>u(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@tweenjs/tween.js"),r=require("three");class d extends r.EventDispatcher{constructor(t,p,a,s){super();i(this,"_uuid",r.MathUtils.generateUUID());i(this,"_playing",!1);i(this,"_stopped",!1);i(this,"_completed",!1);this.object=t,this.to=p,this.duration=a,this.options=s}get uuid(){return this._uuid}get playing(){return this._playing}get stopped(){return this._stopped}get completed(){return this._completed}dispose(){this._playing=!1,this._stopped=!1,this._completed=!1}play(){return this._playing=!0,this._stopped=!1,this.dispatchEvent({type:"play",target:this}),console.log("play",this),this}stop(){return this._playing=!1,this._stopped=!0,this.dispatchEvent({type:"stop",target:this}),this}}class _{constructor(){i(this,"uuid",r.MathUtils.generateUUID());i(this,"_callbackMap",new Map);i(this,"_tweens",new Map)}createAnimator(e,t,p,a){var o,c;const s=new d(e,t,p,a);return this._callbackMap.set(s.uuid,{onUpdate:((o=s.options)==null?void 0:o.onUpdate)??(()=>{}),onComplete:((c=s.options)==null?void 0:c.onComplete)??(()=>{})}),this._setupTween(s),s}unregister(e){if(!this._callbackMap.has(e)){console.warn(`Animator with uuid ${e} not registered`);return}this._callbackMap.delete(e),this._tweens.delete(e)}Dispose(){this._callbackMap.clear(),this._tweens.clear()}tick(){l.update()}Animate(e){return new l.Tween(e)}_setupTween(e){var p;const t=new l.Tween(e.object).to(e.to,e.duration).easing(((p=e.options)==null?void 0:p.easing)??l.Easing.Quadratic.Out).onUpdate((a,s)=>{var o;(o=this._callbackMap.get(e.uuid))==null||o.onUpdate(a,s)}).onComplete(a=>{var s;(s=this._callbackMap.get(e.uuid))==null||s.onComplete(a)});e.addEventListener("play",()=>{t.start()}),e.addEventListener("stop",()=>{t.stop()}),this._tweens.set(e.uuid,t)}}exports.AnimationSystem=_;
|
|
@@ -1,12 +1,36 @@
|
|
|
1
1
|
import { Tween } from '@tweenjs/tween.js';
|
|
2
|
+
import { Animator } from './animator/Animator.ts';
|
|
3
|
+
import { UUID } from '../../types/index.ts';
|
|
4
|
+
import { DIVETicker } from '../../engine/clock/Clock.ts';
|
|
5
|
+
import { TAnimatorParameters } from './types/AnimatorParameters.ts';
|
|
6
|
+
export type * from './animator/Animator.ts';
|
|
7
|
+
declare global {
|
|
8
|
+
interface ModuleClasses {
|
|
9
|
+
AnimationSystem: typeof AnimationSystem;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
2
12
|
/**
|
|
13
|
+
* @module AnimationSystem
|
|
14
|
+
*
|
|
3
15
|
* Updates all animations.
|
|
4
16
|
* DIVE uses Tween.js to handle animations.
|
|
5
|
-
*
|
|
6
|
-
* @module
|
|
7
17
|
*/
|
|
8
|
-
export declare class
|
|
18
|
+
export declare class AnimationSystem implements DIVETicker {
|
|
19
|
+
uuid: string;
|
|
20
|
+
private _callbackMap;
|
|
21
|
+
private _tweens;
|
|
22
|
+
/**
|
|
23
|
+
* Creates a new animator and registers it.
|
|
24
|
+
* @param object - The object to animate.
|
|
25
|
+
* @param to - The target object.
|
|
26
|
+
* @param duration - The duration of the animation.
|
|
27
|
+
* @param options - The options for the animation.
|
|
28
|
+
* @returns The animator.
|
|
29
|
+
*/
|
|
30
|
+
createAnimator<T extends object>(object: T, to: T, duration: number, options?: TAnimatorParameters<T>): Animator<T>;
|
|
31
|
+
unregister(uuid: UUID): void;
|
|
9
32
|
Dispose(): void;
|
|
10
|
-
|
|
33
|
+
tick(): void;
|
|
11
34
|
Animate<T extends object>(object: T): Tween<T>;
|
|
35
|
+
private _setupTween;
|
|
12
36
|
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
var c = Object.defineProperty;
|
|
2
|
+
var d = (p, t, e) => t in p ? c(p, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : p[t] = e;
|
|
3
|
+
var i = (p, t, e) => d(p, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { update as u, Tween as r, Easing as _ } from "@tweenjs/tween.js";
|
|
5
|
+
import { EventDispatcher as g, MathUtils as h } from "three";
|
|
6
|
+
class w extends g {
|
|
7
|
+
constructor(e, n, a, s) {
|
|
8
|
+
super();
|
|
9
|
+
i(this, "_uuid", h.generateUUID());
|
|
10
|
+
i(this, "_playing", !1);
|
|
11
|
+
i(this, "_stopped", !1);
|
|
12
|
+
i(this, "_completed", !1);
|
|
13
|
+
this.object = e, this.to = n, this.duration = a, this.options = s;
|
|
14
|
+
}
|
|
15
|
+
get uuid() {
|
|
16
|
+
return this._uuid;
|
|
17
|
+
}
|
|
18
|
+
get playing() {
|
|
19
|
+
return this._playing;
|
|
20
|
+
}
|
|
21
|
+
get stopped() {
|
|
22
|
+
return this._stopped;
|
|
23
|
+
}
|
|
24
|
+
get completed() {
|
|
25
|
+
return this._completed;
|
|
26
|
+
}
|
|
27
|
+
dispose() {
|
|
28
|
+
this._playing = !1, this._stopped = !1, this._completed = !1;
|
|
29
|
+
}
|
|
30
|
+
play() {
|
|
31
|
+
return this._playing = !0, this._stopped = !1, this.dispatchEvent({ type: "play", target: this }), console.log("play", this), this;
|
|
32
|
+
}
|
|
33
|
+
stop() {
|
|
34
|
+
return this._playing = !1, this._stopped = !0, this.dispatchEvent({ type: "stop", target: this }), this;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
class M {
|
|
38
|
+
constructor() {
|
|
39
|
+
i(this, "uuid", h.generateUUID());
|
|
40
|
+
i(this, "_callbackMap", /* @__PURE__ */ new Map());
|
|
41
|
+
i(this, "_tweens", /* @__PURE__ */ new Map());
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Creates a new animator and registers it.
|
|
45
|
+
* @param object - The object to animate.
|
|
46
|
+
* @param to - The target object.
|
|
47
|
+
* @param duration - The duration of the animation.
|
|
48
|
+
* @param options - The options for the animation.
|
|
49
|
+
* @returns The animator.
|
|
50
|
+
*/
|
|
51
|
+
createAnimator(t, e, n, a) {
|
|
52
|
+
var o, l;
|
|
53
|
+
const s = new w(t, e, n, a);
|
|
54
|
+
return this._callbackMap.set(s.uuid, {
|
|
55
|
+
onUpdate: ((o = s.options) == null ? void 0 : o.onUpdate) ?? (() => {
|
|
56
|
+
}),
|
|
57
|
+
onComplete: ((l = s.options) == null ? void 0 : l.onComplete) ?? (() => {
|
|
58
|
+
})
|
|
59
|
+
}), this._setupTween(s), s;
|
|
60
|
+
}
|
|
61
|
+
unregister(t) {
|
|
62
|
+
if (!this._callbackMap.has(t)) {
|
|
63
|
+
console.warn(`Animator with uuid ${t} not registered`);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
this._callbackMap.delete(t), this._tweens.delete(t);
|
|
67
|
+
}
|
|
68
|
+
Dispose() {
|
|
69
|
+
this._callbackMap.clear(), this._tweens.clear();
|
|
70
|
+
}
|
|
71
|
+
tick() {
|
|
72
|
+
u();
|
|
73
|
+
}
|
|
74
|
+
Animate(t) {
|
|
75
|
+
return new r(t);
|
|
76
|
+
}
|
|
77
|
+
_setupTween(t) {
|
|
78
|
+
var n;
|
|
79
|
+
const e = new r(t.object).to(t.to, t.duration).easing(((n = t.options) == null ? void 0 : n.easing) ?? _.Quadratic.Out).onUpdate((a, s) => {
|
|
80
|
+
var o;
|
|
81
|
+
(o = this._callbackMap.get(t.uuid)) == null || o.onUpdate(a, s);
|
|
82
|
+
}).onComplete((a) => {
|
|
83
|
+
var s;
|
|
84
|
+
(s = this._callbackMap.get(t.uuid)) == null || s.onComplete(a);
|
|
85
|
+
});
|
|
86
|
+
t.addEventListener("play", () => {
|
|
87
|
+
e.start();
|
|
88
|
+
}), t.addEventListener("stop", () => {
|
|
89
|
+
e.stop();
|
|
90
|
+
}), this._tweens.set(t.uuid, e);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
export {
|
|
94
|
+
M as AnimationSystem
|
|
95
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { EventDispatcher, Event } from 'three';
|
|
2
|
+
import { UUID } from '../../../types/index.ts';
|
|
3
|
+
import { TAnimatorParameters } from '../types/AnimatorParameters.ts';
|
|
4
|
+
type TAnimatorEventMap = {
|
|
5
|
+
play: Event;
|
|
6
|
+
stop: Event;
|
|
7
|
+
};
|
|
8
|
+
export declare class Animator<T extends object> extends EventDispatcher<TAnimatorEventMap> {
|
|
9
|
+
readonly object: T;
|
|
10
|
+
readonly to: T;
|
|
11
|
+
readonly duration: number;
|
|
12
|
+
readonly options?: TAnimatorParameters<T> | undefined;
|
|
13
|
+
private _uuid;
|
|
14
|
+
private _playing;
|
|
15
|
+
private _stopped;
|
|
16
|
+
private _completed;
|
|
17
|
+
constructor(object: T, to: T, duration: number, options?: TAnimatorParameters<T> | undefined);
|
|
18
|
+
get uuid(): UUID;
|
|
19
|
+
get playing(): boolean;
|
|
20
|
+
get stopped(): boolean;
|
|
21
|
+
get completed(): boolean;
|
|
22
|
+
dispose(): void;
|
|
23
|
+
play(): this;
|
|
24
|
+
stop(): this;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
//# sourceMappingURL=ARSystem.cjs.map
|
|
1
|
+
"use strict";var u=Object.defineProperty;var d=(a,e,t)=>e in a?u(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var l=(a,e,t)=>d(a,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../../../chunks/SystemInfo-oX-NNneO.cjs"),i=require("../../../chunks/index-DAwIH9xh.cjs"),m=require("../asset/converter/AssetConverter.cjs"),h=require("../asset/loader/AssetLoader.cjs"),y=require("../asset/exporter/AssetExporter.cjs");class S{constructor(){l(this,"converter",new m.AssetConverter(new h.AssetLoader,new y.AssetExporter))}async launch(e,t){const r=await this.convertToUSDZ(e,t);return this.launchARQuickLook(r,t)}async convertToUSDZ(e,t){const r=await this.converter.convert(e).to("usdz",{quickLookCompatible:!0,ar:{anchoring:{type:"plane"},planeAnchoring:{alignment:(t==null?void 0:t.arPlacement)==="vertical"?"vertical":"horizontal"}}}),n=new Blob([r],{type:"model/vnd.usdz+zip"});return URL.createObjectURL(n)}launchARQuickLook(e,t){return new Promise(r=>{(t==null?void 0:t.arScale)==="fixed"&&(e=e.concat("#allowsContentScaling=0"));const n=document.createElement("a");n.innerHTML="<picture></picture>",n.rel="ar",n.href=e,n.download="scene.usdz",r(),n.click()})}}class _{launch(e,t){const r=self.location.toString(),n=document.createElement("a"),c=this._createParams(r,e,t),o=this._createIntent(r,e,c);n.setAttribute("href",o),n.click()}_createParams(e,t,r){const n=new URL(t,e),c=new URLSearchParams(n.search);return c.set("mode","ar_preferred"),this._applyScaleOption(c,r),this._applyPlacementOption(c,r),this._applySoundOption(c,e),this._applyLinkOption(c,e),c}_applyScaleOption(e,t){(t==null?void 0:t.arScale)==="fixed"&&e.set("resizable","false")}_applyPlacementOption(e,t){(t==null?void 0:t.arPlacement)==="vertical"&&e.set("enable_vertical_placement","true")}_applySoundOption(e,t){if(e.has("sound")){const r=new URL(e.get("sound"),t);e.set("sound",r.toString())}}_applyLinkOption(e,t){if(e.has("link")){const r=new URL(e.get("link"),t);e.set("link",r.toString())}}_createIntent(e,t,r){const n=new URL(e),c=new URL(t,e),o="#model-viewer-no-ar-fallback";return n.hash=o,`intent://arvr.google.com/scene-viewer/1.2?${r.toString()+"&file="+c.toString()}#Intent;scheme=https;package=com.google.android.googlequicksearchbox;action=android.intent.action.VIEW;S.browser_fallback_url=${encodeURIComponent(n.toString())};end;`}}class w{async launch(e,t){const r=s.SystemInfo.getSystem();return r===i.ESystem.IOS?this.tryARQuickLook(e,t):r===i.ESystem.ANDROID?this.trySceneViewer(e,t):Promise.reject(new s.ARCompatibilityError("AR not supported on non-mobile systems",window.navigator.userAgent,window.navigator.platform,window.navigator.vendor))}async tryARQuickLook(e,t){try{s.SystemInfo.getSupportsARQuickLook()}catch(r){return Promise.reject(r)}return new S().launch(e,t)}async trySceneViewer(e,t){try{return new _().launch(e,t)}catch(r){return Promise.reject(r)}}}exports.ARSystem=w;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
var u = Object.defineProperty;
|
|
2
2
|
var m = (c, e, t) => e in c ? u(c, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : c[e] = t;
|
|
3
3
|
var i = (c, e, t) => m(c, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { S as l,
|
|
4
|
+
import { S as l, A as d } from "../../../chunks/SystemInfo-DPAQG-S5.mjs";
|
|
5
|
+
import { E as s } from "../../../chunks/index-C_uFFwT2.mjs";
|
|
5
6
|
import { AssetConverter as h } from "../asset/converter/AssetConverter.mjs";
|
|
6
|
-
import {
|
|
7
|
+
import { AssetLoader as w } from "../asset/loader/AssetLoader.mjs";
|
|
7
8
|
import { AssetExporter as p } from "../asset/exporter/AssetExporter.mjs";
|
|
8
9
|
class y {
|
|
9
10
|
constructor() {
|
|
@@ -103,7 +104,7 @@ class S {
|
|
|
103
104
|
)};end;`;
|
|
104
105
|
}
|
|
105
106
|
}
|
|
106
|
-
class
|
|
107
|
+
class A {
|
|
107
108
|
/**
|
|
108
109
|
* Launches an AR experience using the appropriate platform-specific implementation
|
|
109
110
|
*
|
|
@@ -158,6 +159,5 @@ class R {
|
|
|
158
159
|
}
|
|
159
160
|
}
|
|
160
161
|
export {
|
|
161
|
-
|
|
162
|
+
A as ARSystem
|
|
162
163
|
};
|
|
163
|
-
//# sourceMappingURL=ARSystem.mjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DIVEEngine } from '../../../engine';
|
|
1
|
+
import { OrbitController } from '../../../modules/controller/orbit/OrbitController.ts';
|
|
2
|
+
import { DIVEEngine } from '../../../engine/Engine.ts';
|
|
3
3
|
export declare class DIVEWebXR {
|
|
4
4
|
private static _renderer;
|
|
5
5
|
private static _scene;
|
|
@@ -12,7 +12,7 @@ export declare class DIVEWebXR {
|
|
|
12
12
|
private static _overlay;
|
|
13
13
|
private static _options;
|
|
14
14
|
private static _xrController;
|
|
15
|
-
static Launch(engine: DIVEEngine, controller:
|
|
15
|
+
static Launch(engine: DIVEEngine, controller: OrbitController): Promise<void>;
|
|
16
16
|
static Update(_time: DOMHighResTimeStamp, frame: XRFrame): void;
|
|
17
17
|
static End(): void;
|
|
18
18
|
private static _onSessionStarted;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Object3D } from 'three';
|
|
2
|
-
import {
|
|
3
|
-
import { DIVEScene } from '../../../../engine/scene/Scene';
|
|
2
|
+
import { DIVERenderPipeline } from '../../../../engine/renderer/Renderer.ts';
|
|
3
|
+
import { DIVEScene } from '../../../../engine/scene/Scene.ts';
|
|
4
4
|
export declare class DIVEWebXRController extends Object3D {
|
|
5
5
|
private _renderer;
|
|
6
6
|
private _scene;
|
|
@@ -23,7 +23,7 @@ export declare class DIVEWebXRController extends Object3D {
|
|
|
23
23
|
private _touchQuaterion;
|
|
24
24
|
private _touchScale;
|
|
25
25
|
private _scaleThreshold;
|
|
26
|
-
constructor(session: XRSession, renderer:
|
|
26
|
+
constructor(session: XRSession, renderer: DIVERenderPipeline, scene: DIVEScene);
|
|
27
27
|
Init(): Promise<this>;
|
|
28
28
|
Dispose(): void;
|
|
29
29
|
Update(frame: XRFrame): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Matrix4, Quaternion, Vector3 } from 'three';
|
|
2
|
-
import {
|
|
2
|
+
import { DIVERenderPipeline } from '../../../../engine/renderer/Renderer.ts';
|
|
3
3
|
export declare class DIVEWebXROrigin {
|
|
4
4
|
private _renderer;
|
|
5
5
|
private _session;
|
|
@@ -22,7 +22,7 @@ export declare class DIVEWebXROrigin {
|
|
|
22
22
|
get quaternion(): Quaternion;
|
|
23
23
|
private _scale;
|
|
24
24
|
get scale(): Vector3;
|
|
25
|
-
constructor(session: XRSession, renderer:
|
|
25
|
+
constructor(session: XRSession, renderer: DIVERenderPipeline, entityTypes?: XRHitTestTrackableType[]);
|
|
26
26
|
Init(): Promise<this>;
|
|
27
27
|
Dispose(): void;
|
|
28
28
|
Update(frame: XRFrame): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Matrix4, Mesh, Vector3 } from 'three';
|
|
2
|
-
import {
|
|
3
|
-
import { DIVEScene } from '../../../../engine/scene/Scene';
|
|
4
|
-
import { DIVEEventExecutor } from '../../../../modules/events/EventExecutor';
|
|
2
|
+
import { DIVERenderPipeline } from '../../../../engine/renderer/Renderer.ts';
|
|
3
|
+
import { DIVEScene } from '../../../../engine/scene/Scene.ts';
|
|
4
|
+
import { DIVEEventExecutor } from '../../../../modules/events/EventExecutor.ts';
|
|
5
5
|
/**
|
|
6
6
|
* object is undefined when AR world is hit.
|
|
7
7
|
*/
|
|
@@ -28,7 +28,7 @@ export declare class DIVEWebXRRaycaster extends DIVEEventExecutor<DIVEWebXRRayca
|
|
|
28
28
|
private _arHitResultBuffer;
|
|
29
29
|
private _sceneHitResultBuffer;
|
|
30
30
|
private _hasHit;
|
|
31
|
-
constructor(session: XRSession, renderer:
|
|
31
|
+
constructor(session: XRSession, renderer: DIVERenderPipeline, scene: DIVEScene);
|
|
32
32
|
Dispose(): void;
|
|
33
33
|
Init(): Promise<this>;
|
|
34
34
|
GetARIntersections(frame: XRFrame): DIVEHitResult[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DIVEHitResult } from '../WebXRRaycaster';
|
|
1
|
+
import { DIVERenderPipeline } from '../../../../../engine/renderer/Renderer.ts';
|
|
2
|
+
import { DIVEHitResult } from '../WebXRRaycaster.ts';
|
|
3
3
|
export declare class DIVEWebXRRaycasterAR {
|
|
4
4
|
private _session;
|
|
5
5
|
private _renderer;
|
|
@@ -8,7 +8,7 @@ export declare class DIVEWebXRRaycasterAR {
|
|
|
8
8
|
private _requesting;
|
|
9
9
|
private _initialized;
|
|
10
10
|
private _hitMatrixBuffer;
|
|
11
|
-
constructor(session: XRSession, renderer:
|
|
11
|
+
constructor(session: XRSession, renderer: DIVERenderPipeline);
|
|
12
12
|
Dispose(): void;
|
|
13
13
|
Init(): Promise<this>;
|
|
14
14
|
GetIntersections(frame: XRFrame): DIVEHitResult[];
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DIVEScene } from '../../../../../engine/scene/Scene';
|
|
3
|
-
import { DIVEHitResult } from '../WebXRRaycaster';
|
|
1
|
+
import { DIVERenderPipeline } from '../../../../../engine/renderer/Renderer.ts';
|
|
2
|
+
import { DIVEScene } from '../../../../../engine/scene/Scene.ts';
|
|
3
|
+
import { DIVEHitResult } from '../WebXRRaycaster.ts';
|
|
4
4
|
export declare class DIVEWebXRRaycasterTHREE {
|
|
5
5
|
private _renderer;
|
|
6
6
|
private _scene;
|
|
7
7
|
private _controller;
|
|
8
8
|
private _raycaster;
|
|
9
|
-
constructor(renderer:
|
|
9
|
+
constructor(renderer: DIVERenderPipeline, scene: DIVEScene);
|
|
10
10
|
Init(): Promise<this>;
|
|
11
11
|
GetIntersections(): DIVEHitResult[];
|
|
12
12
|
}
|
|
@@ -1,2 +1 @@
|
|
|
1
1
|
"use strict";var i=Object.defineProperty;var n=(e,t,r)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var o=(e,t,r)=>n(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class a{constructor(t,r){o(this,"_uri","");this._loader=t,this._exporter=r}convert(t){return this._uri=t,{to:this._to.bind(this)}}async _to(t,r){const s=await this._loader.load(this._uri);return this._exporter.export(s,t,r)}}exports.AssetConverter=a;
|
|
2
|
-
//# sourceMappingURL=AssetConverter.cjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AssetLoader } from '../loader/AssetLoader';
|
|
2
|
-
import { AssetExporter, FileTypeToExporterOptions } from '../exporter/AssetExporter';
|
|
3
|
-
import { FileType } from '../../../types/file';
|
|
1
|
+
import { AssetLoader } from '../loader/AssetLoader.ts';
|
|
2
|
+
import { AssetExporter, FileTypeToExporterOptions } from '../exporter/AssetExporter.ts';
|
|
3
|
+
import { FileType } from '../../../types/file/index.ts';
|
|
4
4
|
declare global {
|
|
5
5
|
interface ModuleClasses {
|
|
6
6
|
AssetConverter: typeof AssetConverter;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Draco 3D Data Compression
|
|
2
|
+
|
|
3
|
+
Draco is an open-source library for compressing and decompressing 3D geometric meshes and point clouds. It is intended to improve the storage and transmission of 3D graphics.
|
|
4
|
+
|
|
5
|
+
[Website](https://google.github.io/draco/) | [GitHub](https://github.com/google/draco)
|
|
6
|
+
|
|
7
|
+
## Contents
|
|
8
|
+
|
|
9
|
+
This folder contains three utilities:
|
|
10
|
+
|
|
11
|
+
* `draco_decoder.js` — Emscripten-compiled decoder, compatible with any modern browser.
|
|
12
|
+
* `draco_decoder.wasm` — WebAssembly decoder, compatible with newer browsers and devices.
|
|
13
|
+
* `draco_wasm_wrapper.js` — JavaScript wrapper for the WASM decoder.
|
|
14
|
+
|
|
15
|
+
Each file is provided in two variations:
|
|
16
|
+
|
|
17
|
+
* **Default:** Latest stable builds, tracking the project's [master branch](https://github.com/google/draco).
|
|
18
|
+
* **glTF:** Builds targeted by the [glTF mesh compression extension](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression), tracking the [corresponding Draco branch](https://github.com/google/draco/tree/gltf_2.0_draco_extension).
|
|
19
|
+
|
|
20
|
+
Either variation may be used with `THREE.DRACOLoader`:
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
var dracoLoader = new THREE.DRACOLoader();
|
|
24
|
+
dracoLoader.setDecoderPath('path/to/decoders/');
|
|
25
|
+
dracoLoader.setDecoderConfig({type: 'js'}); // (Optional) Override detection of WASM support.
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Further [documentation on GitHub](https://github.com/google/draco/tree/master/javascript/example#static-loading-javascript-decoder).
|
|
29
|
+
|
|
30
|
+
## License
|
|
31
|
+
|
|
32
|
+
[Apache License 2.0](https://github.com/google/draco/blob/master/LICENSE)
|