@shopware-ag/dive 2.2.34 → 2.3.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/Animator-BGFdF70Z.mjs +47 -0
- package/build/chunks/Animator-Cu7NIkVg.cjs +1 -0
- package/build/chunks/{AssetCache-lGp7KKQA.mjs → AssetCache-BN-AmXc9.mjs} +1 -1
- package/build/chunks/{AssetCache-BOMaDRGn.cjs → AssetCache-CwK-0iP9.cjs} +1 -1
- package/build/chunks/{AssetExporter-brT7ogoM.mjs → AssetExporter-BBaDvZ8D.mjs} +68 -61
- package/build/chunks/{AssetExporter-DsbC2rqv.cjs → AssetExporter-Bqv27MWV.cjs} +15 -15
- package/build/chunks/{AssetLoader-BDP2bROu.mjs → AssetLoader-C-PfRr8Z.mjs} +20 -12
- package/build/chunks/{AssetLoader-B00ge8um.cjs → AssetLoader-uFMzuJWt.cjs} +2 -2
- package/build/chunks/ClipAnimator-BJZ4_C4B.mjs +83 -0
- package/build/chunks/ClipAnimator-CNKeT7rW.cjs +1 -0
- package/build/chunks/{FileTypes-DeUmmPCi.mjs → FileTypes-B8g1qxjR.mjs} +41 -38
- package/build/chunks/{FileTypes-DOUQk-mF.cjs → FileTypes-BHH0KUFf.cjs} +2 -2
- package/build/chunks/TargetAnimator-DUqkkdVb.mjs +79 -0
- package/build/chunks/TargetAnimator-DuqPk2eq.cjs +1 -0
- package/build/chunks/{isFileTypeSupported-D8QKkffJ.cjs → isFileTypeSupported-CFN9V48s.cjs} +1 -1
- package/build/chunks/{isFileTypeSupported-DsYDdT2J.mjs → isFileTypeSupported-DA7cjOZa.mjs} +1 -1
- package/build/dive.cjs +1 -1
- package/build/dive.mjs +2 -2
- package/build/plugins/animation/index.cjs +1 -1
- package/build/plugins/animation/index.d.ts +1 -1
- package/build/plugins/animation/index.mjs +84 -109
- package/build/plugins/animation/src/animator/Animator.d.ts +23 -22
- package/build/plugins/animation/src/animator/ClipAnimator.d.ts +33 -0
- package/build/plugins/animation/src/animator/TargetAnimator.d.ts +45 -0
- package/build/plugins/animation/src/index.d.ts +4 -2
- package/build/plugins/animation/src/system/AnimationSystem.d.ts +136 -14
- package/build/plugins/animation/src/types/AnimatorTypes.d.ts +11 -0
- package/build/plugins/ar/index.cjs +1 -1
- package/build/plugins/ar/index.mjs +2 -2
- 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 -0
- package/build/plugins/assetloader/index.cjs +1 -1
- package/build/plugins/assetloader/index.mjs +2 -2
- package/build/plugins/orbitcontroller/index.cjs +1 -1
- package/build/plugins/orbitcontroller/index.mjs +1 -1
- package/build/plugins/orientationdisplay/index.cjs +1 -1
- package/build/plugins/orientationdisplay/index.mjs +1 -1
- package/build/plugins/quickview/index.cjs +1 -1
- package/build/plugins/quickview/index.mjs +7 -7
- package/build/plugins/quickview/src/QuickView.d.ts +2 -1
- package/build/plugins/state/index.cjs +4 -4
- package/build/plugins/state/index.mjs +791 -794
- package/build/plugins/toolbox/index.cjs +1 -1
- package/build/plugins/toolbox/index.mjs +1 -1
- package/package.json +2 -2
- package/build/plugins/animation/src/types/AnimatorParameters.d.ts +0 -7
|
@@ -1,23 +1,145 @@
|
|
|
1
|
+
import { AnimationClip, Object3D } from 'three';
|
|
1
2
|
import { DIVETicker } from '../../../../index.ts';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
type ClipAnimator = import('../animator/ClipAnimator.ts').ClipAnimator;
|
|
4
|
+
type TargetAnimator = import('../animator/TargetAnimator.ts').TargetAnimator;
|
|
5
|
+
type TargetAnimatorOptions = import('../animator/TargetAnimator.ts').TargetAnimatorOptions;
|
|
6
|
+
type AnimationTarget = import('../animator/TargetAnimator.ts').AnimationTarget;
|
|
7
|
+
/**
|
|
8
|
+
* Central animation system that manages all animators (target-based and clip-based).
|
|
9
|
+
*
|
|
10
|
+
* Create "to-target" animators with `fromTargets()` and "animation-clip" animators with `fromClips()`.
|
|
11
|
+
*
|
|
12
|
+
* Implements DIVETicker so it can be registered with DIVEClock for per-frame updates.
|
|
13
|
+
*
|
|
14
|
+
* @module
|
|
15
|
+
*/
|
|
5
16
|
export declare class AnimationSystem implements DIVETicker {
|
|
6
17
|
uuid: string;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
18
|
+
readonly Easing: Readonly<{
|
|
19
|
+
Linear: Readonly<{
|
|
20
|
+
In: (amount: number) => number;
|
|
21
|
+
Out: (amount: number) => number;
|
|
22
|
+
InOut: (amount: number) => number;
|
|
23
|
+
} & {
|
|
24
|
+
None: (amount: number) => number;
|
|
25
|
+
}>;
|
|
26
|
+
Quadratic: Readonly<{
|
|
27
|
+
In: (amount: number) => number;
|
|
28
|
+
Out: (amount: number) => number;
|
|
29
|
+
InOut: (amount: number) => number;
|
|
30
|
+
}>;
|
|
31
|
+
Cubic: Readonly<{
|
|
32
|
+
In: (amount: number) => number;
|
|
33
|
+
Out: (amount: number) => number;
|
|
34
|
+
InOut: (amount: number) => number;
|
|
35
|
+
}>;
|
|
36
|
+
Quartic: Readonly<{
|
|
37
|
+
In: (amount: number) => number;
|
|
38
|
+
Out: (amount: number) => number;
|
|
39
|
+
InOut: (amount: number) => number;
|
|
40
|
+
}>;
|
|
41
|
+
Quintic: Readonly<{
|
|
42
|
+
In: (amount: number) => number;
|
|
43
|
+
Out: (amount: number) => number;
|
|
44
|
+
InOut: (amount: number) => number;
|
|
45
|
+
}>;
|
|
46
|
+
Sinusoidal: Readonly<{
|
|
47
|
+
In: (amount: number) => number;
|
|
48
|
+
Out: (amount: number) => number;
|
|
49
|
+
InOut: (amount: number) => number;
|
|
50
|
+
}>;
|
|
51
|
+
Exponential: Readonly<{
|
|
52
|
+
In: (amount: number) => number;
|
|
53
|
+
Out: (amount: number) => number;
|
|
54
|
+
InOut: (amount: number) => number;
|
|
55
|
+
}>;
|
|
56
|
+
Circular: Readonly<{
|
|
57
|
+
In: (amount: number) => number;
|
|
58
|
+
Out: (amount: number) => number;
|
|
59
|
+
InOut: (amount: number) => number;
|
|
60
|
+
}>;
|
|
61
|
+
Elastic: Readonly<{
|
|
62
|
+
In: (amount: number) => number;
|
|
63
|
+
Out: (amount: number) => number;
|
|
64
|
+
InOut: (amount: number) => number;
|
|
65
|
+
}>;
|
|
66
|
+
Back: Readonly<{
|
|
67
|
+
In: (amount: number) => number;
|
|
68
|
+
Out: (amount: number) => number;
|
|
69
|
+
InOut: (amount: number) => number;
|
|
70
|
+
}>;
|
|
71
|
+
Bounce: Readonly<{
|
|
72
|
+
In: (amount: number) => number;
|
|
73
|
+
Out: (amount: number) => number;
|
|
74
|
+
InOut: (amount: number) => number;
|
|
75
|
+
}>;
|
|
76
|
+
generatePow(power?: number): {
|
|
77
|
+
In: (amount: number) => number;
|
|
78
|
+
Out: (amount: number) => number;
|
|
79
|
+
InOut: (amount: number) => number;
|
|
80
|
+
};
|
|
81
|
+
}>;
|
|
82
|
+
private _animators;
|
|
83
|
+
dispose(): void;
|
|
84
|
+
tick(deltaTime: number): void;
|
|
85
|
+
/**
|
|
86
|
+
* @deprecated Use `fromTargets()` instead.
|
|
87
|
+
* @note This method also calls .play() on the animator automatically. This has been removed in fromTargets(). You have to call .play() independently after creating the animator.
|
|
88
|
+
*/
|
|
89
|
+
animate(targets: AnimationTarget | AnimationTarget[], duration: number, options?: TargetAnimatorOptions): Promise<TargetAnimator>;
|
|
10
90
|
/**
|
|
11
|
-
* Creates a
|
|
12
|
-
*
|
|
13
|
-
* @
|
|
91
|
+
* Creates a TargetAnimator and returns it asynchronously.
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* // Animate a single target (e.g. position).
|
|
95
|
+
* const animator = await animationSystem.fromTargets(
|
|
96
|
+
* { position: { x: 0, y: 0, z: 0 }, to: { x: 10, y: 10, z: 10 } },
|
|
97
|
+
* 1000,
|
|
98
|
+
* );
|
|
99
|
+
* // animate the target
|
|
100
|
+
* animator.play();
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* // Animate multiple targets (e.g. position and rotation) at once using an array.
|
|
104
|
+
* const animator = await animationSystem.fromTargets(
|
|
105
|
+
* [
|
|
106
|
+
* { position: { x: 0, y: 0, z: 0 }, to: { x: 10, y: 10, z: 10 } },
|
|
107
|
+
* { rotation: { x: 0, y: 0, z: 0 }, to: { x: 0, y: Math.PI / 2, z: 0 } },
|
|
108
|
+
* ],
|
|
109
|
+
* 1000,
|
|
110
|
+
* );
|
|
111
|
+
* // animate all targets in the array at once
|
|
112
|
+
* animator.play();
|
|
113
|
+
* @param targets - The targets to animate.
|
|
14
114
|
* @param duration - The duration of the animation in milliseconds.
|
|
15
115
|
* @param options - The options for the animation.
|
|
16
|
-
* @returns
|
|
116
|
+
* @returns Promise<TargetAnimator>.
|
|
117
|
+
*/
|
|
118
|
+
fromTargets(targets: AnimationTarget | AnimationTarget[], duration: number, options?: TargetAnimatorOptions): Promise<TargetAnimator>;
|
|
119
|
+
/**
|
|
120
|
+
* Creates a ClipAnimator and returns it asynchronously.
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* // Animate a single clip (e.g. a single animation) at once.
|
|
124
|
+
* const animator = await animationSystem.fromClips(
|
|
125
|
+
* model,
|
|
126
|
+
* model.animations,
|
|
127
|
+
* );
|
|
128
|
+
* // plays first clip by default
|
|
129
|
+
* animator.play();
|
|
130
|
+
* // plays plays "Idle" clip by name
|
|
131
|
+
* animator.play("Idle");
|
|
132
|
+
*
|
|
133
|
+
* @param root - The root object to animate.
|
|
134
|
+
* @param clips - The animation clips to animate.
|
|
135
|
+
* @returns Promise<ClipAnimator>.
|
|
136
|
+
*/
|
|
137
|
+
fromClips(root: Object3D, clips: AnimationClip[]): Promise<ClipAnimator>;
|
|
138
|
+
/**
|
|
139
|
+
* Removes an animator from the system.
|
|
140
|
+
*
|
|
141
|
+
* @param uuid - The UUID of the animator to remove.
|
|
17
142
|
*/
|
|
18
|
-
animate<T extends object>(object: T, to: T, duration: number, options?: TAnimatorParameters<T>): Animator<T>;
|
|
19
143
|
remove(uuid: string): void;
|
|
20
|
-
dispose(): void;
|
|
21
|
-
tick(): void;
|
|
22
|
-
private _createTween;
|
|
23
144
|
}
|
|
145
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Event } from 'three/src/core/EventDispatcher.js';
|
|
2
|
+
export type TAnimatorState = 'idle' | 'playing' | 'paused';
|
|
3
|
+
export type TAnimatorEventMap = {
|
|
4
|
+
play: Event;
|
|
5
|
+
pause: Event;
|
|
6
|
+
resume: Event;
|
|
7
|
+
stop: Event;
|
|
8
|
+
update: Event;
|
|
9
|
+
complete: Event;
|
|
10
|
+
};
|
|
11
|
+
export type TAnimatorLoopMode = 'once' | 'repeat' | 'pingpong';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var f=Object.defineProperty;var h=(o,e,r)=>e in o?f(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r;var l=(o,e,r)=>h(o,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../systeminfo/index.cjs"),A=require("../assetconverter/index.cjs"),O=require("../../chunks/AssetLoader-
|
|
1
|
+
"use strict";var f=Object.defineProperty;var h=(o,e,r)=>e in o?f(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r;var l=(o,e,r)=>h(o,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../systeminfo/index.cjs"),A=require("../assetconverter/index.cjs"),O=require("../../chunks/AssetLoader-uFMzuJWt.cjs"),w=require("../../chunks/AssetExporter-Bqv27MWV.cjs");var m=(o=>(o.AR_DESKTOP_PLATFORM_ERROR="ar-desktop-platform-error",o.AR_QUICK_LOOK_NOT_SAFARI_ERROR="ar-quicklook-not-safari-error",o.AR_QUICK_LOOK_VERSION_MISMATCH_ERROR="ar-quicklook-version-mismatch-error",o.AR_QUICK_LOOK_UNKNOWN_ERROR="ar-quicklook-unknown-error",o))(m||{});class a extends Error{constructor(r,t){super(r);l(this,"type");this.name=this.constructor.name,this.type=t,Object.setPrototypeOf(this,new.target.prototype)}}class R extends a{constructor(){super("AR features are not supported on desktop platforms.","ar-desktop-platform-error")}}class p extends a{constructor(){super("ARQuickLook on iOS is only available in Safari.","ar-quicklook-not-safari-error")}}class d extends a{constructor(e,r){super(`ARQuickLook requires iOS version ${r} or later. Current version: ${e}.`,"ar-quicklook-version-mismatch-error"),this.currentVersion=e,this.requiredVersion=r}}class u extends a{constructor(){super("An unknown ARQuickLook compatibility error occurred.","ar-quicklook-unknown-error")}}const k=12;class S{constructor(){l(this,"converter",new A.AssetConverter(new O.AssetLoader,new w.AssetExporter))}async launch(e,r){if(c.SystemInfo.getBrowser()!==c.EBrowser.SAFARI)return Promise.reject(new p);const t=c.SystemInfo.getIOSVersion();if(t&&t.major<k)return Promise.reject(new d(t.full,k));if(!t)return Promise.reject(new u);if(!c.SystemInfo.getSupportsARQuickLook())return Promise.reject(new u);const n=await this.convertToUSDZ(e,r);return this.launchARQuickLook(n,r)}async convertToUSDZ(e,r){const t=await this.converter.convert(e).to("usdz",{quickLookCompatible:!0,ar:{anchoring:{type:"plane"},planeAnchoring:{alignment:"horizontal"}}}),n=new Blob([t],{type:"model/vnd.usdz+zip"});return URL.createObjectURL(n)}launchARQuickLook(e,r){return new Promise(t=>{(r==null?void 0:r.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",t(),n.click()})}}class _{launch(e,r){const t=self.location.toString(),n=document.createElement("a"),s=this._createParams(t,e,r),i=this._createIntent(t,e,s);n.setAttribute("href",i),n.click()}_createParams(e,r,t){const n=new URL(r,e),s=new URLSearchParams(n.search);return s.set("mode","ar_preferred"),this._applyScaleOption(s,t),this._applyPlacementOption(s,t),this._applySoundOption(s,e),this._applyLinkOption(s,e),s}_applyScaleOption(e,r){(r==null?void 0:r.arScale)==="fixed"&&e.set("resizable","false")}_applyPlacementOption(e,r){(r==null?void 0:r.arPlacement)==="vertical"&&e.set("enable_vertical_placement","true")}_applySoundOption(e,r){if(e.has("sound")){const t=new URL(e.get("sound"),r);e.set("sound",t.toString())}}_applyLinkOption(e,r){if(e.has("link")){const t=new URL(e.get("link"),r);e.set("link",t.toString())}}_createIntent(e,r,t){const n=new URL(e),s=new URL(r,e),i="#model-viewer-no-ar-fallback";return n.hash=i,`intent://arvr.google.com/scene-viewer/1.2?${t.toString()+"&file="+s.toString()}#Intent;scheme=https;package=com.google.android.googlequicksearchbox;action=android.intent.action.VIEW;S.browser_fallback_url=${encodeURIComponent(n.toString())};end;`}}class L{async launch(e,r){const t=c.SystemInfo.getSystem();return t===c.ESystem.IOS?new S().launch(e,r):t===c.ESystem.ANDROID?new _().launch(e,r):Promise.reject(new R)}}exports.ARDesktopPlatformError=R;exports.ARError=a;exports.ARQuickLook=S;exports.ARQuickLookNotSafariError=p;exports.ARQuickLookUnknownError=u;exports.ARQuickLookVersionMismatchError=d;exports.ARSystem=L;exports.EARErrorType=m;exports.SceneViewer=_;
|
|
@@ -3,8 +3,8 @@ var R = (o, e, r) => e in o ? p(o, e, { enumerable: !0, configurable: !0, writab
|
|
|
3
3
|
var l = (o, e, r) => R(o, typeof e != "symbol" ? e + "" : e, r);
|
|
4
4
|
import { SystemInfo as c, EBrowser as d, ESystem as u } from "../systeminfo/index.mjs";
|
|
5
5
|
import { AssetConverter as h } from "../assetconverter/index.mjs";
|
|
6
|
-
import { A as _ } from "../../chunks/AssetLoader-
|
|
7
|
-
import { A as f } from "../../chunks/AssetExporter-
|
|
6
|
+
import { A as _ } from "../../chunks/AssetLoader-C-PfRr8Z.mjs";
|
|
7
|
+
import { A as f } from "../../chunks/AssetExporter-BBaDvZ8D.mjs";
|
|
8
8
|
var S = /* @__PURE__ */ ((o) => (o.AR_DESKTOP_PLATFORM_ERROR = "ar-desktop-platform-error", o.AR_QUICK_LOOK_NOT_SAFARI_ERROR = "ar-quicklook-not-safari-error", o.AR_QUICK_LOOK_VERSION_MISMATCH_ERROR = "ar-quicklook-version-mismatch-error", o.AR_QUICK_LOOK_UNKNOWN_ERROR = "ar-quicklook-unknown-error", o))(S || {});
|
|
9
9
|
class a extends Error {
|
|
10
10
|
constructor(r, t) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../chunks/AssetCache-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../chunks/AssetCache-CwK-0iP9.cjs");exports.AssetCache=e.AssetCache;exports.Chunk=e.Chunk;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../chunks/AssetExporter-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../chunks/AssetExporter-Bqv27MWV.cjs");exports.AssetExporter=e.AssetExporter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../chunks/AssetLoader-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../chunks/AssetLoader-uFMzuJWt.cjs");exports.AssetLoader=e.AssetLoader;exports.DRACOWorker=e.DRACOWorker;exports.DracoLoader=e.DracoLoader;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as o } from "../../chunks/AssetLoader-
|
|
2
|
-
import { D as s, a as t } from "../../chunks/AssetLoader-
|
|
1
|
+
import { A as o } from "../../chunks/AssetLoader-C-PfRr8Z.mjs";
|
|
2
|
+
import { D as s, a as t } from "../../chunks/AssetLoader-C-PfRr8Z.mjs";
|
|
3
3
|
export {
|
|
4
4
|
o as AssetLoader,
|
|
5
5
|
s as DRACOWorker,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../chunks/FileTypes-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../chunks/FileTypes-BHH0KUFf.cjs");exports.OrbitController=t.OrbitController;exports.OrbitControllerDefaultSettings=t.OrbitControllerDefaultSettings;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var c=Object.defineProperty;var p=(s,e,r)=>e in s?c(s,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[e]=r;var a=(s,e,r)=>p(s,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("three");require("../../chunks/FileTypes-
|
|
1
|
+
"use strict";var c=Object.defineProperty;var p=(s,e,r)=>e in s?c(s,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[e]=r;var a=(s,e,r)=>p(s,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("three");require("../../chunks/FileTypes-BHH0KUFf.cjs");const n=require("../../chunks/PerspectiveCamera-iAsZqrnY.cjs"),i=require("../../chunks/AxisHelperColors-BrGqktN5.cjs"),l=require("three-spritetext");class _ extends t.Object3D{constructor(){super();a(this,"_axesHelper");this._axesHelper=new t.AxesHelper(.5),this._axesHelper.layers.mask=n.COORDINATE_LAYER_MASK,this._axesHelper.material.depthTest=!1,this._axesHelper.position.set(0,0,-1),this._axesHelper.setColors(new t.Color(i.AxesColorRed),new t.Color(i.AxesColorGreen),new t.Color(i.AxesColorBlue));const r=new l("X",.2,i.AxesColorRedLetter),o=new l("Y",.2,i.AxesColorGreenLetter),h=new l("Z",.2,i.AxesColorBlueLetter);r.layers.mask=n.COORDINATE_LAYER_MASK,o.layers.mask=n.COORDINATE_LAYER_MASK,h.layers.mask=n.COORDINATE_LAYER_MASK,r.position.set(.7,0,0),o.position.set(0,.7,0),h.position.set(0,0,.7),this._axesHelper.add(r),this._axesHelper.add(o),this._axesHelper.add(h),this.add(this._axesHelper)}setFromCameraMatrix(r){this._axesHelper.rotation.setFromRotationMatrix(new t.Matrix4().extractRotation(r).invert())}}class d{constructor(e,r,o){a(this,"uuid",t.MathUtils.generateUUID());a(this,"_axes");a(this,"_orthographicCamera");a(this,"_restoreViewport",new t.Vector4);this._renderer=e,this._scene=r,this._camera=o,this._orthographicCamera=new t.OrthographicCamera(-1,1,1,-1,.1,100),this._orthographicCamera.name="OrientationDisplayCamera",this._orthographicCamera.layers.mask=n.COORDINATE_LAYER_MASK,this._scene.add(this._orthographicCamera),this._axes=new _,this._axes.name="OrientationDisplayAxes",this._scene.add(this._axes)}tick(){const e=this._scene.background??null;this._scene.background=null,this._renderer.webglrenderer.getViewport(this._restoreViewport),this._renderer.webglrenderer.setViewport(0,0,150,150),this._renderer.webglrenderer.autoClear=!1,this._axes.setFromCameraMatrix(this._camera.matrix),this._renderer.webglrenderer.render(this._scene,this._orthographicCamera),this._renderer.webglrenderer.setViewport(this._restoreViewport),this._renderer.webglrenderer.autoClear=!0,this._scene.background=e}dispose(){this._scene.remove(this._axes),this._scene.remove(this._orthographicCamera)}}exports.OrientationDisplay=d;exports.OrientationDisplayAxes=_;
|
|
@@ -2,7 +2,7 @@ var l = Object.defineProperty;
|
|
|
2
2
|
var _ = (s, e, r) => e in s ? l(s, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : s[e] = r;
|
|
3
3
|
var t = (s, e, r) => _(s, typeof e != "symbol" ? e + "" : e, r);
|
|
4
4
|
import { Object3D as p, AxesHelper as c, Color as n, Matrix4 as d, OrthographicCamera as m, MathUtils as x, Vector4 as w } from "three";
|
|
5
|
-
import "../../chunks/FileTypes-
|
|
5
|
+
import "../../chunks/FileTypes-B8g1qxjR.mjs";
|
|
6
6
|
import { C as i } from "../../chunks/PerspectiveCamera-BFzE2TQU.mjs";
|
|
7
7
|
import { A as C, a as g, b as u, c as A, d as H, e as b } from "../../chunks/AxisHelperColors-JLBHYQDi.mjs";
|
|
8
8
|
import h from "three-spritetext";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../chunks/FileTypes-BHH0KUFf.cjs");require("three");const r={...o.DIVEDefaultSettings},l=async(n,c)=>{const e=new o.DIVE(c);e.mainView.camera.position.set(0,1,2);const i=await new o.DIVEModel().setFromURL(n);e.scene.root.add(i),i.placeOnFloor();const t=new o.OrbitController(e.mainView.camera,e.mainView.canvas);t.focusObject(i),e.clock.addTicker(t);const s=Object.assign(e,{orbitController:t,model:i}),a=e.dispose.bind(e);return s.dispose=async()=>{t.dispose(),await a()},s};exports.QuickView=l;exports.QuickViewDefaultSettings=r;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { D as c, b as r, c as l, O as d } from "../../chunks/FileTypes-
|
|
1
|
+
import { D as c, b as r, c as l, O as d } from "../../chunks/FileTypes-B8g1qxjR.mjs";
|
|
2
2
|
import "three";
|
|
3
3
|
const p = {
|
|
4
4
|
...c
|
|
5
5
|
}, V = async (t, n) => {
|
|
6
6
|
const e = new r(n);
|
|
7
7
|
e.mainView.camera.position.set(0, 1, 2);
|
|
8
|
-
const
|
|
9
|
-
e.scene.root.add(
|
|
10
|
-
const
|
|
8
|
+
const i = await new l().setFromURL(t);
|
|
9
|
+
e.scene.root.add(i), i.placeOnFloor();
|
|
10
|
+
const o = new d(
|
|
11
11
|
e.mainView.camera,
|
|
12
12
|
e.mainView.canvas
|
|
13
13
|
);
|
|
14
|
-
|
|
15
|
-
const s = Object.assign(e, { orbitController: i }), a = e.dispose.bind(e);
|
|
14
|
+
o.focusObject(i), e.clock.addTicker(o);
|
|
15
|
+
const s = Object.assign(e, { orbitController: o, model: i }), a = e.dispose.bind(e);
|
|
16
16
|
return s.dispose = async () => {
|
|
17
|
-
|
|
17
|
+
o.dispose(), await a();
|
|
18
18
|
}, s;
|
|
19
19
|
};
|
|
20
20
|
export {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { DIVE } from '../../../index.ts';
|
|
1
|
+
import { DIVE, DIVEModel } from '../../../index.ts';
|
|
2
2
|
import { OrbitController } from '../../orbitcontroller/index.ts';
|
|
3
3
|
import { QuickViewSettings } from '../types/index.ts';
|
|
4
4
|
export declare const QuickViewDefaultSettings: Omit<Required<QuickViewSettings>, 'hdr'>;
|
|
5
5
|
export type QuickView = DIVE & {
|
|
6
6
|
orbitController: OrbitController;
|
|
7
|
+
model: DIVEModel;
|
|
7
8
|
};
|
|
8
9
|
/**
|
|
9
10
|
*
|