gl-draw 0.0.18 → 0.0.22
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/dist/core/BaseObject.d.ts +2 -4
- package/dist/core/Camera.d.ts +1 -2
- package/dist/core/Composer.d.ts +6 -6
- package/dist/core/Control.d.ts +1 -1
- package/dist/core/GUIObject.d.ts +4 -18
- package/dist/core/Pencil.d.ts +8 -10
- package/dist/core/Renderer.d.ts +1 -1
- package/dist/core/Scene.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5 -5
- package/dist/objects/index.js +11 -11
- package/dist/objects/line/index.d.ts +41 -1
- package/dist/objects/text/index.d.ts +0 -1
- package/dist/plugins/Draw.d.ts +1 -1
- package/dist/plugins/index.js +1 -1
- package/package.json +1 -1
- package/dist/objects/line/line.d.ts +0 -41
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
|
-
import
|
|
3
|
-
import Pencil from '../core/Pencil';
|
|
2
|
+
import type Pencil from '../core/Pencil';
|
|
4
3
|
export { CSS3DObject, CSS3DSprite, } from 'three/examples/jsm/renderers/CSS3DRenderer';
|
|
5
4
|
export { CSS2DObject } from 'three/examples/jsm/renderers/CSS2DRenderer';
|
|
6
|
-
export default class BaseObject
|
|
5
|
+
export default class BaseObject {
|
|
7
6
|
objecttype__: string;
|
|
8
7
|
key: string;
|
|
9
8
|
pencil: Pencil;
|
|
@@ -22,7 +21,6 @@ export default class BaseObject extends GUIObject {
|
|
|
22
21
|
render(): void;
|
|
23
22
|
update(delta: number, elapsed: number): void;
|
|
24
23
|
resize(width: number, height: number): void;
|
|
25
|
-
constructor(options?: {});
|
|
26
24
|
show(): this;
|
|
27
25
|
hide(): this;
|
|
28
26
|
isVisible(): boolean;
|
package/dist/core/Camera.d.ts
CHANGED
|
@@ -18,14 +18,13 @@ interface Options {
|
|
|
18
18
|
}
|
|
19
19
|
export default class {
|
|
20
20
|
options: Options;
|
|
21
|
-
camera
|
|
21
|
+
camera: THREE.PerspectiveCamera;
|
|
22
22
|
oldCameraPosition: THREE.Vector3;
|
|
23
23
|
oldCameraRotation: THREE.Euler;
|
|
24
24
|
customCamera: boolean;
|
|
25
25
|
checkCameraChange(): boolean;
|
|
26
26
|
constructor(options: Options);
|
|
27
27
|
setSize(width: number, height: number): void;
|
|
28
|
-
dispose(): void;
|
|
29
28
|
setGui(gui: GUI): void;
|
|
30
29
|
}
|
|
31
30
|
export {};
|
package/dist/core/Composer.d.ts
CHANGED
|
@@ -21,11 +21,11 @@ interface Options {
|
|
|
21
21
|
composerParams: ComposerParams;
|
|
22
22
|
}
|
|
23
23
|
export default class {
|
|
24
|
-
renderer
|
|
25
|
-
scene
|
|
26
|
-
camera
|
|
27
|
-
finalComposer
|
|
28
|
-
renderPass
|
|
24
|
+
renderer: THREE.WebGLRenderer;
|
|
25
|
+
scene: THREE.Scene;
|
|
26
|
+
camera: THREE.Camera;
|
|
27
|
+
finalComposer: EffectComposer;
|
|
28
|
+
renderPass: RenderPass;
|
|
29
29
|
copyPass?: ShaderPass;
|
|
30
30
|
gammaCorrectionPass?: ShaderPass;
|
|
31
31
|
smaaPass?: SMAAPass;
|
|
@@ -34,7 +34,7 @@ export default class {
|
|
|
34
34
|
bloomController?: BloomController;
|
|
35
35
|
outlineController?: OutlineController;
|
|
36
36
|
ssrController?: SSRController;
|
|
37
|
-
renderTarget
|
|
37
|
+
renderTarget: THREE.WebGLRenderTarget;
|
|
38
38
|
options: Options;
|
|
39
39
|
active: boolean;
|
|
40
40
|
constructor(options: Options);
|
package/dist/core/Control.d.ts
CHANGED
package/dist/core/GUIObject.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ interface GuiParams {
|
|
|
3
3
|
[key: string]: {
|
|
4
4
|
[key: string]: {
|
|
5
5
|
value?: any;
|
|
6
|
-
to?: any;
|
|
7
6
|
name?: string;
|
|
8
7
|
items?: string[] | object;
|
|
9
8
|
min?: number;
|
|
@@ -17,22 +16,9 @@ interface GuiParams {
|
|
|
17
16
|
}
|
|
18
17
|
export default class GUIObject {
|
|
19
18
|
guiParams: GuiParams;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
duration?: number | undefined;
|
|
25
|
-
}): import("@tweenjs/tween.js").Tween<{
|
|
26
|
-
value?: any;
|
|
27
|
-
to?: any;
|
|
28
|
-
name?: string | undefined;
|
|
29
|
-
items?: object | string[] | undefined;
|
|
30
|
-
min?: number | undefined;
|
|
31
|
-
max?: number | undefined;
|
|
32
|
-
step?: number | undefined;
|
|
33
|
-
paramMap?: string | undefined;
|
|
34
|
-
target?: (() => any) | undefined;
|
|
35
|
-
onChange?: ((value: any) => any) | undefined;
|
|
36
|
-
}>;
|
|
19
|
+
constructor(guiParams?: GuiParams);
|
|
20
|
+
showGui(gui?: GUI): void;
|
|
21
|
+
setTargetValue(key: string, param: string, value: any, paramMap?: string): void;
|
|
22
|
+
setTargetValueByParams(): void;
|
|
37
23
|
}
|
|
38
24
|
export {};
|
package/dist/core/Pencil.d.ts
CHANGED
|
@@ -41,25 +41,24 @@ interface Options {
|
|
|
41
41
|
css2DRendererParams?: Partial<CSSRendererParams>;
|
|
42
42
|
css3DRenderer?: boolean;
|
|
43
43
|
css3DRendererParams?: Partial<CSSRendererParams>;
|
|
44
|
-
staticPath?: string;
|
|
45
44
|
}
|
|
46
45
|
export default class Pencil {
|
|
47
46
|
options: Omit<DeepRequired<Options>, 'controlParams'> & Pick<Options, 'controlParams'>;
|
|
48
|
-
composerController
|
|
49
|
-
private rendererController
|
|
47
|
+
composerController: ComposerController;
|
|
48
|
+
private rendererController;
|
|
50
49
|
cssRendererController?: CSSRendererController;
|
|
51
|
-
private cameraController
|
|
50
|
+
private cameraController;
|
|
52
51
|
controlController?: ControlController;
|
|
53
|
-
sceneController
|
|
52
|
+
sceneController: SceneController;
|
|
54
53
|
stats?: Stats;
|
|
55
54
|
gui?: GUI;
|
|
56
|
-
private resizeObserver
|
|
55
|
+
private resizeObserver;
|
|
57
56
|
private raycaster;
|
|
58
57
|
installPlugins: Map<any, boolean>;
|
|
59
|
-
get renderer(): THREE.WebGLRenderer
|
|
58
|
+
get renderer(): THREE.WebGLRenderer;
|
|
60
59
|
get control(): import("three/examples/jsm/controls/OrbitControls").OrbitControls | undefined;
|
|
61
|
-
get camera(): THREE.PerspectiveCamera
|
|
62
|
-
get scene(): THREE.Scene
|
|
60
|
+
get camera(): THREE.PerspectiveCamera;
|
|
61
|
+
get scene(): THREE.Scene;
|
|
63
62
|
event: EventEmitter;
|
|
64
63
|
clock: THREE.Clock;
|
|
65
64
|
static options: {
|
|
@@ -119,7 +118,6 @@ export default class Pencil {
|
|
|
119
118
|
css3DRendererParams: {
|
|
120
119
|
zIndex: string;
|
|
121
120
|
};
|
|
122
|
-
staticPath: string;
|
|
123
121
|
};
|
|
124
122
|
constructor(options: Options);
|
|
125
123
|
use(plugin: any, ...args: any[]): void;
|
package/dist/core/Renderer.d.ts
CHANGED
package/dist/core/Scene.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){var Ue={187:function(R){"use strict";var T=typeof Reflect=="object"?Reflect:null,x=T&&typeof T.apply=="function"?T.apply:function(c,p,P){return Function.prototype.apply.call(c,p,P)},z;T&&typeof T.ownKeys=="function"?z=T.ownKeys:Object.getOwnPropertySymbols?z=function(c){return Object.getOwnPropertyNames(c).concat(Object.getOwnPropertySymbols(c))}:z=function(c){return Object.getOwnPropertyNames(c)};function G(f){console&&console.warn&&console.warn(f)}var E=Number.isNaN||function(c){return c!==c};function m(){m.init.call(this)}R.exports=m,R.exports.once=$,m.EventEmitter=m,m.prototype._events=void 0,m.prototype._eventsCount=0,m.prototype._maxListeners=void 0;var B=10;function q(f){if(typeof f!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof f)}Object.defineProperty(m,"defaultMaxListeners",{enumerable:!0,get:function(){return B},set:function(f){if(typeof f!="number"||f<0||E(f))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+f+".");B=f}}),m.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},m.prototype.setMaxListeners=function(c){if(typeof c!="number"||c<0||E(c))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+c+".");return this._maxListeners=c,this};function W(f){return f._maxListeners===void 0?m.defaultMaxListeners:f._maxListeners}m.prototype.getMaxListeners=function(){return W(this)},m.prototype.emit=function(c){for(var p=[],P=1;P<arguments.length;P++)p.push(arguments[P]);var S=c==="error",L=this._events;if(L!==void 0)S=S&&L.error===void 0;else if(!S)return!1;if(S){var j;if(p.length>0&&(j=p[0]),j instanceof Error)throw j;var F=new Error("Unhandled error."+(j?" ("+j.message+")":""));throw F.context=j,F}var oe=L[c];if(oe===void 0)return!1;if(typeof oe=="function")x(oe,this,p);else for(var he=oe.length,ve=se(oe,he),P=0;P<he;++P)x(ve[P],this,p);return!0};function U(f,c,p,P){var S,L,j;if(q(p),L=f._events,L===void 0?(L=f._events=Object.create(null),f._eventsCount=0):(L.newListener!==void 0&&(f.emit("newListener",c,p.listener?p.listener:p),L=f._events),j=L[c]),j===void 0)j=L[c]=p,++f._eventsCount;else if(typeof j=="function"?j=L[c]=P?[p,j]:[j,p]:P?j.unshift(p):j.push(p),S=W(f),S>0&&j.length>S&&!j.warned){j.warned=!0;var F=new Error("Possible EventEmitter memory leak detected. "+j.length+" "+String(c)+" listeners added. Use emitter.setMaxListeners() to increase limit");F.name="MaxListenersExceededWarning",F.emitter=f,F.type=c,F.count=j.length,G(F)}return f}m.prototype.addListener=function(c,p){return U(this,c,p,!1)},m.prototype.on=m.prototype.addListener,m.prototype.prependListener=function(c,p){return U(this,c,p,!0)};function X(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Y(f,c,p){var P={fired:!1,wrapFn:void 0,target:f,type:c,listener:p},S=X.bind(P);return S.listener=p,P.wrapFn=S,S}m.prototype.once=function(c,p){return q(p),this.on(c,Y(this,c,p)),this},m.prototype.prependOnceListener=function(c,p){return q(p),this.prependListener(c,Y(this,c,p)),this},m.prototype.removeListener=function(c,p){var P,S,L,j,F;if(q(p),S=this._events,S===void 0)return this;if(P=S[c],P===void 0)return this;if(P===p||P.listener===p)--this._eventsCount===0?this._events=Object.create(null):(delete S[c],S.removeListener&&this.emit("removeListener",c,P.listener||p));else if(typeof P!="function"){for(L=-1,j=P.length-1;j>=0;j--)if(P[j]===p||P[j].listener===p){F=P[j].listener,L=j;break}if(L<0)return this;L===0?P.shift():ae(P,L),P.length===1&&(S[c]=P[0]),S.removeListener!==void 0&&this.emit("removeListener",c,F||p)}return this},m.prototype.off=m.prototype.removeListener,m.prototype.removeAllListeners=function(c){var p,P,S;if(P=this._events,P===void 0)return this;if(P.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):P[c]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete P[c]),this;if(arguments.length===0){var L=Object.keys(P),j;for(S=0;S<L.length;++S)j=L[S],j!=="removeListener"&&this.removeAllListeners(j);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(p=P[c],typeof p=="function")this.removeListener(c,p);else if(p!==void 0)for(S=p.length-1;S>=0;S--)this.removeListener(c,p[S]);return this};function Q(f,c,p){var P=f._events;if(P===void 0)return[];var S=P[c];return S===void 0?[]:typeof S=="function"?p?[S.listener||S]:[S]:p?k(S):se(S,S.length)}m.prototype.listeners=function(c){return Q(this,c,!0)},m.prototype.rawListeners=function(c){return Q(this,c,!1)},m.listenerCount=function(f,c){return typeof f.listenerCount=="function"?f.listenerCount(c):h.call(f,c)},m.prototype.listenerCount=h;function h(f){var c=this._events;if(c!==void 0){var p=c[f];if(typeof p=="function")return 1;if(p!==void 0)return p.length}return 0}m.prototype.eventNames=function(){return this._eventsCount>0?z(this._events):[]};function se(f,c){for(var p=new Array(c),P=0;P<c;++P)p[P]=f[P];return p}function ae(f,c){for(;c+1<f.length;c++)f[c]=f[c+1];f.pop()}function k(f){for(var c=new Array(f.length),p=0;p<c.length;++p)c[p]=f[p].listener||f[p];return c}function $(f,c){return new Promise(function(p,P){function S(j){f.removeListener(c,L),P(j)}function L(){typeof f.removeListener=="function"&&f.removeListener("error",S),p([].slice.call(arguments))}I(f,c,L,{once:!0}),c!=="error"&&D(f,S,{once:!0})})}function D(f,c,p){typeof f.on=="function"&&I(f,"error",c,p)}function I(f,c,p,P){if(typeof f.on=="function")P.once?f.once(c,p):f.on(c,p);else if(typeof f.addEventListener=="function")f.addEventListener(c,function S(L){P.once&&f.removeEventListener(c,S),p(L)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof f)}},666:function(R){var T=function(x){"use strict";var z=Object.prototype,G=z.hasOwnProperty,E,m=typeof Symbol=="function"?Symbol:{},B=m.iterator||"@@iterator",q=m.asyncIterator||"@@asyncIterator",W=m.toStringTag||"@@toStringTag";function U(v,l,g){return Object.defineProperty(v,l,{value:g,enumerable:!0,configurable:!0,writable:!0}),v[l]}try{U({},"")}catch(v){U=function(l,g,O){return l[g]=O}}function X(v,l,g,O){var C=l&&l.prototype instanceof $?l:$,Z=Object.create(C.prototype),te=new ve(O||[]);return Z._invoke=j(v,g,te),Z}x.wrap=X;function Y(v,l,g){try{return{type:"normal",arg:v.call(l,g)}}catch(O){return{type:"throw",arg:O}}}var Q="suspendedStart",h="suspendedYield",se="executing",ae="completed",k={};function $(){}function D(){}function I(){}var f={};U(f,B,function(){return this});var c=Object.getPrototypeOf,p=c&&c(c(me([])));p&&p!==z&&G.call(p,B)&&(f=p);var P=I.prototype=$.prototype=Object.create(f);D.prototype=I,U(P,"constructor",I),U(I,"constructor",D),D.displayName=U(I,W,"GeneratorFunction");function S(v){["next","throw","return"].forEach(function(l){U(v,l,function(g){return this._invoke(l,g)})})}x.isGeneratorFunction=function(v){var l=typeof v=="function"&&v.constructor;return l?l===D||(l.displayName||l.name)==="GeneratorFunction":!1},x.mark=function(v){return Object.setPrototypeOf?Object.setPrototypeOf(v,I):(v.__proto__=I,U(v,W,"GeneratorFunction")),v.prototype=Object.create(P),v},x.awrap=function(v){return{__await:v}};function L(v,l){function g(Z,te,J,ne){var ee=Y(v[Z],v,te);if(ee.type==="throw")ne(ee.arg);else{var pe=ee.arg,le=pe.value;return le&&typeof le=="object"&&G.call(le,"__await")?l.resolve(le.__await).then(function(ue){g("next",ue,J,ne)},function(ue){g("throw",ue,J,ne)}):l.resolve(le).then(function(ue){pe.value=ue,J(pe)},function(ue){return g("throw",ue,J,ne)})}}var O;function C(Z,te){function J(){return new l(function(ne,ee){g(Z,te,ne,ee)})}return O=O?O.then(J,J):J()}this._invoke=C}S(L.prototype),U(L.prototype,q,function(){return this}),x.AsyncIterator=L,x.async=function(v,l,g,O,C){C===void 0&&(C=Promise);var Z=new L(X(v,l,g,O),C);return x.isGeneratorFunction(l)?Z:Z.next().then(function(te){return te.done?te.value:Z.next()})};function j(v,l,g){var O=Q;return function(Z,te){if(O===se)throw new Error("Generator is already running");if(O===ae){if(Z==="throw")throw te;return ge()}for(g.method=Z,g.arg=te;;){var J=g.delegate;if(J){var ne=F(J,g);if(ne){if(ne===k)continue;return ne}}if(g.method==="next")g.sent=g._sent=g.arg;else if(g.method==="throw"){if(O===Q)throw O=ae,g.arg;g.dispatchException(g.arg)}else g.method==="return"&&g.abrupt("return",g.arg);O=se;var ee=Y(v,l,g);if(ee.type==="normal"){if(O=g.done?ae:h,ee.arg===k)continue;return{value:ee.arg,done:g.done}}else ee.type==="throw"&&(O=ae,g.method="throw",g.arg=ee.arg)}}}function F(v,l){var g=v.iterator[l.method];if(g===E){if(l.delegate=null,l.method==="throw"){if(v.iterator.return&&(l.method="return",l.arg=E,F(v,l),l.method==="throw"))return k;l.method="throw",l.arg=new TypeError("The iterator does not provide a 'throw' method")}return k}var O=Y(g,v.iterator,l.arg);if(O.type==="throw")return l.method="throw",l.arg=O.arg,l.delegate=null,k;var C=O.arg;if(!C)return l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,k;if(C.done)l[v.resultName]=C.value,l.next=v.nextLoc,l.method!=="return"&&(l.method="next",l.arg=E);else return C;return l.delegate=null,k}S(P),U(P,W,"Generator"),U(P,B,function(){return this}),U(P,"toString",function(){return"[object Generator]"});function oe(v){var l={tryLoc:v[0]};1 in v&&(l.catchLoc=v[1]),2 in v&&(l.finallyLoc=v[2],l.afterLoc=v[3]),this.tryEntries.push(l)}function he(v){var l=v.completion||{};l.type="normal",delete l.arg,v.completion=l}function ve(v){this.tryEntries=[{tryLoc:"root"}],v.forEach(oe,this),this.reset(!0)}x.keys=function(v){var l=[];for(var g in v)l.push(g);return l.reverse(),function O(){for(;l.length;){var C=l.pop();if(C in v)return O.value=C,O.done=!1,O}return O.done=!0,O}};function me(v){if(v){var l=v[B];if(l)return l.call(v);if(typeof v.next=="function")return v;if(!isNaN(v.length)){var g=-1,O=function C(){for(;++g<v.length;)if(G.call(v,g))return C.value=v[g],C.done=!1,C;return C.value=E,C.done=!0,C};return O.next=O}}return{next:ge}}x.values=me;function ge(){return{value:E,done:!0}}return ve.prototype={constructor:ve,reset:function(v){if(this.prev=0,this.next=0,this.sent=this._sent=E,this.done=!1,this.delegate=null,this.method="next",this.arg=E,this.tryEntries.forEach(he),!v)for(var l in this)l.charAt(0)==="t"&&G.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=E)},stop:function(){this.done=!0;var v=this.tryEntries[0],l=v.completion;if(l.type==="throw")throw l.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var l=this;function g(ne,ee){return Z.type="throw",Z.arg=v,l.next=ne,ee&&(l.method="next",l.arg=E),!!ee}for(var O=this.tryEntries.length-1;O>=0;--O){var C=this.tryEntries[O],Z=C.completion;if(C.tryLoc==="root")return g("end");if(C.tryLoc<=this.prev){var te=G.call(C,"catchLoc"),J=G.call(C,"finallyLoc");if(te&&J){if(this.prev<C.catchLoc)return g(C.catchLoc,!0);if(this.prev<C.finallyLoc)return g(C.finallyLoc)}else if(te){if(this.prev<C.catchLoc)return g(C.catchLoc,!0)}else if(J){if(this.prev<C.finallyLoc)return g(C.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(v,l){for(var g=this.tryEntries.length-1;g>=0;--g){var O=this.tryEntries[g];if(O.tryLoc<=this.prev&&G.call(O,"finallyLoc")&&this.prev<O.finallyLoc){var C=O;break}}C&&(v==="break"||v==="continue")&&C.tryLoc<=l&&l<=C.finallyLoc&&(C=null);var Z=C?C.completion:{};return Z.type=v,Z.arg=l,C?(this.method="next",this.next=C.finallyLoc,k):this.complete(Z)},complete:function(v,l){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&l&&(this.next=l),k},finish:function(v){for(var l=this.tryEntries.length-1;l>=0;--l){var g=this.tryEntries[l];if(g.finallyLoc===v)return this.complete(g.completion,g.afterLoc),he(g),k}},catch:function(v){for(var l=this.tryEntries.length-1;l>=0;--l){var g=this.tryEntries[l];if(g.tryLoc===v){var O=g.completion;if(O.type==="throw"){var C=O.arg;he(g)}return C}}throw new Error("illegal catch attempt")},delegateYield:function(v,l,g){return this.delegate={iterator:me(v),resultName:l,nextLoc:g},this.method==="next"&&(this.arg=E),k}},x}(R.exports);try{regeneratorRuntime=T}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=T:Function("r","regeneratorRuntime = r")(T)}},695:function(R,T,x){"use strict";x.d(T,{Z:function(){return z}});function z(G){if(G.geometry&&G.geometry.dispose(),G.material){var E=Array.isArray(G.material)?G.material:[G.material];E.forEach(function(m){var B,q,W,U,X,Y,Q,h,se,ae,k,$,D;(B=m.map)===null||B===void 0||B.dispose(),(q=m.lightMap)===null||q===void 0||q.dispose(),(W=m.bumpMap)===null||W===void 0||W.dispose(),(U=m.normalMap)===null||U===void 0||U.dispose(),(X=m.specularMap)===null||X===void 0||X.dispose(),(Y=m.envMap)===null||Y===void 0||Y.dispose(),(Q=m.alphaMap)===null||Q===void 0||Q.dispose(),(h=m.aoMap)===null||h===void 0||h.dispose(),(se=m.displacementMap)===null||se===void 0||se.dispose(),(ae=m.emissiveMap)===null||ae===void 0||ae.dispose(),(k=m.gradientMap)===null||k===void 0||k.dispose(),($=m.metalnessMap)===null||$===void 0||$.dispose(),(D=m.roughnessMap)===null||D===void 0||D.dispose(),m.dispose()})}}},519:function(R,T,x){"use strict";x.d(T,{disposeMesh:function(){return m.Z},isPlainObject:function(){return W.Z}});var z=x(666),G=x.n(z),E=null,m=x(695),B=x(644);function q(k){if(k.material){var $=Array.isArray(k.material)?k.material:[k.material];$.forEach(function(D){var I,f;(I=D.color)===null||I===void 0||I.convertSRGBToLinear(),(f=D.emissive)===null||f===void 0||f.convertSRGBToLinear(),D.map&&(D.map.encoding=THREE.sRGBEncoding),D.emissiveMap&&(D.emissiveMap.encoding=THREE.sRGBEncoding)})}}var W=x(738),U=x(568),X=x(924),Y=require("idb-keyval"),Q=x(484),h=null,se=null,ae=function(){var k=(0,U.Z)(G().mark(function $(D,I){var f,c,p,P,S,L;return G().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return f=I.version,F.next=4,(0,Y.get)(D);case 4:if(p=F.sent,!(p&&p[f])){F.next=9;break}c=p[f],F.next=15;break;case 9:return F.next=11,(0,Q.Z)(fetch(D).then(function(oe){if(oe.ok)return oe.blob();throw new Error}));case 11:P=F.sent,S=P.res,L=P.err,L||(c=S,(0,Y.set)(D,(0,X.Z)({},f,S)));case 15:return F.abrupt("return",c?{url:URL.createObjectURL(c)}:{url:D});case 16:case"end":return F.stop()}},$)}));return function(D,I){return k.apply(this,arguments)}}()},738:function(R,T,x){"use strict";x.d(T,{Z:function(){return G}});function z(E){return Object.prototype.toString.call(E)==="[object Object]"}function G(E){if(z(E)===!1)return!1;var m=E.constructor;if(m===void 0)return!0;var B=m.prototype;return!(z(B)===!1||B.hasOwnProperty("isPrototypeOf")===!1)}},484:function(R,T,x){"use strict";x.d(T,{Z:function(){return G}});var z=x(42);function G(E){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return E.then(function(B){return(0,z.Z)({err:null,res:B},m)}).catch(function(B){return(0,z.Z)({err:B,res:void 0},m)})}},644:function(R){"use strict";R.exports=require("three")},568:function(R,T,x){"use strict";x.d(T,{Z:function(){return G}});function z(E,m,B,q,W,U,X){try{var Y=E[U](X),Q=Y.value}catch(h){B(h);return}Y.done?m(Q):Promise.resolve(Q).then(q,W)}function G(E){return function(){var m=this,B=arguments;return new Promise(function(q,W){var U=E.apply(m,B);function X(Q){z(U,q,W,X,Y,"next",Q)}function Y(Q){z(U,q,W,X,Y,"throw",Q)}X(void 0)})}}},924:function(R,T,x){"use strict";x.d(T,{Z:function(){return z}});function z(G,E,m){return E in G?Object.defineProperty(G,E,{value:m,enumerable:!0,configurable:!0,writable:!0}):G[E]=m,G}},42:function(R,T,x){"use strict";x.d(T,{Z:function(){return G}});var z=x(924);function G(E){for(var m=1;m<arguments.length;m++){var B=arguments[m]!=null?arguments[m]:{},q=Object.keys(B);typeof Object.getOwnPropertySymbols=="function"&&(q=q.concat(Object.getOwnPropertySymbols(B).filter(function(W){return Object.getOwnPropertyDescriptor(B,W).enumerable}))),q.forEach(function(W){(0,z.Z)(E,W,B[W])})}return E}}},Oe={};function K(R){var T=Oe[R];if(T!==void 0)return T.exports;var x=Oe[R]={exports:{}};return Ue[R](x,x.exports,K),x.exports}(function(){K.n=function(R){var T=R&&R.__esModule?function(){return R.default}:function(){return R};return K.d(T,{a:T}),T}})(),function(){K.d=function(R,T){for(var x in T)K.o(T,x)&&!K.o(R,x)&&Object.defineProperty(R,x,{enumerable:!0,get:T[x]})}}(),function(){K.o=function(R,T){return Object.prototype.hasOwnProperty.call(R,T)}}(),function(){K.r=function(R){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(R,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(R,"__esModule",{value:!0})}}();var ye={};(function(){"use strict";K.r(ye),K.d(ye,{BaseObject:function(){return gt},Pencil:function(){return Ce},default:function(){return Ce}});function R(o,s){if(!(o instanceof s))throw new TypeError("Cannot call a class as a function")}function T(o,s){for(var n=0;n<s.length;n++){var e=s[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(o,e.key,e)}}function x(o,s,n){return s&&T(o.prototype,s),n&&T(o,n),o}var z=K(42);function G(o,s){var n=Object.keys(o);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(o);s&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(o,r).enumerable})),n.push.apply(n,e)}return n}function E(o,s){return s=s!=null?s:{},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(s)):G(Object(s)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(s,n))}),o}function m(o,s){(s==null||s>o.length)&&(s=o.length);for(var n=0,e=new Array(s);n<s;n++)e[n]=o[n];return e}function B(o){if(Array.isArray(o))return m(o)}function q(o){if(typeof Symbol!="undefined"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)}function W(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function U(o,s){if(!!o){if(typeof o=="string")return m(o,s);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor&&(n=o.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m(o,s)}}function X(o){return B(o)||q(o)||U(o)||W()}var Y=require("@tweenjs/tween.js"),Q=K.n(Y),h=K(644),se=K(187),ae=require("deepmerge"),k=K.n(ae),$=require("three/examples/jsm/libs/stats.module"),D=K.n($),I=require("lil-gui"),f=K.n(I),c=function(){"use strict";function o(){R(this,o),this.guiParams={}}var s=o.prototype;return s.showGuiParams=function(e){var r=this;!e||Object.keys(this.guiParams).forEach(function(t){var a=e.addFolder(t),u=r.guiParams[t];Object.keys(u).forEach(function(i){var d=u[i],w=d.min,b=d.max,_=d.step,y=d.name,M=d.to,A=d.paramMap,H=d.items,V=d.value,ie=d.target,re=i.toLowerCase().indexOf("color")>-1,N,fe=typeof V=="undefined"&&ie,ce=fe?ie():u[i],de=fe?i:"value";H?N=a.add(ce,de,H):re?N=a.addColor(ce,de):N=a.add(ce,de),N=N.name(y||i),typeof w!="undefined"&&(N=N.min(w)),typeof b!="undefined"&&(N=N.max(b)),typeof _!="undefined"&&(N=N.step(_)),N=N.onChange(function(){r.setGuiTargetValue(t,i,ce[de],A)}),(M||fe)&&N.listen()})})},s.setGuiTargetValue=function(e,r,t,a){var u=this.guiParams[e][r],i=u.onChange,d=u.target,w=u.value,b=r.toLowerCase().indexOf("color")>-1,_=typeof w=="undefined"&&d;if(d&&!_){var y=d();Array.isArray(y)||(y=[y]),y.forEach(function(M){if(!!M)if(b)try{M[a||r].set(t)}catch(A){r!=="color"&&!a&&console.warn("".concat(r," is not a color,set paramMap"))}else M[a||r]=t})}i&&i(t)},s.setGuiTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(r){Object.keys(e.guiParams[r]).forEach(function(t){var a=e.guiParams[r][t];typeof a.value!="undefined"&&e.setGuiTargetValue(r,t,a.value,a.paramMap)})})},s.guiParamTween=function(e,r,t){var a=t.duration,u=a===void 0?0:a,i=this,d=this.guiParams[e][r],w=d.to,b=d.paramMap,_=b===void 0?"":b;return new(Q()).Tween(this.guiParams[e][r]).to({value:w},u).onUpdate(function(y){i.setGuiTargetValue(e,r,y.value,_)})},o}(),p={None:h.NoToneMapping,Linear:h.LinearToneMapping,Reinhard:h.ReinhardToneMapping,Cineon:h.CineonToneMapping,ACESFilmic:h.ACESFilmicToneMapping},P={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:h.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1},S=function(){"use strict";function o(n){R(this,o),this.options=n;var e=n.width,r=n.height,t=n.rendererParams,a=t.alpha,u=t.devicePixelRatio,i=t.antialias,d=t.powerPreference,w=t.toneMapping,b=t.toneMappingExposure,_=t.outputEncoding,y=t.logarithmicDepthBuffer,M=t.preserveDrawingBuffer,A=new h.WebGLRenderer({alpha:a,antialias:i,powerPreference:d,logarithmicDepthBuffer:y,preserveDrawingBuffer:M});A.setSize(e,r),A.setPixelRatio(u),A.autoClear=!1,A.toneMapping=p[w],A.toneMappingExposure=b,A.outputEncoding=_,this.renderer=A}var s=o.prototype;return s.setSize=function(e,r){this.renderer.setSize(e,r)},s.render=function(){var e=this.options,r=e.scene,t=e.camera;this.renderer.render(r,t)},s.setGui=function(e){var r=this,t=new c;t.guiParams={renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:p,target:function(){return r.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return r.renderer}}}},t.showGuiParams(e)},s.dispose=function(){var e,r,t;(e=this.renderer)===null||e===void 0||e.clear(),(r=this.renderer)===null||r===void 0||r.dispose(),(t=this.renderer)===null||t===void 0||t.renderLists.dispose(),this.renderer=void 0},o}(),L={fov:45,near:1,far:1e3},j=function(){"use strict";function o(n){R(this,o),this.oldCameraPosition=new h.Vector3,this.oldCameraRotation=new h.Euler,this.customCamera=!1,this.options=n;var e=n.width,r=n.height,t=n.cameraParams;if(t instanceof h.Camera)this.camera=t,this.customCamera=!0;else{var a=t.fov,u=t.far,i=t.near,d=new h.PerspectiveCamera(a,e/r,i,u);d.position.set(0,0,400),d.lookAt(0,0,0),this.camera=d}}var s=o.prototype;return s.checkCameraChange=function(){var e=this.camera,r=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!r},s.setSize=function(e,r){this.camera instanceof h.PerspectiveCamera&&(this.camera.aspect=e/r),this.camera.updateProjectionMatrix()},s.dispose=function(){this.camera=void 0},s.setGui=function(e){var r=this,t=new c;t.guiParams={camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return r.camera},onChange:function(a){r.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return r.camera},onChange:function(a){r.camera.updateProjectionMatrix()}}}},this.camera instanceof h.PerspectiveCamera&&(t.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return r.camera},onChange:function(a){r.camera.updateProjectionMatrix()}}),t.showGuiParams(e)},o}(),F=K(519),oe={background:null},he=function(){"use strict";function o(n){R(this,o),this.options=n;var e=n.camera,r=n.sceneParams,t=r.background,a=new h.Scene;t&&(a.background=t),a.add(e),this.scene=a}var s=o.prototype;return s.addAxesHelper=function(){var e,r=new h.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(r)},s.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(r){(0,F.disposeMesh)(r)}),this.scene=void 0},o}(),ve=require("three/examples/jsm/controls/OrbitControls"),me={},ge=function(){"use strict";function o(n){R(this,o),this.options=n;var e=n.camera,r=n.controlParams,t=n.mapControl,a=r.domElement,u=t?new ve.MapControls(e,a):new ve.OrbitControls(e,a);u.minPolarAngle=Math.PI*.15,u.maxPolarAngle=Math.PI*.85,u.enableDamping=!0,u.dampingFactor=.063,u.autoRotate=!1,u.autoRotateSpeed=-60,u.enableZoom=!0,u.zoomSpeed=.2,this.control=u}var s=o.prototype;return s.limitPan=function(e){var r=e.maxX,t=r===void 0?1/0:r,a=e.minX,u=a===void 0?-1/0:a,i=e.maxZ,d=i===void 0?1/0:i,w=e.minZ,b=w===void 0?-1/0:w,_=e.maxY,y=_===void 0?1/0:_,M=e.minY,A=M===void 0?-1/0:M,H=this.limitPanV||new h.Vector3,V=this.control,ie=this.options.camera,re=new h.Vector3(u,A,b),N=new h.Vector3(t,y,d);this.limitPanV=H,H.copy(V.target),V.target.clamp(re,N),H.sub(V.target),ie.position.sub(H)},s.update=function(){var e;(e=this.control)===null||e===void 0||e.update()},s.dispose=function(){var e;(e=this.control)===null||e===void 0||e.dispose(),this.control=void 0},o}(),v=require("three/examples/jsm/renderers/CSS3DRenderer"),l=new h.Vector3,g=new h.Matrix4,O=new h.Matrix4,C=new h.Vector3,Z=new h.Vector3,te=function o(){"use strict";var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};R(this,o);var n=function(M,A){return C.setFromMatrixPosition(M.matrixWorld),Z.setFromMatrixPosition(A.matrixWorld),C.distanceToSquared(Z)},e=function(M){var A=[];return M.traverse(function(H){H.isCSS2DObject&&A.push(H)}),A},r=function(M){for(var A=e(M).sort(function(N,fe){if(N.renderOrder!==fe.renderOrder)return fe.renderOrder-N.renderOrder;var ce=w.objects.get(N).distanceToCameraSquared,de=w.objects.get(fe).distanceToCameraSquared;return ce-de}),H=A.length,V=0,ie=A.length;V<ie;V++){var re=A[V].userData.zIndexFix||0;A[V].element.style.zIndex=H-V+re}},t=this,a,u,i,d,w={objects:new WeakMap},b=s.element!==void 0?s.element:document.createElement("div");b.style.overflow="hidden",this.domElement=b,this.getSize=function(){return{width:a,height:u}},this.render=function(y,M){y.autoUpdate===!0&&y.updateMatrixWorld(),M.parent===null&&M.updateMatrixWorld(),g.copy(M.matrixWorldInverse),O.multiplyMatrices(M.projectionMatrix,g),_(y,y,M),r(y)},this.setSize=function(y,M){a=y,u=M,i=a/2,d=u/2,b.style.width="".concat(y,"px"),b.style.height="".concat(M,"px")};function _(y,M,A){if(y.isCSS2DObject){l.setFromMatrixPosition(y.matrixWorld),l.applyMatrix4(O);var H=y.visible===!0&&l.z>=-1&&l.z<=1&&y.layers.test(A.layers)===!0;if(y.element.style.display=H===!0?"":"none",H===!0){y.onBeforeRender(t,M,A);var V=y.element;V.style.transform="translate(-50%,-50%) translate(".concat(l.x*i+i,"px,").concat(-l.y*d+d,"px)"),V.parentNode!==b&&b.appendChild(V),y.onAfterRender(t,M,A)}var ie={distanceToCameraSquared:n(A,y)};w.objects.set(y,ie)}for(var re=0,N=y.children.length;re<N;re++)_(y.children[re],M,A)}},J={zIndex:"auto"},ne=function(){"use strict";function o(n){R(this,o),this.container=n}var s=o.prototype;return s.addRenderer=function(e,r){var t=this.container,a=t.offsetWidth,u=t.offsetHeight,i=e==="css2d"?new te:new v.CSS3DRenderer;i.domElement.style.position="absolute",i.domElement.style.top="0",i.domElement.style.pointerEvents="none",i.domElement.style.zIndex=r.zIndex,i.setSize(a,u),t.appendChild(i.domElement),e==="css2d"?this.css2Drenderer=i:e==="css3d"&&(this.css3Drenderer=i)},s.setSize=function(e,r){var t,a;(t=this.css2Drenderer)===null||t===void 0||t.setSize(e,r),(a=this.css3Drenderer)===null||a===void 0||a.setSize(e,r)},s.render=function(e,r){var t,a;(t=this.css2Drenderer)===null||t===void 0||t.render(e,r),(a=this.css3Drenderer)===null||a===void 0||a.render(e,r)},s.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},o}(),ee=require("three/examples/jsm/postprocessing/EffectComposer"),pe=require("three/examples/jsm/postprocessing/RenderPass"),le=require("three/examples/jsm/postprocessing/ShaderPass"),ue=require("three/examples/jsm/shaders/CopyShader"),ke=require("three/examples/jsm/shaders/GammaCorrectionShader"),Ve=require("three/examples/jsm/postprocessing/SMAAPass"),Ie=require("three/examples/jsm/postprocessing/SSAARenderPass"),Ne=require("three/examples/jsm/shaders/FXAAShader"),We=function(){try{var o=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&o.getContext("webgl2"))}catch(s){return!1}},yt=0,He=1,be=!1,Re=We()!==!1,Ze=`varying vec2 vUv;
|
|
1
|
+
(function(){var Be={187:function(R){"use strict";var T=typeof Reflect=="object"?Reflect:null,x=T&&typeof T.apply=="function"?T.apply:function(c,p,b){return Function.prototype.apply.call(c,p,b)},G;T&&typeof T.ownKeys=="function"?G=T.ownKeys:Object.getOwnPropertySymbols?G=function(c){return Object.getOwnPropertyNames(c).concat(Object.getOwnPropertySymbols(c))}:G=function(c){return Object.getOwnPropertyNames(c)};function z(f){console&&console.warn&&console.warn(f)}var E=Number.isNaN||function(c){return c!==c};function m(){m.init.call(this)}R.exports=m,R.exports.once=$,m.EventEmitter=m,m.prototype._events=void 0,m.prototype._eventsCount=0,m.prototype._maxListeners=void 0;var B=10;function q(f){if(typeof f!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof f)}Object.defineProperty(m,"defaultMaxListeners",{enumerable:!0,get:function(){return B},set:function(f){if(typeof f!="number"||f<0||E(f))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+f+".");B=f}}),m.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},m.prototype.setMaxListeners=function(c){if(typeof c!="number"||c<0||E(c))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+c+".");return this._maxListeners=c,this};function W(f){return f._maxListeners===void 0?m.defaultMaxListeners:f._maxListeners}m.prototype.getMaxListeners=function(){return W(this)},m.prototype.emit=function(c){for(var p=[],b=1;b<arguments.length;b++)p.push(arguments[b]);var S=c==="error",A=this._events;if(A!==void 0)S=S&&A.error===void 0;else if(!S)return!1;if(S){var j;if(p.length>0&&(j=p[0]),j instanceof Error)throw j;var F=new Error("Unhandled error."+(j?" ("+j.message+")":""));throw F.context=j,F}var oe=A[c];if(oe===void 0)return!1;if(typeof oe=="function")x(oe,this,p);else for(var de=oe.length,he=se(oe,de),b=0;b<de;++b)x(he[b],this,p);return!0};function U(f,c,p,b){var S,A,j;if(q(p),A=f._events,A===void 0?(A=f._events=Object.create(null),f._eventsCount=0):(A.newListener!==void 0&&(f.emit("newListener",c,p.listener?p.listener:p),A=f._events),j=A[c]),j===void 0)j=A[c]=p,++f._eventsCount;else if(typeof j=="function"?j=A[c]=b?[p,j]:[j,p]:b?j.unshift(p):j.push(p),S=W(f),S>0&&j.length>S&&!j.warned){j.warned=!0;var F=new Error("Possible EventEmitter memory leak detected. "+j.length+" "+String(c)+" listeners added. Use emitter.setMaxListeners() to increase limit");F.name="MaxListenersExceededWarning",F.emitter=f,F.type=c,F.count=j.length,z(F)}return f}m.prototype.addListener=function(c,p){return U(this,c,p,!1)},m.prototype.on=m.prototype.addListener,m.prototype.prependListener=function(c,p){return U(this,c,p,!0)};function X(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Q(f,c,p){var b={fired:!1,wrapFn:void 0,target:f,type:c,listener:p},S=X.bind(b);return S.listener=p,b.wrapFn=S,S}m.prototype.once=function(c,p){return q(p),this.on(c,Q(this,c,p)),this},m.prototype.prependOnceListener=function(c,p){return q(p),this.prependListener(c,Q(this,c,p)),this},m.prototype.removeListener=function(c,p){var b,S,A,j,F;if(q(p),S=this._events,S===void 0)return this;if(b=S[c],b===void 0)return this;if(b===p||b.listener===p)--this._eventsCount===0?this._events=Object.create(null):(delete S[c],S.removeListener&&this.emit("removeListener",c,b.listener||p));else if(typeof b!="function"){for(A=-1,j=b.length-1;j>=0;j--)if(b[j]===p||b[j].listener===p){F=b[j].listener,A=j;break}if(A<0)return this;A===0?b.shift():ie(b,A),b.length===1&&(S[c]=b[0]),S.removeListener!==void 0&&this.emit("removeListener",c,F||p)}return this},m.prototype.off=m.prototype.removeListener,m.prototype.removeAllListeners=function(c){var p,b,S;if(b=this._events,b===void 0)return this;if(b.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):b[c]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete b[c]),this;if(arguments.length===0){var A=Object.keys(b),j;for(S=0;S<A.length;++S)j=A[S],j!=="removeListener"&&this.removeAllListeners(j);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(p=b[c],typeof p=="function")this.removeListener(c,p);else if(p!==void 0)for(S=p.length-1;S>=0;S--)this.removeListener(c,p[S]);return this};function Y(f,c,p){var b=f._events;if(b===void 0)return[];var S=b[c];return S===void 0?[]:typeof S=="function"?p?[S.listener||S]:[S]:p?V(S):se(S,S.length)}m.prototype.listeners=function(c){return Y(this,c,!0)},m.prototype.rawListeners=function(c){return Y(this,c,!1)},m.listenerCount=function(f,c){return typeof f.listenerCount=="function"?f.listenerCount(c):d.call(f,c)},m.prototype.listenerCount=d;function d(f){var c=this._events;if(c!==void 0){var p=c[f];if(typeof p=="function")return 1;if(p!==void 0)return p.length}return 0}m.prototype.eventNames=function(){return this._eventsCount>0?G(this._events):[]};function se(f,c){for(var p=new Array(c),b=0;b<c;++b)p[b]=f[b];return p}function ie(f,c){for(;c+1<f.length;c++)f[c]=f[c+1];f.pop()}function V(f){for(var c=new Array(f.length),p=0;p<c.length;++p)c[p]=f[p].listener||f[p];return c}function $(f,c){return new Promise(function(p,b){function S(j){f.removeListener(c,A),b(j)}function A(){typeof f.removeListener=="function"&&f.removeListener("error",S),p([].slice.call(arguments))}N(f,c,A,{once:!0}),c!=="error"&&D(f,S,{once:!0})})}function D(f,c,p){typeof f.on=="function"&&N(f,"error",c,p)}function N(f,c,p,b){if(typeof f.on=="function")b.once?f.once(c,p):f.on(c,p);else if(typeof f.addEventListener=="function")f.addEventListener(c,function S(A){b.once&&f.removeEventListener(c,S),p(A)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof f)}},666:function(R){var T=function(x){"use strict";var G=Object.prototype,z=G.hasOwnProperty,E,m=typeof Symbol=="function"?Symbol:{},B=m.iterator||"@@iterator",q=m.asyncIterator||"@@asyncIterator",W=m.toStringTag||"@@toStringTag";function U(v,l,g){return Object.defineProperty(v,l,{value:g,enumerable:!0,configurable:!0,writable:!0}),v[l]}try{U({},"")}catch(v){U=function(l,g,O){return l[g]=O}}function X(v,l,g,O){var C=l&&l.prototype instanceof $?l:$,H=Object.create(C.prototype),te=new he(O||[]);return H._invoke=j(v,g,te),H}x.wrap=X;function Q(v,l,g){try{return{type:"normal",arg:v.call(l,g)}}catch(O){return{type:"throw",arg:O}}}var Y="suspendedStart",d="suspendedYield",se="executing",ie="completed",V={};function $(){}function D(){}function N(){}var f={};U(f,B,function(){return this});var c=Object.getPrototypeOf,p=c&&c(c(me([])));p&&p!==G&&z.call(p,B)&&(f=p);var b=N.prototype=$.prototype=Object.create(f);D.prototype=N,U(b,"constructor",N),U(N,"constructor",D),D.displayName=U(N,W,"GeneratorFunction");function S(v){["next","throw","return"].forEach(function(l){U(v,l,function(g){return this._invoke(l,g)})})}x.isGeneratorFunction=function(v){var l=typeof v=="function"&&v.constructor;return l?l===D||(l.displayName||l.name)==="GeneratorFunction":!1},x.mark=function(v){return Object.setPrototypeOf?Object.setPrototypeOf(v,N):(v.__proto__=N,U(v,W,"GeneratorFunction")),v.prototype=Object.create(b),v},x.awrap=function(v){return{__await:v}};function A(v,l){function g(H,te,J,re){var ee=Q(v[H],v,te);if(ee.type==="throw")re(ee.arg);else{var ve=ee.arg,le=ve.value;return le&&typeof le=="object"&&z.call(le,"__await")?l.resolve(le.__await).then(function(ue){g("next",ue,J,re)},function(ue){g("throw",ue,J,re)}):l.resolve(le).then(function(ue){ve.value=ue,J(ve)},function(ue){return g("throw",ue,J,re)})}}var O;function C(H,te){function J(){return new l(function(re,ee){g(H,te,re,ee)})}return O=O?O.then(J,J):J()}this._invoke=C}S(A.prototype),U(A.prototype,q,function(){return this}),x.AsyncIterator=A,x.async=function(v,l,g,O,C){C===void 0&&(C=Promise);var H=new A(X(v,l,g,O),C);return x.isGeneratorFunction(l)?H:H.next().then(function(te){return te.done?te.value:H.next()})};function j(v,l,g){var O=Y;return function(H,te){if(O===se)throw new Error("Generator is already running");if(O===ie){if(H==="throw")throw te;return ge()}for(g.method=H,g.arg=te;;){var J=g.delegate;if(J){var re=F(J,g);if(re){if(re===V)continue;return re}}if(g.method==="next")g.sent=g._sent=g.arg;else if(g.method==="throw"){if(O===Y)throw O=ie,g.arg;g.dispatchException(g.arg)}else g.method==="return"&&g.abrupt("return",g.arg);O=se;var ee=Q(v,l,g);if(ee.type==="normal"){if(O=g.done?ie:d,ee.arg===V)continue;return{value:ee.arg,done:g.done}}else ee.type==="throw"&&(O=ie,g.method="throw",g.arg=ee.arg)}}}function F(v,l){var g=v.iterator[l.method];if(g===E){if(l.delegate=null,l.method==="throw"){if(v.iterator.return&&(l.method="return",l.arg=E,F(v,l),l.method==="throw"))return V;l.method="throw",l.arg=new TypeError("The iterator does not provide a 'throw' method")}return V}var O=Q(g,v.iterator,l.arg);if(O.type==="throw")return l.method="throw",l.arg=O.arg,l.delegate=null,V;var C=O.arg;if(!C)return l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,V;if(C.done)l[v.resultName]=C.value,l.next=v.nextLoc,l.method!=="return"&&(l.method="next",l.arg=E);else return C;return l.delegate=null,V}S(b),U(b,W,"Generator"),U(b,B,function(){return this}),U(b,"toString",function(){return"[object Generator]"});function oe(v){var l={tryLoc:v[0]};1 in v&&(l.catchLoc=v[1]),2 in v&&(l.finallyLoc=v[2],l.afterLoc=v[3]),this.tryEntries.push(l)}function de(v){var l=v.completion||{};l.type="normal",delete l.arg,v.completion=l}function he(v){this.tryEntries=[{tryLoc:"root"}],v.forEach(oe,this),this.reset(!0)}x.keys=function(v){var l=[];for(var g in v)l.push(g);return l.reverse(),function O(){for(;l.length;){var C=l.pop();if(C in v)return O.value=C,O.done=!1,O}return O.done=!0,O}};function me(v){if(v){var l=v[B];if(l)return l.call(v);if(typeof v.next=="function")return v;if(!isNaN(v.length)){var g=-1,O=function C(){for(;++g<v.length;)if(z.call(v,g))return C.value=v[g],C.done=!1,C;return C.value=E,C.done=!0,C};return O.next=O}}return{next:ge}}x.values=me;function ge(){return{value:E,done:!0}}return he.prototype={constructor:he,reset:function(v){if(this.prev=0,this.next=0,this.sent=this._sent=E,this.done=!1,this.delegate=null,this.method="next",this.arg=E,this.tryEntries.forEach(de),!v)for(var l in this)l.charAt(0)==="t"&&z.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=E)},stop:function(){this.done=!0;var v=this.tryEntries[0],l=v.completion;if(l.type==="throw")throw l.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var l=this;function g(re,ee){return H.type="throw",H.arg=v,l.next=re,ee&&(l.method="next",l.arg=E),!!ee}for(var O=this.tryEntries.length-1;O>=0;--O){var C=this.tryEntries[O],H=C.completion;if(C.tryLoc==="root")return g("end");if(C.tryLoc<=this.prev){var te=z.call(C,"catchLoc"),J=z.call(C,"finallyLoc");if(te&&J){if(this.prev<C.catchLoc)return g(C.catchLoc,!0);if(this.prev<C.finallyLoc)return g(C.finallyLoc)}else if(te){if(this.prev<C.catchLoc)return g(C.catchLoc,!0)}else if(J){if(this.prev<C.finallyLoc)return g(C.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(v,l){for(var g=this.tryEntries.length-1;g>=0;--g){var O=this.tryEntries[g];if(O.tryLoc<=this.prev&&z.call(O,"finallyLoc")&&this.prev<O.finallyLoc){var C=O;break}}C&&(v==="break"||v==="continue")&&C.tryLoc<=l&&l<=C.finallyLoc&&(C=null);var H=C?C.completion:{};return H.type=v,H.arg=l,C?(this.method="next",this.next=C.finallyLoc,V):this.complete(H)},complete:function(v,l){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&l&&(this.next=l),V},finish:function(v){for(var l=this.tryEntries.length-1;l>=0;--l){var g=this.tryEntries[l];if(g.finallyLoc===v)return this.complete(g.completion,g.afterLoc),de(g),V}},catch:function(v){for(var l=this.tryEntries.length-1;l>=0;--l){var g=this.tryEntries[l];if(g.tryLoc===v){var O=g.completion;if(O.type==="throw"){var C=O.arg;de(g)}return C}}throw new Error("illegal catch attempt")},delegateYield:function(v,l,g){return this.delegate={iterator:me(v),resultName:l,nextLoc:g},this.method==="next"&&(this.arg=E),V}},x}(R.exports);try{regeneratorRuntime=T}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=T:Function("r","regeneratorRuntime = r")(T)}},695:function(R,T,x){"use strict";x.d(T,{Z:function(){return G}});function G(z){if(z.geometry&&z.geometry.dispose(),z.material){var E=Array.isArray(z.material)?z.material:[z.material];E.forEach(function(m){var B,q,W,U,X,Q,Y,d,se,ie,V,$,D;(B=m.map)===null||B===void 0||B.dispose(),(q=m.lightMap)===null||q===void 0||q.dispose(),(W=m.bumpMap)===null||W===void 0||W.dispose(),(U=m.normalMap)===null||U===void 0||U.dispose(),(X=m.specularMap)===null||X===void 0||X.dispose(),(Q=m.envMap)===null||Q===void 0||Q.dispose(),(Y=m.alphaMap)===null||Y===void 0||Y.dispose(),(d=m.aoMap)===null||d===void 0||d.dispose(),(se=m.displacementMap)===null||se===void 0||se.dispose(),(ie=m.emissiveMap)===null||ie===void 0||ie.dispose(),(V=m.gradientMap)===null||V===void 0||V.dispose(),($=m.metalnessMap)===null||$===void 0||$.dispose(),(D=m.roughnessMap)===null||D===void 0||D.dispose(),m.dispose()})}}},519:function(R,T,x){"use strict";x.d(T,{disposeMesh:function(){return m.Z},isPlainObject:function(){return W.Z}});var G=x(666),z=x.n(G),E=null,m=x(695),B=x(644);function q(V){if(V.material){var $=Array.isArray(V.material)?V.material:[V.material];$.forEach(function(D){var N,f;(N=D.color)===null||N===void 0||N.convertSRGBToLinear(),(f=D.emissive)===null||f===void 0||f.convertSRGBToLinear(),D.map&&(D.map.encoding=THREE.sRGBEncoding),D.emissiveMap&&(D.emissiveMap.encoding=THREE.sRGBEncoding)})}}var W=x(738),U=x(568),X=x(924),Q=require("idb-keyval"),Y=x(484),d=null,se=null,ie=function(){var V=(0,U.Z)(z().mark(function $(D,N){var f,c,p,b,S,A;return z().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return f=N.version,F.next=4,(0,Q.get)(D);case 4:if(p=F.sent,!(p&&p[f])){F.next=9;break}c=p[f],F.next=15;break;case 9:return F.next=11,(0,Y.Z)(fetch(D).then(function(oe){if(oe.ok)return oe.blob();throw new Error}));case 11:b=F.sent,S=b.res,A=b.err,A||(c=S,(0,Q.set)(D,(0,X.Z)({},f,S)));case 15:return F.abrupt("return",c?{url:URL.createObjectURL(c)}:{url:D});case 16:case"end":return F.stop()}},$)}));return function(D,N){return V.apply(this,arguments)}}()},738:function(R,T,x){"use strict";x.d(T,{Z:function(){return z}});function G(E){return Object.prototype.toString.call(E)==="[object Object]"}function z(E){if(G(E)===!1)return!1;var m=E.constructor;if(m===void 0)return!0;var B=m.prototype;return!(G(B)===!1||B.hasOwnProperty("isPrototypeOf")===!1)}},484:function(R,T,x){"use strict";x.d(T,{Z:function(){return z}});var G=x(42);function z(E){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return E.then(function(B){return(0,G.Z)({err:null,res:B},m)}).catch(function(B){return(0,G.Z)({err:B,res:void 0},m)})}},644:function(R){"use strict";R.exports=require("three")},568:function(R,T,x){"use strict";x.d(T,{Z:function(){return z}});function G(E,m,B,q,W,U,X){try{var Q=E[U](X),Y=Q.value}catch(d){B(d);return}Q.done?m(Y):Promise.resolve(Y).then(q,W)}function z(E){return function(){var m=this,B=arguments;return new Promise(function(q,W){var U=E.apply(m,B);function X(Y){G(U,q,W,X,Q,"next",Y)}function Q(Y){G(U,q,W,X,Q,"throw",Y)}X(void 0)})}}},924:function(R,T,x){"use strict";x.d(T,{Z:function(){return G}});function G(z,E,m){return E in z?Object.defineProperty(z,E,{value:m,enumerable:!0,configurable:!0,writable:!0}):z[E]=m,z}},42:function(R,T,x){"use strict";x.d(T,{Z:function(){return z}});var G=x(924);function z(E){for(var m=1;m<arguments.length;m++){var B=arguments[m]!=null?arguments[m]:{},q=Object.keys(B);typeof Object.getOwnPropertySymbols=="function"&&(q=q.concat(Object.getOwnPropertySymbols(B).filter(function(W){return Object.getOwnPropertyDescriptor(B,W).enumerable}))),q.forEach(function(W){(0,G.Z)(E,W,B[W])})}return E}}},Oe={};function K(R){var T=Oe[R];if(T!==void 0)return T.exports;var x=Oe[R]={exports:{}};return Be[R](x,x.exports,K),x.exports}(function(){K.n=function(R){var T=R&&R.__esModule?function(){return R.default}:function(){return R};return K.d(T,{a:T}),T}})(),function(){K.d=function(R,T){for(var x in T)K.o(T,x)&&!K.o(R,x)&&Object.defineProperty(R,x,{enumerable:!0,get:T[x]})}}(),function(){K.o=function(R,T){return Object.prototype.hasOwnProperty.call(R,T)}}(),function(){K.r=function(R){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(R,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(R,"__esModule",{value:!0})}}();var Pe={};(function(){"use strict";K.r(Pe),K.d(Pe,{BaseObject:function(){return gt},GUIObject:function(){return c},Pencil:function(){return Ce},default:function(){return Ce}});function R(s,i){if(!(s instanceof i))throw new TypeError("Cannot call a class as a function")}function T(s,i){for(var n=0;n<i.length;n++){var e=i[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(s,e.key,e)}}function x(s,i,n){return i&&T(s.prototype,i),n&&T(s,n),s}var G=K(42);function z(s,i){var n=Object.keys(s);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(s);i&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(s,t).enumerable})),n.push.apply(n,e)}return n}function E(s,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(i)):z(Object(i)).forEach(function(n){Object.defineProperty(s,n,Object.getOwnPropertyDescriptor(i,n))}),s}function m(s,i){(i==null||i>s.length)&&(i=s.length);for(var n=0,e=new Array(i);n<i;n++)e[n]=s[n];return e}function B(s){if(Array.isArray(s))return m(s)}function q(s){if(typeof Symbol!="undefined"&&s[Symbol.iterator]!=null||s["@@iterator"]!=null)return Array.from(s)}function W(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function U(s,i){if(!!s){if(typeof s=="string")return m(s,i);var n=Object.prototype.toString.call(s).slice(8,-1);if(n==="Object"&&s.constructor&&(n=s.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m(s,i)}}function X(s){return B(s)||q(s)||U(s)||W()}var Q=require("@tweenjs/tween.js"),Y=K.n(Q),d=K(644),se=K(187),ie=require("deepmerge"),V=K.n(ie),$=require("three/examples/jsm/libs/stats.module"),D=K.n($),N=require("lil-gui"),f=K.n(N),c=function(){"use strict";function s(n){R(this,s),this.guiParams={},n&&(this.guiParams=n)}var i=s.prototype;return i.showGui=function(e){var t=this;!e||Object.keys(this.guiParams).forEach(function(r){var o=e.addFolder(r),u=t.guiParams[r];Object.keys(u).forEach(function(a){var h=u[a],w=h.min,P=h.max,y=h.step,_=h.name,M=h.paramMap,L=h.items,Z=h.value,I=h.target,ae=a.toLowerCase().indexOf("color")>-1,k,ne=typeof Z=="undefined"&&I,ce=ne?I():u[a],fe=ne?a:"value";L?k=o.add(ce,fe,L):ae?k=o.addColor(ce,fe):k=o.add(ce,fe),k=k.name(_||a),typeof w!="undefined"&&(k=k.min(w)),typeof P!="undefined"&&(k=k.max(P)),typeof y!="undefined"&&(k=k.step(y)),k=k.onChange(function(){t.setTargetValue(r,a,ce[fe],M)}),ne&&k.listen()})})},i.setTargetValue=function(e,t,r,o){var u=this.guiParams[e][t],a=u.onChange,h=u.target,w=u.value,P=t.toLowerCase().indexOf("color")>-1,y=typeof w=="undefined"&&h;if(h&&!y){var _=h();Array.isArray(_)||(_=[_]),_.forEach(function(M){if(!!M)if(P)try{M[o||t].set(r)}catch(L){t!=="color"&&!o&&console.warn("".concat(t," is not a color,set paramMap"))}else M[o||t]=r})}a&&a(r)},i.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(t){Object.keys(e.guiParams[t]).forEach(function(r){var o=e.guiParams[t][r];typeof o.value!="undefined"&&e.setTargetValue(t,r,o.value,o.paramMap)})})},s}(),p={None:d.NoToneMapping,Linear:d.LinearToneMapping,Reinhard:d.ReinhardToneMapping,Cineon:d.CineonToneMapping,ACESFilmic:d.ACESFilmicToneMapping},b={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:d.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1},S=function(){"use strict";function s(n){R(this,s),this.options=n;var e=n.width,t=n.height,r=n.rendererParams,o=r.alpha,u=r.devicePixelRatio,a=r.antialias,h=r.powerPreference,w=r.toneMapping,P=r.toneMappingExposure,y=r.outputEncoding,_=r.logarithmicDepthBuffer,M=r.preserveDrawingBuffer,L=new d.WebGLRenderer({alpha:o,antialias:a,powerPreference:h,logarithmicDepthBuffer:_,preserveDrawingBuffer:M});L.setSize(e,t),L.setPixelRatio(u),L.autoClear=!1,L.toneMapping=p[w],L.toneMappingExposure=P,L.outputEncoding=y,this.renderer=L}var i=s.prototype;return i.setSize=function(e,t){this.renderer.setSize(e,t)},i.render=function(){var e=this.options,t=e.scene,r=e.camera;this.renderer.render(t,r)},i.setGui=function(e){var t=this,r=new c({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:p,target:function(){return t.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return t.renderer}}}});r.showGui(e)},i.dispose=function(){var e,t,r;(e=this.renderer)===null||e===void 0||e.clear(),(t=this.renderer)===null||t===void 0||t.dispose(),(r=this.renderer)===null||r===void 0||r.renderLists.dispose()},s}(),A={fov:45,near:1,far:1e3},j=function(){"use strict";function s(n){R(this,s),this.oldCameraPosition=new d.Vector3,this.oldCameraRotation=new d.Euler,this.customCamera=!1,this.options=n;var e=n.width,t=n.height,r=n.cameraParams;if(r instanceof d.Camera)this.camera=r,this.customCamera=!0;else{var o=r.fov,u=r.far,a=r.near,h=new d.PerspectiveCamera(o,e/t,a,u);h.position.set(0,0,400),h.lookAt(0,0,0),this.camera=h}}var i=s.prototype;return i.checkCameraChange=function(){var e=this.camera,t=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!t},i.setSize=function(e,t){this.camera instanceof d.PerspectiveCamera&&(this.camera.aspect=e/t),this.camera.updateProjectionMatrix()},i.setGui=function(e){var t=this,r=new c({camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}}}});this.camera instanceof d.PerspectiveCamera&&(r.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}}),r.showGui(e)},s}(),F=K(519),oe={background:null},de=function(){"use strict";function s(n){R(this,s),this.options=n;var e=n.camera,t=n.sceneParams,r=t.background,o=new d.Scene;r&&(o.background=r),o.add(e),this.scene=o}var i=s.prototype;return i.addAxesHelper=function(){var e,t=new d.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(t)},i.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(t){(0,F.disposeMesh)(t)})},s}(),he=require("three/examples/jsm/controls/OrbitControls"),me={},ge=function(){"use strict";function s(n){R(this,s),this.options=n;var e=n.camera,t=n.controlParams,r=n.mapControl,o=t.domElement,u=r?new he.MapControls(e,o):new he.OrbitControls(e,o);u.minPolarAngle=Math.PI*.15,u.maxPolarAngle=Math.PI*.85,u.enableDamping=!0,u.dampingFactor=.063,u.autoRotate=!1,u.autoRotateSpeed=-60,u.enableZoom=!0,u.zoomSpeed=.2,this.control=u}var i=s.prototype;return i.limitPan=function(e){var t=e.maxX,r=t===void 0?1/0:t,o=e.minX,u=o===void 0?-1/0:o,a=e.maxZ,h=a===void 0?1/0:a,w=e.minZ,P=w===void 0?-1/0:w,y=e.maxY,_=y===void 0?1/0:y,M=e.minY,L=M===void 0?-1/0:M,Z=this.limitPanV||new d.Vector3,I=this.control,ae=this.options.camera,k=new d.Vector3(u,L,P),ne=new d.Vector3(r,_,h);this.limitPanV=Z,Z.copy(I.target),I.target.clamp(k,ne),Z.sub(I.target),ae.position.sub(Z)},i.update=function(){this.control.update()},i.dispose=function(){this.control.dispose()},s}(),v=require("three/examples/jsm/renderers/CSS3DRenderer"),l=new d.Vector3,g=new d.Matrix4,O=new d.Matrix4,C=new d.Vector3,H=new d.Vector3,te=function s(){"use strict";var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};R(this,s);var n=function(M,L){return C.setFromMatrixPosition(M.matrixWorld),H.setFromMatrixPosition(L.matrixWorld),C.distanceToSquared(H)},e=function(M){var L=[];return M.traverse(function(Z){Z.isCSS2DObject&&L.push(Z)}),L},t=function(M){for(var L=e(M).sort(function(ne,ce){if(ne.renderOrder!==ce.renderOrder)return ce.renderOrder-ne.renderOrder;var fe=w.objects.get(ne).distanceToCameraSquared,ye=w.objects.get(ce).distanceToCameraSquared;return fe-ye}),Z=L.length,I=0,ae=L.length;I<ae;I++){var k=L[I].userData.zIndexFix||0;L[I].element.style.zIndex=Z-I+k}},r=this,o,u,a,h,w={objects:new WeakMap},P=i.element!==void 0?i.element:document.createElement("div");P.style.overflow="hidden",this.domElement=P,this.getSize=function(){return{width:o,height:u}},this.render=function(_,M){_.autoUpdate===!0&&_.updateMatrixWorld(),M.parent===null&&M.updateMatrixWorld(),g.copy(M.matrixWorldInverse),O.multiplyMatrices(M.projectionMatrix,g),y(_,_,M),t(_)},this.setSize=function(_,M){o=_,u=M,a=o/2,h=u/2,P.style.width="".concat(_,"px"),P.style.height="".concat(M,"px")};function y(_,M,L){if(_.isCSS2DObject){l.setFromMatrixPosition(_.matrixWorld),l.applyMatrix4(O);var Z=_.visible===!0&&l.z>=-1&&l.z<=1&&_.layers.test(L.layers)===!0;if(_.element.style.display=Z===!0?"":"none",Z===!0){_.onBeforeRender(r,M,L);var I=_.element;I.style.transform="translate(-50%,-50%) translate(".concat(l.x*a+a,"px,").concat(-l.y*h+h,"px)"),I.parentNode!==P&&P.appendChild(I),_.onAfterRender(r,M,L)}var ae={distanceToCameraSquared:n(L,_)};w.objects.set(_,ae)}for(var k=0,ne=_.children.length;k<ne;k++)y(_.children[k],M,L)}},J={zIndex:"auto"},re=function(){"use strict";function s(n){R(this,s),this.container=n}var i=s.prototype;return i.addRenderer=function(e,t){var r=this.container,o=r.offsetWidth,u=r.offsetHeight,a=e==="css2d"?new te:new v.CSS3DRenderer;a.domElement.style.position="absolute",a.domElement.style.top="0",a.domElement.style.pointerEvents="none",a.domElement.style.zIndex=t.zIndex,a.setSize(o,u),r.appendChild(a.domElement),e==="css2d"?this.css2Drenderer=a:e==="css3d"&&(this.css3Drenderer=a)},i.setSize=function(e,t){var r,o;(r=this.css2Drenderer)===null||r===void 0||r.setSize(e,t),(o=this.css3Drenderer)===null||o===void 0||o.setSize(e,t)},i.render=function(e,t){var r,o;(r=this.css2Drenderer)===null||r===void 0||r.render(e,t),(o=this.css3Drenderer)===null||o===void 0||o.render(e,t)},i.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},s}(),ee=require("three/examples/jsm/postprocessing/EffectComposer"),ve=require("three/examples/jsm/postprocessing/RenderPass"),le=require("three/examples/jsm/postprocessing/ShaderPass"),ue=require("three/examples/jsm/shaders/CopyShader"),Fe=require("three/examples/jsm/shaders/GammaCorrectionShader"),Ue=require("three/examples/jsm/postprocessing/SMAAPass"),ke=require("three/examples/jsm/postprocessing/SSAARenderPass"),Ve=require("three/examples/jsm/shaders/FXAAShader"),Ie=function(){try{var s=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&s.getContext("webgl2"))}catch(i){return!1}},Pt=0,Ne=1,pe=!1,Re=Ie()!==!1,We=`varying vec2 vUv;
|
|
2
2
|
|
|
3
3
|
void main() {
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ void main() {
|
|
|
6
6
|
|
|
7
7
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
8
8
|
|
|
9
|
-
}`,
|
|
9
|
+
}`,He=`uniform sampler2D baseTexture;
|
|
10
10
|
uniform sampler2D bloomTexture;
|
|
11
11
|
|
|
12
12
|
varying vec2 vUv;
|
|
@@ -15,7 +15,7 @@ void main() {
|
|
|
15
15
|
|
|
16
16
|
gl_FragColor = (texture2D(baseTexture, vUv) + vec4(1.0) * texture2D(bloomTexture, vUv));
|
|
17
17
|
|
|
18
|
-
}`;function _e(
|
|
18
|
+
}`;function _e(s,i){return _e=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_e(s,i)}function Me(s,i){return _e(s,i)}function Ze(s,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(i&&i.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),i&&Me(s,i)}function qe(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(s){return!1}}function Se(s){return Se=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Se(s)}function Te(s){return Se(s)}function Xe(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}function Qe(s){return s&&s.constructor===Symbol?"symbol":typeof s}function Ye(s,i){return i&&(Qe(i)==="object"||typeof i=="function")?i:Xe(s)}function Ke(s){var i=qe();return function(){var e=Te(s),t;if(i){var r=Te(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return Ye(this,t)}}var je=require("three/examples/jsm/postprocessing/Pass"),Ee=require("three/examples/jsm/shaders/LuminosityHighPassShader"),we=function(s){"use strict";Ze(n,s);var i=Ke(n);function n(t,r,o,u){R(this,n);var a;a=i.call(this),a.strength=r!==void 0?r:1,a.radius=o,a.threshold=u,a.resolution=t!==void 0?new d.Vector2(t.x,t.y):new d.Vector2(256,256),a.clearColor=new d.Color(0,0,0);var h={minFilter:d.LinearFilter,magFilter:d.LinearFilter,format:d.RGBAFormat};a.renderTargetsHorizontal=[],a.renderTargetsVertical=[],a.nMips=5;var w=Math.round(a.resolution.x/2),P=Math.round(a.resolution.y/2);a.renderTargetBright=new d.WebGLRenderTarget(w,P,h),a.renderTargetBright.texture.name="UnrealBloomPass.bright",a.renderTargetBright.texture.generateMipmaps=!1;for(var y=0;y<a.nMips;y++){var _=new d.WebGLRenderTarget(w,P,h);_.texture.name="UnrealBloomPass.h".concat(y),_.texture.generateMipmaps=!1,a.renderTargetsHorizontal.push(_);var M=new d.WebGLRenderTarget(w,P,h);M.texture.name="UnrealBloomPass.v".concat(y),M.texture.generateMipmaps=!1,a.renderTargetsVertical.push(M),w=Math.round(w/2),P=Math.round(P/2)}Ee.LuminosityHighPassShader===void 0&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");var L=Ee.LuminosityHighPassShader;a.highPassUniforms=d.UniformsUtils.clone(L.uniforms),a.highPassUniforms.luminosityThreshold.value=u,a.highPassUniforms.smoothWidth.value=.01,a.materialHighPassFilter=new d.ShaderMaterial({uniforms:a.highPassUniforms,vertexShader:L.vertexShader,fragmentShader:L.fragmentShader,defines:{}}),a.separableBlurMaterials=[];var Z=[3,5,7,9,11];w=Math.round(a.resolution.x/2),P=Math.round(a.resolution.y/2);for(var I=0;I<a.nMips;I++)a.separableBlurMaterials.push(a.getSeperableBlurMaterial(Z[I])),a.separableBlurMaterials[I].uniforms.texSize.value=new d.Vector2(w,P),w=Math.round(w/2),P=Math.round(P/2);a.compositeMaterial=a.getCompositeMaterial(a.nMips),a.compositeMaterial.uniforms.blurTexture1.value=a.renderTargetsVertical[0].texture,a.compositeMaterial.uniforms.blurTexture2.value=a.renderTargetsVertical[1].texture,a.compositeMaterial.uniforms.blurTexture3.value=a.renderTargetsVertical[2].texture,a.compositeMaterial.uniforms.blurTexture4.value=a.renderTargetsVertical[3].texture,a.compositeMaterial.uniforms.blurTexture5.value=a.renderTargetsVertical[4].texture,a.compositeMaterial.uniforms.bloomStrength.value=r,a.compositeMaterial.uniforms.bloomRadius.value=.1,a.compositeMaterial.needsUpdate=!0;var ae=[1,.8,.6,.4,.2];a.compositeMaterial.uniforms.bloomFactors.value=ae,a.bloomTintColors=[new d.Vector3(1,1,1),new d.Vector3(1,1,1),new d.Vector3(1,1,1),new d.Vector3(1,1,1),new d.Vector3(1,1,1)],a.compositeMaterial.uniforms.bloomTintColors.value=a.bloomTintColors,ue.CopyShader===void 0&&console.error("THREE.UnrealBloomPass relies on CopyShader");var k=ue.CopyShader;return a.copyUniforms=d.UniformsUtils.clone(k.uniforms),a.copyUniforms.opacity.value=1,a.materialCopy=new d.ShaderMaterial({uniforms:a.copyUniforms,vertexShader:k.vertexShader,fragmentShader:k.fragmentShader,blending:d.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0}),a.enabled=!0,a.needsSwap=!1,a._oldClearColor=new d.Color,a.oldClearAlpha=1,a.basic=new d.MeshBasicMaterial,a.fsQuad=new je.FullScreenQuad(void 0),a}var e=n.prototype;return e.dispose=function(){for(var r=0;r<this.renderTargetsHorizontal.length;r++)this.renderTargetsHorizontal[r].dispose();for(var o=0;o<this.renderTargetsVertical.length;o++)this.renderTargetsVertical[o].dispose();this.renderTargetBright.dispose()},e.setSize=function(r,o){var u=Math.round(r/2),a=Math.round(o/2);this.renderTargetBright.setSize(u,a);for(var h=0;h<this.nMips;h++)this.renderTargetsHorizontal[h].setSize(u,a),this.renderTargetsVertical[h].setSize(u,a),this.separableBlurMaterials[h].uniforms.texSize.value=new d.Vector2(u,a),u=Math.round(u/2),a=Math.round(a/2)},e.render=function(r,o,u,a,h){r.getClearColor(this._oldClearColor),this.oldClearAlpha=r.getClearAlpha();var w=r.autoClear;r.autoClear=!1,r.setClearColor(this.clearColor,0),h&&r.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=u.texture,r.setRenderTarget(null),r.clear(),this.fsQuad.render(r)),this.highPassUniforms.tDiffuse.value=u.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,r.setRenderTarget(this.renderTargetBright),r.clear(),this.fsQuad.render(r);for(var P=this.renderTargetBright,y=0;y<this.nMips;y++)this.fsQuad.material=this.separableBlurMaterials[y],this.separableBlurMaterials[y].uniforms.colorTexture.value=P.texture,this.separableBlurMaterials[y].uniforms.direction.value=n.BlurDirectionX,r.setRenderTarget(this.renderTargetsHorizontal[y]),r.clear(),this.fsQuad.render(r),this.separableBlurMaterials[y].uniforms.colorTexture.value=this.renderTargetsHorizontal[y].texture,this.separableBlurMaterials[y].uniforms.direction.value=n.BlurDirectionY,r.setRenderTarget(this.renderTargetsVertical[y]),r.clear(),this.fsQuad.render(r),P=this.renderTargetsVertical[y];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,r.setRenderTarget(this.renderTargetsHorizontal[0]),r.clear(),this.fsQuad.render(r),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,h&&r.state.buffers.stencil.setTest(!0),this.renderToScreen?(r.setRenderTarget(null),this.fsQuad.render(r)):(r.setRenderTarget(u),this.fsQuad.render(r)),r.setClearColor(this._oldClearColor,this.oldClearAlpha),r.autoClear=w},e.getSeperableBlurMaterial=function(r){return new d.ShaderMaterial({defines:{KERNEL_RADIUS:r,SIGMA:r},uniforms:{colorTexture:{value:null},texSize:{value:new d.Vector2(.5,.5)},direction:{value:new d.Vector2(.5,.5)}},vertexShader:`varying vec2 vUv;
|
|
19
19
|
void main() {
|
|
20
20
|
vUv = uv;
|
|
21
21
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
@@ -29,7 +29,7 @@ void main() {
|
|
|
29
29
|
}
|
|
30
30
|
void main() {
|
|
31
31
|
vec2 invSize = 1.0 / texSize; float fSigma = float(SIGMA); float weightSum = gaussianPdf(0.0, fSigma); float alphaSum = 0.0; vec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum; for( int i = 1; i < KERNEL_RADIUS; i ++ ) { float x = float(i); float w = gaussianPdf(x, fSigma); vec2 uvOffset = direction * invSize * x; vec4 sample1 = texture2D( colorTexture, vUv + uvOffset); vec4 sample2 = texture2D( colorTexture, vUv - uvOffset); diffuseSum += (sample1.rgb + sample2.rgb) * w; alphaSum += (sample1.a + sample2.a) * w; weightSum += 2.0 * w; } gl_FragColor = vec4(diffuseSum/weightSum, alphaSum/weightSum);
|
|
32
|
-
}`})},e.getCompositeMaterial=function(
|
|
32
|
+
}`})},e.getCompositeMaterial=function(r){return new d.ShaderMaterial({defines:{NUM_MIPS:r},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:`varying vec2 vUv;
|
|
33
33
|
void main() {
|
|
34
34
|
vUv = uv;
|
|
35
35
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
@@ -54,4 +54,4 @@ void main() {
|
|
|
54
54
|
lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +
|
|
55
55
|
lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +
|
|
56
56
|
lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );
|
|
57
|
-
}`})},n}(Le.Pass);Se.BlurDirectionX=new h.Vector2(1,0),Se.BlurDirectionY=new h.Vector2(0,1);var $e={threshold:.2,strength:.5,radius:0},Je=new h.MeshBasicMaterial({color:"black"}),et=new h.SpriteMaterial({color:"#000"}),tt=function(){"use strict";function o(n,e){R(this,o),this.materials={},this.bloomLayer=new h.Layers,this.active=!0,this.composerController=n,this.options=e;var r=n.renderer,t=n.renderPass,a=n.finalComposer,u=n.getSize(),i=u.width,d=u.height,w=new Se(new h.Vector2(i,d),e.strength,e.radius,e.threshold);this.bloomPass=w;var b=new ee.EffectComposer(r);b.renderToScreen=!1,b.addPass(t),b.addPass(this.bloomPass),this.bloomComposer=b,this.bloomLayer.set(He);var _=new h.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:b.renderTarget2.texture}},vertexShader:Ze,fragmentShader:qe,defines:{}}),y=new le.ShaderPass(_,"baseTexture");y.needsSwap=!0,this.finalPass=y,a.addPass(y)}var s=o.prototype;return s.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},s.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},s.render=function(e){if(!!this.active){var r=this,t=r.bloomComposer,a=r.bloomLayer,u=r.materials;e.traverse(function(i){var d=i;d.material&&a.test(d.layers)===!1&&(u[d.uuid]=d.material,d.material=d.isSprite?et:Je)}),t.render(),e.traverse(function(i){var d=i;u[d.uuid]&&(d.material=u[d.uuid],delete u[d.uuid])})}},s.setSize=function(e,r){this.bloomComposer.setSize(e,r)},s.setGui=function(e){var r=this,t=new c;t.guiParams={bloom:{threshold:{value:this.options.threshold,min:0,max:1,target:function(){return r.bloomPass}},strength:{value:this.options.strength,min:0,max:10,target:function(){return r.bloomPass}},radius:{value:this.options.radius,min:0,max:2,step:.01,target:function(){return r.bloomPass}}}},t.showGuiParams(e)},s.dispose=function(){this.bloomPass.dispose(),this.materials={}},o}(),rt=require("three/examples/jsm/postprocessing/OutlinePass"),nt={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},it=function(){"use strict";function o(n,e){R(this,o),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var r=n.scene,t=n.camera,a=n.finalComposer,u=n.getSize(),i=u.width,d=u.height,w=new rt.OutlinePass(new h.Vector2(i,d),r,t);w.selectedObjects=this.selectedObjects,this.outlinePass=w,a.addPass(w),this.setGui()}var s=o.prototype;return s.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},s.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},s.setGui=function(){var e=this,r=new c;r.guiParams={outline:{edgeStrength:{value:this.options.edgeStrength,min:.01,max:10,step:.01,target:function(){return e.outlinePass}},edgeGlow:{value:this.options.edgeGlow,min:0,max:10,step:.01,target:function(){return e.outlinePass}},edgeThickness:{value:this.options.edgeThickness,min:0,max:4,step:.01,target:function(){return e.outlinePass}},pulsePeriod:{value:this.options.pulsePeriod,min:0,max:4,step:.01,target:function(){return e.outlinePass}},usePatternTexture:{value:this.options.usePatternTexture,target:function(){return e.outlinePass}},visibleEdgeColor:{value:this.options.visibleEdgeColor,target:function(){return e.outlinePass}},hiddenEdgeColor:{value:this.options.hiddenEdgeColor,target:function(){return e.outlinePass}}}},r.setGuiTargetValueByParams(),this.outlineGui=r},s.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},o}();function at(o,s){if(o==null)return{};var n={},e=Object.keys(o),r,t;for(t=0;t<e.length;t++)r=e[t],!(s.indexOf(r)>=0)&&(n[r]=o[r]);return n}function st(o,s){if(o==null)return{};var n=at(o,s),e,r;if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(o);for(r=0;r<t.length;r++)e=t[r],!(s.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(o,e)||(n[e]=o[e]))}return n}var ot=require("three/examples/jsm/postprocessing/SSRPass"),ut=require("three/examples/jsm/objects/ReflectorForSSRPass"),lt={maxDistance:10,selects:!0},ct={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},ft=function(){"use strict";function o(n,e){R(this,o),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var r=n.scene,t=n.camera,a=n.renderer,u=n.finalComposer,i=n.getSize(),d=i.width,w=i.height,b=new ot.SSRPass({renderer:a,scene:r,camera:t,width:d,height:w,groundReflector:null,selects:this.selectedObjects});this.ssrPass=b,u.addPass(b),this.setGui()}var s=o.prototype;return s.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=(0,z.Z)({},ct,e),t=r.width,a=r.height,u=st(r,["width","height"]),i=this.composerController,d=i.scene,w=i.getSize(),b=new h.PlaneGeometry(t,a),_=new ut.ReflectorForSSRPass(b,E((0,z.Z)({},u),{textureWidth:w.width,textureHeight:w.height}));_.material.depthWrite=!1,_.rotation.x=-Math.PI/2,_.visible=!1,d.add(_),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=_},s.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},s.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},s.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},s.setSize=function(e,r){var t=this.groundReflector;t&&(t.getRenderTarget().setSize(e,r),t.resolution.set(e,r))},s.setGui=function(){var e=this,r=new c;r.guiParams={ssr:{thickness:{value:.018,min:0,max:.1,step:1e-4,target:function(){return e.ssrPass}},infiniteThick:{value:!1,target:function(){return e.ssrPass}},fresnel:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},distanceAttenuation:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},selects:{value:this.options.selects,onChange:function(t){t?e.ssrPass.selects=e.selectedObjects:e.ssrPass.selects=null}},maxDistance:{value:this.options.maxDistance,min:0,max:100,step:.001,target:function(){return[e.ssrPass,e.groundReflector]}},opacity:{value:1,min:0,max:1,step:.01,target:function(){return[e.ssrPass,e.groundReflector]}}}},r.setGuiTargetValueByParams(),this.ssrGui=r},s.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},o}(),dt=function(){"use strict";function o(n){R(this,o),this.active=!0,this.options=n;var e=n.renderer,r=n.scene,t=n.camera,a=this.createRenderTarget(),u=new ee.EffectComposer(e,a);u.setPixelRatio(e.getPixelRatio()),this.finalComposer=u,this.addRenderPasss(),this.renderer=e,this.scene=r,this.renderTarget=a,this.camera=t}var s=o.prototype;return s.createRenderTarget=function(){var e=this.options.composerParams,r=e.multisampling,t=e.type,a=e.encoding,u=this.getSize(),i={minFilter:h.LinearFilter,magFilter:h.LinearFilter,format:h.RGBAFormat,encoding:a,type:t},d;if(+h.REVISION<138&&r>0){var w=new h.WebGLMultisampleRenderTarget(u.width,u.height,i);w.samples=r,d=w}else if(+h.REVISION>=138&&r>0){var b=new h.WebGLRenderTarget(u.width,u.height,E((0,z.Z)({},i),{samples:r}));d=b}else{var _=new h.WebGLRenderTarget(u.width,u.height,i);d=_}return d.texture.name="EffectComposer.rt1",d},s.addRenderPasss=function(){var e=this.options,r=e.scene,t=e.camera,a=new pe.RenderPass(r,t);this.finalComposer.addPass(a),this.renderPass=a},s.addCopyPass=function(){var e=new le.ShaderPass(ue.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},s.addGammaCorrectionPass=function(){var e=new le.ShaderPass(ke.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},s.addFXAAPass=function(){var e=this.getSize(),r=e.width,t=e.height,a=new le.ShaderPass(Ne.FXAAShader);this.finalComposer.addPass(a),this.fxaaPass=a,this.setFXAAPassSize(r,t)},s.addSMAAPass=function(){var e=this.getSize(),r=e.width,t=e.height,a=this.options.renderer,u=new Ve.SMAAPass(r*a.getPixelRatio(),t*a.getPixelRatio());this.finalComposer.addPass(u),this.smaaPass=u},s.addSSAAPass=function(){var e=this.options,r=e.scene,t=e.camera,a=new Ie.SSAARenderPass(r,t,0,0);a.unbiased=!0,a.sampleLevel=1,this.finalComposer.addPass(a),this.ssaaPass=a},s.addBloomPass=function(e){var r=new tt(this,e);r.disable(),this.options.gui&&r.setGui(this.options.gui),this.bloomController=r},s.addOutlinePass=function(e){var r=new it(this,e);r.disable(),this.options.gui&&r.outlineGui.showGuiParams(this.options.gui),this.outlineController=r},s.addSSRPass=function(e){var r=new ft(this,e);r.disable(),this.options.gui&&r.ssrGui.showGuiParams(this.options.gui),this.ssrController=r},s.getSize=function(){var e=this.options.renderer;return e.getSize(new h.Vector2)},s.enable=function(){this.active||(this.active=!0)},s.disable=function(){!this.active||(this.active=!1)},s.checkCopyPass=function(){var e=this,r=this.finalComposer.passes.some(function(t){return t!==e.renderPass&&t!==e.copyPass?t.enabled:!1});r&&this.copyPass?this.copyPass.enabled=!1:!r&&this.copyPass?this.copyPass.enabled=!0:!r&&!this.copyPass&&this.addCopyPass()},s.setSize=function(e,r){var t,a;this.finalComposer.setSize(e,r),(t=this.bloomController)===null||t===void 0||t.setSize(e,r),(a=this.ssrController)===null||a===void 0||a.setSize(e,r),this.setFXAAPassSize(e,r)},s.setFXAAPassSize=function(e,r){if(!!this.fxaaPass){var t=this.options.renderer,a=t.getPixelRatio();this.fxaaPass.material.uniforms.resolution.value.x=1/(e*a),this.fxaaPass.material.uniforms.resolution.value.y=1/(r*a)}},s.render=function(){var e;if(!!this.active){var r=this.options.scene;(e=this.bloomController)===null||e===void 0||e.render(r),this.finalComposer.render()}},s.dispose=function(){var e,r,t,a,u;(e=this.bloomController)===null||e===void 0||e.dispose(),(r=this.outlineController)===null||r===void 0||r.dispose(),(t=this.ssrController)===null||t===void 0||t.dispose(),(a=this.finalComposer)===null||a===void 0||a.passes.forEach(function(i){var d,w,b;(d=i.fsQuad)===null||d===void 0||d.dispose(),(w=i.fsQuad)===null||w===void 0||(b=w.material)===null||b===void 0||b.dispose()}),(u=this.renderTarget)===null||u===void 0||u.dispose(),this.renderer=void 0,this.scene=void 0,this.camera=void 0,this.finalComposer=void 0,this.renderTarget=void 0,this.renderPass=void 0,this.copyPass=void 0,this.gammaCorrectionPass=void 0,this.smaaPass=void 0,this.ssaaPass=void 0,this.fxaaPass=void 0,this.bloomController=void 0,this.outlineController=void 0,this.ssrController=void 0},o}(),Ce=function(){"use strict";function o(n){R(this,o),this.raycaster=new h.Raycaster,this.installPlugins=new Map,this.event=new se.EventEmitter,this.clock=new h.Clock,this.options=k()(o.options,n,{isMergeableObject:F.isPlainObject});var e=this.options,r=e.container,t=e.stats,a=e.gui;if(a){var u=new(f());u.open(!1),this.gui=u}if(t){var i=new(D());i.showPanel(0),i.dom.style.position="absolute",r.appendChild(i.dom),this.stats=i}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),this.clock.getDelta(),this.clock.getElapsedTime()}var s=o.prototype;return s.use=function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),a=1;a<r;a++)t[a-1]=arguments[a];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var u;(u=e).install.apply(u,[this].concat(X(t))),this.installPlugins.set(e,!0)}},s.init=function(){var e=this,r=this.options,t=r.container,a=r.isdev,u=r.axesHelper,i=r.renderer,d=r.scene,w=r.camera,b=this.getSize(),_=b.width,y=b.height,M=new j({isdev:a,width:_,height:y,cameraParams:w});this.gui&&M.setGui(this.gui);var A=M.camera,H=new he({camera:A,sceneParams:d}),V=H.scene,ie=new S({width:_,height:y,scene:V,camera:A,isdev:a,rendererParams:E((0,z.Z)({},i),{outputEncoding:h.LinearEncoding,antialias:!1})});this.gui&&ie.setGui(this.gui);var re=ie.renderer;u&&H.addAxesHelper(),this.sceneController=H,this.rendererController=ie,this.cameraController=M,t.appendChild(re.domElement);var N=new ResizeObserver(function(fe){var ce=!0,de=!1,ze=void 0;try{for(var xe=fe[Symbol.iterator](),Be;!(ce=(Be=xe.next()).done);ce=!0){var bt=Be.value,Fe=bt.contentRect;e.handeleResize(Fe.width,Fe.height)}}catch(Pt){de=!0,ze=Pt}finally{try{!ce&&xe.return!=null&&xe.return()}finally{if(de)throw ze}}});N.observe(t),this.resizeObserver=N},s.initComposer=function(){var e=this.options,r=e.bloom,t=e.outline,a=e.ssr,u=e.renderer,i=e.bloomParams,d=e.outlineParams,w=e.ssrParams,b=e.multisampling,_=u.antialias;_==="msaa"&&!Re&&(_=!1,console.warn("MSAA is not supported on this browser"));var y=new dt({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:_==="msaa"?b:0,type:h.UnsignedByteType,encoding:u.outputEncoding}});this.composerController=y,_==="ssaa"&&y.addSSAAPass(),a&&y.addSSRPass(w),r&&y.addBloomPass(i),t&&y.addOutlinePass(d),u.outputEncoding===h.sRGBEncoding&&y.addGammaCorrectionPass(),_==="fxaa"?y.addFXAAPass():_==="smaa"&&y.addSMAAPass(),y.checkCopyPass(),this.event.on("passcheck",function(){y.checkCopyPass()})},s.initCSSRenderer=function(){var e=this.options,r=e.container,t=e.css2DRenderer,a=e.css3DRenderer,u=e.css2DRendererParams,i=e.css3DRendererParams;if(t||a){var d=new ne(r);t&&d.addRenderer("css2d",u),a&&d.addRenderer("css3d",i),this.cssRendererController=d}},s.initControl=function(){var e=this.options,r=e.control,t=e.mapControl,a=e.controlParams;if(r){var u=new ge({camera:this.camera,controlParams:{domElement:(a==null?void 0:a.domElement)||this.renderer.domElement},mapControl:t});this.controlController=u}},s.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},s.handeleResize=function(e,r){var t=this,a=t.rendererController,u=t.cameraController,i=t.composerController,d=t.cssRendererController;u==null||u.setSize(e,r),a==null||a.setSize(e,r),i==null||i.setSize(e,r),d==null||d.setSize(e,r),this.installPlugins.forEach(function(w,b){var _;(_=b.resize)===null||_===void 0||_.call(b,{width:e,height:r})}),this.event.emit("resize",{width:e,height:r})},s.pick=function(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=this,u=a.raycaster,i=a.options,d=i.container,w=new h.Vector2,b=d.getBoundingClientRect();if(w.x=(e.clientX-b.left)/(b.right-b.left)*2-1,w.y=-((e.clientY-b.top)/(b.bottom-b.top))*2+1,this.camera&&this.scene){u.setFromCamera(w,this.camera);var _=u.intersectObjects(r||this.scene.children,t);if(_.length)return{object:_[0].object,intersects:_}}},s.render=function(){var e,r,t,a,u=this,i=u.renderer,d=u.scene,w=u.camera,b=u.clock;if(!(!i||!d||!w||this.options.staticRender&&!this.cameraController.checkCameraChange())){var _=b.getDelta(),y=b.getElapsedTime();if(i.clear(),Q().update(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(A,H){var V;(V=H.update)===null||V===void 0||V.call(H,_,y)}),!((r=this.composerController)===null||r===void 0)&&r.active)this.composerController.render();else{var M;(M=this.rendererController)===null||M===void 0||M.render()}(t=this.cssRendererController)===null||t===void 0||t.render(d,w),(a=this.stats)===null||a===void 0||a.update(),this.event.emit("render",{delta:_,elapsed:y})}},s.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},s.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},s.dispose=function(){var e,r,t,a,u,i,d,w;this.stop(),Q().removeAll(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.resizeObserver=void 0,this.installPlugins.forEach(function(b,_){var y;(y=_.dispose)===null||y===void 0||y.call(_)}),(r=this.controlController)===null||r===void 0||r.dispose(),(t=this.cssRendererController)===null||t===void 0||t.dispose(),(a=this.cameraController)===null||a===void 0||a.dispose(),(u=this.sceneController)===null||u===void 0||u.dispose(),(i=this.composerController)===null||i===void 0||i.dispose(),(d=this.rendererController)===null||d===void 0||d.dispose(),this.controlController=void 0,this.cssRendererController=void 0,this.cameraController=void 0,this.sceneController=void 0,this.composerController=void 0,this.rendererController=void 0,(w=this.gui)===null||w===void 0||w.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},x(o,[{key:"renderer",get:function(){var e;return(e=this.rendererController)===null||e===void 0?void 0:e.renderer}},{key:"control",get:function(){var e;return(e=this.controlController)===null||e===void 0?void 0:e.control}},{key:"camera",get:function(){var e;return(e=this.cameraController)===null||e===void 0?void 0:e.camera}},{key:"scene",get:function(){var e;return(e=this.sceneController)===null||e===void 0?void 0:e.scene}}]),o}();Ce.options={isdev:be,stats:be,gui:be,axesHelper:be,control:!1,renderer:E((0,z.Z)({},P),{antialias:Re?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:oe,camera:L,bloom:!1,bloomParams:$e,outline:!1,outlineParams:nt,css2DRenderer:!1,ssr:!1,ssrParams:lt,css2DRendererParams:(0,z.Z)({},J),css3DRenderer:!1,css3DRendererParams:(0,z.Z)({},J),staticPath:"/"};function ht(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(o){return!1}}function Pe(o,s,n){return ht()?Pe=Reflect.construct:Pe=function(r,t,a){var u=[null];u.push.apply(u,t);var i=Function.bind.apply(r,u),d=new i;return a&&Me(d,a.prototype),d},Pe.apply(null,arguments)}function De(o,s,n){return Pe.apply(null,arguments)}var vt=K(484);function pt(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n={};return n.promise=new Promise(function(e,r){n.resolve=e,n.reject=r}),o&&(n.promise=(0,vt.Z)(n.promise,s)),n}var mt=require("three/examples/jsm/renderers/CSS2DRenderer"),Ge=function(o){o&&((0,F.disposeMesh)(o),o.children.forEach(function(s){s.userData.BaseObject_||Ge(s)}))},gt=function(o){"use strict";Te(n,o);var s=Ee(n);function n(r){R(this,n);var t;return t=s.call(this),t.objecttype__="BaseObject",t.userData={},t.pm=pt(),t.visible=!1,t}var e=n.prototype;return e.init=function(){},e.create=function(){},e.render=function(){},e.update=function(t,a){},e.resize=function(t,a){},e.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},e.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},e.isVisible=function(){return this.visible},e.createMesh=function(){for(var t=arguments.length,a=new Array(t),u=0;u<t;u++)a[u]=arguments[u];return this.object3d=De(h.Mesh,X(a)),this},e.createGroup=function(){return this.object3d=new h.Group,this},e.createPoints=function(){for(var t=arguments.length,a=new Array(t),u=0;u<t;u++)a[u]=arguments[u];return this.object3d=De(h.Points,X(a)),this},e.createCSS2DObject=function(t){return this.object3d=new mt.CSS2DObject(t),this},e.createCSS3DObject=function(t){return this.object3d=new v.CSS3DObject(t),this},e.createCSS3DSprite=function(t){return this.object3d=new v.CSS3DSprite(t),this},e.createSprite=function(t){return this.object3d=new h.Sprite(t),this},e.add=function(){for(var t=arguments.length,a=new Array(t),u=0;u<t;u++)a[u]=arguments[u];var i;return(i=this.object3d).add.apply(i,X(a)),this},e.remove=function(){for(var t=arguments.length,a=new Array(t),u=0;u<t;u++)a[u]=arguments[u];var i;return(i=this.object3d).remove.apply(i,X(a)),this},e.getSize=function(){var t=new h.Box3().setFromObject(this.object3d);return{min:t.min,max:t.max,size:t.getSize(new h.Vector3)}},e.traverse=function(t){t(this),this.children.forEach(function(a){a.traverse(t)})},e.dispose=function(){Ge(this.object3d)},x(n,[{key:"parent",get:function(){var t=this.object3d.parent;return(t==null?void 0:t.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(t){return t.userData.BaseObject_}).filter(function(t){return!!t})}}]),n}(c)})(),module.exports=ye})();
|
|
57
|
+
}`})},n}(je.Pass);we.BlurDirectionX=new d.Vector2(1,0),we.BlurDirectionY=new d.Vector2(0,1);var $e={threshold:.2,strength:.5,radius:0},Je=new d.MeshBasicMaterial({color:"black"}),et=new d.SpriteMaterial({color:"#000"}),tt=function(){"use strict";function s(n,e){R(this,s),this.materials={},this.bloomLayer=new d.Layers,this.active=!0,this.composerController=n,this.options=e;var t=n.renderer,r=n.renderPass,o=n.finalComposer,u=n.getSize(),a=u.width,h=u.height,w=new we(new d.Vector2(a,h),e.strength,e.radius,e.threshold);this.bloomPass=w;var P=new ee.EffectComposer(t);P.renderToScreen=!1,P.addPass(r),P.addPass(this.bloomPass),this.bloomComposer=P,this.bloomLayer.set(Ne);var y=new d.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:P.renderTarget2.texture}},vertexShader:We,fragmentShader:He,defines:{}}),_=new le.ShaderPass(y,"baseTexture");_.needsSwap=!0,this.finalPass=_,o.addPass(_)}var i=s.prototype;return i.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},i.render=function(e){if(!!this.active){var t=this,r=t.bloomComposer,o=t.bloomLayer,u=t.materials;e.traverse(function(a){var h=a;h.material&&o.test(h.layers)===!1&&(u[h.uuid]=h.material,h.material=h.isSprite?et:Je)}),r.render(),e.traverse(function(a){var h=a;u[h.uuid]&&(h.material=u[h.uuid],delete u[h.uuid])})}},i.setSize=function(e,t){this.bloomComposer.setSize(e,t)},i.setGui=function(e){var t=this,r=new c({bloom:{threshold:{value:this.options.threshold,min:0,max:1,target:function(){return t.bloomPass}},strength:{value:this.options.strength,min:0,max:10,target:function(){return t.bloomPass}},radius:{value:this.options.radius,min:0,max:2,step:.01,target:function(){return t.bloomPass}}}});r.showGui(e)},i.dispose=function(){this.bloomPass.dispose(),this.materials={}},s}(),rt=require("three/examples/jsm/postprocessing/OutlinePass"),nt={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},it=function(){"use strict";function s(n,e){R(this,s),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var t=n.scene,r=n.camera,o=n.finalComposer,u=n.getSize(),a=u.width,h=u.height,w=new rt.OutlinePass(new d.Vector2(a,h),t,r);w.selectedObjects=this.selectedObjects,this.outlinePass=w,o.addPass(w),this.setGui()}var i=s.prototype;return i.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},i.setGui=function(){var e=this,t=new c({outline:{edgeStrength:{value:this.options.edgeStrength,min:.01,max:10,step:.01,target:function(){return e.outlinePass}},edgeGlow:{value:this.options.edgeGlow,min:0,max:10,step:.01,target:function(){return e.outlinePass}},edgeThickness:{value:this.options.edgeThickness,min:0,max:4,step:.01,target:function(){return e.outlinePass}},pulsePeriod:{value:this.options.pulsePeriod,min:0,max:4,step:.01,target:function(){return e.outlinePass}},usePatternTexture:{value:this.options.usePatternTexture,target:function(){return e.outlinePass}},visibleEdgeColor:{value:this.options.visibleEdgeColor,target:function(){return e.outlinePass}},hiddenEdgeColor:{value:this.options.hiddenEdgeColor,target:function(){return e.outlinePass}}}});t.setTargetValueByParams(),this.outlineGui=t},i.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},s}();function at(s,i){if(s==null)return{};var n={},e=Object.keys(s),t,r;for(r=0;r<e.length;r++)t=e[r],!(i.indexOf(t)>=0)&&(n[t]=s[t]);return n}function st(s,i){if(s==null)return{};var n=at(s,i),e,t;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(s);for(t=0;t<r.length;t++)e=r[t],!(i.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(s,e)||(n[e]=s[e]))}return n}var ot=require("three/examples/jsm/postprocessing/SSRPass"),ut=require("three/examples/jsm/objects/ReflectorForSSRPass"),lt={maxDistance:10,selects:!0},ct={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},ft=function(){"use strict";function s(n,e){R(this,s),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var t=n.scene,r=n.camera,o=n.renderer,u=n.finalComposer,a=n.getSize(),h=a.width,w=a.height,P=new ot.SSRPass({renderer:o,scene:t,camera:r,width:h,height:w,groundReflector:null,selects:this.selectedObjects});this.ssrPass=P,u.addPass(P),this.setGui()}var i=s.prototype;return i.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=(0,G.Z)({},ct,e),r=t.width,o=t.height,u=st(t,["width","height"]),a=this.composerController,h=a.scene,w=a.getSize(),P=new d.PlaneGeometry(r,o),y=new ut.ReflectorForSSRPass(P,E((0,G.Z)({},u),{textureWidth:w.width,textureHeight:w.height}));y.material.depthWrite=!1,y.rotation.x=-Math.PI/2,y.visible=!1,h.add(y),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=y},i.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},i.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},i.setSize=function(e,t){var r=this.groundReflector;r&&(r.getRenderTarget().setSize(e,t),r.resolution.set(e,t))},i.setGui=function(){var e=this,t=new c({ssr:{thickness:{value:.018,min:0,max:.1,step:1e-4,target:function(){return e.ssrPass}},infiniteThick:{value:!1,target:function(){return e.ssrPass}},fresnel:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},distanceAttenuation:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},selects:{value:this.options.selects,onChange:function(r){r?e.ssrPass.selects=e.selectedObjects:e.ssrPass.selects=null}},maxDistance:{value:this.options.maxDistance,min:0,max:100,step:.001,target:function(){return[e.ssrPass,e.groundReflector]}},opacity:{value:1,min:0,max:1,step:.01,target:function(){return[e.ssrPass,e.groundReflector]}}}});t.setTargetValueByParams(),this.ssrGui=t},i.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},s}(),dt=function(){"use strict";function s(n){R(this,s),this.active=!0,this.options=n;var e=n.renderer,t=n.scene,r=n.camera,o=this.createRenderTarget(),u=new ee.EffectComposer(e,o);u.setPixelRatio(e.getPixelRatio()),this.finalComposer=u,this.addRenderPasss(),this.renderer=e,this.scene=t,this.renderTarget=o,this.camera=r}var i=s.prototype;return i.createRenderTarget=function(){var e=this.options.composerParams,t=e.multisampling,r=e.type,o=e.encoding,u=this.getSize(),a={minFilter:d.LinearFilter,magFilter:d.LinearFilter,format:d.RGBAFormat,encoding:o,type:r},h;if(+d.REVISION<138&&t>0){var w=new d.WebGLMultisampleRenderTarget(u.width,u.height,a);w.samples=t,h=w}else if(+d.REVISION>=138&&t>0){var P=new d.WebGLRenderTarget(u.width,u.height,E((0,G.Z)({},a),{samples:t}));h=P}else{var y=new d.WebGLRenderTarget(u.width,u.height,a);h=y}return h.texture.name="EffectComposer.rt1",h},i.addRenderPasss=function(){var e=this.options,t=e.scene,r=e.camera,o=new ve.RenderPass(t,r);this.finalComposer.addPass(o),this.renderPass=o},i.addCopyPass=function(){var e=new le.ShaderPass(ue.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},i.addGammaCorrectionPass=function(){var e=new le.ShaderPass(Fe.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},i.addFXAAPass=function(){var e=this.getSize(),t=e.width,r=e.height,o=new le.ShaderPass(Ve.FXAAShader);this.finalComposer.addPass(o),this.fxaaPass=o,this.setFXAAPassSize(t,r)},i.addSMAAPass=function(){var e=this.getSize(),t=e.width,r=e.height,o=this.options.renderer,u=new Ue.SMAAPass(t*o.getPixelRatio(),r*o.getPixelRatio());this.finalComposer.addPass(u),this.smaaPass=u},i.addSSAAPass=function(){var e=this.options,t=e.scene,r=e.camera,o=new ke.SSAARenderPass(t,r,0,0);o.unbiased=!0,o.sampleLevel=1,this.finalComposer.addPass(o),this.ssaaPass=o},i.addBloomPass=function(e){var t=new tt(this,e);t.disable(),this.options.gui&&t.setGui(this.options.gui),this.bloomController=t},i.addOutlinePass=function(e){var t=new it(this,e);t.disable(),this.options.gui&&t.outlineGui.showGui(this.options.gui),this.outlineController=t},i.addSSRPass=function(e){var t=new ft(this,e);t.disable(),this.options.gui&&t.ssrGui.showGui(this.options.gui),this.ssrController=t},i.getSize=function(){var e=this.options.renderer;return e.getSize(new d.Vector2)},i.enable=function(){this.active||(this.active=!0)},i.disable=function(){!this.active||(this.active=!1)},i.checkCopyPass=function(){var e=this,t=this.finalComposer.passes.some(function(r){return r!==e.renderPass&&r!==e.copyPass?r.enabled:!1});t&&this.copyPass?this.copyPass.enabled=!1:!t&&this.copyPass?this.copyPass.enabled=!0:!t&&!this.copyPass&&this.addCopyPass()},i.setSize=function(e,t){var r,o;this.finalComposer.setSize(e,t),(r=this.bloomController)===null||r===void 0||r.setSize(e,t),(o=this.ssrController)===null||o===void 0||o.setSize(e,t),this.setFXAAPassSize(e,t)},i.setFXAAPassSize=function(e,t){if(!!this.fxaaPass){var r=this.options.renderer,o=r.getPixelRatio();this.fxaaPass.material.uniforms.resolution.value.x=1/(e*o),this.fxaaPass.material.uniforms.resolution.value.y=1/(t*o)}},i.render=function(){var e;if(!!this.active){var t=this.options.scene;(e=this.bloomController)===null||e===void 0||e.render(t),this.finalComposer.render()}},i.dispose=function(){var e,t,r;(e=this.bloomController)===null||e===void 0||e.dispose(),(t=this.outlineController)===null||t===void 0||t.dispose(),(r=this.ssrController)===null||r===void 0||r.dispose(),this.finalComposer.passes.forEach(function(o){var u,a,h;(u=o.fsQuad)===null||u===void 0||u.dispose(),(a=o.fsQuad)===null||a===void 0||(h=a.material)===null||h===void 0||h.dispose()}),this.renderTarget.dispose(),this.copyPass=void 0,this.gammaCorrectionPass=void 0,this.smaaPass=void 0,this.ssaaPass=void 0,this.fxaaPass=void 0,this.bloomController=void 0,this.outlineController=void 0,this.ssrController=void 0},s}(),Ce=function(){"use strict";function s(n){R(this,s),this.raycaster=new d.Raycaster,this.installPlugins=new Map,this.event=new se.EventEmitter,this.clock=new d.Clock,this.options=V()(s.options,n,{isMergeableObject:F.isPlainObject});var e=this.options,t=e.container,r=e.stats,o=e.gui;if(o){var u=new(f());u.open(!1),this.gui=u}if(r){var a=new(D());a.showPanel(0),a.dom.style.position="absolute",t.appendChild(a.dom),this.stats=a}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),this.clock.getDelta(),this.clock.getElapsedTime()}var i=s.prototype;return i.use=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var u;(u=e).install.apply(u,[this].concat(X(r))),this.installPlugins.set(e,!0)}},i.init=function(){var e=this,t=this.options,r=t.container,o=t.isdev,u=t.axesHelper,a=t.renderer,h=t.scene,w=t.camera,P=this.getSize(),y=P.width,_=P.height,M=new j({isdev:o,width:y,height:_,cameraParams:w});this.gui&&M.setGui(this.gui);var L=M.camera,Z=new de({camera:L,sceneParams:h}),I=Z.scene,ae=new S({width:y,height:_,scene:I,camera:L,isdev:o,rendererParams:E((0,G.Z)({},a),{outputEncoding:d.LinearEncoding,antialias:!1})});this.gui&&ae.setGui(this.gui);var k=ae.renderer;u&&Z.addAxesHelper(),this.sceneController=Z,this.rendererController=ae,this.cameraController=M,r.appendChild(k.domElement);var ne=new ResizeObserver(function(ce){var fe=!0,ye=!1,De=void 0;try{for(var xe=ce[Symbol.iterator](),ze;!(fe=(ze=xe.next()).done);fe=!0){var bt=ze.value,Ge=bt.contentRect;e.handeleResize(Ge.width,Ge.height)}}catch(yt){ye=!0,De=yt}finally{try{!fe&&xe.return!=null&&xe.return()}finally{if(ye)throw De}}});ne.observe(r),this.resizeObserver=ne},i.initComposer=function(){var e=this.options,t=e.bloom,r=e.outline,o=e.ssr,u=e.renderer,a=e.bloomParams,h=e.outlineParams,w=e.ssrParams,P=e.multisampling,y=u.antialias;y==="msaa"&&!Re&&(y=!1,console.warn("MSAA is not supported on this browser"));var _=new dt({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:y==="msaa"?P:0,type:d.UnsignedByteType,encoding:u.outputEncoding}});this.composerController=_,y==="ssaa"&&_.addSSAAPass(),o&&_.addSSRPass(w),t&&_.addBloomPass(a),r&&_.addOutlinePass(h),u.outputEncoding===d.sRGBEncoding&&_.addGammaCorrectionPass(),y==="fxaa"?_.addFXAAPass():y==="smaa"&&_.addSMAAPass(),_.checkCopyPass(),this.event.on("passcheck",function(){_.checkCopyPass()})},i.initCSSRenderer=function(){var e=this.options,t=e.container,r=e.css2DRenderer,o=e.css3DRenderer,u=e.css2DRendererParams,a=e.css3DRendererParams;if(r||o){var h=new re(t);r&&h.addRenderer("css2d",u),o&&h.addRenderer("css3d",a),this.cssRendererController=h}},i.initControl=function(){var e=this.options,t=e.control,r=e.mapControl,o=e.controlParams;if(t){var u=new ge({camera:this.camera,controlParams:{domElement:(o==null?void 0:o.domElement)||this.renderer.domElement},mapControl:r});this.controlController=u}},i.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},i.handeleResize=function(e,t){var r=this,o=r.rendererController,u=r.cameraController,a=r.composerController,h=r.cssRendererController;u==null||u.setSize(e,t),o==null||o.setSize(e,t),a==null||a.setSize(e,t),h==null||h.setSize(e,t),this.installPlugins.forEach(function(w,P){var y;(y=P.resize)===null||y===void 0||y.call(P,{width:e,height:t})}),this.event.emit("resize",{width:e,height:t})},i.pick=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this,u=o.raycaster,a=o.options,h=a.container,w=new d.Vector2,P=h.getBoundingClientRect();if(w.x=(e.clientX-P.left)/(P.right-P.left)*2-1,w.y=-((e.clientY-P.top)/(P.bottom-P.top))*2+1,this.camera&&this.scene){u.setFromCamera(w,this.camera);var y=u.intersectObjects(t||this.scene.children,r);if(y.length)return{object:y[0].object,intersects:y}}},i.render=function(){var e,t,r,o,u=this,a=u.renderer,h=u.scene,w=u.camera,P=u.clock;if(!(!a||!h||!w||this.options.staticRender&&!this.cameraController.checkCameraChange())){var y=P.getDelta(),_=P.getElapsedTime();if(a.clear(),Y().update(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(L,Z){var I;(I=Z.update)===null||I===void 0||I.call(Z,y,_)}),!((t=this.composerController)===null||t===void 0)&&t.active)this.composerController.render();else{var M;(M=this.rendererController)===null||M===void 0||M.render()}(r=this.cssRendererController)===null||r===void 0||r.render(h,w),(o=this.stats)===null||o===void 0||o.update(),this.event.emit("render",{delta:y,elapsed:_})}},i.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},i.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},i.dispose=function(){var e,t,r,o,u,a,h;this.stop(),Y().removeAll(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(w,P){var y;(y=P.dispose)===null||y===void 0||y.call(P)}),(t=this.controlController)===null||t===void 0||t.dispose(),(r=this.cssRendererController)===null||r===void 0||r.dispose(),(o=this.sceneController)===null||o===void 0||o.dispose(),(u=this.composerController)===null||u===void 0||u.dispose(),(a=this.rendererController)===null||a===void 0||a.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(h=this.gui)===null||h===void 0||h.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},x(s,[{key:"renderer",get:function(){return this.rendererController.renderer}},{key:"control",get:function(){var e;return(e=this.controlController)===null||e===void 0?void 0:e.control}},{key:"camera",get:function(){return this.cameraController.camera}},{key:"scene",get:function(){return this.sceneController.scene}}]),s}();Ce.options={isdev:pe,stats:pe,gui:pe,axesHelper:pe,control:pe,renderer:E((0,G.Z)({},b),{antialias:Re?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:oe,camera:A,bloom:!1,bloomParams:$e,outline:!1,outlineParams:nt,css2DRenderer:!1,ssr:!1,ssrParams:lt,css2DRendererParams:(0,G.Z)({},J),css3DRenderer:!1,css3DRendererParams:(0,G.Z)({},J)};function ht(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(s){return!1}}function be(s,i,n){return ht()?be=Reflect.construct:be=function(t,r,o){var u=[null];u.push.apply(u,r);var a=Function.bind.apply(t,u),h=new a;return o&&Me(h,o.prototype),h},be.apply(null,arguments)}function Le(s,i,n){return be.apply(null,arguments)}var vt=K(484);function pt(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n={};return n.promise=new Promise(function(e,t){n.resolve=e,n.reject=t}),s&&(n.promise=(0,vt.Z)(n.promise,i)),n}var mt=require("three/examples/jsm/renderers/CSS2DRenderer"),Ae=function(s){s&&((0,F.disposeMesh)(s),s.children.forEach(function(i){i.userData.BaseObject_||Ae(i)}))},gt=function(){"use strict";function s(){R(this,s),this.objecttype__="BaseObject",this.userData={},this.pm=pt(),this.visible=!1}var i=s.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(e,t){},i.resize=function(e,t){},i.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},i.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},i.isVisible=function(){return this.visible},i.createMesh=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.object3d=Le(d.Mesh,X(t)),this},i.createGroup=function(){return this.object3d=new d.Group,this},i.createPoints=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.object3d=Le(d.Points,X(t)),this},i.createCSS2DObject=function(e){return this.object3d=new mt.CSS2DObject(e),this},i.createCSS3DObject=function(e){return this.object3d=new v.CSS3DObject(e),this},i.createCSS3DSprite=function(e){return this.object3d=new v.CSS3DSprite(e),this},i.createSprite=function(e){return this.object3d=new d.Sprite(e),this},i.add=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o;return(o=this.object3d).add.apply(o,X(t)),this},i.remove=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o;return(o=this.object3d).remove.apply(o,X(t)),this},i.getSize=function(){var e=new d.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new d.Vector3)}},i.traverse=function(e){e(this),this.children.forEach(function(t){t.traverse(e)})},i.dispose=function(){Ae(this.object3d)},x(s,[{key:"parent",get:function(){var e=this.object3d.parent;return(e==null?void 0:e.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(e){return e.userData.BaseObject_}).filter(function(e){return!!e})}}]),s}()})(),module.exports=Pe})();
|
package/dist/objects/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(){var Ae={666:function(S){var C=function(_){"use strict";var R=Object.prototype,A=R.hasOwnProperty,T,x=typeof Symbol=="function"?Symbol:{},z=x.iterator||"@@iterator",Z=x.asyncIterator||"@@asyncIterator",E=x.toStringTag||"@@toStringTag";function L(c,s,f){return Object.defineProperty(c,s,{value:f,enumerable:!0,configurable:!0,writable:!0}),c[s]}try{L({},"")}catch(c){L=function(s,f,d){return s[f]=d}}function $(c,s,f,d){var m=s&&s.prototype instanceof O?s:O,k=Object.create(m.prototype),Y=new de(d||[]);return k._invoke=J(c,f,Y),k}_.wrap=$;function H(c,s,f){try{return{type:"normal",arg:c.call(s,f)}}catch(d){return{type:"throw",arg:d}}}var G="suspendedStart",l="suspendedYield",ie="executing",U="completed",D={};function O(){}function V(){}function B(){}var q={};L(q,z,function(){return this});var ee=Object.getPrototypeOf,te=ee&&ee(ee(ce([])));te&&te!==R&&A.call(te,z)&&(q=te);var Q=B.prototype=O.prototype=Object.create(q);V.prototype=B,L(Q,"constructor",B),L(B,"constructor",V),V.displayName=L(B,E,"GeneratorFunction");function re(c){["next","throw","return"].forEach(function(s){L(c,s,function(f){return this._invoke(s,f)})})}_.isGeneratorFunction=function(c){var s=typeof c=="function"&&c.constructor;return s?s===V||(s.displayName||s.name)==="GeneratorFunction":!1},_.mark=function(c){return Object.setPrototypeOf?Object.setPrototypeOf(c,B):(c.__proto__=B,L(c,E,"GeneratorFunction")),c.prototype=Object.create(Q),c},_.awrap=function(c){return{__await:c}};function oe(c,s){function f(k,Y,K,X){var N=H(c[k],c,Y);if(N.type==="throw")X(N.arg);else{var me=N.arg,ue=me.value;return ue&&typeof ue=="object"&&A.call(ue,"__await")?s.resolve(ue.__await).then(function(ae){f("next",ae,K,X)},function(ae){f("throw",ae,K,X)}):s.resolve(ue).then(function(ae){me.value=ae,K(me)},function(ae){return f("throw",ae,K,X)})}}var d;function m(k,Y){function K(){return new s(function(X,N){f(k,Y,X,N)})}return d=d?d.then(K,K):K()}this._invoke=m}re(oe.prototype),L(oe.prototype,Z,function(){return this}),_.AsyncIterator=oe,_.async=function(c,s,f,d,m){m===void 0&&(m=Promise);var k=new oe($(c,s,f,d),m);return _.isGeneratorFunction(s)?k:k.next().then(function(Y){return Y.done?Y.value:k.next()})};function J(c,s,f){var d=G;return function(k,Y){if(d===ie)throw new Error("Generator is already running");if(d===U){if(k==="throw")throw Y;return ye()}for(f.method=k,f.arg=Y;;){var K=f.delegate;if(K){var X=se(K,f);if(X){if(X===D)continue;return X}}if(f.method==="next")f.sent=f._sent=f.arg;else if(f.method==="throw"){if(d===G)throw d=U,f.arg;f.dispatchException(f.arg)}else f.method==="return"&&f.abrupt("return",f.arg);d=ie;var N=H(c,s,f);if(N.type==="normal"){if(d=f.done?U:l,N.arg===D)continue;return{value:N.arg,done:f.done}}else N.type==="throw"&&(d=U,f.method="throw",f.arg=N.arg)}}}function se(c,s){var f=c.iterator[s.method];if(f===T){if(s.delegate=null,s.method==="throw"){if(c.iterator.return&&(s.method="return",s.arg=T,se(c,s),s.method==="throw"))return D;s.method="throw",s.arg=new TypeError("The iterator does not provide a 'throw' method")}return D}var d=H(f,c.iterator,s.arg);if(d.type==="throw")return s.method="throw",s.arg=d.arg,s.delegate=null,D;var m=d.arg;if(!m)return s.method="throw",s.arg=new TypeError("iterator result is not an object"),s.delegate=null,D;if(m.done)s[c.resultName]=m.value,s.next=c.nextLoc,s.method!=="return"&&(s.method="next",s.arg=T);else return m;return s.delegate=null,D}re(Q),L(Q,E,"Generator"),L(Q,z,function(){return this}),L(Q,"toString",function(){return"[object Generator]"});function pe(c){var s={tryLoc:c[0]};1 in c&&(s.catchLoc=c[1]),2 in c&&(s.finallyLoc=c[2],s.afterLoc=c[3]),this.tryEntries.push(s)}function ve(c){var s=c.completion||{};s.type="normal",delete s.arg,c.completion=s}function de(c){this.tryEntries=[{tryLoc:"root"}],c.forEach(pe,this),this.reset(!0)}_.keys=function(c){var s=[];for(var f in c)s.push(f);return s.reverse(),function d(){for(;s.length;){var m=s.pop();if(m in c)return d.value=m,d.done=!1,d}return d.done=!0,d}};function ce(c){if(c){var s=c[z];if(s)return s.call(c);if(typeof c.next=="function")return c;if(!isNaN(c.length)){var f=-1,d=function m(){for(;++f<c.length;)if(A.call(c,f))return m.value=c[f],m.done=!1,m;return m.value=T,m.done=!0,m};return d.next=d}}return{next:ye}}_.values=ce;function ye(){return{value:T,done:!0}}return de.prototype={constructor:de,reset:function(c){if(this.prev=0,this.next=0,this.sent=this._sent=T,this.done=!1,this.delegate=null,this.method="next",this.arg=T,this.tryEntries.forEach(ve),!c)for(var s in this)s.charAt(0)==="t"&&A.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=T)},stop:function(){this.done=!0;var c=this.tryEntries[0],s=c.completion;if(s.type==="throw")throw s.arg;return this.rval},dispatchException:function(c){if(this.done)throw c;var s=this;function f(X,N){return k.type="throw",k.arg=c,s.next=X,N&&(s.method="next",s.arg=T),!!N}for(var d=this.tryEntries.length-1;d>=0;--d){var m=this.tryEntries[d],k=m.completion;if(m.tryLoc==="root")return f("end");if(m.tryLoc<=this.prev){var Y=A.call(m,"catchLoc"),K=A.call(m,"finallyLoc");if(Y&&K){if(this.prev<m.catchLoc)return f(m.catchLoc,!0);if(this.prev<m.finallyLoc)return f(m.finallyLoc)}else if(Y){if(this.prev<m.catchLoc)return f(m.catchLoc,!0)}else if(K){if(this.prev<m.finallyLoc)return f(m.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(c,s){for(var f=this.tryEntries.length-1;f>=0;--f){var d=this.tryEntries[f];if(d.tryLoc<=this.prev&&A.call(d,"finallyLoc")&&this.prev<d.finallyLoc){var m=d;break}}m&&(c==="break"||c==="continue")&&m.tryLoc<=s&&s<=m.finallyLoc&&(m=null);var k=m?m.completion:{};return k.type=c,k.arg=s,m?(this.method="next",this.next=m.finallyLoc,D):this.complete(k)},complete:function(c,s){if(c.type==="throw")throw c.arg;return c.type==="break"||c.type==="continue"?this.next=c.arg:c.type==="return"?(this.rval=this.arg=c.arg,this.method="return",this.next="end"):c.type==="normal"&&s&&(this.next=s),D},finish:function(c){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.finallyLoc===c)return this.complete(f.completion,f.afterLoc),ve(f),D}},catch:function(c){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.tryLoc===c){var d=f.completion;if(d.type==="throw"){var m=d.arg;ve(f)}return m}}throw new Error("illegal catch attempt")},delegateYield:function(c,s,f){return this.delegate={iterator:ce(c),resultName:s,nextLoc:f},this.method==="next"&&(this.arg=T),D}},_}(S.exports);try{regeneratorRuntime=C}catch(_){typeof globalThis=="object"?globalThis.regeneratorRuntime=C:Function("r","regeneratorRuntime = r")(C)}},695:function(S,C,_){"use strict";_.d(C,{Z:function(){return R}});function R(A){if(A.geometry&&A.geometry.dispose(),A.material){var T=Array.isArray(A.material)?A.material:[A.material];T.forEach(function(x){var z,Z,E,L,$,H,G,l,ie,U,D,O,V;(z=x.map)===null||z===void 0||z.dispose(),(Z=x.lightMap)===null||Z===void 0||Z.dispose(),(E=x.bumpMap)===null||E===void 0||E.dispose(),(L=x.normalMap)===null||L===void 0||L.dispose(),($=x.specularMap)===null||$===void 0||$.dispose(),(H=x.envMap)===null||H===void 0||H.dispose(),(G=x.alphaMap)===null||G===void 0||G.dispose(),(l=x.aoMap)===null||l===void 0||l.dispose(),(ie=x.displacementMap)===null||ie===void 0||ie.dispose(),(U=x.emissiveMap)===null||U===void 0||U.dispose(),(D=x.gradientMap)===null||D===void 0||D.dispose(),(O=x.metalnessMap)===null||O===void 0||O.dispose(),(V=x.roughnessMap)===null||V===void 0||V.dispose(),x.dispose()})}}},519:function(S,C,_){"use strict";_.d(C,{disposeMesh:function(){return x.Z}});var R=_(666),A=_.n(R),T=null,x=_(695),z=_(644);function Z(U){if(U.material){var D=Array.isArray(U.material)?U.material:[U.material];D.forEach(function(O){var V,B;(V=O.color)===null||V===void 0||V.convertSRGBToLinear(),(B=O.emissive)===null||B===void 0||B.convertSRGBToLinear(),O.map&&(O.map.encoding=THREE.sRGBEncoding),O.emissiveMap&&(O.emissiveMap.encoding=THREE.sRGBEncoding)})}}var E=_(568),L=_(924),$=require("idb-keyval"),H=_(484),G=null,l=null,ie=function(){var U=(0,E.Z)(A().mark(function D(O,V){var B,q,ee,te,Q,re;return A().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return B=V.version,J.next=4,(0,$.get)(O);case 4:if(ee=J.sent,!(ee&&ee[B])){J.next=9;break}q=ee[B],J.next=15;break;case 9:return J.next=11,(0,H.Z)(fetch(O).then(function(se){if(se.ok)return se.blob();throw new Error}));case 11:te=J.sent,Q=te.res,re=te.err,re||(q=Q,(0,$.set)(O,(0,L.Z)({},B,Q)));case 15:return J.abrupt("return",q?{url:URL.createObjectURL(q)}:{url:O});case 16:case"end":return J.stop()}},D)}));return function(O,V){return U.apply(this,arguments)}}()},484:function(S,C,_){"use strict";_.d(C,{Z:function(){return A}});var R=_(42);function A(T){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return T.then(function(z){return(0,R.Z)({err:null,res:z},x)}).catch(function(z){return(0,R.Z)({err:z,res:void 0},x)})}},644:function(S){"use strict";S.exports=require("three")},568:function(S,C,_){"use strict";_.d(C,{Z:function(){return A}});function R(T,x,z,Z,E,L,$){try{var H=T[L]($),G=H.value}catch(l){z(l);return}H.done?x(G):Promise.resolve(G).then(Z,E)}function A(T){return function(){var x=this,z=arguments;return new Promise(function(Z,E){var L=T.apply(x,z);function $(G){R(L,Z,E,$,H,"next",G)}function H(G){R(L,Z,E,$,H,"throw",G)}$(void 0)})}}},924:function(S,C,_){"use strict";_.d(C,{Z:function(){return R}});function R(A,T,x){return T in A?Object.defineProperty(A,T,{value:x,enumerable:!0,configurable:!0,writable:!0}):A[T]=x,A}},42:function(S,C,_){"use strict";_.d(C,{Z:function(){return A}});var R=_(924);function A(T){for(var x=1;x<arguments.length;x++){var z=arguments[x]!=null?arguments[x]:{},Z=Object.keys(z);typeof Object.getOwnPropertySymbols=="function"&&(Z=Z.concat(Object.getOwnPropertySymbols(z).filter(function(E){return Object.getOwnPropertyDescriptor(z,E).enumerable}))),Z.forEach(function(E){(0,R.Z)(T,E,z[E])})}return T}}},xe={};function I(S){var C=xe[S];if(C!==void 0)return C.exports;var _=xe[S]={exports:{}};return Ae[S](_,_.exports,I),_.exports}(function(){I.n=function(S){var C=S&&S.__esModule?function(){return S.default}:function(){return S};return I.d(C,{a:C}),C}})(),function(){I.d=function(S,C){for(var _ in C)I.o(C,_)&&!I.o(S,_)&&Object.defineProperty(S,_,{enumerable:!0,get:C[_]})}}(),function(){I.o=function(S,C){return Object.prototype.hasOwnProperty.call(S,C)}}(),function(){I.r=function(S){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(S,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(S,"__esModule",{value:!0})}}();var be={};(function(){"use strict";I.r(be),I.d(be,{Image:function(){return Y},Line:function(){return Le},MeshLine:function(){return ne},MeshLineMaterial:function(){return we},MeshLineRaycast:function(){return Se},Node:function(){return ae},Text:function(){return f},Video:function(){return me}});function S(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}function C(t,a){return C=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},C(t,a)}function _(t,a){return C(t,a)}function R(t,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(a&&a.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),a&&_(t,a)}var A=I(42);function T(t,a){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);a&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function x(t,a){return a=a!=null?a:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):T(Object(a)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))}),t}function z(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function Z(t){return Z=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Z(t)}function E(t){return Z(t)}function L(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $(t){return t&&t.constructor===Symbol?"symbol":typeof t}function H(t,a){return a&&($(a)==="object"||typeof a=="function")?a:L(t)}function G(t){var a=z();return function(){var n=E(t),i;if(a){var e=E(this).constructor;i=Reflect.construct(n,arguments,e)}else i=n.apply(this,arguments);return H(this,i)}}var l=I(644);function ie(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}function U(t,a,r){return ie()?U=Reflect.construct:U=function(i,e,o){var u=[null];u.push.apply(u,e);var h=Function.bind.apply(i,u),p=new h;return o&&_(p,o.prototype),p},U.apply(null,arguments)}function D(t,a,r){return U.apply(null,arguments)}function O(t,a){for(var r=0;r<a.length;r++){var n=a[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function V(t,a,r){return a&&O(t.prototype,a),r&&O(t,r),t}function B(t,a){(a==null||a>t.length)&&(a=t.length);for(var r=0,n=new Array(a);r<a;r++)n[r]=t[r];return n}function q(t){if(Array.isArray(t))return B(t)}function ee(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function te(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Q(t,a){if(!!t){if(typeof t=="string")return B(t,a);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return B(t,a)}}function re(t){return q(t)||ee(t)||Q(t)||te()}var oe=I(484);function J(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(n,i){r.resolve=n,r.reject=i}),t&&(r.promise=(0,oe.Z)(r.promise,a)),r}var se=require("@tweenjs/tween.js"),pe=I.n(se),ve=function(){"use strict";function t(){S(this,t),this.guiParams={}}var a=t.prototype;return a.showGuiParams=function(n){var i=this;!n||Object.keys(this.guiParams).forEach(function(e){var o=n.addFolder(e),u=i.guiParams[e];Object.keys(u).forEach(function(h){var p=u[h],y=p.min,g=p.max,b=p.step,P=p.name,w=p.to,M=p.paramMap,v=p.items,F=p.value,W=p.target,ge=h.toLowerCase().indexOf("color")>-1,j,le=typeof F=="undefined"&&W,he=le?W():u[h],fe=le?h:"value";v?j=o.add(he,fe,v):ge?j=o.addColor(he,fe):j=o.add(he,fe),j=j.name(P||h),typeof y!="undefined"&&(j=j.min(y)),typeof g!="undefined"&&(j=j.max(g)),typeof b!="undefined"&&(j=j.step(b)),j=j.onChange(function(){i.setGuiTargetValue(e,h,he[fe],M)}),(w||le)&&j.listen()})})},a.setGuiTargetValue=function(n,i,e,o){var u=this.guiParams[n][i],h=u.onChange,p=u.target,y=u.value,g=i.toLowerCase().indexOf("color")>-1,b=typeof y=="undefined"&&p;if(p&&!b){var P=p();Array.isArray(P)||(P=[P]),P.forEach(function(w){if(!!w)if(g)try{w[o||i].set(e)}catch(M){i!=="color"&&!o&&console.warn("".concat(i," is not a color,set paramMap"))}else w[o||i]=e})}h&&h(e)},a.setGuiTargetValueByParams=function(){var n=this;Object.keys(this.guiParams).forEach(function(i){Object.keys(n.guiParams[i]).forEach(function(e){var o=n.guiParams[i][e];typeof o.value!="undefined"&&n.setGuiTargetValue(i,e,o.value,o.paramMap)})})},a.guiParamTween=function(n,i,e){var o=e.duration,u=o===void 0?0:o,h=this,p=this.guiParams[n][i],y=p.to,g=p.paramMap,b=g===void 0?"":g;return new(pe()).Tween(this.guiParams[n][i]).to({value:y},u).onUpdate(function(P){h.setGuiTargetValue(n,i,P.value,b)})},t}(),de=require("three/examples/jsm/renderers/CSS2DRenderer"),ce=require("three/examples/jsm/renderers/CSS3DRenderer"),ye=I(519),c=function(t){t&&((0,ye.disposeMesh)(t),t.children.forEach(function(a){a.userData.BaseObject_||c(a)}))},s=function(t){"use strict";R(r,t);var a=G(r);function r(i){S(this,r);var e;return e=a.call(this),e.objecttype__="BaseObject",e.userData={},e.pm=J(),e.visible=!1,e}var n=r.prototype;return n.init=function(){},n.create=function(){},n.render=function(){},n.update=function(e,o){},n.resize=function(e,o){},n.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},n.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},n.isVisible=function(){return this.visible},n.createMesh=function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];return this.object3d=D(l.Mesh,re(o)),this},n.createGroup=function(){return this.object3d=new l.Group,this},n.createPoints=function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];return this.object3d=D(l.Points,re(o)),this},n.createCSS2DObject=function(e){return this.object3d=new de.CSS2DObject(e),this},n.createCSS3DObject=function(e){return this.object3d=new ce.CSS3DObject(e),this},n.createCSS3DSprite=function(e){return this.object3d=new ce.CSS3DSprite(e),this},n.createSprite=function(e){return this.object3d=new l.Sprite(e),this},n.add=function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];var h;return(h=this.object3d).add.apply(h,re(o)),this},n.remove=function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];var h;return(h=this.object3d).remove.apply(h,re(o)),this},n.getSize=function(){var e=new l.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new l.Vector3)}},n.traverse=function(e){e(this),this.children.forEach(function(o){o.traverse(e)})},n.dispose=function(){c(this.object3d)},V(r,[{key:"parent",get:function(){var e=this.object3d.parent;return(e==null?void 0:e.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(e){return e.userData.BaseObject_}).filter(function(e){return!!e})}}]),r}(ve),f=function(t){"use strict";R(r,t);var a=G(r);function r(i){S(this,r);var e;return e=a.call(this),e.width=0,e.options=(0,A.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},i),e}var n=r.prototype;return n.init=function(){var e=document.createElement("canvas");this.canvas=e},n.create=function(){var e=this.options,o=e.position,u=e.lookAt,h=e.sprite,p=e.text,y=e.sizeAttenuation;if(h){var g=new l.Sprite(new l.SpriteMaterial({transparent:!0,sizeAttenuation:y}));this.object3d=g}else{var b=new l.MeshBasicMaterial({side:l.DoubleSide,transparent:!0}),P=new l.PlaneGeometry(1,1,1,1);this.createMesh(P,b)}this.object3d.position.copy(o),u&&this.object3d.lookAt(u),this.setText(p)},n.setText=function(e,o){var u=(0,A.Z)(x((0,A.Z)({},this.options),{text:e}),o||{}),h=u.text,p=u.fontSize,y=u.fontFamily,g=u.fontWeight,b=u.flipX,P=u.scale,w=this.canvas;w.width=p*h.length*2,w.height=p;var M=w.getContext("2d");M.font="".concat(g," ").concat(p,"px/1 ").concat(y);var v=M.measureText(h).width;w.width=v,this.width=v,M=w.getContext("2d"),M.clearRect(0,0,w.width,w.height),b&&M.scale(-1,1),M.font="".concat(g," ").concat(p,"px/1 ").concat(y),M.textBaseline="middle",M.fillStyle="#ffffff",M.fillText(h,b?v*-1:0,w.height/2),M.restore();var F=new l.Texture(w);F.anisotropy=16,F.needsUpdate=!0;var W=this.object3d;W.material.map&&W.material.map.dispose(),W.material.map=F,W.material.needsUpdate=!0,W.scale.set(F.image.width*P,F.image.height*P,1)},r}(s),d=I(568),m=I(666),k=I.n(m),Y=function(t){"use strict";R(r,t);var a=G(r);function r(i){S(this,r);var e;return e=a.call(this),e.options=i,e}var n=r.prototype;return n.getMaterial=function(){var e=this;return(0,d.Z)(k().mark(function o(){var u,h,p,y,g,b,P,w,M,v;return k().wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return u=e.options,h=u.transparent,p=u.blending,y=u.src,g=u.depthWrite,b=u.alphaTest,P=u.sprite,w=u.sizeAttenuation,W.next=3,new l.TextureLoader().loadAsync(y);case 3:return M=W.sent,v=P?new l.SpriteMaterial({map:M,transparent:h!=null?h:!1,blending:p!=null?p:l.NormalBlending,depthWrite:g!=null?g:!0,alphaTest:b!=null?b:0,sizeAttenuation:w!=null?w:!0}):new l.MeshBasicMaterial({map:M,transparent:h!=null?h:!1,blending:p!=null?p:l.NormalBlending,depthWrite:g!=null?g:!0,alphaTest:b!=null?b:0}),W.abrupt("return",v);case 6:case"end":return W.stop()}},o)}))()},n.create=function(){var e=this;return(0,d.Z)(k().mark(function o(){var u,h,p,y,g,b,P,w;return k().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(u=e.options,h=u.scale,p=u.position,y=u.src,g=u.cache,b=u.sprite,!(g&&!g.get(y))){v.next=7;break}return g.init(y),v.next=5,e.getMaterial();case 5:P=v.sent,g.set(y,P);case 7:if(!g){v.next=13;break}return v.next=10,g.get(y);case 10:v.t0=v.sent,v.next=16;break;case 13:return v.next=15,e.getMaterial();case 15:v.t0=v.sent;case 16:w=v.t0,e.texture=w.map,b?e.createSprite(w):e.createMesh(new l.PlaneBufferGeometry(1,1),w),h&&e.object3d.scale.set(w.map.image.width*h,w.map.image.height*h,1),p&&e.object3d.position.copy(p);case 21:case"end":return v.stop()}},o)}))()},r}(s);function K(t,a){for(;!Object.prototype.hasOwnProperty.call(t,a)&&(t=E(t),t!==null););return t}function X(t,a,r){return typeof Reflect!="undefined"&&Reflect.get?X=Reflect.get:X=function(i,e,o){var u=K(i,e);if(!!u){var h=Object.getOwnPropertyDescriptor(u,e);return h.get?h.get.call(o||i):h.value}},X(t,a,r)}function N(t,a,r){return X(t,a,r)}var me=function(t){"use strict";R(r,t);var a=G(r);function r(i){S(this,r);var e;return e=a.call(this),e.options=(0,A.Z)({},{autoPlay:!0,loop:!0},i),e}var n=r.prototype;return n.getMaterial=function(){var e=this.options,o=e.src,u=e.transparent,h=e.blending,p=e.depthWrite,y=e.format,g=e.autoPlay,b=e.loop,P=e.alphaTest,w=e.sprite,M=J(),v=document.createElement("video");return v.addEventListener("loadedmetadata",function(){var F=new l.VideoTexture(v);F.format=y!=null?y:l.RGBAFormat,F.needsUpdate=!0;var W=w?new l.SpriteMaterial({map:F,transparent:u!=null?u:!1,blending:h!=null?h:l.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:P!=null?P:0}):new l.MeshBasicMaterial({map:F,transparent:u!=null?u:!1,blending:h!=null?h:l.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:P!=null?P:0});M.resolve(W)},!1),v.src=o,v.muted=!0,v.autoplay=g,v.loop=b,v.preload="auto",M.promise},n.create=function(){var e=this;return(0,d.Z)(k().mark(function o(){var u,h,p,y,g,b,P,w;return k().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(u=e.options,h=u.scale,p=u.position,y=u.src,g=u.cache,b=u.sprite,!(g&&!g.get(y))){v.next=7;break}return g.init(y),v.next=5,e.getMaterial();case 5:P=v.sent,g.set(y,P);case 7:if(!g){v.next=13;break}return v.next=10,g.get(y);case 10:v.t0=v.sent,v.next=16;break;case 13:return v.next=15,e.getMaterial();case 15:v.t0=v.sent;case 16:w=v.t0,e.video=w.map.image,b?e.createSprite(w):e.createMesh(new l.PlaneBufferGeometry(1,1),w),h&&e.object3d.scale.set(e.video.videoWidth*h,e.video.videoHeight*h,1),p&&e.object3d.position.copy(p);case 21:case"end":return v.stop()}},o)}))()},n.render=function(){var e=this.options.autoPlay;e&&this.video.play()},n.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),N(E(r.prototype),"dispose",this).call(this)},r}(s),ue=function(t){"use strict";R(r,t);var a=G(r);function r(i){S(this,r);var e;return e=a.call(this),e.options=(0,A.Z)({},i),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,u=e.children,h=e.onClick,p=e.zIndexFix,y=document.createElement("div");y.appendChild(u),this.createCSS2DObject(y),o&&this.object3d.position.copy(o),h&&y.addEventListener("click",h),p&&(this.object3d.userData.zIndexFix=p)},n.getMaterial=function(e){return(0,d.Z)(k().mark(function o(){var u,h,p,y;return k().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return u=document.createElement("canvas"),u.width=256,u.height=256,h=u.getContext("2d"),h.fillStyle="#ff0000",h.fillRect(0,0,256,256),p=new l.CanvasTexture(u),y=new l.SpriteMaterial({map:p,opacity:e?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),b.abrupt("return",y);case 9:case"end":return b.stop()}},o)}))()},n.createPickObject=function(e){var o=e.show,u=o===void 0?!1:o,h=e.scale,p=h===void 0?new l.Vector3(1,1,1):h,y=e.position,g=y===void 0?new l.Vector3(0,0,0):y,b=e.cache,P=this;return(0,d.Z)(k().mark(function w(){var M,v,F,W;return k().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:if(M="node-create-pick-object",!(b&&!b.get(M))){j.next=7;break}return b.init(M),j.next=5,P.getMaterial(u);case 5:v=j.sent,b.set(M,v);case 7:if(!b){j.next=13;break}return j.next=10,b.get(M);case 10:j.t0=j.sent,j.next=16;break;case 13:return j.next=15,P.getMaterial(u);case 15:j.t0=j.sent;case 16:F=j.t0,W=new l.Sprite(F),W.scale.set(F.map.image.width*p.x,F.map.image.height*p.y,1),W.position.copy(g),P.add(W),P.pickObject=W;case 22:case"end":return j.stop()}},w)}))()},n.dispose=function(){var e=this.options.onClick;if(e){var o;(o=this.object3d.element)===null||o===void 0||o.removeEventListener("click",e)}N(E(r.prototype),"dispose",this).call(this)},r}(s),ae=ue,Me=`
|
|
2
|
-
`.concat(
|
|
3
|
-
`).concat(
|
|
1
|
+
(function(){var Ae={666:function(A){var P=function(y){"use strict";var R=Object.prototype,S=R.hasOwnProperty,j,_=typeof Symbol=="function"?Symbol:{},E=_.iterator||"@@iterator",F=_.asyncIterator||"@@asyncIterator",L=_.toStringTag||"@@toStringTag";function k(s,o,l){return Object.defineProperty(s,o,{value:l,enumerable:!0,configurable:!0,writable:!0}),s[o]}try{k({},"")}catch(s){k=function(o,l,m){return o[l]=m}}function $(s,o,l,m){var v=o&&o.prototype instanceof M?o:M,T=Object.create(v.prototype),N=new ce(m||[]);return T._invoke=J(s,l,N),T}y.wrap=$;function H(s,o,l){try{return{type:"normal",arg:s.call(o,l)}}catch(m){return{type:"throw",arg:m}}}var B="suspendedStart",c="suspendedYield",ie="executing",V="completed",W={};function M(){}function D(){}function z(){}var ee={};k(ee,E,function(){return this});var te=Object.getPrototypeOf,re=te&&te(te(ae([])));re&&re!==R&&S.call(re,E)&&(ee=re);var q=z.prototype=M.prototype=Object.create(ee);D.prototype=z,k(q,"constructor",z),k(z,"constructor",D),D.displayName=k(z,L,"GeneratorFunction");function ne(s){["next","throw","return"].forEach(function(o){k(s,o,function(l){return this._invoke(o,l)})})}y.isGeneratorFunction=function(s){var o=typeof s=="function"&&s.constructor;return o?o===D||(o.displayName||o.name)==="GeneratorFunction":!1},y.mark=function(s){return Object.setPrototypeOf?Object.setPrototypeOf(s,z):(s.__proto__=z,k(s,L,"GeneratorFunction")),s.prototype=Object.create(q),s},y.awrap=function(s){return{__await:s}};function oe(s,o){function l(T,N,Y,Q){var K=H(s[T],s,N);if(K.type==="throw")Q(K.arg);else{var he=K.arg,ue=he.value;return ue&&typeof ue=="object"&&S.call(ue,"__await")?o.resolve(ue.__await).then(function(I){l("next",I,Y,Q)},function(I){l("throw",I,Y,Q)}):o.resolve(ue).then(function(I){he.value=I,Y(he)},function(I){return l("throw",I,Y,Q)})}}var m;function v(T,N){function Y(){return new o(function(Q,K){l(T,N,Q,K)})}return m=m?m.then(Y,Y):Y()}this._invoke=v}ne(oe.prototype),k(oe.prototype,F,function(){return this}),y.AsyncIterator=oe,y.async=function(s,o,l,m,v){v===void 0&&(v=Promise);var T=new oe($(s,o,l,m),v);return y.isGeneratorFunction(o)?T:T.next().then(function(N){return N.done?N.value:T.next()})};function J(s,o,l){var m=B;return function(T,N){if(m===ie)throw new Error("Generator is already running");if(m===V){if(T==="throw")throw N;return pe()}for(l.method=T,l.arg=N;;){var Y=l.delegate;if(Y){var Q=se(Y,l);if(Q){if(Q===W)continue;return Q}}if(l.method==="next")l.sent=l._sent=l.arg;else if(l.method==="throw"){if(m===B)throw m=V,l.arg;l.dispatchException(l.arg)}else l.method==="return"&&l.abrupt("return",l.arg);m=ie;var K=H(s,o,l);if(K.type==="normal"){if(m=l.done?V:c,K.arg===W)continue;return{value:K.arg,done:l.done}}else K.type==="throw"&&(m=V,l.method="throw",l.arg=K.arg)}}}function se(s,o){var l=s.iterator[o.method];if(l===j){if(o.delegate=null,o.method==="throw"){if(s.iterator.return&&(o.method="return",o.arg=j,se(s,o),o.method==="throw"))return W;o.method="throw",o.arg=new TypeError("The iterator does not provide a 'throw' method")}return W}var m=H(l,s.iterator,o.arg);if(m.type==="throw")return o.method="throw",o.arg=m.arg,o.delegate=null,W;var v=m.arg;if(!v)return o.method="throw",o.arg=new TypeError("iterator result is not an object"),o.delegate=null,W;if(v.done)o[s.resultName]=v.value,o.next=s.nextLoc,o.method!=="return"&&(o.method="next",o.arg=j);else return v;return o.delegate=null,W}ne(q),k(q,L,"Generator"),k(q,E,function(){return this}),k(q,"toString",function(){return"[object Generator]"});function fe(s){var o={tryLoc:s[0]};1 in s&&(o.catchLoc=s[1]),2 in s&&(o.finallyLoc=s[2],o.afterLoc=s[3]),this.tryEntries.push(o)}function le(s){var o=s.completion||{};o.type="normal",delete o.arg,s.completion=o}function ce(s){this.tryEntries=[{tryLoc:"root"}],s.forEach(fe,this),this.reset(!0)}y.keys=function(s){var o=[];for(var l in s)o.push(l);return o.reverse(),function m(){for(;o.length;){var v=o.pop();if(v in s)return m.value=v,m.done=!1,m}return m.done=!0,m}};function ae(s){if(s){var o=s[E];if(o)return o.call(s);if(typeof s.next=="function")return s;if(!isNaN(s.length)){var l=-1,m=function v(){for(;++l<s.length;)if(S.call(s,l))return v.value=s[l],v.done=!1,v;return v.value=j,v.done=!0,v};return m.next=m}}return{next:pe}}y.values=ae;function pe(){return{value:j,done:!0}}return ce.prototype={constructor:ce,reset:function(s){if(this.prev=0,this.next=0,this.sent=this._sent=j,this.done=!1,this.delegate=null,this.method="next",this.arg=j,this.tryEntries.forEach(le),!s)for(var o in this)o.charAt(0)==="t"&&S.call(this,o)&&!isNaN(+o.slice(1))&&(this[o]=j)},stop:function(){this.done=!0;var s=this.tryEntries[0],o=s.completion;if(o.type==="throw")throw o.arg;return this.rval},dispatchException:function(s){if(this.done)throw s;var o=this;function l(Q,K){return T.type="throw",T.arg=s,o.next=Q,K&&(o.method="next",o.arg=j),!!K}for(var m=this.tryEntries.length-1;m>=0;--m){var v=this.tryEntries[m],T=v.completion;if(v.tryLoc==="root")return l("end");if(v.tryLoc<=this.prev){var N=S.call(v,"catchLoc"),Y=S.call(v,"finallyLoc");if(N&&Y){if(this.prev<v.catchLoc)return l(v.catchLoc,!0);if(this.prev<v.finallyLoc)return l(v.finallyLoc)}else if(N){if(this.prev<v.catchLoc)return l(v.catchLoc,!0)}else if(Y){if(this.prev<v.finallyLoc)return l(v.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(s,o){for(var l=this.tryEntries.length-1;l>=0;--l){var m=this.tryEntries[l];if(m.tryLoc<=this.prev&&S.call(m,"finallyLoc")&&this.prev<m.finallyLoc){var v=m;break}}v&&(s==="break"||s==="continue")&&v.tryLoc<=o&&o<=v.finallyLoc&&(v=null);var T=v?v.completion:{};return T.type=s,T.arg=o,v?(this.method="next",this.next=v.finallyLoc,W):this.complete(T)},complete:function(s,o){if(s.type==="throw")throw s.arg;return s.type==="break"||s.type==="continue"?this.next=s.arg:s.type==="return"?(this.rval=this.arg=s.arg,this.method="return",this.next="end"):s.type==="normal"&&o&&(this.next=o),W},finish:function(s){for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o];if(l.finallyLoc===s)return this.complete(l.completion,l.afterLoc),le(l),W}},catch:function(s){for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o];if(l.tryLoc===s){var m=l.completion;if(m.type==="throw"){var v=m.arg;le(l)}return v}}throw new Error("illegal catch attempt")},delegateYield:function(s,o,l){return this.delegate={iterator:ae(s),resultName:o,nextLoc:l},this.method==="next"&&(this.arg=j),W}},y}(A.exports);try{regeneratorRuntime=P}catch(y){typeof globalThis=="object"?globalThis.regeneratorRuntime=P:Function("r","regeneratorRuntime = r")(P)}},695:function(A,P,y){"use strict";y.d(P,{Z:function(){return R}});function R(S){if(S.geometry&&S.geometry.dispose(),S.material){var j=Array.isArray(S.material)?S.material:[S.material];j.forEach(function(_){var E,F,L,k,$,H,B,c,ie,V,W,M,D;(E=_.map)===null||E===void 0||E.dispose(),(F=_.lightMap)===null||F===void 0||F.dispose(),(L=_.bumpMap)===null||L===void 0||L.dispose(),(k=_.normalMap)===null||k===void 0||k.dispose(),($=_.specularMap)===null||$===void 0||$.dispose(),(H=_.envMap)===null||H===void 0||H.dispose(),(B=_.alphaMap)===null||B===void 0||B.dispose(),(c=_.aoMap)===null||c===void 0||c.dispose(),(ie=_.displacementMap)===null||ie===void 0||ie.dispose(),(V=_.emissiveMap)===null||V===void 0||V.dispose(),(W=_.gradientMap)===null||W===void 0||W.dispose(),(M=_.metalnessMap)===null||M===void 0||M.dispose(),(D=_.roughnessMap)===null||D===void 0||D.dispose(),_.dispose()})}}},519:function(A,P,y){"use strict";y.d(P,{disposeMesh:function(){return _.Z}});var R=y(666),S=y.n(R),j=null,_=y(695),E=y(644);function F(V){if(V.material){var W=Array.isArray(V.material)?V.material:[V.material];W.forEach(function(M){var D,z;(D=M.color)===null||D===void 0||D.convertSRGBToLinear(),(z=M.emissive)===null||z===void 0||z.convertSRGBToLinear(),M.map&&(M.map.encoding=THREE.sRGBEncoding),M.emissiveMap&&(M.emissiveMap.encoding=THREE.sRGBEncoding)})}}var L=y(568),k=y(924),$=require("idb-keyval"),H=y(484),B=null,c=null,ie=function(){var V=(0,L.Z)(S().mark(function W(M,D){var z,ee,te,re,q,ne;return S().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return z=D.version,J.next=4,(0,$.get)(M);case 4:if(te=J.sent,!(te&&te[z])){J.next=9;break}ee=te[z],J.next=15;break;case 9:return J.next=11,(0,H.Z)(fetch(M).then(function(se){if(se.ok)return se.blob();throw new Error}));case 11:re=J.sent,q=re.res,ne=re.err,ne||(ee=q,(0,$.set)(M,(0,k.Z)({},z,q)));case 15:return J.abrupt("return",ee?{url:URL.createObjectURL(ee)}:{url:M});case 16:case"end":return J.stop()}},W)}));return function(M,D){return V.apply(this,arguments)}}()},484:function(A,P,y){"use strict";y.d(P,{Z:function(){return S}});var R=y(42);function S(j){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return j.then(function(E){return(0,R.Z)({err:null,res:E},_)}).catch(function(E){return(0,R.Z)({err:E,res:void 0},_)})}},644:function(A){"use strict";A.exports=require("three")},568:function(A,P,y){"use strict";y.d(P,{Z:function(){return S}});function R(j,_,E,F,L,k,$){try{var H=j[k]($),B=H.value}catch(c){E(c);return}H.done?_(B):Promise.resolve(B).then(F,L)}function S(j){return function(){var _=this,E=arguments;return new Promise(function(F,L){var k=j.apply(_,E);function $(B){R(k,F,L,$,H,"next",B)}function H(B){R(k,F,L,$,H,"throw",B)}$(void 0)})}}},924:function(A,P,y){"use strict";y.d(P,{Z:function(){return R}});function R(S,j,_){return j in S?Object.defineProperty(S,j,{value:_,enumerable:!0,configurable:!0,writable:!0}):S[j]=_,S}},42:function(A,P,y){"use strict";y.d(P,{Z:function(){return S}});var R=y(924);function S(j){for(var _=1;_<arguments.length;_++){var E=arguments[_]!=null?arguments[_]:{},F=Object.keys(E);typeof Object.getOwnPropertySymbols=="function"&&(F=F.concat(Object.getOwnPropertySymbols(E).filter(function(L){return Object.getOwnPropertyDescriptor(E,L).enumerable}))),F.forEach(function(L){(0,R.Z)(j,L,E[L])})}return j}}},ge={};function Z(A){var P=ge[A];if(P!==void 0)return P.exports;var y=ge[A]={exports:{}};return Ae[A](y,y.exports,Z),y.exports}(function(){Z.n=function(A){var P=A&&A.__esModule?function(){return A.default}:function(){return A};return Z.d(P,{a:P}),P}})(),function(){Z.d=function(A,P){for(var y in P)Z.o(P,y)&&!Z.o(A,y)&&Object.defineProperty(A,y,{enumerable:!0,get:P[y]})}}(),function(){Z.o=function(A,P){return Object.prototype.hasOwnProperty.call(A,P)}}(),function(){Z.r=function(A){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})}}();var ve={};(function(){"use strict";Z.r(ve),Z.d(ve,{Image:function(){return m},Line:function(){return Ce},MeshLine:function(){return I},MeshLineMaterial:function(){return me},MeshLineRaycast:function(){return be},Node:function(){return K},Text:function(){return pe},Video:function(){return Y}});function A(e,i){if(!(e instanceof i))throw new TypeError("Cannot call a class as a function")}function P(e,i){return P=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},P(e,i)}function y(e,i){return P(e,i)}function R(e,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),i&&y(e,i)}var S=Z(42);function j(e,i){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);i&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function _(e,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):j(Object(i)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(i,r))}),e}function E(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function F(e){return F=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},F(e)}function L(e){return F(e)}function k(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $(e){return e&&e.constructor===Symbol?"symbol":typeof e}function H(e,i){return i&&($(i)==="object"||typeof i=="function")?i:k(e)}function B(e){var i=E();return function(){var n=L(e),a;if(i){var t=L(this).constructor;a=Reflect.construct(n,arguments,t)}else a=n.apply(this,arguments);return H(this,a)}}var c=Z(644);function ie(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function V(e,i,r){return ie()?V=Reflect.construct:V=function(a,t,u){var h=[null];h.push.apply(h,t);var p=Function.bind.apply(a,h),d=new p;return u&&y(d,u.prototype),d},V.apply(null,arguments)}function W(e,i,r){return V.apply(null,arguments)}function M(e,i){for(var r=0;r<i.length;r++){var n=i[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function D(e,i,r){return i&&M(e.prototype,i),r&&M(e,r),e}function z(e,i){(i==null||i>e.length)&&(i=e.length);for(var r=0,n=new Array(i);r<i;r++)n[r]=e[r];return n}function ee(e){if(Array.isArray(e))return z(e)}function te(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function re(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function q(e,i){if(!!e){if(typeof e=="string")return z(e,i);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return z(e,i)}}function ne(e){return ee(e)||te(e)||q(e)||re()}var oe=Z(484);function J(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(n,a){r.resolve=n,r.reject=a}),e&&(r.promise=(0,oe.Z)(r.promise,i)),r}var se=require("three/examples/jsm/renderers/CSS2DRenderer"),fe=require("three/examples/jsm/renderers/CSS3DRenderer"),le=Z(519),ce=function(e){e&&((0,le.disposeMesh)(e),e.children.forEach(function(i){i.userData.BaseObject_||ce(i)}))},ae=function(){"use strict";function e(){A(this,e),this.objecttype__="BaseObject",this.userData={},this.pm=J(),this.visible=!1}var i=e.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(n,a){},i.resize=function(n,a){},i.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},i.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},i.isVisible=function(){return this.visible},i.createMesh=function(){for(var n=arguments.length,a=new Array(n),t=0;t<n;t++)a[t]=arguments[t];return this.object3d=W(c.Mesh,ne(a)),this},i.createGroup=function(){return this.object3d=new c.Group,this},i.createPoints=function(){for(var n=arguments.length,a=new Array(n),t=0;t<n;t++)a[t]=arguments[t];return this.object3d=W(c.Points,ne(a)),this},i.createCSS2DObject=function(n){return this.object3d=new se.CSS2DObject(n),this},i.createCSS3DObject=function(n){return this.object3d=new fe.CSS3DObject(n),this},i.createCSS3DSprite=function(n){return this.object3d=new fe.CSS3DSprite(n),this},i.createSprite=function(n){return this.object3d=new c.Sprite(n),this},i.add=function(){for(var n=arguments.length,a=new Array(n),t=0;t<n;t++)a[t]=arguments[t];var u;return(u=this.object3d).add.apply(u,ne(a)),this},i.remove=function(){for(var n=arguments.length,a=new Array(n),t=0;t<n;t++)a[t]=arguments[t];var u;return(u=this.object3d).remove.apply(u,ne(a)),this},i.getSize=function(){var n=new c.Box3().setFromObject(this.object3d);return{min:n.min,max:n.max,size:n.getSize(new c.Vector3)}},i.traverse=function(n){n(this),this.children.forEach(function(a){a.traverse(n)})},i.dispose=function(){ce(this.object3d)},D(e,[{key:"parent",get:function(){var n=this.object3d.parent;return(n==null?void 0:n.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(n){return n.userData.BaseObject_}).filter(function(n){return!!n})}}]),e}(),pe=function(e){"use strict";R(r,e);var i=B(r);function r(a){A(this,r);var t;return t=i.call(this),t.width=0,t.canvas=document.createElement("canvas"),t.options=(0,S.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},a),t}var n=r.prototype;return n.create=function(){var t=this.options,u=t.position,h=t.lookAt,p=t.sprite,d=t.text,g=t.sizeAttenuation;if(p){var b=new c.Sprite(new c.SpriteMaterial({transparent:!0,sizeAttenuation:g}));this.object3d=b}else{var w=new c.MeshBasicMaterial({side:c.DoubleSide,transparent:!0}),O=new c.PlaneGeometry(1,1,1,1);this.createMesh(O,w)}this.object3d.position.copy(u),h&&this.object3d.lookAt(h),this.setText(d)},n.setText=function(t,u){var h=(0,S.Z)(_((0,S.Z)({},this.options),{text:t}),u||{}),p=h.text,d=h.fontSize,g=h.fontFamily,b=h.fontWeight,w=h.flipX,O=h.scale,x=this.canvas;x.width=d*p.length*2,x.height=d;var C=x.getContext("2d");C.font="".concat(b," ").concat(d,"px/1 ").concat(g);var f=C.measureText(p).width;x.width=f,this.width=f,C=x.getContext("2d"),C.clearRect(0,0,x.width,x.height),w&&C.scale(-1,1),C.font="".concat(b," ").concat(d,"px/1 ").concat(g),C.textBaseline="middle",C.fillStyle="#ffffff",C.fillText(p,w?f*-1:0,x.height/2),C.restore();var U=new c.Texture(x);U.anisotropy=16,U.needsUpdate=!0;var G=this.object3d;G.material.map&&G.material.map.dispose(),G.material.map=U,G.material.needsUpdate=!0,G.scale.set(U.image.width*O,U.image.height*O,1)},r}(ae),s=Z(568),o=Z(666),l=Z.n(o),m=function(e){"use strict";R(r,e);var i=B(r);function r(a){A(this,r);var t;return t=i.call(this),t.options=a,t}var n=r.prototype;return n.getMaterial=function(){var t=this;return(0,s.Z)(l().mark(function u(){var h,p,d,g,b,w,O,x,C,f;return l().wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return h=t.options,p=h.transparent,d=h.blending,g=h.src,b=h.depthWrite,w=h.alphaTest,O=h.sprite,x=h.sizeAttenuation,G.next=3,new c.TextureLoader().loadAsync(g);case 3:return C=G.sent,f=O?new c.SpriteMaterial({map:C,transparent:p!=null?p:!1,blending:d!=null?d:c.NormalBlending,depthWrite:b!=null?b:!0,alphaTest:w!=null?w:0,sizeAttenuation:x!=null?x:!0}):new c.MeshBasicMaterial({map:C,transparent:p!=null?p:!1,blending:d!=null?d:c.NormalBlending,depthWrite:b!=null?b:!0,alphaTest:w!=null?w:0}),G.abrupt("return",f);case 6:case"end":return G.stop()}},u)}))()},n.create=function(){var t=this;return(0,s.Z)(l().mark(function u(){var h,p,d,g,b,w,O,x;return l().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(h=t.options,p=h.scale,d=h.position,g=h.src,b=h.cache,w=h.sprite,!(b&&!b.get(g))){f.next=7;break}return b.init(g),f.next=5,t.getMaterial();case 5:O=f.sent,b.set(g,O);case 7:if(!b){f.next=13;break}return f.next=10,b.get(g);case 10:f.t0=f.sent,f.next=16;break;case 13:return f.next=15,t.getMaterial();case 15:f.t0=f.sent;case 16:x=f.t0,t.texture=x.map,w?t.createSprite(x):t.createMesh(new c.PlaneBufferGeometry(1,1),x),p&&t.object3d.scale.set(x.map.image.width*p,x.map.image.height*p,1),d&&t.object3d.position.copy(d);case 21:case"end":return f.stop()}},u)}))()},r}(ae);function v(e,i){for(;!Object.prototype.hasOwnProperty.call(e,i)&&(e=L(e),e!==null););return e}function T(e,i,r){return typeof Reflect!="undefined"&&Reflect.get?T=Reflect.get:T=function(a,t,u){var h=v(a,t);if(!!h){var p=Object.getOwnPropertyDescriptor(h,t);return p.get?p.get.call(u||a):p.value}},T(e,i,r)}function N(e,i,r){return T(e,i,r)}var Y=function(e){"use strict";R(r,e);var i=B(r);function r(a){A(this,r);var t;return t=i.call(this),t.options=(0,S.Z)({},{autoPlay:!0,loop:!0},a),t}var n=r.prototype;return n.getMaterial=function(){var t=this.options,u=t.src,h=t.transparent,p=t.blending,d=t.depthWrite,g=t.format,b=t.autoPlay,w=t.loop,O=t.alphaTest,x=t.sprite,C=J(),f=document.createElement("video");return f.addEventListener("loadedmetadata",function(){var U=new c.VideoTexture(f);U.format=g!=null?g:c.RGBAFormat,U.needsUpdate=!0;var G=x?new c.SpriteMaterial({map:U,transparent:h!=null?h:!1,blending:p!=null?p:c.NormalBlending,depthWrite:d!=null?d:!0,alphaTest:O!=null?O:0}):new c.MeshBasicMaterial({map:U,transparent:h!=null?h:!1,blending:p!=null?p:c.NormalBlending,depthWrite:d!=null?d:!0,alphaTest:O!=null?O:0});C.resolve(G)},!1),f.src=u,f.muted=!0,f.autoplay=b,f.loop=w,f.preload="auto",C.promise},n.create=function(){var t=this;return(0,s.Z)(l().mark(function u(){var h,p,d,g,b,w,O,x;return l().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(h=t.options,p=h.scale,d=h.position,g=h.src,b=h.cache,w=h.sprite,!(b&&!b.get(g))){f.next=7;break}return b.init(g),f.next=5,t.getMaterial();case 5:O=f.sent,b.set(g,O);case 7:if(!b){f.next=13;break}return f.next=10,b.get(g);case 10:f.t0=f.sent,f.next=16;break;case 13:return f.next=15,t.getMaterial();case 15:f.t0=f.sent;case 16:x=f.t0,t.video=x.map.image,w?t.createSprite(x):t.createMesh(new c.PlaneBufferGeometry(1,1),x),p&&t.object3d.scale.set(t.video.videoWidth*p,t.video.videoHeight*p,1),d&&t.object3d.position.copy(d);case 21:case"end":return f.stop()}},u)}))()},n.render=function(){var t=this.options.autoPlay;t&&this.video.play()},n.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),N(L(r.prototype),"dispose",this).call(this)},r}(ae),Q=function(e){"use strict";R(r,e);var i=B(r);function r(a){A(this,r);var t;return t=i.call(this),t.options=(0,S.Z)({},a),t}var n=r.prototype;return n.create=function(){var t=this.options,u=t.position,h=t.children,p=t.onClick,d=t.zIndexFix,g=document.createElement("div");g.appendChild(h),this.createCSS2DObject(g),u&&this.object3d.position.copy(u),p&&g.addEventListener("click",p),d&&(this.object3d.userData.zIndexFix=d)},n.getMaterial=function(t){return(0,s.Z)(l().mark(function u(){var h,p,d,g;return l().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return h=document.createElement("canvas"),h.width=256,h.height=256,p=h.getContext("2d"),p.fillStyle="#ff0000",p.fillRect(0,0,256,256),d=new c.CanvasTexture(h),g=new c.SpriteMaterial({map:d,opacity:t?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),w.abrupt("return",g);case 9:case"end":return w.stop()}},u)}))()},n.createPickObject=function(t){var u=t.show,h=u===void 0?!1:u,p=t.scale,d=p===void 0?new c.Vector3(1,1,1):p,g=t.position,b=g===void 0?new c.Vector3(0,0,0):g,w=t.cache,O=this;return(0,s.Z)(l().mark(function x(){var C,f,U,G;return l().wrap(function(X){for(;;)switch(X.prev=X.next){case 0:if(C="node-create-pick-object",!(w&&!w.get(C))){X.next=7;break}return w.init(C),X.next=5,O.getMaterial(h);case 5:f=X.sent,w.set(C,f);case 7:if(!w){X.next=13;break}return X.next=10,w.get(C);case 10:X.t0=X.sent,X.next=16;break;case 13:return X.next=15,O.getMaterial(h);case 15:X.t0=X.sent;case 16:U=X.t0,G=new c.Sprite(U),G.scale.set(U.map.image.width*d.x,U.map.image.height*d.y,1),G.position.copy(b),O.add(G),O.pickObject=G;case 22:case"end":return X.stop()}},x)}))()},n.dispose=function(){var t=this.options.onClick;if(t){var u;(u=this.object3d.element)===null||u===void 0||u.removeEventListener("click",t)}N(L(r.prototype),"dispose",this).call(this)},r}(ae),K=Q,he=`
|
|
2
|
+
`.concat(c.ShaderChunk.logdepthbuf_pars_vertex,`
|
|
3
|
+
`).concat(c.ShaderChunk.fog_pars_vertex,`
|
|
4
4
|
attribute vec3 previous;
|
|
5
5
|
attribute vec3 next;
|
|
6
6
|
attribute float side;
|
|
@@ -91,13 +91,13 @@
|
|
|
91
91
|
finalPosition.xy+=offset.xy;
|
|
92
92
|
|
|
93
93
|
gl_Position=finalPosition;
|
|
94
|
-
`).concat(
|
|
94
|
+
`).concat(c.ShaderChunk.logdepthbuf_vertex,`
|
|
95
95
|
vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
|
|
96
|
-
`).concat(
|
|
96
|
+
`).concat(c.ShaderChunk.fog_vertex,`
|
|
97
97
|
}
|
|
98
|
-
`),
|
|
99
|
-
`.concat(
|
|
100
|
-
`).concat(
|
|
98
|
+
`),ue=`
|
|
99
|
+
`.concat(c.ShaderChunk.fog_pars_fragment,`
|
|
100
|
+
`).concat(c.ShaderChunk.logdepthbuf_pars_fragment,`
|
|
101
101
|
|
|
102
102
|
|
|
103
103
|
uniform sampler2D map;
|
|
@@ -117,7 +117,7 @@ varying vec4 vColor;
|
|
|
117
117
|
varying float vCounters;
|
|
118
118
|
|
|
119
119
|
void main() {
|
|
120
|
-
`).concat(
|
|
120
|
+
`).concat(c.ShaderChunk.logdepthbuf_fragment,`
|
|
121
121
|
vec4 c = vColor;
|
|
122
122
|
if( useMap == 1. ) c *= texture2D( map, vUV * repeat );
|
|
123
123
|
if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;
|
|
@@ -127,6 +127,6 @@ void main() {
|
|
|
127
127
|
}
|
|
128
128
|
gl_FragColor = c;
|
|
129
129
|
gl_FragColor.a *= step(vCounters, visibility);
|
|
130
|
-
`).concat(
|
|
130
|
+
`).concat(c.ShaderChunk.fog_fragment,`
|
|
131
131
|
}
|
|
132
|
-
`),ne=function(t){"use strict";R(r,t);var a=G(r);function r(){S(this,r);var n;return n=a.call(this),n.isMeshLine=!0,n.type="MeshLine",n.positions=[],n.previous=[],n.next=[],n.side=[],n.width=[],n.indices_array=[],n.uvs=[],n.counters=[],n._points=[],n._geom=null,n.widthCallback=null,n.matrixWorld=new l.Matrix4,Object.defineProperties(L(n),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(e){this.setGeometry(e,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(e){this.setPoints(e,this.widthCallback)}}}),n}return r}(l.BufferGeometry);ne.prototype.setMatrixWorld=function(t){this.matrixWorld=t},ne.prototype.setGeometry=function(t,a){this._geometry=t,this.setPoints(t.getAttribute("position").array,a)},ne.prototype.setPoints=function(t,a){if(!(t instanceof Float32Array)&&!(t instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=t,this.widthCallback=a,this.positions=[],this.counters=[],t.length&&t[0]instanceof l.Vector3)for(var r=0;r<t.length;r++){var n=t[r],i=r/t.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(i),this.counters.push(i)}else for(var r=0;r<t.length;r+=3){var i=r/t.length;this.positions.push(t[r],t[r+1],t[r+2]),this.positions.push(t[r],t[r+1],t[r+2]),this.counters.push(i),this.counters.push(i)}this.process()};function Se(t,a){var r=new l.Matrix4,n=new l.Ray,i=new l.Sphere,e=new l.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),i.copy(o.boundingSphere),i.applyMatrix4(this.matrixWorld),t.ray.intersectSphere(i,e)!==!1){r.copy(this.matrixWorld).invert(),n.copy(t.ray).applyMatrix4(r);var u=new l.Vector3,h=new l.Vector3,p=new l.Vector3,y=this instanceof l.LineSegments?2:1,g=o.index,b=o.attributes;if(g!==null)for(var P=g.array,w=b.position.array,M=b.width.array,v=0,F=P.length-1;v<F;v+=y){var W=P[v],ge=P[v+1];u.fromArray(w,W*3),h.fromArray(w,ge*3);var j=M[Math.floor(v/3)]!==void 0?M[Math.floor(v/3)]:1,le=t.params.Line.threshold+this.material.lineWidth*j/2,he=le*le,fe=n.distanceSqToSegment(u,h,e,p);if(!(fe>he)){e.applyMatrix4(this.matrixWorld);var Pe=t.ray.origin.distanceTo(e);Pe<t.near||Pe>t.far||(a.push({distance:Pe,point:p.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this}),v=F)}}}}ne.prototype.raycast=Se,ne.prototype.compareV3=function(t,a){var r=t*6,n=a*6;return this.positions[r]===this.positions[n]&&this.positions[r+1]===this.positions[n+1]&&this.positions[r+2]===this.positions[n+2]},ne.prototype.copyV3=function(t){var a=t*6;return[this.positions[a],this.positions[a+1],this.positions[a+2]]},ne.prototype.process=function(){var t=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var a,r;this.compareV3(0,t-1)?r=this.copyV3(t-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var n=0;n<t;n++){if(this.side.push(1),this.side.push(-1),this.widthCallback?a=this.widthCallback(n/(t-1)):a=1,this.width.push(a),this.width.push(a),this.uvs.push(n/(t-1),0),this.uvs.push(n/(t-1),1),n<t-1){r=this.copyV3(n),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var i=n*2;this.indices_array.push(i,i+1,i+2),this.indices_array.push(i+2,i+1,i+3)}n>0&&(r=this.copyV3(n),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(t-1,0)?r=this.copyV3(1):r=this.copyV3(t-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new l.BufferAttribute(new Float32Array(this.positions),3),previous:new l.BufferAttribute(new Float32Array(this.previous),3),next:new l.BufferAttribute(new Float32Array(this.next),3),side:new l.BufferAttribute(new Float32Array(this.side),1),width:new l.BufferAttribute(new Float32Array(this.width),1),uv:new l.BufferAttribute(new Float32Array(this.uvs),2),index:new l.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new l.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function _e(t,a,r,n,i){var e;if(t=t.subarray||t.slice?t:t.buffer,r=r.subarray||r.slice?r:r.buffer,t=a?t.subarray?t.subarray(a,i&&a+i):t.slice(a,i&&a+i):t,r.set)r.set(t,n);else for(e=0;e<t.length;e++)r[e+n]=t[e];return r}ne.prototype.advance=function(t){var a=this._attributes.position.array,r=this._attributes.previous.array,n=this._attributes.next.array,i=a.length;_e(a,0,r,0,i),_e(a,6,a,0,i-6),a[i-6]=t.x,a[i-5]=t.y,a[i-4]=t.z,a[i-3]=t.x,a[i-2]=t.y,a[i-1]=t.z,_e(a,6,n,0,i-6),n[i-6]=t.x,n[i-5]=t.y,n[i-4]=t.z,n[i-3]=t.x,n[i-2]=t.y,n[i-1]=t.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},l.ShaderChunk.meshline_vert=Me,l.ShaderChunk.meshline_frag=Oe;var we=function(t){"use strict";R(r,t);var a=G(r);function r(n){S(this,r);var i;return i=a.call(this,{uniforms:Object.assign({},l.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new l.Color(16777215)},opacity:{value:1},resolution:{value:new l.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new l.Vector2(1,1)},offset:{value:new l.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new l.Vector2(0,0)},lightColor:{value:new l.Color(16777215)}}),vertexShader:l.ShaderChunk.meshline_vert,fragmentShader:l.ShaderChunk.meshline_frag}),i.isMeshLineMaterial=!0,i.type="MeshLineMaterial",Object.defineProperties(L(i),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(o){this.uniforms.lineWidth.value=o}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(o){this.uniforms.lineLightAnimation.value=o}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(o){this.uniforms.map.value=o}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(o){this.uniforms.useMap.value=o}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(o){this.uniforms.alphaMap.value=o}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(o){this.uniforms.useAlphaMap.value=o}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(o){this.uniforms.color.value=o}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(o){this.uniforms.lightColor.value=o}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(o){this.uniforms.time.value=o}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(o){this.uniforms.uCenter.value=o}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(o){this.uniforms.size.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(o){this.uniforms.sizeAttenuation.value=o}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(o){this.uniforms.dashArray.value=o,this.useDash=o!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(o){this.uniforms.dashOffset.value=o}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(o){this.uniforms.dashRatio.value=o}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(o){this.uniforms.useDash.value=o}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(o){this.uniforms.visibility.value=o}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(o){this.uniforms.alphaTest.value=o}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(o){this.uniforms.repeat.value.copy(o)}}}),i.setValues(n),i}return r}(l.ShaderMaterial);we.prototype.copy=function(t){return l.ShaderMaterial.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.dashArray.copy(t.dashArray),this.dashOffset.copy(t.dashOffset),this.dashRatio.copy(t.dashRatio),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this};function Ce(t,a){if(t==null)return{};var r={},n=Object.keys(t),i,e;for(e=0;e<n.length;e++)i=n[e],!(a.indexOf(i)>=0)&&(r[i]=t[i]);return r}function je(t,a){if(t==null)return{};var r=Ce(t,a),n,i;if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);for(i=0;i<e.length;i++)n=e[i],!(a.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,n)||(r[n]=t[n]))}return r}var ke={nodes:[],color:new l.Color("red"),lineWidth:3,sizeAttenuation:0},Te=function(t){"use strict";R(r,t);var a=G(r);function r(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};S(this,r);var e;return e=a.call(this),e.geometry=new l.BufferGeometry,e.meshline=new ne,e.options=(0,A.Z)({},ke,i),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.nodes,u=e.duration,h=e.delay,p=e.onComplete,y=e.setPointWidth,g=je(e,["nodes","duration","delay","onComplete","setPointWidth"]),b=this.pencil.getSize(),P=b.width,w=b.height;delete g.key,this.geometry.setFromPoints(o),this.meshline.setGeometry(this.geometry,y);var M=new we(x((0,A.Z)({},g),{resolution:new l.Vector2(P,w)}));this.material=M,this.createMesh(this.meshline,M)},n.resize=function(e,o){this.material.uniforms.resolution.value.set(e,o)},n.animate=function(){var e=this.options,o=e.duration,u=e.delay,h=e.onComplete,p=this.material.uniforms.offset,y=new(pe()).Tween(p.value).to({x:0},o!=null?o:1e3).delay(u!=null?u:0).repeat(1/0);h&&y.onComplete(h),y.start(),this.tween=y},n.dispose=function(){N(E(r.prototype),"dispose",this).call(this),this.tween&&pe().remove(this.tween)},r}(s),Le=Te})(),module.exports=be})();
|
|
132
|
+
`),I=function(e){"use strict";R(r,e);var i=B(r);function r(){A(this,r);var n;return n=i.call(this),n.isMeshLine=!0,n.type="MeshLine",n.positions=[],n.previous=[],n.next=[],n.side=[],n.width=[],n.indices_array=[],n.uvs=[],n.counters=[],n._points=[],n._geom=null,n.widthCallback=null,n.matrixWorld=new c.Matrix4,Object.defineProperties(k(n),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(t){this.setGeometry(t,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(t){this.setPoints(t,this.widthCallback)}}}),n}return r}(c.BufferGeometry);I.prototype.setMatrixWorld=function(e){this.matrixWorld=e},I.prototype.setGeometry=function(e,i){this._geometry=e,this.setPoints(e.getAttribute("position").array,i)},I.prototype.setPoints=function(e,i){if(!(e instanceof Float32Array)&&!(e instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=e,this.widthCallback=i,this.positions=[],this.counters=[],e.length&&e[0]instanceof c.Vector3)for(var r=0;r<e.length;r++){var n=e[r],a=r/e.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(a),this.counters.push(a)}else for(var r=0;r<e.length;r+=3){var a=r/e.length;this.positions.push(e[r],e[r+1],e[r+2]),this.positions.push(e[r],e[r+1],e[r+2]),this.counters.push(a),this.counters.push(a)}this.process()};function be(e,i){var r=new c.Matrix4,n=new c.Ray,a=new c.Sphere,t=new c.Vector3,u=this.geometry;if(u.boundingSphere||u.computeBoundingSphere(),a.copy(u.boundingSphere),a.applyMatrix4(this.matrixWorld),e.ray.intersectSphere(a,t)!==!1){r.copy(this.matrixWorld).invert(),n.copy(e.ray).applyMatrix4(r);var h=new c.Vector3,p=new c.Vector3,d=new c.Vector3,g=this instanceof c.LineSegments?2:1,b=u.index,w=u.attributes;if(b!==null)for(var O=b.array,x=w.position.array,C=w.width.array,f=0,U=O.length-1;f<U;f+=g){var G=O[f],we=O[f+1];h.fromArray(x,G*3),p.fromArray(x,we*3);var X=C[Math.floor(f/3)]!==void 0?C[Math.floor(f/3)]:1,Se=e.params.Line.threshold+this.material.lineWidth*X/2,je=Se*Se,ke=n.distanceSqToSegment(h,p,t,d);if(!(ke>je)){t.applyMatrix4(this.matrixWorld);var ye=e.ray.origin.distanceTo(t);ye<e.near||ye>e.far||(i.push({distance:ye,point:d.clone().applyMatrix4(this.matrixWorld),index:f,face:null,faceIndex:null,object:this}),f=U)}}}}I.prototype.raycast=be,I.prototype.compareV3=function(e,i){var r=e*6,n=i*6;return this.positions[r]===this.positions[n]&&this.positions[r+1]===this.positions[n+1]&&this.positions[r+2]===this.positions[n+2]},I.prototype.copyV3=function(e){var i=e*6;return[this.positions[i],this.positions[i+1],this.positions[i+2]]},I.prototype.process=function(){var e=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var i,r;this.compareV3(0,e-1)?r=this.copyV3(e-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var n=0;n<e;n++){if(this.side.push(1),this.side.push(-1),this.widthCallback?i=this.widthCallback(n/(e-1)):i=1,this.width.push(i),this.width.push(i),this.uvs.push(n/(e-1),0),this.uvs.push(n/(e-1),1),n<e-1){r=this.copyV3(n),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var a=n*2;this.indices_array.push(a,a+1,a+2),this.indices_array.push(a+2,a+1,a+3)}n>0&&(r=this.copyV3(n),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(e-1,0)?r=this.copyV3(1):r=this.copyV3(e-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new c.BufferAttribute(new Float32Array(this.positions),3),previous:new c.BufferAttribute(new Float32Array(this.previous),3),next:new c.BufferAttribute(new Float32Array(this.next),3),side:new c.BufferAttribute(new Float32Array(this.side),1),width:new c.BufferAttribute(new Float32Array(this.width),1),uv:new c.BufferAttribute(new Float32Array(this.uvs),2),index:new c.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new c.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function de(e,i,r,n,a){var t;if(e=e.subarray||e.slice?e:e.buffer,r=r.subarray||r.slice?r:r.buffer,e=i?e.subarray?e.subarray(i,a&&i+a):e.slice(i,a&&i+a):e,r.set)r.set(e,n);else for(t=0;t<e.length;t++)r[t+n]=e[t];return r}I.prototype.advance=function(e){var i=this._attributes.position.array,r=this._attributes.previous.array,n=this._attributes.next.array,a=i.length;de(i,0,r,0,a),de(i,6,i,0,a-6),i[a-6]=e.x,i[a-5]=e.y,i[a-4]=e.z,i[a-3]=e.x,i[a-2]=e.y,i[a-1]=e.z,de(i,6,n,0,a-6),n[a-6]=e.x,n[a-5]=e.y,n[a-4]=e.z,n[a-3]=e.x,n[a-2]=e.y,n[a-1]=e.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},c.ShaderChunk.meshline_vert=he,c.ShaderChunk.meshline_frag=ue;var me=function(e){"use strict";R(r,e);var i=B(r);function r(n){A(this,r);var a;return a=i.call(this,{uniforms:Object.assign({},c.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new c.Color(16777215)},opacity:{value:1},resolution:{value:new c.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new c.Vector2(1,1)},offset:{value:new c.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new c.Vector2(0,0)},lightColor:{value:new c.Color(16777215)}}),vertexShader:c.ShaderChunk.meshline_vert,fragmentShader:c.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(k(a),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(u){this.uniforms.lineWidth.value=u}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(u){this.uniforms.lineLightAnimation.value=u}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(u){this.uniforms.map.value=u}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(u){this.uniforms.useMap.value=u}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(u){this.uniforms.alphaMap.value=u}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(u){this.uniforms.useAlphaMap.value=u}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(u){this.uniforms.color.value=u}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(u){this.uniforms.lightColor.value=u}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(u){this.uniforms.time.value=u}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(u){this.uniforms.uCenter.value=u}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(u){this.uniforms.size.value=u}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(u){this.uniforms.opacity.value=u}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(u){this.uniforms.resolution.value.copy(u)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(u){this.uniforms.sizeAttenuation.value=u}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(u){this.uniforms.dashArray.value=u,this.useDash=u!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(u){this.uniforms.dashOffset.value=u}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(u){this.uniforms.dashRatio.value=u}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(u){this.uniforms.useDash.value=u}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(u){this.uniforms.visibility.value=u}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(u){this.uniforms.alphaTest.value=u}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(u){this.uniforms.repeat.value.copy(u)}}}),a.setValues(n),a}return r}(c.ShaderMaterial);me.prototype.copy=function(e){return c.ShaderMaterial.prototype.copy.call(this,e),this.lineWidth=e.lineWidth,this.map=e.map,this.useMap=e.useMap,this.alphaMap=e.alphaMap,this.useAlphaMap=e.useAlphaMap,this.color.copy(e.color),this.opacity=e.opacity,this.resolution.copy(e.resolution),this.sizeAttenuation=e.sizeAttenuation,this.dashArray.copy(e.dashArray),this.dashOffset.copy(e.dashOffset),this.dashRatio.copy(e.dashRatio),this.useDash=e.useDash,this.visibility=e.visibility,this.alphaTest=e.alphaTest,this.repeat.copy(e.repeat),this};function xe(e,i){if(e==null)return{};var r={},n=Object.keys(e),a,t;for(t=0;t<n.length;t++)a=n[t],!(i.indexOf(a)>=0)&&(r[a]=e[a]);return r}function Me(e,i){if(e==null)return{};var r=xe(e,i),n,a;if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);for(a=0;a<t.length;a++)n=t[a],!(i.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(e,n)||(r[n]=e[n]))}return r}var Pe=require("@tweenjs/tween.js"),_e=Z.n(Pe),Oe={nodes:[],color:new c.Color("red"),lineWidth:3,sizeAttenuation:0},Ce=function(e){"use strict";R(r,e);var i=B(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};A(this,r);var t;return t=i.call(this),t.geometry=new c.BufferGeometry,t.meshline=new I,t.options=(0,S.Z)({},Oe,a),t}var n=r.prototype;return n.create=function(){var t=this.options,u=t.nodes,h=t.duration,p=t.delay,d=t.onComplete,g=t.setPointWidth,b=Me(t,["nodes","duration","delay","onComplete","setPointWidth"]),w=this.pencil.getSize(),O=w.width,x=w.height;delete b.key,this.geometry.setFromPoints(u),this.meshline.setGeometry(this.geometry,g);var C=new me(_((0,S.Z)({},b),{resolution:new c.Vector2(O,x)}));this.material=C,this.createMesh(this.meshline,C)},n.resize=function(t,u){this.material.uniforms.resolution.value.set(t,u)},n.animate=function(){var t=this.options,u=t.duration,h=t.delay,p=t.onComplete,d=this.material.uniforms.offset,g=new(_e()).Tween(d.value).to({x:0},u!=null?u:1e3).delay(h!=null?h:0).repeat(1/0);p&&g.onComplete(p),g.start(),this.tween=g},n.dispose=function(){N(L(r.prototype),"dispose",this).call(this),this.tween&&_e().remove(this.tween)},r}(ae)})(),module.exports=ve})();
|
|
@@ -1 +1,41 @@
|
|
|
1
|
-
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { Tween } from '@tweenjs/tween.js';
|
|
3
|
+
import BaseObject from '../../core/BaseObject';
|
|
4
|
+
import { MeshLine, MeshLineMaterial } from './meshLine';
|
|
5
|
+
interface Options {
|
|
6
|
+
nodes: THREE.Vector3[];
|
|
7
|
+
duration?: number;
|
|
8
|
+
delay?: number;
|
|
9
|
+
onComplete?: (...args: any[]) => void;
|
|
10
|
+
color?: string | THREE.Color | number;
|
|
11
|
+
lineWidth?: number;
|
|
12
|
+
sizeAttenuation?: number;
|
|
13
|
+
map?: THREE.Texture;
|
|
14
|
+
useMap?: number;
|
|
15
|
+
alphaMap?: THREE.Texture;
|
|
16
|
+
useAlphaMap?: number;
|
|
17
|
+
opacity?: number;
|
|
18
|
+
dashArray?: number;
|
|
19
|
+
dashOffset?: number;
|
|
20
|
+
dashRatio?: number;
|
|
21
|
+
useDash?: number;
|
|
22
|
+
visibility?: number;
|
|
23
|
+
alphaTest?: number;
|
|
24
|
+
repeat?: THREE.Vector2;
|
|
25
|
+
transparent?: boolean;
|
|
26
|
+
depthTest?: boolean;
|
|
27
|
+
setPointWidth?: (p: number) => number;
|
|
28
|
+
}
|
|
29
|
+
export default class Line extends BaseObject {
|
|
30
|
+
options: Options;
|
|
31
|
+
tween: Tween<any>;
|
|
32
|
+
constructor(options?: Partial<Options>);
|
|
33
|
+
material: MeshLineMaterial;
|
|
34
|
+
geometry: THREE.BufferGeometry;
|
|
35
|
+
meshline: MeshLine;
|
|
36
|
+
create(): void;
|
|
37
|
+
resize(w: number, h: number): void;
|
|
38
|
+
animate(): void;
|
|
39
|
+
dispose(): void;
|
|
40
|
+
}
|
|
41
|
+
export {};
|
package/dist/plugins/Draw.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export default class Draw<T extends {
|
|
|
14
14
|
initObjectFactories(): void;
|
|
15
15
|
getObject<Y extends KeyOf<T>>(nameOrigin: Y, options?: {
|
|
16
16
|
key: string;
|
|
17
|
-
}): InstanceType<T[Y]
|
|
17
|
+
}): InstanceType<T[Y]> | undefined;
|
|
18
18
|
getAllObject<Y extends KeyOf<T>>(nameOrigin: Y, options?: {
|
|
19
19
|
key: string;
|
|
20
20
|
}): InstanceType<T[Y]>[];
|
package/dist/plugins/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){var J={666:function(p){var v=function(c){"use strict";var P=Object.prototype,g=P.hasOwnProperty,d,b=typeof Symbol=="function"?Symbol:{},_=b.iterator||"@@iterator",T=b.asyncIterator||"@@asyncIterator",E=b.toStringTag||"@@toStringTag";function j(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{j({},"")}catch(e){j=function(t,n,f){return t[n]=f}}function R(e,t,n,f){var s=t&&t.prototype instanceof y?t:y,O=Object.create(s.prototype),M=new x(f||[]);return O._invoke=m(e,n,M),O}c.wrap=R;function I(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(f){return{type:"throw",arg:f}}}var Z="suspendedStart",W="suspendedYield",z="executing",L="completed",k={};function y(){}function A(){}function i(){}var o={};j(o,_,function(){return this});var a=Object.getPrototypeOf,r=a&&a(a(N([])));r&&r!==P&&g.call(r,_)&&(o=r);var u=i.prototype=y.prototype=Object.create(o);A.prototype=i,j(u,"constructor",i),j(i,"constructor",A),A.displayName=j(i,E,"GeneratorFunction");function h(e){["next","throw","return"].forEach(function(t){j(e,t,function(n){return this._invoke(t,n)})})}c.isGeneratorFunction=function(e){var t=typeof e=="function"&&e.constructor;return t?t===A||(t.displayName||t.name)==="GeneratorFunction":!1},c.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,i):(e.__proto__=i,j(e,E,"GeneratorFunction")),e.prototype=Object.create(u),e},c.awrap=function(e){return{__await:e}};function l(e,t){function n(O,M,G,B){var D=I(e[O],e,M);if(D.type==="throw")B(D.arg);else{var Y=D.arg,H=Y.value;return H&&typeof H=="object"&&g.call(H,"__await")?t.resolve(H.__await).then(function($){n("next",$,G,B)},function($){n("throw",$,G,B)}):t.resolve(H).then(function($){Y.value=$,G(Y)},function($){return n("throw",$,G,B)})}}var f;function s(O,M){function G(){return new t(function(B,D){n(O,M,B,D)})}return f=f?f.then(G,G):G()}this._invoke=s}h(l.prototype),j(l.prototype,T,function(){return this}),c.AsyncIterator=l,c.async=function(e,t,n,f,s){s===void 0&&(s=Promise);var O=new l(R(e,t,n,f),s);return c.isGeneratorFunction(t)?O:O.next().then(function(M){return M.done?M.value:O.next()})};function m(e,t,n){var f=Z;return function(O,M){if(f===z)throw new Error("Generator is already running");if(f===L){if(O==="throw")throw M;return F()}for(n.method=O,n.arg=M;;){var G=n.delegate;if(G){var B=w(G,n);if(B){if(B===k)continue;return B}}if(n.method==="next")n.sent=n._sent=n.arg;else if(n.method==="throw"){if(f===Z)throw f=L,n.arg;n.dispatchException(n.arg)}else n.method==="return"&&n.abrupt("return",n.arg);f=z;var D=I(e,t,n);if(D.type==="normal"){if(f=n.done?L:W,D.arg===k)continue;return{value:D.arg,done:n.done}}else D.type==="throw"&&(f=L,n.method="throw",n.arg=D.arg)}}}function w(e,t){var n=e.iterator[t.method];if(n===d){if(t.delegate=null,t.method==="throw"){if(e.iterator.return&&(t.method="return",t.arg=d,w(e,t),t.method==="throw"))return k;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return k}var f=I(n,e.iterator,t.arg);if(f.type==="throw")return t.method="throw",t.arg=f.arg,t.delegate=null,k;var s=f.arg;if(!s)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,k;if(s.done)t[e.resultName]=s.value,t.next=e.nextLoc,t.method!=="return"&&(t.method="next",t.arg=d);else return s;return t.delegate=null,k}h(u),j(u,E,"Generator"),j(u,_,function(){return this}),j(u,"toString",function(){return"[object Generator]"});function U(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(U,this),this.reset(!0)}c.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function f(){for(;t.length;){var s=t.pop();if(s in e)return f.value=s,f.done=!1,f}return f.done=!0,f}};function N(e){if(e){var t=e[_];if(t)return t.call(e);if(typeof e.next=="function")return e;if(!isNaN(e.length)){var n=-1,f=function s(){for(;++n<e.length;)if(g.call(e,n))return s.value=e[n],s.done=!1,s;return s.value=d,s.done=!0,s};return f.next=f}}return{next:F}}c.values=N;function F(){return{value:d,done:!0}}return x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=d,this.done=!1,this.delegate=null,this.method="next",this.arg=d,this.tryEntries.forEach(C),!e)for(var t in this)t.charAt(0)==="t"&&g.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=d)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(B,D){return O.type="throw",O.arg=e,t.next=B,D&&(t.method="next",t.arg=d),!!D}for(var f=this.tryEntries.length-1;f>=0;--f){var s=this.tryEntries[f],O=s.completion;if(s.tryLoc==="root")return n("end");if(s.tryLoc<=this.prev){var M=g.call(s,"catchLoc"),G=g.call(s,"finallyLoc");if(M&&G){if(this.prev<s.catchLoc)return n(s.catchLoc,!0);if(this.prev<s.finallyLoc)return n(s.finallyLoc)}else if(M){if(this.prev<s.catchLoc)return n(s.catchLoc,!0)}else if(G){if(this.prev<s.finallyLoc)return n(s.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var f=this.tryEntries[n];if(f.tryLoc<=this.prev&&g.call(f,"finallyLoc")&&this.prev<f.finallyLoc){var s=f;break}}s&&(e==="break"||e==="continue")&&s.tryLoc<=t&&t<=s.finallyLoc&&(s=null);var O=s?s.completion:{};return O.type=e,O.arg=t,s?(this.method="next",this.next=s.finallyLoc,k):this.complete(O)},complete:function(e,t){if(e.type==="throw")throw e.arg;return e.type==="break"||e.type==="continue"?this.next=e.arg:e.type==="return"?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):e.type==="normal"&&t&&(this.next=t),k},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),k}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var f=n.completion;if(f.type==="throw"){var s=f.arg;C(n)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:N(e),resultName:t,nextLoc:n},this.method==="next"&&(this.arg=d),k}},c}(p.exports);try{regeneratorRuntime=v}catch(c){typeof globalThis=="object"?globalThis.regeneratorRuntime=v:Function("r","regeneratorRuntime = r")(v)}},519:function(p,v,c){"use strict";c.d(v,{makePromiseCreator:function(){return P.Z}});var P=c(282),g=c(666),d=c.n(g),b=null,_=c(644);function T(L){if(L.material){var k=Array.isArray(L.material)?L.material:[L.material];k.forEach(function(y){var A,i;(A=y.color)===null||A===void 0||A.convertSRGBToLinear(),(i=y.emissive)===null||i===void 0||i.convertSRGBToLinear(),y.map&&(y.map.encoding=THREE.sRGBEncoding),y.emissiveMap&&(y.emissiveMap.encoding=THREE.sRGBEncoding)})}}var E=c(568),j=c(924),R=require("idb-keyval"),I=c(484),Z=null,W=null,z=function(){var L=(0,E.Z)(d().mark(function k(y,A){var i,o,a,r,u,h;return d().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return i=A.version,m.next=4,(0,R.get)(y);case 4:if(a=m.sent,!(a&&a[i])){m.next=9;break}o=a[i],m.next=15;break;case 9:return m.next=11,(0,I.Z)(fetch(y).then(function(w){if(w.ok)return w.blob();throw new Error}));case 11:r=m.sent,u=r.res,h=r.err,h||(o=u,(0,R.set)(y,(0,j.Z)({},i,u)));case 15:return m.abrupt("return",o?{url:URL.createObjectURL(o)}:{url:y});case 16:case"end":return m.stop()}},k)}));return function(y,A){return L.apply(this,arguments)}}()},282:function(p,v,c){"use strict";c.d(v,{Z:function(){return g}});var P=c(484);function g(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_={};return _.promise=new Promise(function(T,E){_.resolve=T,_.reject=E}),d&&(_.promise=(0,P.Z)(_.promise,b)),_}},484:function(p,v,c){"use strict";c.d(v,{Z:function(){return g}});var P=c(42);function g(d){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return d.then(function(_){return(0,P.Z)({err:null,res:_},b)}).catch(function(_){return(0,P.Z)({err:_,res:void 0},b)})}},644:function(p){"use strict";p.exports=require("three")},568:function(p,v,c){"use strict";c.d(v,{Z:function(){return g}});function P(d,b,_,T,E,j,R){try{var I=d[j](R),Z=I.value}catch(W){_(W);return}I.done?b(Z):Promise.resolve(Z).then(T,E)}function g(d){return function(){var b=this,_=arguments;return new Promise(function(T,E){var j=d.apply(b,_);function R(Z){P(j,T,E,R,I,"next",Z)}function I(Z){P(j,T,E,R,I,"throw",Z)}R(void 0)})}}},924:function(p,v,c){"use strict";c.d(v,{Z:function(){return P}});function P(g,d,b){return d in g?Object.defineProperty(g,d,{value:b,enumerable:!0,configurable:!0,writable:!0}):g[d]=b,g}},42:function(p,v,c){"use strict";c.d(v,{Z:function(){return g}});var P=c(924);function g(d){for(var b=1;b<arguments.length;b++){var _=arguments[b]!=null?arguments[b]:{},T=Object.keys(_);typeof Object.getOwnPropertySymbols=="function"&&(T=T.concat(Object.getOwnPropertySymbols(_).filter(function(E){return Object.getOwnPropertyDescriptor(_,E).enumerable}))),T.forEach(function(E){(0,P.Z)(d,E,_[E])})}return d}}},X={};function S(p){var v=X[p];if(v!==void 0)return v.exports;var c=X[p]={exports:{}};return J[p](c,c.exports,S),c.exports}(function(){S.n=function(p){var v=p&&p.__esModule?function(){return p.default}:function(){return p};return S.d(v,{a:v}),v}})(),function(){S.d=function(p,v){for(var c in v)S.o(v,c)&&!S.o(p,c)&&Object.defineProperty(p,c,{enumerable:!0,get:v[c]})}}(),function(){S.o=function(p,v){return Object.prototype.hasOwnProperty.call(p,v)}}(),function(){S.r=function(p){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(p,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(p,"__esModule",{value:!0})}}();var K={};(function(){"use strict";S.r(K),S.d(K,{Cache:function(){return c},Data:function(){return A},Draw:function(){return y}});function p(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}var v=S(519),c=function(){"use strict";function i(){p(this,i),this.cache=new Map}var o=i.prototype;return o.install=function(){},o.init=function(r){var u=(0,v.makePromiseCreator)();this.cache.set(r,u)},o.get=function(r){var u;return(u=this.cache.get(r))===null||u===void 0?void 0:u.promise},o.set=function(r,u){var h=this.cache.get(r);h?h.resolve(u):console.warn("init cache first")},o.dispose=function(){this.cache.forEach(function(r,u){r.reject("stop set cache:".concat(u))}),this.cache.clear()},i}(),P=S(568);function g(i,o){for(var a=0;a<o.length;a++){var r=o[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,r.key,r)}}function d(i,o,a){return o&&g(i.prototype,o),a&&g(i,a),i}function b(i){if(Array.isArray(i))return i}function _(i){if(typeof Symbol!="undefined"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function T(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function E(i,o){(o==null||o>i.length)&&(o=i.length);for(var a=0,r=new Array(o);a<o;a++)r[a]=i[a];return r}function j(i,o){if(!!i){if(typeof i=="string")return E(i,o);var a=Object.prototype.toString.call(i).slice(8,-1);if(a==="Object"&&i.constructor&&(a=i.constructor.name),a==="Map"||a==="Set")return Array.from(a);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return E(i,o)}}function R(i,o){return b(i)||_(i,o)||j(i,o)||T()}function I(i){if(Array.isArray(i))return E(i)}function Z(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function W(i){return I(i)||_(i)||j(i)||Z()}var z=S(666),L=S.n(z),k=S(644),y=function(){"use strict";function i(a){p(this,i),this.objectNamesToFactories=new Map,this.objects=new Map,this.objects_=a}var o=i.prototype;return o.install=function(r){this.pencil=r,this.initObjectFactories()},o.initObjectFactories=function(){var r=this,u=this.objects_;Object.keys(u).forEach(function(h){var l=function(){function m(){p(this,m)}var w=m.prototype;return w.create=function(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new u[h](C)},m}();r.objectNamesToFactories.set(h,l)})},o.getObject=function(r,u){r.includes("#")&&console.warn("getObject:err:\u4E0D\u652F\u6301 #",r);var h=(u||{}).key,l="".concat(r).concat(h?"#".concat(h):""),m=this.objects.get(l);return m},o.getAllObject=function(r,u){r.includes("#")&&console.warn("getAllObject:err:\u4E0D\u652F\u6301 #",r);var h=(u||{}).key,l="".concat(r).concat(h?"#".concat(h):""),m=[];return this.objects.forEach(function(w,U){(U.startsWith("".concat(l,"#"))||U===l)&&m.push(w)}),m},o.draw=function(r,u,h){var l=this;return(0,P.Z)(L().mark(function m(){var w,U,C,x,N,F,e;return L().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(w=l.objectNamesToFactories.get(r),!w){n.next=15;break}return U=(u||{}).key,C="".concat(r).concat(U?"#".concat(U):""),l.objects.has(C)&&(x=k.MathUtils.generateUUID(),C+="#".concat(x)),N=(u==null?void 0:u.target)||h,typeof N=="string"?F=l.objects.get(N):(N==null?void 0:N.objecttype__)==="BaseObject"?F=N:F=l.pencil.scene,e=new w().create(u),e.pencil=l.pencil,e.key=C,l.objects.set(C,e),n.next=14,l.addMesh(e,F);case 14:return n.abrupt("return",e);case 15:throw new Error("Unrecognized:".concat(r));case 16:case"end":return n.stop()}},m)}))()},o.addMesh=function(r,u){var h=this;return(0,P.Z)(L().mark(function l(){return L().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return w.next=2,r.init();case 2:return w.next=4,r.create();case 4:r.object3d&&(r.object3d.userData.BaseObject_=r,u.add(r.object3d)),r.visible=!0,r.render(),h.pencil.gui&&r.showGuiParams(h.pencil.gui),r.pm.resolve();case 9:case"end":return w.stop()}},l)}))()},o.erase=function(){for(var r=arguments.length,u=new Array(r),h=0;h<r;h++)u[h]=arguments[h];var l=this;W(u).forEach(function(m){var w=[];if(typeof m=="string"){var U,C=R(m.split("#"),2),x=C[0],N=C[1];(U=w).push.apply(U,W(l.getAllObject(x,{key:N})))}else w.push(m);w.forEach(function(F){l.removeMesh(F)})})},o.removeMesh=function(r){var u=this,h=r.parent;r.object3d&&h.remove(r.object3d),r.traverse(function(l){l.visible=!1,l.dispose(),u.objects.delete(l.key)})},o.update=function(r,u){this.objects.forEach(function(h){h.update(r,u)})},o.setSize=function(r,u){this.objects.forEach(function(h){h.resize(r,u)})},o.dispose=function(){this.objects.forEach(function(r,u){r.dispose(),r.pm.reject("stop draw:".concat(u))}),this.objects.clear(),this.objectNamesToFactories.clear()},d(i,[{key:"objectsPromise",get:function(){var r=[];return this.objects.forEach(function(u){r.push(u.pm.promise)}),r}}]),i}(),A=function(){"use strict";function i(){p(this,i),this.data={}}var o=i.prototype;return o.install=function(){},o.setData=function(r,u){var h,l;this.data[r]=u,(l=(h=this).cb)===null||l===void 0||l.call(h,r)},o.dispose=function(){this.data={},this.cb=void 0},i}()})(),module.exports=K})();
|
|
1
|
+
(function(){var J={666:function(v){var d=function(s){"use strict";var O=Object.prototype,g=O.hasOwnProperty,_,b=typeof Symbol=="function"?Symbol:{},y=b.iterator||"@@iterator",T=b.asyncIterator||"@@asyncIterator",j=b.toStringTag||"@@toStringTag";function w(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{w({},"")}catch(e){w=function(t,n,f){return t[n]=f}}function R(e,t,n,f){var c=t&&t.prototype instanceof m?t:m,E=Object.create(c.prototype),M=new x(f||[]);return E._invoke=p(e,n,M),E}s.wrap=R;function I(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(f){return{type:"throw",arg:f}}}var Z="suspendedStart",W="suspendedYield",z="executing",A="completed",P={};function m(){}function k(){}function i(){}var o={};w(o,y,function(){return this});var a=Object.getPrototypeOf,r=a&&a(a(N([])));r&&r!==O&&g.call(r,y)&&(o=r);var u=i.prototype=m.prototype=Object.create(o);k.prototype=i,w(u,"constructor",i),w(i,"constructor",k),k.displayName=w(i,j,"GeneratorFunction");function h(e){["next","throw","return"].forEach(function(t){w(e,t,function(n){return this._invoke(t,n)})})}s.isGeneratorFunction=function(e){var t=typeof e=="function"&&e.constructor;return t?t===k||(t.displayName||t.name)==="GeneratorFunction":!1},s.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,i):(e.__proto__=i,w(e,j,"GeneratorFunction")),e.prototype=Object.create(u),e},s.awrap=function(e){return{__await:e}};function l(e,t){function n(E,M,G,B){var D=I(e[E],e,M);if(D.type==="throw")B(D.arg);else{var Y=D.arg,H=Y.value;return H&&typeof H=="object"&&g.call(H,"__await")?t.resolve(H.__await).then(function($){n("next",$,G,B)},function($){n("throw",$,G,B)}):t.resolve(H).then(function($){Y.value=$,G(Y)},function($){return n("throw",$,G,B)})}}var f;function c(E,M){function G(){return new t(function(B,D){n(E,M,B,D)})}return f=f?f.then(G,G):G()}this._invoke=c}h(l.prototype),w(l.prototype,T,function(){return this}),s.AsyncIterator=l,s.async=function(e,t,n,f,c){c===void 0&&(c=Promise);var E=new l(R(e,t,n,f),c);return s.isGeneratorFunction(t)?E:E.next().then(function(M){return M.done?M.value:E.next()})};function p(e,t,n){var f=Z;return function(E,M){if(f===z)throw new Error("Generator is already running");if(f===A){if(E==="throw")throw M;return F()}for(n.method=E,n.arg=M;;){var G=n.delegate;if(G){var B=L(G,n);if(B){if(B===P)continue;return B}}if(n.method==="next")n.sent=n._sent=n.arg;else if(n.method==="throw"){if(f===Z)throw f=A,n.arg;n.dispatchException(n.arg)}else n.method==="return"&&n.abrupt("return",n.arg);f=z;var D=I(e,t,n);if(D.type==="normal"){if(f=n.done?A:W,D.arg===P)continue;return{value:D.arg,done:n.done}}else D.type==="throw"&&(f=A,n.method="throw",n.arg=D.arg)}}}function L(e,t){var n=e.iterator[t.method];if(n===_){if(t.delegate=null,t.method==="throw"){if(e.iterator.return&&(t.method="return",t.arg=_,L(e,t),t.method==="throw"))return P;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return P}var f=I(n,e.iterator,t.arg);if(f.type==="throw")return t.method="throw",t.arg=f.arg,t.delegate=null,P;var c=f.arg;if(!c)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,P;if(c.done)t[e.resultName]=c.value,t.next=e.nextLoc,t.method!=="return"&&(t.method="next",t.arg=_);else return c;return t.delegate=null,P}h(u),w(u,j,"Generator"),w(u,y,function(){return this}),w(u,"toString",function(){return"[object Generator]"});function U(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(U,this),this.reset(!0)}s.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function f(){for(;t.length;){var c=t.pop();if(c in e)return f.value=c,f.done=!1,f}return f.done=!0,f}};function N(e){if(e){var t=e[y];if(t)return t.call(e);if(typeof e.next=="function")return e;if(!isNaN(e.length)){var n=-1,f=function c(){for(;++n<e.length;)if(g.call(e,n))return c.value=e[n],c.done=!1,c;return c.value=_,c.done=!0,c};return f.next=f}}return{next:F}}s.values=N;function F(){return{value:_,done:!0}}return x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=_,this.done=!1,this.delegate=null,this.method="next",this.arg=_,this.tryEntries.forEach(C),!e)for(var t in this)t.charAt(0)==="t"&&g.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=_)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(B,D){return E.type="throw",E.arg=e,t.next=B,D&&(t.method="next",t.arg=_),!!D}for(var f=this.tryEntries.length-1;f>=0;--f){var c=this.tryEntries[f],E=c.completion;if(c.tryLoc==="root")return n("end");if(c.tryLoc<=this.prev){var M=g.call(c,"catchLoc"),G=g.call(c,"finallyLoc");if(M&&G){if(this.prev<c.catchLoc)return n(c.catchLoc,!0);if(this.prev<c.finallyLoc)return n(c.finallyLoc)}else if(M){if(this.prev<c.catchLoc)return n(c.catchLoc,!0)}else if(G){if(this.prev<c.finallyLoc)return n(c.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var f=this.tryEntries[n];if(f.tryLoc<=this.prev&&g.call(f,"finallyLoc")&&this.prev<f.finallyLoc){var c=f;break}}c&&(e==="break"||e==="continue")&&c.tryLoc<=t&&t<=c.finallyLoc&&(c=null);var E=c?c.completion:{};return E.type=e,E.arg=t,c?(this.method="next",this.next=c.finallyLoc,P):this.complete(E)},complete:function(e,t){if(e.type==="throw")throw e.arg;return e.type==="break"||e.type==="continue"?this.next=e.arg:e.type==="return"?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):e.type==="normal"&&t&&(this.next=t),P},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),P}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var f=n.completion;if(f.type==="throw"){var c=f.arg;C(n)}return c}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:N(e),resultName:t,nextLoc:n},this.method==="next"&&(this.arg=_),P}},s}(v.exports);try{regeneratorRuntime=d}catch(s){typeof globalThis=="object"?globalThis.regeneratorRuntime=d:Function("r","regeneratorRuntime = r")(d)}},519:function(v,d,s){"use strict";s.d(d,{makePromiseCreator:function(){return O.Z}});var O=s(282),g=s(666),_=s.n(g),b=null,y=s(644);function T(A){if(A.material){var P=Array.isArray(A.material)?A.material:[A.material];P.forEach(function(m){var k,i;(k=m.color)===null||k===void 0||k.convertSRGBToLinear(),(i=m.emissive)===null||i===void 0||i.convertSRGBToLinear(),m.map&&(m.map.encoding=THREE.sRGBEncoding),m.emissiveMap&&(m.emissiveMap.encoding=THREE.sRGBEncoding)})}}var j=s(568),w=s(924),R=require("idb-keyval"),I=s(484),Z=null,W=null,z=function(){var A=(0,j.Z)(_().mark(function P(m,k){var i,o,a,r,u,h;return _().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return i=k.version,p.next=4,(0,R.get)(m);case 4:if(a=p.sent,!(a&&a[i])){p.next=9;break}o=a[i],p.next=15;break;case 9:return p.next=11,(0,I.Z)(fetch(m).then(function(L){if(L.ok)return L.blob();throw new Error}));case 11:r=p.sent,u=r.res,h=r.err,h||(o=u,(0,R.set)(m,(0,w.Z)({},i,u)));case 15:return p.abrupt("return",o?{url:URL.createObjectURL(o)}:{url:m});case 16:case"end":return p.stop()}},P)}));return function(m,k){return A.apply(this,arguments)}}()},282:function(v,d,s){"use strict";s.d(d,{Z:function(){return g}});var O=s(484);function g(){var _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y={};return y.promise=new Promise(function(T,j){y.resolve=T,y.reject=j}),_&&(y.promise=(0,O.Z)(y.promise,b)),y}},484:function(v,d,s){"use strict";s.d(d,{Z:function(){return g}});var O=s(42);function g(_){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return _.then(function(y){return(0,O.Z)({err:null,res:y},b)}).catch(function(y){return(0,O.Z)({err:y,res:void 0},b)})}},644:function(v){"use strict";v.exports=require("three")},568:function(v,d,s){"use strict";s.d(d,{Z:function(){return g}});function O(_,b,y,T,j,w,R){try{var I=_[w](R),Z=I.value}catch(W){y(W);return}I.done?b(Z):Promise.resolve(Z).then(T,j)}function g(_){return function(){var b=this,y=arguments;return new Promise(function(T,j){var w=_.apply(b,y);function R(Z){O(w,T,j,R,I,"next",Z)}function I(Z){O(w,T,j,R,I,"throw",Z)}R(void 0)})}}},924:function(v,d,s){"use strict";s.d(d,{Z:function(){return O}});function O(g,_,b){return _ in g?Object.defineProperty(g,_,{value:b,enumerable:!0,configurable:!0,writable:!0}):g[_]=b,g}},42:function(v,d,s){"use strict";s.d(d,{Z:function(){return g}});var O=s(924);function g(_){for(var b=1;b<arguments.length;b++){var y=arguments[b]!=null?arguments[b]:{},T=Object.keys(y);typeof Object.getOwnPropertySymbols=="function"&&(T=T.concat(Object.getOwnPropertySymbols(y).filter(function(j){return Object.getOwnPropertyDescriptor(y,j).enumerable}))),T.forEach(function(j){(0,O.Z)(_,j,y[j])})}return _}}},X={};function S(v){var d=X[v];if(d!==void 0)return d.exports;var s=X[v]={exports:{}};return J[v](s,s.exports,S),s.exports}(function(){S.n=function(v){var d=v&&v.__esModule?function(){return v.default}:function(){return v};return S.d(d,{a:d}),d}})(),function(){S.d=function(v,d){for(var s in d)S.o(d,s)&&!S.o(v,s)&&Object.defineProperty(v,s,{enumerable:!0,get:d[s]})}}(),function(){S.o=function(v,d){return Object.prototype.hasOwnProperty.call(v,d)}}(),function(){S.r=function(v){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(v,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(v,"__esModule",{value:!0})}}();var K={};(function(){"use strict";S.r(K),S.d(K,{Cache:function(){return s},Data:function(){return k},Draw:function(){return m}});function v(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}var d=S(519),s=function(){"use strict";function i(){v(this,i),this.cache=new Map}var o=i.prototype;return o.install=function(){},o.init=function(r){var u=(0,d.makePromiseCreator)();this.cache.set(r,u)},o.get=function(r){var u;return(u=this.cache.get(r))===null||u===void 0?void 0:u.promise},o.set=function(r,u){var h=this.cache.get(r);h?h.resolve(u):console.warn("init cache first")},o.dispose=function(){this.cache.forEach(function(r,u){r.reject("stop set cache:".concat(u))}),this.cache.clear()},i}(),O=S(568);function g(i,o){for(var a=0;a<o.length;a++){var r=o[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,r.key,r)}}function _(i,o,a){return o&&g(i.prototype,o),a&&g(i,a),i}function b(i){if(Array.isArray(i))return i}function y(i){if(typeof Symbol!="undefined"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function T(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function j(i,o){(o==null||o>i.length)&&(o=i.length);for(var a=0,r=new Array(o);a<o;a++)r[a]=i[a];return r}function w(i,o){if(!!i){if(typeof i=="string")return j(i,o);var a=Object.prototype.toString.call(i).slice(8,-1);if(a==="Object"&&i.constructor&&(a=i.constructor.name),a==="Map"||a==="Set")return Array.from(a);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return j(i,o)}}function R(i,o){return b(i)||y(i,o)||w(i,o)||T()}function I(i){if(Array.isArray(i))return j(i)}function Z(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function W(i){return I(i)||y(i)||w(i)||Z()}var z=S(666),A=S.n(z),P=S(644),m=function(){"use strict";function i(a){v(this,i),this.objectNamesToFactories=new Map,this.objects=new Map,this.objects_=a}var o=i.prototype;return o.install=function(r){this.pencil=r,this.initObjectFactories()},o.initObjectFactories=function(){var r=this,u=this.objects_;Object.keys(u).forEach(function(h){var l=function(){function p(){v(this,p)}var L=p.prototype;return L.create=function(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new u[h](C)},p}();r.objectNamesToFactories.set(h,l)})},o.getObject=function(r,u){r.includes("#")&&console.warn("getObject:err:\u4E0D\u652F\u6301 #",r);var h=(u||{}).key,l="".concat(r).concat(h?"#".concat(h):""),p=this.objects.get(l);return p},o.getAllObject=function(r,u){r.includes("#")&&console.warn("getAllObject:err:\u4E0D\u652F\u6301 #",r);var h=(u||{}).key,l="".concat(r).concat(h?"#".concat(h):""),p=[];return this.objects.forEach(function(L,U){(U.startsWith("".concat(l,"#"))||U===l)&&p.push(L)}),p},o.draw=function(r,u,h){var l=this;return(0,O.Z)(A().mark(function p(){var L,U,C,x,N,F,e;return A().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(L=l.objectNamesToFactories.get(r),!L){n.next=15;break}return U=(u||{}).key,C="".concat(r).concat(U?"#".concat(U):""),l.objects.has(C)&&(x=P.MathUtils.generateUUID(),C+="#".concat(x)),N=(u==null?void 0:u.target)||h,typeof N=="string"?F=l.objects.get(N):(N==null?void 0:N.objecttype__)==="BaseObject"?F=N:F=l.pencil.scene,e=new L().create(u),e.pencil=l.pencil,e.key=C,l.objects.set(C,e),n.next=14,l.addMesh(e,F);case 14:return n.abrupt("return",e);case 15:throw new Error("Unrecognized:".concat(r));case 16:case"end":return n.stop()}},p)}))()},o.addMesh=function(r,u){return(0,O.Z)(A().mark(function h(){return A().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,r.create();case 2:r.object3d&&(r.object3d.userData.BaseObject_=r,u.add(r.object3d)),r.visible=!0,r.render(),r.pm.resolve();case 6:case"end":return p.stop()}},h)}))()},o.erase=function(){for(var r=arguments.length,u=new Array(r),h=0;h<r;h++)u[h]=arguments[h];var l=this;W(u).forEach(function(p){var L=[];if(typeof p=="string"){var U,C=R(p.split("#"),2),x=C[0],N=C[1];(U=L).push.apply(U,W(l.getAllObject(x,{key:N})))}else L.push(p);L.forEach(function(F){l.removeMesh(F)})})},o.removeMesh=function(r){var u=this,h=r.parent;r.object3d&&h.remove(r.object3d),r.traverse(function(l){l.visible=!1,l.dispose(),u.objects.delete(l.key)})},o.update=function(r,u){this.objects.forEach(function(h){h.update(r,u)})},o.setSize=function(r,u){this.objects.forEach(function(h){h.resize(r,u)})},o.dispose=function(){this.objects.forEach(function(r,u){r.dispose(),r.pm.reject("stop draw:".concat(u))}),this.objects.clear(),this.objectNamesToFactories.clear()},_(i,[{key:"objectsPromise",get:function(){var r=[];return this.objects.forEach(function(u){r.push(u.pm.promise)}),r}}]),i}(),k=function(){"use strict";function i(){v(this,i),this.data={}}var o=i.prototype;return o.install=function(){},o.setData=function(r,u){var h,l;this.data[r]=u,(l=(h=this).cb)===null||l===void 0||l.call(h,r)},o.dispose=function(){this.data={},this.cb=void 0},i}()})(),module.exports=K})();
|
package/package.json
CHANGED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import { Tween } from '@tweenjs/tween.js';
|
|
3
|
-
import BaseObject from '../../core/BaseObject';
|
|
4
|
-
import { MeshLine, MeshLineMaterial } from './meshLine';
|
|
5
|
-
interface Options {
|
|
6
|
-
nodes: THREE.Vector3[];
|
|
7
|
-
duration?: number;
|
|
8
|
-
delay?: number;
|
|
9
|
-
onComplete?: (...args: any[]) => void;
|
|
10
|
-
color?: string | THREE.Color | number;
|
|
11
|
-
lineWidth?: number;
|
|
12
|
-
sizeAttenuation?: number;
|
|
13
|
-
map?: THREE.Texture;
|
|
14
|
-
useMap?: number;
|
|
15
|
-
alphaMap?: THREE.Texture;
|
|
16
|
-
useAlphaMap?: number;
|
|
17
|
-
opacity?: number;
|
|
18
|
-
dashArray?: number;
|
|
19
|
-
dashOffset?: number;
|
|
20
|
-
dashRatio?: number;
|
|
21
|
-
useDash?: number;
|
|
22
|
-
visibility?: number;
|
|
23
|
-
alphaTest?: number;
|
|
24
|
-
repeat?: THREE.Vector2;
|
|
25
|
-
transparent?: boolean;
|
|
26
|
-
depthTest?: boolean;
|
|
27
|
-
setPointWidth?: (p: number) => number;
|
|
28
|
-
}
|
|
29
|
-
export declare class Line extends BaseObject {
|
|
30
|
-
options: Options;
|
|
31
|
-
tween: Tween<any>;
|
|
32
|
-
constructor(options?: Partial<Options>);
|
|
33
|
-
material: MeshLineMaterial;
|
|
34
|
-
geometry: THREE.BufferGeometry;
|
|
35
|
-
meshline: MeshLine;
|
|
36
|
-
create(): void;
|
|
37
|
-
resize(w: number, h: number): void;
|
|
38
|
-
animate(): void;
|
|
39
|
-
dispose(): void;
|
|
40
|
-
}
|
|
41
|
-
export default Line;
|