aptechka 0.64.5 → 0.64.7
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/lib/en3/index.cjs +2 -2
- package/lib/en3/index.js +28 -28
- package/lib/window-resizer/index.cjs +1 -1
- package/lib/window-resizer/index.d.ts +1 -1
- package/lib/window-resizer/index.js +11 -11
- package/package.json +1 -1
package/lib/en3/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";var de=Object.defineProperty,ue=Object.defineProperties;var me=Object.getOwnPropertyDescriptors;var Z=Object.getOwnPropertySymbols;var fe=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable;var Q=
|
|
1
|
+
"use strict";var de=Object.defineProperty,ue=Object.defineProperties;var me=Object.getOwnPropertyDescriptors;var Z=Object.getOwnPropertySymbols;var fe=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable;var Q=s=>{throw TypeError(s)};var J=(s,e,i)=>e in s?de(s,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[e]=i,k=(s,e)=>{for(var i in e||(e={}))fe.call(e,i)&&J(s,i,e[i]);if(Z)for(var i of Z(e))ge.call(e,i)&&J(s,i,e[i]);return s},ee=(s,e)=>ue(s,me(e));var te=(s,e,i)=>e.has(s)||Q("Cannot "+i);var t=(s,e,i)=>(te(s,e,"read from private field"),i?i.call(s):e.get(s)),r=(s,e,i)=>e.has(s)?Q("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(s):e.set(s,i),n=(s,e,i,a)=>(te(s,e,"write to private field"),a?a.call(s,i):e.set(s,i),i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("three"),ie=require("../order/index.cjs"),se=require("../window-resizer/index.cjs"),re=require("../ticker/index.cjs"),ae=require("../dom-JBOkFLTh.cjs");require("construct-style-sheets-polyfill");require("../index-DekP7OZe.cjs");const ne=require("../layout-box/index.cjs");function he(s){const e=i=>{i.dispose();for(const a of Object.keys(i)){const h=i[a];h&&typeof h=="object"&&"minFilter"in h&&h.dispose()}};s.traverse(i=>{if(i instanceof u.Mesh){if(i.geometry.dispose(),!Array.isArray(i.material)&&i.material.isMaterial)e(i.material);else if(Array.isArray(i.material))for(const a of i.material)e(a)}})}var P,o,C,p,w,O,D,R;class X{constructor(e,i){r(this,P);r(this,o);r(this,C);r(this,p);r(this,w);r(this,O);r(this,D);r(this,R);n(this,P,e),n(this,o,(i==null?void 0:i.cameraType)==="orthographic"?new u.OrthographicCamera:new u.PerspectiveCamera),n(this,C,new u.Scene),n(this,p,[]),n(this,w,(i==null?void 0:i.cameraDistance)||1e3),t(this,o).near=(i==null?void 0:i.cameraNear)||1,t(this,o).far=(i==null?void 0:i.cameraFar)||11e3,n(this,O,(i==null?void 0:i.cameraFov)||"auto"),t(this,o).position.z=t(this,w),t(this,o).name=`Cameras.${t(this,P)}`,n(this,D,ae.getElement(i==null?void 0:i.sizeElement)||document.documentElement),this.beforeRenderCallback=i==null?void 0:i.beforeRender,n(this,R,new ne.LayoutBox(t(this,D))),t(this,R).onResize(()=>{this.resize()})}get name(){return t(this,P)}get camera(){return t(this,o)}get scene(){return t(this,C)}get box(){return t(this,R)}get cameraDistance(){return t(this,w)}set cameraDistance(e){n(this,w,e),this.resize()}get sizeElement(){return t(this,D)}get isClipped(){return t(this,D)!==d.containerElement}resize(){const{width:e,height:i}=t(this,R);t(this,o).userData.controlled||(t(this,o).position.z=t(this,w)),t(this,o)instanceof u.PerspectiveCamera?(t(this,o).aspect=e/i,t(this,o).fov=t(this,O)==="auto"?2*Math.atan(i/2/t(this,w))*(180/Math.PI):t(this,o).userData.controlled?t(this,o).fov:t(this,O)):t(this,o)instanceof u.OrthographicCamera&&(t(this,o).left=e/-2,t(this,o).right=e/2,t(this,o).top=i/2,t(this,o).bottom=i/-2),t(this,o).updateProjectionMatrix()}destroy(){t(this,p).forEach(e=>{e.userData.box.destroy()}),t(this,C).clear(),he(t(this,C)),d.destroyView(this.name),t(this,R).destroy()}attachToHTMLElement(e,i,a){const h=new ne.LayoutBox(e,ee(k({},a),{containerElement:t(this,D),cartesian:!0,scrollStep:!this.isClipped}));return h.bindObject(i),i.userData.box=h,t(this,p).push(i),i}detachFromHTMLElement(e){n(this,p,t(this,p).filter(i=>i===e?(e.userData.box.destroy(),!1):!0))}add(...e){const i=e[0],a=e[1],h=e[2];return a&&this.attachToHTMLElement(a,i,h),this.scene.add(i),i}remove(e,i){this.scene.remove(e),i&&this.detachFromHTMLElement(e)}}P=new WeakMap,o=new WeakMap,C=new WeakMap,p=new WeakMap,w=new WeakMap,O=new WeakMap,D=new WeakMap,R=new WeakMap;var A,q,F,z,I;class Ee{constructor(e){r(this,A);r(this,q);r(this,F);r(this,z);r(this,I);n(this,A,e.targetName||void 0),n(this,q,e.eventDispatcher||e.object3D),n(this,F,e.propagation||!1),n(this,z,e.object3D),n(this,I,t(this,A)?()=>t(this,z).getObjectByName(t(this,A))||t(this,z):()=>t(this,z))}get object3D(){return t(this,z)}get eventDispatcher(){return t(this,q)}get propagation(){return t(this,F)}get target(){return t(this,I).call(this)}dispatch(e,i){this.eventDispatcher.dispatchEvent(k({originalEvent:i,type:e},this.intersection))}}A=new WeakMap,q=new WeakMap,F=new WeakMap,z=new WeakMap,I=new WeakMap;var b,m,H,N,_,B,$;class xe{constructor(){r(this,b,[]);r(this,m,[]);r(this,H,new u.Vector2);r(this,N,new u.Raycaster);r(this,_,e=>{for(let i=0;i<t(this,m).length;i++)t(this,m)[i].dispatch("pointerDown",e)});r(this,B,e=>{for(let i=0;i<t(this,m).length;i++)t(this,m)[i].dispatch("pointerUp",e)});r(this,$,e=>{if(!t(this,b).length)return;t(this,H).x=e.clientX/d.width*2-1,t(this,H).y=-(e.clientY/d.height)*2+1,d.camera&&t(this,N).setFromCamera(t(this,H),d.camera);const i=[];for(const c of t(this,b)){const g=t(this,N).intersectObject(c.target);g.length&&(c.intersection=g[0],i.push(c))}let a=!1;const h=t(this,m).filter(c=>!i.find(g=>g.object3D.uuid===c.object3D.uuid)),y=i.sort((c,g)=>g.object3D.position.z-c.object3D.position.z).filter((c,g)=>a?(h.push(c),!1):(a=!c.propagation,!0)),v=y.filter(c=>!t(this,m).find(g=>g.object3D.uuid===c.object3D.uuid));for(let c=0;c<h.length;c++)h[c].dispatch("pointerLeave",e);for(let c=0;c<v.length;c++)v[c].dispatch("pointerEnter",e);n(this,m,y);for(let c=0;c<t(this,m).length;c++)t(this,m)[c].dispatch("pointerMove",e)});d.containerElement.addEventListener("pointerdown",t(this,_)),d.containerElement.addEventListener("pointerup",t(this,B)),d.containerElement.addEventListener("pointermove",t(this,$))}destroy(){d.containerElement.removeEventListener("pointerdown",t(this,_)),d.containerElement.removeEventListener("pointerup",t(this,B)),d.containerElement.removeEventListener("pointermove",t(this,$)),n(this,b,[]),n(this,m,[])}add(e,i){if(t(this,b).find(h=>h.object3D.uuid===e.uuid))return;const a=new Ee(k({object3D:e},i));t(this,b).push(a)}remove(e){n(this,b,t(this,b).filter(i=>i.object3D.uuid!==e.uuid)),n(this,m,t(this,m).filter(i=>i.object3D.uuid!==e.uuid))}}b=new WeakMap,m=new WeakMap,H=new WeakMap,N=new WeakMap,_=new WeakMap,B=new WeakMap,$=new WeakMap;var U,E,l,j,f,M,T,L,W,S,x,Y,G;class ye{constructor(){r(this,U,`https://unpkg.com/three@0.${u.REVISION}.x`);r(this,E,null);r(this,l,null);r(this,j,null);r(this,f,new Map);r(this,M,0);r(this,T,0);r(this,L,0);r(this,W,2);r(this,S,!1);r(this,x,null);r(this,Y,e=>{e instanceof CustomEvent||(n(this,M,t(this,E).clientWidth),n(this,T,t(this,E).clientHeight),n(this,L,Math.min(t(this,W),devicePixelRatio||1)),t(this,l).setPixelRatio(t(this,L)),t(this,l).setSize(t(this,M),t(this,T)),t(this,x)&&(t(this,x).setPixelRatio(t(this,L)),t(this,x).setSize(t(this,M),t(this,T))))});r(this,G,()=>{t(this,l).setRenderTarget(null),t(this,f).forEach(e=>{this.render(e)})})}get CDNVersion(){return t(this,U)}get containerElement(){return t(this,E)}get webglRenderer(){return t(this,l)}get raycaster(){return t(this,j)}get views(){return t(this,f)}get view(){return this.getView("default")}get camera(){return this.getView("default").camera}get scene(){return this.getView("default").scene}get width(){return t(this,M)}get height(){return t(this,T)}get pixelRatio(){return t(this,L)}get composer(){return t(this,x)}setup(e){if(t(this,S)){console.warn("[en3.setup]: You are trying to setup en3 again.");return}n(this,E,ae.getElement(e==null?void 0:e.containerElement)||document.body),n(this,W,(e==null?void 0:e.maxPixelRatio)||2),n(this,l,new u.WebGLRenderer(e==null?void 0:e.webGLRendererParameters)),t(this,l).domElement.style.cssText=`
|
|
2
2
|
position: ${(e==null?void 0:e.position)||"fixed"};
|
|
3
3
|
left: 0;
|
|
4
4
|
top: 0;
|
|
5
5
|
width: 100%;
|
|
6
6
|
height: 100%;
|
|
7
7
|
z-index: ${(e==null?void 0:e.zIndex)||0};
|
|
8
|
-
`,(t(this,
|
|
8
|
+
`,(t(this,E).shadowRoot||t(this,E)).append(t(this,l).domElement),t(this,f).set("default",new X("default",k({sizeElement:t(this,E)},e==null?void 0:e.view))),n(this,j,new xe),e!=null&&e.composer&&(n(this,x,new e.composer(t(this,l))),this.render=()=>{t(this,x).render()}),n(this,S,!0),se.windowResizer.subscribe(t(this,Y),ie.RESIZE_ORDER.CANVAS),re.ticker.subscribe(t(this,G),{order:ie.TICK_ORDER.CANVAS,culling:t(this,E)})}destroy(){var e;if(!t(this,S)){console.warn("[en3.setup]: You are trying to destory en3 but it has not been initialized.");return}se.windowResizer.unsubscribe(t(this,Y)),re.ticker.unsubscribe(t(this,G)),t(this,j).destroy(),t(this,f).forEach(i=>{i.destroy()}),t(this,f).clear(),t(this,l).dispose(),t(this,l).domElement.remove(),n(this,l,null),(e=t(this,x))==null||e.dispose(),n(this,x,null),n(this,S,!1)}createView(e,i){const a=t(this,f).size,h=new X(e,i);return t(this,f).set(e,h),a===1&&t(this,l).setScissorTest(!0),h}getView(e){return t(this,f).get(e)}destroyView(e){const i=t(this,f).get(e);i&&(t(this,f).delete(e),i.destroy(),t(this,f).size<=1&&t(this,l).setScissorTest(!1))}render(e){var i;if(t(this,f).size>1||this.view.isClipped){const a=e.box.left+e.box.CSSTranslation.x+e.box.scrollValue.x,h=d.height-e.box.height-e.box.top+e.box.CSSTranslation.y+e.box.scrollValue.y*-1;t(this,l).setScissor(a,h,e.box.width,e.box.height),t(this,l).setViewport(a,h,e.box.width,e.box.height)}(i=e.beforeRenderCallback)==null||i.call(e),t(this,l).render(e.scene,e.camera)}}U=new WeakMap,E=new WeakMap,l=new WeakMap,j=new WeakMap,f=new WeakMap,M=new WeakMap,T=new WeakMap,L=new WeakMap,W=new WeakMap,S=new WeakMap,x=new WeakMap,Y=new WeakMap,G=new WeakMap;const d=new ye;function be(s,e,i){const a=e.x,h=e.y,V=i||s.image.width/s.image.height;let y=0,v=0,c=s.offset.x,g=s.offset.y,ce=s.rotation,oe=s.center.x,le=s.center.y;a/h>V?(y=1,v=h/a*V):(v=1,y=a/h/V),s.matrix.setUvTransform(c,g,y,v,ce,oe,le)}const K=new u.Vector3,we=new u.Vector3;function ve(s,e="default"){const i=d.getView(e),{width:a,height:h}=d,V=a/h;s instanceof u.Vector3?K.copy(s):K.set(...s);const y=i.camera.getWorldPosition(we).distanceTo(K);if(i.camera instanceof u.OrthographicCamera)return{width:a/i.camera.zoom,height:h/i.camera.zoom,factor:1,distance:y,aspect:V};{const v=i.camera.fov*Math.PI/180,c=2*Math.tan(v/2)*y,g=c*(a/h);return{width:g,height:c,factor:a/g,distance:y,aspect:V}}}function pe(s,e){s.traverse(i=>{i instanceof u.Mesh&&i.material&&(Array.isArray(i.material)?i.material:[i.material]).forEach(e)})}function De(s,e){s.traverse(i=>{i instanceof u.Mesh&&e(i)})}exports.En3View=X;exports.coverTexture=be;exports.dispose=he;exports.en3=d;exports.getCurrentViewport=ve;exports.traverseMaterials=pe;exports.traverseMeshes=De;
|
package/lib/en3/index.js
CHANGED
|
@@ -16,14 +16,14 @@ var Q = (s, e, i) => e in s ? ue(s, e, { enumerable: !0, configurable: !0, writa
|
|
|
16
16
|
var ie = (s, e, i) => e.has(s) || ee("Cannot " + i);
|
|
17
17
|
var t = (s, e, i) => (ie(s, e, "read from private field"), i ? i.call(s) : e.get(s)), r = (s, e, i) => e.has(s) ? ee("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, i), h = (s, e, i, a) => (ie(s, e, "write to private field"), a ? a.call(s, i) : e.set(s, i), i);
|
|
18
18
|
import { Mesh as Z, OrthographicCamera as X, PerspectiveCamera as se, Scene as be, Vector2 as ye, Raycaster as xe, REVISION as we, WebGLRenderer as pe, Vector3 as q } from "three";
|
|
19
|
-
import { RESIZE_ORDER as De, TICK_ORDER as
|
|
19
|
+
import { RESIZE_ORDER as De, TICK_ORDER as ve } from "../order/index.js";
|
|
20
20
|
import { windowResizer as re } from "../window-resizer/index.js";
|
|
21
21
|
import { ticker as he } from "../ticker/index.js";
|
|
22
22
|
import { g as ce } from "../dom-CVWzyXPH.js";
|
|
23
23
|
import "construct-style-sheets-polyfill";
|
|
24
24
|
import "../index-Bv9zgfdb.js";
|
|
25
25
|
import { LayoutBox as ae } from "../layout-box/index.js";
|
|
26
|
-
function
|
|
26
|
+
function Re(s) {
|
|
27
27
|
const e = (i) => {
|
|
28
28
|
i.dispose();
|
|
29
29
|
for (const a of Object.keys(i)) {
|
|
@@ -40,7 +40,7 @@ function ve(s) {
|
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
-
var S, o, V, p, x, P, D,
|
|
43
|
+
var S, o, V, p, x, P, D, v;
|
|
44
44
|
class ne {
|
|
45
45
|
constructor(e, i) {
|
|
46
46
|
r(this, S);
|
|
@@ -50,8 +50,8 @@ class ne {
|
|
|
50
50
|
r(this, x);
|
|
51
51
|
r(this, P);
|
|
52
52
|
r(this, D);
|
|
53
|
-
r(this,
|
|
54
|
-
h(this, S, e), h(this, o, (i == null ? void 0 : i.cameraType) === "orthographic" ? new X() : new se()), h(this, V, new be()), h(this, p, []), h(this, x, (i == null ? void 0 : i.cameraDistance) || 1e3), t(this, o).near = (i == null ? void 0 : i.cameraNear) || 1, t(this, o).far = (i == null ? void 0 : i.cameraFar) || 11e3, h(this, P, (i == null ? void 0 : i.cameraFov) || "auto"), t(this, o).position.z = t(this, x), t(this, o).name = `Cameras.${t(this, S)}`, h(this, D, ce(i == null ? void 0 : i.sizeElement) || document.documentElement), this.beforeRenderCallback = i == null ? void 0 : i.beforeRender, h(this,
|
|
53
|
+
r(this, v);
|
|
54
|
+
h(this, S, e), h(this, o, (i == null ? void 0 : i.cameraType) === "orthographic" ? new X() : new se()), h(this, V, new be()), h(this, p, []), h(this, x, (i == null ? void 0 : i.cameraDistance) || 1e3), t(this, o).near = (i == null ? void 0 : i.cameraNear) || 1, t(this, o).far = (i == null ? void 0 : i.cameraFar) || 11e3, h(this, P, (i == null ? void 0 : i.cameraFov) || "auto"), t(this, o).position.z = t(this, x), t(this, o).name = `Cameras.${t(this, S)}`, h(this, D, ce(i == null ? void 0 : i.sizeElement) || document.documentElement), this.beforeRenderCallback = i == null ? void 0 : i.beforeRender, h(this, v, new ae(t(this, D))), t(this, v).onResize(() => {
|
|
55
55
|
this.resize();
|
|
56
56
|
});
|
|
57
57
|
}
|
|
@@ -65,7 +65,7 @@ class ne {
|
|
|
65
65
|
return t(this, V);
|
|
66
66
|
}
|
|
67
67
|
get box() {
|
|
68
|
-
return t(this,
|
|
68
|
+
return t(this, v);
|
|
69
69
|
}
|
|
70
70
|
get cameraDistance() {
|
|
71
71
|
return t(this, x);
|
|
@@ -80,13 +80,13 @@ class ne {
|
|
|
80
80
|
return t(this, D) !== m.containerElement;
|
|
81
81
|
}
|
|
82
82
|
resize() {
|
|
83
|
-
const { width: e, height: i } = t(this,
|
|
83
|
+
const { width: e, height: i } = t(this, v);
|
|
84
84
|
t(this, o).userData.controlled || (t(this, o).position.z = t(this, x)), t(this, o) instanceof se ? (t(this, o).aspect = e / i, t(this, o).fov = t(this, P) === "auto" ? 2 * Math.atan(i / 2 / t(this, x)) * (180 / Math.PI) : t(this, o).userData.controlled ? t(this, o).fov : t(this, P)) : t(this, o) instanceof X && (t(this, o).left = e / -2, t(this, o).right = e / 2, t(this, o).top = i / 2, t(this, o).bottom = i / -2), t(this, o).updateProjectionMatrix();
|
|
85
85
|
}
|
|
86
86
|
destroy() {
|
|
87
87
|
t(this, p).forEach((e) => {
|
|
88
88
|
e.userData.box.destroy();
|
|
89
|
-
}), t(this, V).clear(),
|
|
89
|
+
}), t(this, V).clear(), Re(t(this, V)), m.destroyView(this.name), t(this, v).destroy();
|
|
90
90
|
}
|
|
91
91
|
attachToHTMLElement(e, i, a) {
|
|
92
92
|
const n = new ae(e, te(j({}, a), {
|
|
@@ -107,19 +107,19 @@ class ne {
|
|
|
107
107
|
this.scene.remove(e), i && this.detachFromHTMLElement(e);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
S = new WeakMap(), o = new WeakMap(), V = new WeakMap(), p = new WeakMap(), x = new WeakMap(), P = new WeakMap(), D = new WeakMap(),
|
|
111
|
-
var A, k, F,
|
|
110
|
+
S = new WeakMap(), o = new WeakMap(), V = new WeakMap(), p = new WeakMap(), x = new WeakMap(), P = new WeakMap(), D = new WeakMap(), v = new WeakMap();
|
|
111
|
+
var A, k, F, R, I;
|
|
112
112
|
class ze {
|
|
113
113
|
constructor(e) {
|
|
114
114
|
r(this, A);
|
|
115
115
|
r(this, k);
|
|
116
116
|
r(this, F);
|
|
117
|
-
r(this,
|
|
117
|
+
r(this, R);
|
|
118
118
|
r(this, I);
|
|
119
|
-
h(this, A, e.targetName || void 0), h(this, k, e.eventDispatcher || e.object3D), h(this, F, e.propagation || !1), h(this,
|
|
119
|
+
h(this, A, e.targetName || void 0), h(this, k, e.eventDispatcher || e.object3D), h(this, F, e.propagation || !1), h(this, R, e.object3D), h(this, I, t(this, A) ? () => t(this, R).getObjectByName(t(this, A)) || t(this, R) : () => t(this, R));
|
|
120
120
|
}
|
|
121
121
|
get object3D() {
|
|
122
|
-
return t(this,
|
|
122
|
+
return t(this, R);
|
|
123
123
|
}
|
|
124
124
|
get eventDispatcher() {
|
|
125
125
|
return t(this, k);
|
|
@@ -137,7 +137,7 @@ class ze {
|
|
|
137
137
|
}, this.intersection));
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
A = new WeakMap(), k = new WeakMap(), F = new WeakMap(),
|
|
140
|
+
A = new WeakMap(), k = new WeakMap(), F = new WeakMap(), R = new WeakMap(), I = new WeakMap();
|
|
141
141
|
var y, d, H, N, $, W, Y;
|
|
142
142
|
class Ve {
|
|
143
143
|
constructor() {
|
|
@@ -213,22 +213,22 @@ class Ve {
|
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
y = new WeakMap(), d = new WeakMap(), H = new WeakMap(), N = new WeakMap(), $ = new WeakMap(), W = new WeakMap(), Y = new WeakMap();
|
|
216
|
-
var U, g, l, O, u, L, T,
|
|
217
|
-
class
|
|
216
|
+
var U, g, l, O, u, C, L, T, _, M, E, B, G;
|
|
217
|
+
class Ce {
|
|
218
218
|
constructor() {
|
|
219
219
|
r(this, U, `https://unpkg.com/three@0.${we}.x`);
|
|
220
220
|
r(this, g, null);
|
|
221
221
|
r(this, l, null);
|
|
222
222
|
r(this, O, null);
|
|
223
223
|
r(this, u, /* @__PURE__ */ new Map());
|
|
224
|
+
r(this, C, 0);
|
|
224
225
|
r(this, L, 0);
|
|
225
226
|
r(this, T, 0);
|
|
226
|
-
r(this, C, 0);
|
|
227
227
|
r(this, _, 2);
|
|
228
228
|
r(this, M, !1);
|
|
229
229
|
r(this, E, null);
|
|
230
|
-
r(this, B, () => {
|
|
231
|
-
h(this,
|
|
230
|
+
r(this, B, (e) => {
|
|
231
|
+
e instanceof CustomEvent || (h(this, C, t(this, g).clientWidth), h(this, L, t(this, g).clientHeight), h(this, T, Math.min(t(this, _), devicePixelRatio || 1)), t(this, l).setPixelRatio(t(this, T)), t(this, l).setSize(t(this, C), t(this, L)), t(this, E) && (t(this, E).setPixelRatio(t(this, T)), t(this, E).setSize(t(this, C), t(this, L))));
|
|
232
232
|
});
|
|
233
233
|
r(this, G, () => {
|
|
234
234
|
t(this, l).setRenderTarget(null), t(this, u).forEach((e) => {
|
|
@@ -261,13 +261,13 @@ class Le {
|
|
|
261
261
|
return this.getView("default").scene;
|
|
262
262
|
}
|
|
263
263
|
get width() {
|
|
264
|
-
return t(this,
|
|
264
|
+
return t(this, C);
|
|
265
265
|
}
|
|
266
266
|
get height() {
|
|
267
|
-
return t(this,
|
|
267
|
+
return t(this, L);
|
|
268
268
|
}
|
|
269
269
|
get pixelRatio() {
|
|
270
|
-
return t(this,
|
|
270
|
+
return t(this, T);
|
|
271
271
|
}
|
|
272
272
|
get composer() {
|
|
273
273
|
return t(this, E);
|
|
@@ -292,7 +292,7 @@ class Le {
|
|
|
292
292
|
), h(this, O, new Ve()), e != null && e.composer && (h(this, E, new e.composer(t(this, l))), this.render = () => {
|
|
293
293
|
t(this, E).render();
|
|
294
294
|
}), h(this, M, !0), re.subscribe(t(this, B), De.CANVAS), he.subscribe(t(this, G), {
|
|
295
|
-
order:
|
|
295
|
+
order: ve.CANVAS,
|
|
296
296
|
culling: t(this, g)
|
|
297
297
|
});
|
|
298
298
|
}
|
|
@@ -333,18 +333,18 @@ class Le {
|
|
|
333
333
|
(i = e.beforeRenderCallback) == null || i.call(e), t(this, l).render(e.scene, e.camera);
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
|
-
U = new WeakMap(), g = new WeakMap(), l = new WeakMap(), O = new WeakMap(), u = new WeakMap(),
|
|
337
|
-
const m = new
|
|
336
|
+
U = new WeakMap(), g = new WeakMap(), l = new WeakMap(), O = new WeakMap(), u = new WeakMap(), C = new WeakMap(), L = new WeakMap(), T = new WeakMap(), _ = new WeakMap(), M = new WeakMap(), E = new WeakMap(), B = new WeakMap(), G = new WeakMap();
|
|
337
|
+
const m = new Ce();
|
|
338
338
|
function Fe(s, e, i) {
|
|
339
339
|
const a = e.x, n = e.y, z = i || s.image.width / s.image.height;
|
|
340
340
|
let b = 0, w = 0, c = s.offset.x, f = s.offset.y, oe = s.rotation, le = s.center.x, de = s.center.y;
|
|
341
341
|
a / n > z ? (b = 1, w = n / a * z) : (w = 1, b = a / n / z), s.matrix.setUvTransform(c, f, b, w, oe, le, de);
|
|
342
342
|
}
|
|
343
|
-
const K = new q(),
|
|
343
|
+
const K = new q(), Le = new q();
|
|
344
344
|
function Ie(s, e = "default") {
|
|
345
345
|
const i = m.getView(e), { width: a, height: n } = m, z = a / n;
|
|
346
346
|
s instanceof q ? K.copy(s) : K.set(...s);
|
|
347
|
-
const b = i.camera.getWorldPosition(
|
|
347
|
+
const b = i.camera.getWorldPosition(Le).distanceTo(K);
|
|
348
348
|
if (i.camera instanceof X)
|
|
349
349
|
return {
|
|
350
350
|
width: a / i.camera.zoom,
|
|
@@ -371,7 +371,7 @@ function $e(s, e) {
|
|
|
371
371
|
export {
|
|
372
372
|
ne as En3View,
|
|
373
373
|
Fe as coverTexture,
|
|
374
|
-
|
|
374
|
+
Re as dispose,
|
|
375
375
|
m as en3,
|
|
376
376
|
Ie as getCurrentViewport,
|
|
377
377
|
Ne as traverseMaterials,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var f=
|
|
1
|
+
"use strict";var f=i=>{throw TypeError(i)};var w=(i,s,e)=>s.has(i)||f("Cannot "+e);var t=(i,s,e)=>(w(i,s,"read from private field"),e?e.call(i):s.get(i)),u=(i,s,e)=>s.has(i)?f("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(i):s.set(i,e),c=(i,s,e,o)=>(w(i,s,"write to private field"),o?o.call(i,e):s.set(i,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../notifier/index.cjs"),l=require("../index-DekP7OZe.cjs"),R=require("../function-MthRj-GJ.cjs");require("construct-style-sheets-polyfill");var r,n,d;class h extends b.Notifier{constructor(){super();u(this,r,!1);u(this,n,e=>{t(this,r)||(c(this,r,!0),t(this,d).call(this,e))});u(this,d,R.debounce(e=>{this.notify(e),c(this,r,!1)},0));l.isBrowser&&(window.addEventListener("resize",t(this,n)),t(this,n).call(this))}subscribe(e,o){const z=super.subscribe(e,o);return t(this,r)||e(),z}}r=new WeakMap,n=new WeakMap,d=new WeakMap;const a=new h;exports.WindowResizer=h;exports.windowResizer=a;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var h = (
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var h = (e) => {
|
|
2
|
+
throw TypeError(e);
|
|
3
3
|
};
|
|
4
|
-
var c = (
|
|
5
|
-
var t = (
|
|
4
|
+
var c = (e, i, s) => i.has(e) || h("Cannot " + s);
|
|
5
|
+
var t = (e, i, s) => (c(e, i, "read from private field"), s ? s.call(e) : i.get(e)), u = (e, i, s) => i.has(e) ? h("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(e) : i.set(e, s), f = (e, i, s, n) => (c(e, i, "write to private field"), n ? n.call(e, s) : i.set(e, s), s);
|
|
6
6
|
import { Notifier as p } from "../notifier/index.js";
|
|
7
7
|
import { i as w } from "../index-Bv9zgfdb.js";
|
|
8
8
|
import { d as z } from "../function-C10DGppn.js";
|
|
@@ -12,17 +12,17 @@ class b extends p {
|
|
|
12
12
|
constructor() {
|
|
13
13
|
super();
|
|
14
14
|
u(this, r, !1);
|
|
15
|
-
u(this, o, () => {
|
|
16
|
-
t(this, r) || (f(this, r, !0), t(this, d).call(this));
|
|
15
|
+
u(this, o, (s) => {
|
|
16
|
+
t(this, r) || (f(this, r, !0), t(this, d).call(this, s));
|
|
17
17
|
});
|
|
18
|
-
u(this, d, z(() => {
|
|
19
|
-
this.notify(), f(this, r, !1);
|
|
18
|
+
u(this, d, z((s) => {
|
|
19
|
+
this.notify(s), f(this, r, !1);
|
|
20
20
|
}, 0));
|
|
21
21
|
w && (window.addEventListener("resize", t(this, o)), t(this, o).call(this));
|
|
22
22
|
}
|
|
23
|
-
subscribe(
|
|
24
|
-
const m = super.subscribe(
|
|
25
|
-
return t(this, r) ||
|
|
23
|
+
subscribe(s, n) {
|
|
24
|
+
const m = super.subscribe(s, n);
|
|
25
|
+
return t(this, r) || s(), m;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
r = new WeakMap(), o = new WeakMap(), d = new WeakMap();
|