gl-draw 0.0.1 → 0.0.4

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.
Files changed (50) hide show
  1. package/dist/constants.d.ts +4 -0
  2. package/dist/core/BaseObject.d.ts +47 -0
  3. package/dist/core/CSSRenderer.d.ts +19 -0
  4. package/dist/core/Camera.d.ts +31 -0
  5. package/dist/core/Composer.d.ts +60 -0
  6. package/dist/core/Control.d.ts +28 -0
  7. package/dist/core/GUIObject.d.ts +38 -0
  8. package/dist/core/Pencil.d.ts +144 -0
  9. package/dist/core/Renderer.d.ts +49 -0
  10. package/dist/core/Scene.d.ts +19 -0
  11. package/dist/core/pass/bloom/UnrealBloomPass.d.ts +46 -0
  12. package/dist/core/pass/bloom/index.d.ts +33 -0
  13. package/dist/core/pass/outline/index.d.ts +37 -0
  14. package/dist/core/pass/ssr/index.d.ts +38 -0
  15. package/dist/geojson/china.json +103310 -0
  16. package/dist/geojson/countries.json +27483 -0
  17. package/dist/index.d.ts +2 -0
  18. package/dist/index.js +2038 -1
  19. package/dist/objects/css2dbind/index.d.ts +16 -0
  20. package/dist/objects/image/index.d.ts +21 -0
  21. package/dist/objects/index.d.ts +8 -0
  22. package/dist/objects/index.js +132 -0
  23. package/dist/objects/line/index.d.ts +1 -0
  24. package/dist/objects/line/line.d.ts +41 -0
  25. package/dist/objects/line/meshLine/index.d.ts +89 -0
  26. package/dist/objects/line/meshLine/shader/fragment.d.ts +2 -0
  27. package/dist/objects/line/meshLine/shader/vertex.d.ts +2 -0
  28. package/dist/objects/spriteImage/index.d.ts +20 -0
  29. package/dist/objects/spriteVideo/index.d.ts +29 -0
  30. package/dist/objects/text/index.d.ts +24 -0
  31. package/dist/objects/video/index.d.ts +29 -0
  32. package/dist/plugins/Cache.d.ts +10 -0
  33. package/dist/plugins/Draw.d.ts +32 -0
  34. package/dist/plugins/index.d.ts +2 -0
  35. package/dist/plugins/index.js +1 -0
  36. package/dist/shims.d.ts +5 -0
  37. package/dist/utils/chain.d.ts +23 -0
  38. package/dist/utils/colorCorrection.d.ts +2 -0
  39. package/dist/utils/disposeMesh.d.ts +2 -0
  40. package/dist/utils/exception.d.ts +26 -0
  41. package/dist/utils/getCache.d.ts +8 -0
  42. package/dist/utils/getElementView.d.ts +2 -0
  43. package/dist/utils/index.d.ts +10 -0
  44. package/dist/utils/index.js +1 -0
  45. package/dist/utils/isPlainObject.d.ts +1 -0
  46. package/dist/utils/makePromiseCreator.d.ts +6 -0
  47. package/dist/utils/polar2Cartesian.d.ts +1 -0
  48. package/dist/utils/timer.d.ts +9 -0
  49. package/dist/utils/to.d.ts +8 -0
  50. package/package.json +26 -11
@@ -0,0 +1,16 @@
1
+ import * as THREE from 'three';
2
+ import BaseObject from '../../core/BaseObject';
3
+ interface Options {
4
+ position: THREE.Vector3;
5
+ key?: string;
6
+ children?: HTMLElement;
7
+ onClick?: (key?: string) => {};
8
+ }
9
+ export declare class Css2dBind extends BaseObject {
10
+ options: Options;
11
+ constructor(options: Partial<Options>);
12
+ }
13
+ declare const _default: {
14
+ Css2dBind: typeof Css2dBind;
15
+ };
16
+ export default _default;
@@ -0,0 +1,21 @@
1
+ import * as THREE from 'three';
2
+ import BaseObject from '../../core/BaseObject';
3
+ import Cache from '../../plugins/Cache';
4
+ interface Options {
5
+ src: string;
6
+ scale?: number;
7
+ position?: THREE.Vector3;
8
+ transparent?: boolean;
9
+ blending?: THREE.Blending;
10
+ cache?: Cache;
11
+ depthWrite?: boolean;
12
+ alphaTest?: number;
13
+ }
14
+ export default class extends BaseObject {
15
+ options: Options;
16
+ texture: THREE.Texture;
17
+ constructor(options: Options);
18
+ getMaterial(): Promise<THREE.MeshBasicMaterial>;
19
+ create(): Promise<void>;
20
+ }
21
+ export {};
@@ -0,0 +1,8 @@
1
+ export { default as Text } from './text';
2
+ export { default as Image } from './image';
3
+ export { default as SpriteImage } from './spriteImage';
4
+ export { default as Video } from './video';
5
+ export { default as SpriteVideo } from './spriteVideo';
6
+ export { MeshLine, MeshLineMaterial, MeshLineRaycast } from './line/meshLine';
7
+ export { default as Line } from './line';
8
+ export { Css2dBind } from './css2dbind';
@@ -0,0 +1,132 @@
1
+ (function(){var Et={666:function(M){var O=function(S){"use strict";var T=Object.prototype,A=T.hasOwnProperty,j,P=typeof Symbol=="function"?Symbol:{},z=P.iterator||"@@iterator",Z=P.asyncIterator||"@@asyncIterator",W=P.toStringTag||"@@toStringTag";function E(d,c,g){return Object.defineProperty(d,c,{value:g,enumerable:!0,configurable:!0,writable:!0}),d[c]}try{E({},"")}catch(d){E=function(c,g,x){return c[g]=x}}function $(d,c,g,x){var _=c&&c.prototype instanceof C?c:C,F=Object.create(_.prototype),q=new ft(x||[]);return F._invoke=Y(d,g,q),F}S.wrap=$;function X(d,c,g){try{return{type:"normal",arg:d.call(c,g)}}catch(x){return{type:"throw",arg:x}}}var k="suspendedStart",f="suspendedYield",st="executing",I="completed",B={};function C(){}function G(){}function V(){}var tt={};E(tt,z,function(){return this});var et=Object.getPrototypeOf,rt=et&&et(et(nt([])));rt&&rt!==T&&A.call(rt,z)&&(tt=rt);var J=V.prototype=C.prototype=Object.create(tt);G.prototype=V,E(J,"constructor",V),E(V,"constructor",G),G.displayName=E(V,W,"GeneratorFunction");function it(d){["next","throw","return"].forEach(function(c){E(d,c,function(g){return this._invoke(c,g)})})}S.isGeneratorFunction=function(d){var c=typeof d=="function"&&d.constructor;return c?c===G||(c.displayName||c.name)==="GeneratorFunction":!1},S.mark=function(d){return Object.setPrototypeOf?Object.setPrototypeOf(d,V):(d.__proto__=V,E(d,W,"GeneratorFunction")),d.prototype=Object.create(J),d},S.awrap=function(d){return{__await:d}};function ct(d,c){function g(F,q,H,K){var R=X(d[F],d,q);if(R.type==="throw")K(R.arg);else{var _t=R.arg,dt=_t.value;return dt&&typeof dt=="object"&&A.call(dt,"__await")?c.resolve(dt.__await).then(function(ut){g("next",ut,H,K)},function(ut){g("throw",ut,H,K)}):c.resolve(dt).then(function(ut){_t.value=ut,H(_t)},function(ut){return g("throw",ut,H,K)})}}var x;function _(F,q){function H(){return new c(function(K,R){g(F,q,K,R)})}return x=x?x.then(H,H):H()}this._invoke=_}it(ct.prototype),E(ct.prototype,Z,function(){return this}),S.AsyncIterator=ct,S.async=function(d,c,g,x,_){_===void 0&&(_=Promise);var F=new ct($(d,c,g,x),_);return S.isGeneratorFunction(c)?F:F.next().then(function(q){return q.done?q.value:F.next()})};function Y(d,c,g){var x=k;return function(F,q){if(x===st)throw new Error("Generator is already running");if(x===I){if(F==="throw")throw q;return bt()}for(g.method=F,g.arg=q;;){var H=g.delegate;if(H){var K=ht(H,g);if(K){if(K===B)continue;return K}}if(g.method==="next")g.sent=g._sent=g.arg;else if(g.method==="throw"){if(x===k)throw x=I,g.arg;g.dispatchException(g.arg)}else g.method==="return"&&g.abrupt("return",g.arg);x=st;var R=X(d,c,g);if(R.type==="normal"){if(x=g.done?I:f,R.arg===B)continue;return{value:R.arg,done:g.done}}else R.type==="throw"&&(x=I,g.method="throw",g.arg=R.arg)}}}function ht(d,c){var g=d.iterator[c.method];if(g===j){if(c.delegate=null,c.method==="throw"){if(d.iterator.return&&(c.method="return",c.arg=j,ht(d,c),c.method==="throw"))return B;c.method="throw",c.arg=new TypeError("The iterator does not provide a 'throw' method")}return B}var x=X(g,d.iterator,c.arg);if(x.type==="throw")return c.method="throw",c.arg=x.arg,c.delegate=null,B;var _=x.arg;if(!_)return c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,B;if(_.done)c[d.resultName]=_.value,c.next=d.nextLoc,c.method!=="return"&&(c.method="next",c.arg=j);else return _;return c.delegate=null,B}it(J),E(J,W,"Generator"),E(J,z,function(){return this}),E(J,"toString",function(){return"[object Generator]"});function yt(d){var c={tryLoc:d[0]};1 in d&&(c.catchLoc=d[1]),2 in d&&(c.finallyLoc=d[2],c.afterLoc=d[3]),this.tryEntries.push(c)}function gt(d){var c=d.completion||{};c.type="normal",delete c.arg,d.completion=c}function ft(d){this.tryEntries=[{tryLoc:"root"}],d.forEach(yt,this),this.reset(!0)}S.keys=function(d){var c=[];for(var g in d)c.push(g);return c.reverse(),function x(){for(;c.length;){var _=c.pop();if(_ in d)return x.value=_,x.done=!1,x}return x.done=!0,x}};function nt(d){if(d){var c=d[z];if(c)return c.call(d);if(typeof d.next=="function")return d;if(!isNaN(d.length)){var g=-1,x=function _(){for(;++g<d.length;)if(A.call(d,g))return _.value=d[g],_.done=!1,_;return _.value=j,_.done=!0,_};return x.next=x}}return{next:bt}}S.values=nt;function bt(){return{value:j,done:!0}}return ft.prototype={constructor:ft,reset:function(d){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(gt),!d)for(var c in this)c.charAt(0)==="t"&&A.call(this,c)&&!isNaN(+c.slice(1))&&(this[c]=j)},stop:function(){this.done=!0;var d=this.tryEntries[0],c=d.completion;if(c.type==="throw")throw c.arg;return this.rval},dispatchException:function(d){if(this.done)throw d;var c=this;function g(K,R){return F.type="throw",F.arg=d,c.next=K,R&&(c.method="next",c.arg=j),!!R}for(var x=this.tryEntries.length-1;x>=0;--x){var _=this.tryEntries[x],F=_.completion;if(_.tryLoc==="root")return g("end");if(_.tryLoc<=this.prev){var q=A.call(_,"catchLoc"),H=A.call(_,"finallyLoc");if(q&&H){if(this.prev<_.catchLoc)return g(_.catchLoc,!0);if(this.prev<_.finallyLoc)return g(_.finallyLoc)}else if(q){if(this.prev<_.catchLoc)return g(_.catchLoc,!0)}else if(H){if(this.prev<_.finallyLoc)return g(_.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(d,c){for(var g=this.tryEntries.length-1;g>=0;--g){var x=this.tryEntries[g];if(x.tryLoc<=this.prev&&A.call(x,"finallyLoc")&&this.prev<x.finallyLoc){var _=x;break}}_&&(d==="break"||d==="continue")&&_.tryLoc<=c&&c<=_.finallyLoc&&(_=null);var F=_?_.completion:{};return F.type=d,F.arg=c,_?(this.method="next",this.next=_.finallyLoc,B):this.complete(F)},complete:function(d,c){if(d.type==="throw")throw d.arg;return d.type==="break"||d.type==="continue"?this.next=d.arg:d.type==="return"?(this.rval=this.arg=d.arg,this.method="return",this.next="end"):d.type==="normal"&&c&&(this.next=c),B},finish:function(d){for(var c=this.tryEntries.length-1;c>=0;--c){var g=this.tryEntries[c];if(g.finallyLoc===d)return this.complete(g.completion,g.afterLoc),gt(g),B}},catch:function(d){for(var c=this.tryEntries.length-1;c>=0;--c){var g=this.tryEntries[c];if(g.tryLoc===d){var x=g.completion;if(x.type==="throw"){var _=x.arg;gt(g)}return _}}throw new Error("illegal catch attempt")},delegateYield:function(d,c,g){return this.delegate={iterator:nt(d),resultName:c,nextLoc:g},this.method==="next"&&(this.arg=j),B}},S}(M.exports);try{regeneratorRuntime=O}catch(S){typeof globalThis=="object"?globalThis.regeneratorRuntime=O:Function("r","regeneratorRuntime = r")(O)}},695:function(M,O,S){"use strict";S.d(O,{Z:function(){return T}});function T(A){if(A.geometry&&A.geometry.dispose(),A.material){var j=Array.isArray(A.material)?A.material:[A.material];j.forEach(function(P){var z,Z,W,E,$,X,k,f,st,I,B,C,G;(z=P.map)===null||z===void 0||z.dispose(),(Z=P.lightMap)===null||Z===void 0||Z.dispose(),(W=P.bumpMap)===null||W===void 0||W.dispose(),(E=P.normalMap)===null||E===void 0||E.dispose(),($=P.specularMap)===null||$===void 0||$.dispose(),(X=P.envMap)===null||X===void 0||X.dispose(),(k=P.alphaMap)===null||k===void 0||k.dispose(),(f=P.aoMap)===null||f===void 0||f.dispose(),(st=P.displacementMap)===null||st===void 0||st.dispose(),(I=P.emissiveMap)===null||I===void 0||I.dispose(),(B=P.gradientMap)===null||B===void 0||B.dispose(),(C=P.metalnessMap)===null||C===void 0||C.dispose(),(G=P.roughnessMap)===null||G===void 0||G.dispose(),P.dispose()})}}},519:function(M,O,S){"use strict";S.d(O,{disposeMesh:function(){return P.Z}});var T=S(666),A=S.n(T),j=null,P=S(695),z=S(644);function Z(I){if(I.material){var B=Array.isArray(I.material)?I.material:[I.material];B.forEach(function(C){var G,V;(G=C.color)===null||G===void 0||G.convertSRGBToLinear(),(V=C.emissive)===null||V===void 0||V.convertSRGBToLinear(),C.map&&(C.map.encoding=THREE.sRGBEncoding),C.emissiveMap&&(C.emissiveMap.encoding=THREE.sRGBEncoding)})}}var W=S(568),E=S(924),$=require("idb-keyval"),X=S(484),k=null,f=null,st=function(){var I=(0,W.Z)(A().mark(function B(C,G){var V,tt,et,rt,J,it;return A().wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return V=G.version,Y.next=4,(0,$.get)(C);case 4:if(et=Y.sent,!(et&&et[V])){Y.next=9;break}tt=et[V],Y.next=15;break;case 9:return Y.next=11,(0,X.Z)(fetch(C).then(function(ht){if(ht.ok)return ht.blob();throw new Error}));case 11:rt=Y.sent,J=rt.res,it=rt.err,it||(tt=J,(0,$.set)(C,(0,E.Z)({},V,J)));case 15:return Y.abrupt("return",tt?{url:URL.createObjectURL(tt)}:{url:C});case 16:case"end":return Y.stop()}},B)}));return function(C,G){return I.apply(this,arguments)}}()},484:function(M,O,S){"use strict";S.d(O,{Z:function(){return A}});var T=S(42);function A(j){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return j.then(function(z){return(0,T.Z)({err:null,res:z},P)}).catch(function(z){return(0,T.Z)({err:z,res:void 0},P)})}},644:function(M){"use strict";M.exports=require("three")},568:function(M,O,S){"use strict";S.d(O,{Z:function(){return A}});function T(j,P,z,Z,W,E,$){try{var X=j[E]($),k=X.value}catch(f){z(f);return}X.done?P(k):Promise.resolve(k).then(Z,W)}function A(j){return function(){var P=this,z=arguments;return new Promise(function(Z,W){var E=j.apply(P,z);function $(k){T(E,Z,W,$,X,"next",k)}function X(k){T(E,Z,W,$,X,"throw",k)}$(void 0)})}}},924:function(M,O,S){"use strict";S.d(O,{Z:function(){return T}});function T(A,j,P){return j in A?Object.defineProperty(A,j,{value:P,enumerable:!0,configurable:!0,writable:!0}):A[j]=P,A}},42:function(M,O,S){"use strict";S.d(O,{Z:function(){return A}});var T=S(924);function A(j){for(var P=1;P<arguments.length;P++){var z=arguments[P]!=null?arguments[P]:{},Z=Object.keys(z);typeof Object.getOwnPropertySymbols=="function"&&(Z=Z.concat(Object.getOwnPropertySymbols(z).filter(function(W){return Object.getOwnPropertyDescriptor(z,W).enumerable}))),Z.forEach(function(W){(0,T.Z)(j,W,z[W])})}return j}}},Ct={};function N(M){var O=Ct[M];if(O!==void 0)return O.exports;var S=Ct[M]={exports:{}};return Et[M](S,S.exports,N),S.exports}(function(){N.n=function(M){var O=M&&M.__esModule?function(){return M.default}:function(){return M};return N.d(O,{a:O}),O}})(),function(){N.d=function(M,O){for(var S in O)N.o(O,S)&&!N.o(M,S)&&Object.defineProperty(M,S,{enumerable:!0,get:O[S]})}}(),function(){N.o=function(M,O){return Object.prototype.hasOwnProperty.call(M,O)}}(),function(){N.r=function(M){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(M,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(M,"__esModule",{value:!0})}}();var St={};(function(){"use strict";N.r(St),N.d(St,{Css2dBind:function(){return Tt},Image:function(){return kt},Line:function(){return Nt},MeshLine:function(){return ot},MeshLineMaterial:function(){return Pt},MeshLineRaycast:function(){return jt},SpriteImage:function(){return Rt},SpriteVideo:function(){return Bt},Text:function(){return Lt},Video:function(){return zt}});function M(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}function O(e,a){return O=Object.setPrototypeOf||function(i,n){return i.__proto__=n,i},O(e,a)}function S(e,a){return O(e,a)}function T(e,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(a&&a.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),a&&S(e,a)}var A=N(42);function j(e,a){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);a&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function P(e,a){return a=a!=null?a:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):j(Object(a)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(a,r))}),e}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(e){return!1}}function Z(e){return Z=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Z(e)}function W(e){return Z(e)}function E(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 X(e,a){return a&&($(a)==="object"||typeof a=="function")?a:E(e)}function k(e){var a=z();return function(){var i=W(e),n;if(a){var t=W(this).constructor;n=Reflect.construct(i,arguments,t)}else n=i.apply(this,arguments);return X(this,n)}}var f=N(644);function st(){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 I(e,a,r){return st()?I=Reflect.construct:I=function(n,t,o){var s=[null];s.push.apply(s,t);var v=Function.bind.apply(n,s),y=new v;return o&&S(y,o.prototype),y},I.apply(null,arguments)}function B(e,a,r){return I.apply(null,arguments)}function C(e,a){for(var r=0;r<a.length;r++){var i=a[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function G(e,a,r){return a&&C(e.prototype,a),r&&C(e,r),e}function V(e,a){(a==null||a>e.length)&&(a=e.length);for(var r=0,i=new Array(a);r<a;r++)i[r]=e[r];return i}function tt(e){if(Array.isArray(e))return V(e)}function et(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function rt(){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 J(e,a){if(!!e){if(typeof e=="string")return V(e,a);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 V(e,a)}}function it(e){return tt(e)||et(e)||J(e)||rt()}var ct=N(484);function Y(){var e=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(i,n){r.resolve=i,r.reject=n}),e&&(r.promise=(0,ct.Z)(r.promise,a)),r}var ht=require("@tweenjs/tween.js"),yt=N.n(ht),gt=function(){"use strict";function e(){M(this,e),this.guiParams={}}var a=e.prototype;return a.showGuiParams=function(i){var n=this;!i||Object.keys(this.guiParams).forEach(function(t){var o=i.addFolder(t),s=n.guiParams[t];Object.keys(s).forEach(function(v){var y=s[v],p=y.min,b=y.max,w=y.step,m=y.name,h=y.to,l=y.paramMap,u=y.items,L=y.value,D=y.target,Q=v.toLowerCase().indexOf("color")>-1,U,lt=typeof L=="undefined"&&D,vt=lt?D():s[v],mt=lt?v:"value";u?U=o.add(vt,mt,u):Q?U=o.addColor(vt,mt):U=o.add(vt,mt),U=U.name(m||v),typeof p!="undefined"&&(U=U.min(p)),typeof b!="undefined"&&(U=U.max(b)),typeof w!="undefined"&&(U=U.step(w)),U=U.onChange(function(){n.setGuiTargetValue(t,v,vt[mt],l)}),(h||lt)&&U.listen()})})},a.setGuiTargetValue=function(i,n,t,o){var s=this.guiParams[i][n],v=s.onChange,y=s.target,p=s.value,b=n.toLowerCase().indexOf("color")>-1,w=typeof p=="undefined"&&y;if(y&&!w){var m=y();Array.isArray(m)||(m=[m]),m.forEach(function(h){if(!!h)if(b)try{h[o||n].set(t)}catch(l){n!=="color"&&!o&&console.warn("".concat(n," is not a color,set paramMap"))}else h[o||n]=t})}v&&v(t)},a.setGuiTargetValueByParams=function(){var i=this;Object.keys(this.guiParams).forEach(function(n){Object.keys(i.guiParams[n]).forEach(function(t){var o=i.guiParams[n][t];typeof o.value!="undefined"&&i.setGuiTargetValue(n,t,o.value,o.paramMap)})})},a.guiParamTween=function(i,n,t){var o=t.duration,s=o===void 0?0:o,v=this,y=this.guiParams[i][n],p=y.to,b=y.paramMap,w=b===void 0?"":b;return new(yt()).Tween(this.guiParams[i][n]).to({value:p},s).onUpdate(function(m){v.setGuiTargetValue(i,n,m.value,w)})},e}();class ft extends f.Object3D{constructor(a=document.createElement("div")){super(),this.element=a,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.addEventListener("removed",function(){this.traverse(function(r){r.element instanceof Element&&r.element.parentNode!==null&&r.element.parentNode.removeChild(r.element)})})}copy(a,r){return super.copy(a,r),this.element=a.element.cloneNode(!0),this}}ft.prototype.isCSS2DObject=!0;const nt=new f.Vector3,bt=new f.Matrix4,d=new f.Matrix4,c=new f.Vector3,g=new f.Vector3;class x{constructor(a={}){const r=this;let i,n,t,o;const s={objects:new WeakMap},v=a.element!==void 0?a.element:document.createElement("div");v.style.overflow="hidden",this.domElement=v,this.getSize=function(){return{width:i,height:n}},this.render=function(m,h){m.autoUpdate===!0&&m.updateMatrixWorld(),h.parent===null&&h.updateMatrixWorld(),bt.copy(h.matrixWorldInverse),d.multiplyMatrices(h.projectionMatrix,bt),y(m,m,h),w(m)},this.setSize=function(m,h){i=m,n=h,t=i/2,o=n/2,v.style.width=m+"px",v.style.height=h+"px"};function y(m,h,l){if(m.isCSS2DObject){m.onBeforeRender(r,h,l),nt.setFromMatrixPosition(m.matrixWorld),nt.applyMatrix4(d);const u=m.element;/apple/i.test(navigator.vendor)?u.style.transform="translate(-50%,-50%) translate("+Math.round(nt.x*t+t)+"px,"+Math.round(-nt.y*o+o)+"px)":u.style.transform="translate(-50%,-50%) translate("+(nt.x*t+t)+"px,"+(-nt.y*o+o)+"px)",u.style.display=m.visible&&nt.z>=-1&&nt.z<=1?"":"none";const L={distanceToCameraSquared:p(l,m)};s.objects.set(m,L),u.parentNode!==v&&v.appendChild(u),m.onAfterRender(r,h,l)}for(let u=0,L=m.children.length;u<L;u++)y(m.children[u],h,l)}function p(m,h){return c.setFromMatrixPosition(m.matrixWorld),g.setFromMatrixPosition(h.matrixWorld),c.distanceToSquared(g)}function b(m){const h=[];return m.traverse(function(l){l.isCSS2DObject&&h.push(l)}),h}function w(m){const h=b(m).sort(function(u,L){const D=s.objects.get(u).distanceToCameraSquared,Q=s.objects.get(L).distanceToCameraSquared;return D-Q}),l=h.length;for(let u=0,L=h.length;u<L;u++)h[u].element.style.zIndex=l-u}}}const _=new f.Vector3,F=new f.Quaternion,q=new f.Vector3;class H extends f.Object3D{constructor(a=document.createElement("div")){super(),this.element=a,this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.addEventListener("removed",function(){this.traverse(function(r){r.element instanceof Element&&r.element.parentNode!==null&&r.element.parentNode.removeChild(r.element)})})}copy(a,r){return super.copy(a,r),this.element=a.element.cloneNode(!0),this}}H.prototype.isCSS3DObject=!0;class K extends H{constructor(a){super(a),this.rotation2D=0}copy(a,r){return super.copy(a,r),this.rotation2D=a.rotation2D,this}}K.prototype.isCSS3DSprite=!0;const R=new f.Matrix4,_t=new f.Matrix4;class dt{constructor(a={}){const r=this;let i,n,t,o;const s={camera:{fov:0,style:""},objects:new WeakMap},v=a.element!==void 0?a.element:document.createElement("div");v.style.overflow="hidden",this.domElement=v;const y=document.createElement("div");y.style.transformStyle="preserve-3d",y.style.pointerEvents="none",v.appendChild(y),this.getSize=function(){return{width:i,height:n}},this.render=function(h,l){const u=l.projectionMatrix.elements[5]*o;s.camera.fov!==u&&(v.style.perspective=l.isPerspectiveCamera?u+"px":"",s.camera.fov=u),h.autoUpdate===!0&&h.updateMatrixWorld(),l.parent===null&&l.updateMatrixWorld();let L,D;l.isOrthographicCamera&&(L=-(l.right+l.left)/2,D=(l.top+l.bottom)/2);const Q=l.isOrthographicCamera?"scale("+u+")translate("+p(L)+"px,"+p(D)+"px)"+b(l.matrixWorldInverse):"translateZ("+u+"px)"+b(l.matrixWorldInverse),U=Q+"translate("+t+"px,"+o+"px)";s.camera.style!==U&&(y.style.transform=U,s.camera.style=U),m(h,h,l,Q)},this.setSize=function(h,l){i=h,n=l,t=i/2,o=n/2,v.style.width=h+"px",v.style.height=l+"px",y.style.width=h+"px",y.style.height=l+"px"};function p(h){return Math.abs(h)<1e-10?0:h}function b(h){const l=h.elements;return"matrix3d("+p(l[0])+","+p(-l[1])+","+p(l[2])+","+p(l[3])+","+p(l[4])+","+p(-l[5])+","+p(l[6])+","+p(l[7])+","+p(l[8])+","+p(-l[9])+","+p(l[10])+","+p(l[11])+","+p(l[12])+","+p(-l[13])+","+p(l[14])+","+p(l[15])+")"}function w(h){const l=h.elements,u="matrix3d("+p(l[0])+","+p(l[1])+","+p(l[2])+","+p(l[3])+","+p(-l[4])+","+p(-l[5])+","+p(-l[6])+","+p(-l[7])+","+p(l[8])+","+p(l[9])+","+p(l[10])+","+p(l[11])+","+p(l[12])+","+p(l[13])+","+p(l[14])+","+p(l[15])+")";return"translate(-50%,-50%)"+u}function m(h,l,u,L){if(h.isCSS3DObject){h.onBeforeRender(r,l,u);let D;h.isCSS3DSprite?(R.copy(u.matrixWorldInverse),R.transpose(),h.rotation2D!==0&&R.multiply(_t.makeRotationZ(h.rotation2D)),h.matrixWorld.decompose(_,F,q),R.setPosition(_),R.scale(q),R.elements[3]=0,R.elements[7]=0,R.elements[11]=0,R.elements[15]=1,D=w(R)):D=w(h.matrixWorld);const Q=h.element,U=s.objects.get(h);if(U===void 0||U.style!==D){Q.style.transform=D;const lt={style:D};s.objects.set(h,lt)}Q.style.display=h.visible?"":"none",Q.parentNode!==y&&y.appendChild(Q),h.onAfterRender(r,l,u)}for(let D=0,Q=h.children.length;D<Q;D++)m(h.children[D],l,u,L)}}}var ut=N(519),pt=function(e){"use strict";T(r,e);var a=k(r);function r(n){M(this,r);var t;return t=a.call(this),t.objecttype__="BaseObject",t.isAdd=!1,t.userData={},t.pm=Y(),t.visible=!1,t}var i=r.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(t,o){},i.resize=function(t,o){},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 t=arguments.length,o=new Array(t),s=0;s<t;s++)o[s]=arguments[s];return this.object3d=B(f.Mesh,it(o)),this},i.createGroup=function(){return this.object3d=new f.Group,this},i.createPoints=function(){for(var t=arguments.length,o=new Array(t),s=0;s<t;s++)o[s]=arguments[s];return this.object3d=B(f.Points,it(o)),this},i.createCSS2DObject=function(t){return this.object3d=new ft(t),this},i.createCSS3DObject=function(t){return this.object3d=new H(t),this},i.createCSS3DSprite=function(t){return this.object3d=new K(t),this},i.add=function(){for(var t=arguments.length,o=new Array(t),s=0;s<t;s++)o[s]=arguments[s];var v;return(v=this.object3d).add.apply(v,it(o)),this},i.remove=function(){for(var t=arguments.length,o=new Array(t),s=0;s<t;s++)o[s]=arguments[s];var v;return(v=this.object3d).remove.apply(v,it(o)),this},i.getSize=function(){var t=new f.Box3().setFromObject(this.object3d);return{min:t.min,max:t.max,size:t.getSize(new f.Vector3)}},i.traverse=function(t){t(this),this.children.forEach(function(o){o.traverse(t)})},i.dispose=function(){var t;(t=this.object3d)===null||t===void 0||t.traverse(function(o){(0,ut.disposeMesh)(o)})},G(r,[{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})}}]),r}(gt),Lt=function(e){"use strict";T(r,e);var a=k(r);function r(n){M(this,r);var t;return t=a.call(this),t.width=0,t.options=(0,A.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},n),t}var i=r.prototype;return i.init=function(){var t=document.createElement("canvas");this.canvas=t},i.create=function(){var t=this.options,o=t.position,s=t.lookAt,v=t.sprite,y=t.text,p=t.sizeAttenuation;if(v){var b=new f.Sprite(new f.SpriteMaterial({transparent:!0,sizeAttenuation:p}));this.object3d=b}else{var w=new f.MeshBasicMaterial({side:f.DoubleSide,transparent:!0}),m=new f.PlaneGeometry(1,1,1,1);this.createMesh(m,w)}this.object3d.position.copy(o),s&&this.object3d.lookAt(s),this.setText(y)},i.setText=function(t,o){var s=(0,A.Z)(P((0,A.Z)({},this.options),{text:t}),o||{}),v=s.text,y=s.fontSize,p=s.fontFamily,b=s.fontWeight,w=s.flipX,m=s.scale,h=this.canvas;h.width=y*v.length*2,h.height=y;var l=h.getContext("2d");l.font="".concat(b," ").concat(y,"px/1 ").concat(p);var u=l.measureText(v).width;h.width=u,this.width=u,l=h.getContext("2d"),l.clearRect(0,0,h.width,h.height),w&&l.scale(-1,1),l.font="".concat(b," ").concat(y,"px/1 ").concat(p),l.textBaseline="middle",l.fillStyle="#ffffff",l.fillText(v,w?u*-1:0,h.height/2),l.restore();var L=new f.Texture(h);L.anisotropy=16,L.needsUpdate=!0;var D=this.object3d;D.material.map&&D.material.map.dispose(),D.material.map=L,D.material.needsUpdate=!0,D.scale.set(L.image.width*m,L.image.height*m,1)},r}(pt),wt=N(568),Wt=N(666),at=N.n(Wt),kt=function(e){"use strict";T(r,e);var a=k(r);function r(n){M(this,r);var t;return t=a.call(this),t.options=n,t}var i=r.prototype;return i.getMaterial=function(){var t=this;return(0,wt.Z)(at().mark(function o(){var s,v,y,p,b,w,m,h;return at().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return s=t.options,v=s.transparent,y=s.blending,p=s.src,b=s.depthWrite,w=s.alphaTest,u.next=3,new f.TextureLoader().loadAsync(p);case 3:return m=u.sent,h=new f.MeshBasicMaterial({map:m,transparent:v!=null?v:!1,blending:y!=null?y:f.NormalBlending,depthWrite:b!=null?b:!0,alphaTest:w!=null?w:0}),u.abrupt("return",h);case 6:case"end":return u.stop()}},o)}))()},i.create=function(){var t=this;return(0,wt.Z)(at().mark(function o(){var s,v,y,p,b,w,m,h;return at().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=t.options,v=s.scale,y=s.position,p=s.src,b=s.cache,!(b&&!b.get(p))){u.next=7;break}return b.init(p),u.next=5,t.getMaterial();case 5:w=u.sent,b.set(p,w);case 7:if(!b){u.next=13;break}return u.next=10,b.get(p);case 10:u.t0=u.sent,u.next=16;break;case 13:return u.next=15,t.getMaterial();case 15:u.t0=u.sent;case 16:m=u.t0,t.texture=m.map,h=new f.PlaneBufferGeometry(m.map.image.width,m.map.image.height),t.createMesh(h,m),v&&t.object3d.scale.set(v,v,1),y&&t.object3d.position.copy(y);case 22:case"end":return u.stop()}},o)}))()},r}(pt),Rt=function(e){"use strict";T(r,e);var a=k(r);function r(n){M(this,r);var t;return t=a.call(this),t.options=n,t}var i=r.prototype;return i.init=function(){var t=this;return(0,wt.Z)(at().mark(function o(){var s,v;return at().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return s=t.options.src,p.next=3,new f.TextureLoader().loadAsync(s);case 3:v=p.sent,t.texture=v;case 5:case"end":return p.stop()}},o)}))()},i.create=function(){var t=this.texture,o=this.options,s=o.scale,v=o.position,y=o.blending,p=o.transparent,b=o.depthWrite,w=o.alphaTest,m=o.sizeAttenuation,h=new f.Sprite(new f.SpriteMaterial({map:t,transparent:p!=null?p:!0,blending:y!=null?y:f.NormalBlending,depthWrite:b!=null?b:!0,alphaTest:w!=null?w:0,sizeAttenuation:m!=null?m:!0}));s&&h.scale.set(t.image.width*s,t.image.height*s,1),v&&h.position.copy(v),this.object3d=h},r}(pt);function Dt(e,a){for(;!Object.prototype.hasOwnProperty.call(e,a)&&(e=W(e),e!==null););return e}function xt(e,a,r){return typeof Reflect!="undefined"&&Reflect.get?xt=Reflect.get:xt=function(n,t,o){var s=Dt(n,t);if(!!s){var v=Object.getOwnPropertyDescriptor(s,t);return v.get?v.get.call(o||n):v.value}},xt(e,a,r)}function Ot(e,a,r){return xt(e,a,r)}var zt=function(e){"use strict";T(r,e);var a=k(r);function r(n){M(this,r);var t;return t=a.call(this),t.options=(0,A.Z)({},{autoPlay:!0,loop:!0},n),t}var i=r.prototype;return i.getMaterial=function(){var t=this.options,o=t.src,s=t.transparent,v=t.blending,y=t.depthWrite,p=t.format,b=t.autoPlay,w=t.loop,m=t.alphaTest,h=Y(),l=document.createElement("video");return l.addEventListener("loadedmetadata",function(){var u=new f.VideoTexture(l);u.format=p!=null?p:f.RGBAFormat,u.needsUpdate=!0;var L=new f.MeshBasicMaterial({map:u,transparent:s!=null?s:!0,blending:v!=null?v:f.AdditiveBlending,depthWrite:y!=null?y:!0,alphaTest:m!=null?m:0});h.resolve(L)},!1),l.src=o,l.muted=!0,l.autoplay=b,l.loop=w,l.preload="auto",h.promise},i.create=function(){var t=this;return(0,wt.Z)(at().mark(function o(){var s,v,y,p,b,w,m,h;return at().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=t.options,v=s.scale,y=s.position,p=s.src,b=s.cache,!(b&&!b.get(p))){u.next=7;break}return b.init(p),u.next=5,t.getMaterial();case 5:w=u.sent,b.set(p,w);case 7:if(!b){u.next=13;break}return u.next=10,b.get(p);case 10:u.t0=u.sent,u.next=16;break;case 13:return u.next=15,t.getMaterial();case 15:u.t0=u.sent;case 16:m=u.t0,t.video=m.map.image,h=new f.PlaneBufferGeometry(t.video.videoWidth,t.video.videoHeight),t.createMesh(h,m),v&&t.object3d.scale.set(v,v,1),y&&t.object3d.position.copy(y);case 22:case"end":return u.stop()}},o)}))()},i.render=function(){var t=this.options.autoPlay;t&&this.video.play()},i.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),Ot(W(r.prototype),"dispose",this).call(this)},r}(pt),Bt=function(e){"use strict";T(r,e);var a=k(r);function r(n){M(this,r);var t;return t=a.call(this),t.options=(0,A.Z)({},{autoPlay:!0,loop:!0},n),t}var i=r.prototype;return i.getMaterial=function(){var t=this.options,o=t.src,s=t.transparent,v=t.blending,y=t.depthWrite,p=t.autoPlay,b=t.loop,w=t.alphaTest,m=t.format,h=Y(),l=document.createElement("video");return l.addEventListener("loadedmetadata",function(){var u=new f.VideoTexture(l);u.format=m!=null?m:f.RGBAFormat,u.needsUpdate=!0;var L=new f.SpriteMaterial({map:u,transparent:s!=null?s:!0,blending:v!=null?v:f.AdditiveBlending,depthWrite:y!=null?y:!0,alphaTest:w!=null?w:0});h.resolve(L)},!1),l.src=o,l.muted=!0,l.autoplay=p,l.loop=b,l.preload="auto",h.promise},i.create=function(){var t=this;return(0,wt.Z)(at().mark(function o(){var s,v,y,p,b,w,m,h;return at().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=t.options,v=s.scale,y=s.position,p=s.src,b=s.cache,!(b&&!b.get(p))){u.next=7;break}return b.init(p),u.next=5,t.getMaterial();case 5:w=u.sent,b.set(p,w);case 7:if(!b){u.next=13;break}return u.next=10,b.get(p);case 10:u.t0=u.sent,u.next=16;break;case 13:return u.next=15,t.getMaterial();case 15:u.t0=u.sent;case 16:m=u.t0,t.video=m.map.image,h=new f.Sprite(m),v&&h.scale.set(t.video.videoWidth*v,t.video.videoHeight*v,1),y&&h.position.copy(y),t.object3d=h;case 22:case"end":return u.stop()}},o)}))()},i.render=function(){var t=this.options.autoPlay;t&&this.video.play()},i.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),Ot(W(r.prototype),"dispose",this).call(this)},r}(pt),Vt=`
2
+ `.concat(f.ShaderChunk.logdepthbuf_pars_vertex,`
3
+ `).concat(f.ShaderChunk.fog_pars_vertex,`
4
+ attribute vec3 previous;
5
+ attribute vec3 next;
6
+ attribute float side;
7
+ attribute float width;
8
+ attribute float counters;
9
+
10
+ uniform vec2 resolution;
11
+ uniform float lineWidth;
12
+ uniform vec3 color;
13
+ uniform float opacity;
14
+ uniform float sizeAttenuation;
15
+ uniform vec2 offset;
16
+ uniform float time;
17
+ uniform vec3 lightColor;
18
+ uniform vec2 uCenter;
19
+ uniform float size;
20
+ uniform float speed;
21
+ uniform float lightWidth;
22
+ uniform float lineLightAnimation;
23
+
24
+ varying vec2 vUV;
25
+ varying vec4 vColor;
26
+ varying float vCounters;
27
+
28
+ vec2 fix(vec4 i,float aspect){
29
+
30
+ vec2 res=i.xy/i.w;
31
+ res.x*=aspect;
32
+ vCounters=counters;
33
+ return res;
34
+
35
+ }
36
+
37
+ void main(){
38
+
39
+ float aspect=resolution.x/resolution.y;
40
+ float pixelWidthRatio=1./(resolution.x*projectionMatrix[0][0]);
41
+
42
+ if (lineLightAnimation == 1.0) {
43
+ vec2 vWorld=position.xy;
44
+ float r_time=mod(time/(speed*size),2.);
45
+ float l=distance(vWorld, uCenter)/size;
46
+ float r_opacity=smoothstep(r_time-lightWidth*2.,r_time-lightWidth,l)-smoothstep(r_time-lightWidth,r_time,l);
47
+ vColor=vec4(mix(color,lightColor,r_opacity),opacity);
48
+ } else {
49
+ vColor=vec4(color,opacity);
50
+ }
51
+
52
+
53
+ vUV=uv+offset;
54
+
55
+ mat4 m=projectionMatrix*modelViewMatrix;
56
+ vec4 finalPosition=m*vec4(position,1.);
57
+ vec4 prevPos=m*vec4(previous,1.);
58
+ vec4 nextPos=m*vec4(next,1.);
59
+
60
+ vec2 currentP=fix(finalPosition,aspect);
61
+ vec2 prevP=fix(prevPos,aspect);
62
+ vec2 nextP=fix(nextPos,aspect);
63
+
64
+ float pixelWidth=finalPosition.w*pixelWidthRatio;
65
+ float w=1.8*pixelWidth*lineWidth*width;
66
+
67
+ if(sizeAttenuation==1.){
68
+ w=1.8*lineWidth*width;
69
+ }
70
+
71
+ vec2 dir;
72
+ if(nextP==currentP)dir=normalize(currentP-prevP);
73
+ else if(prevP==currentP)dir=normalize(nextP-currentP);
74
+ else{
75
+ vec2 dir1=normalize(currentP-prevP);
76
+ vec2 dir2=normalize(nextP-currentP);
77
+ dir=normalize(dir1+dir2);
78
+
79
+ vec2 perp=vec2(-dir1.y,dir1.x);
80
+ vec2 miter=vec2(-dir.y,dir.x);
81
+ //w = clamp( w / dot( miter, perp ), 0., 4. * lineWidth * width );
82
+
83
+ }
84
+
85
+ //vec2 normal = ( cross( vec3( dir, 0. ), vec3( 0., 0., 1. ) ) ).xy;
86
+ vec2 normal=vec2(-dir.y,dir.x);
87
+ normal.x/=aspect;
88
+ normal*=.5*w;
89
+
90
+ vec4 offset=vec4(normal*side,0.,1.);
91
+ finalPosition.xy+=offset.xy;
92
+
93
+ gl_Position=finalPosition;
94
+ `).concat(f.ShaderChunk.logdepthbuf_vertex,`
95
+ vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
96
+ `).concat(f.ShaderChunk.fog_vertex,`
97
+ }
98
+ `),Gt=`
99
+ `.concat(f.ShaderChunk.fog_pars_fragment,`
100
+ `).concat(f.ShaderChunk.logdepthbuf_pars_fragment,`
101
+
102
+
103
+ uniform sampler2D map;
104
+ uniform sampler2D alphaMap;
105
+ uniform float useMap;
106
+ uniform float useAlphaMap;
107
+ uniform float useDash;
108
+ uniform float dashArray;
109
+ uniform float dashOffset;
110
+ uniform float dashRatio;
111
+ uniform float visibility;
112
+ uniform float alphaTest;
113
+ uniform vec2 repeat;
114
+
115
+ varying vec2 vUV;
116
+ varying vec4 vColor;
117
+ varying float vCounters;
118
+
119
+ void main() {
120
+ `).concat(f.ShaderChunk.logdepthbuf_fragment,`
121
+ vec4 c = vColor;
122
+ if( useMap == 1. ) c *= texture2D( map, vUV * repeat );
123
+ if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;
124
+ if( c.a < alphaTest ) discard;
125
+ if( useDash == 1. ){
126
+ c.a *= ceil(mod(vCounters + dashOffset, dashArray) - (dashArray * dashRatio));
127
+ }
128
+ gl_FragColor = c;
129
+ gl_FragColor.a *= step(vCounters, visibility);
130
+ `).concat(f.ShaderChunk.fog_fragment,`
131
+ }
132
+ `),ot=function(e){"use strict";T(r,e);var a=k(r);function r(){M(this,r);var i;return i=a.call(this),i.isMeshLine=!0,i.type="MeshLine",i.positions=[],i.previous=[],i.next=[],i.side=[],i.width=[],i.indices_array=[],i.uvs=[],i.counters=[],i._points=[],i._geom=null,i.widthCallback=null,i.matrixWorld=new f.Matrix4,Object.defineProperties(E(i),{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)}}}),i}return r}(f.BufferGeometry);ot.prototype.setMatrixWorld=function(e){this.matrixWorld=e},ot.prototype.setGeometry=function(e,a){this._geometry=e,this.setPoints(e.getAttribute("position").array,a)},ot.prototype.setPoints=function(e,a){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=a,this.positions=[],this.counters=[],e.length&&e[0]instanceof f.Vector3)for(var r=0;r<e.length;r++){var i=e[r],n=r/e.length;this.positions.push(i.x,i.y,i.z),this.positions.push(i.x,i.y,i.z),this.counters.push(n),this.counters.push(n)}else for(var r=0;r<e.length;r+=3){var n=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(n),this.counters.push(n)}this.process()};function jt(e,a){var r=new f.Matrix4,i=new f.Ray,n=new f.Sphere,t=new f.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),n.copy(o.boundingSphere),n.applyMatrix4(this.matrixWorld),e.ray.intersectSphere(n,t)!==!1){r.copy(this.matrixWorld).invert(),i.copy(e.ray).applyMatrix4(r);var s=new f.Vector3,v=new f.Vector3,y=new f.Vector3,p=this instanceof f.LineSegments?2:1,b=o.index,w=o.attributes;if(b!==null)for(var m=b.array,h=w.position.array,l=w.width.array,u=0,L=m.length-1;u<L;u+=p){var D=m[u],Q=m[u+1];s.fromArray(h,D*3),v.fromArray(h,Q*3);var U=l[Math.floor(u/3)]!==void 0?l[Math.floor(u/3)]:1,lt=e.params.Line.threshold+this.material.lineWidth*U/2,vt=lt*lt,mt=i.distanceSqToSegment(s,v,t,y);if(!(mt>vt)){t.applyMatrix4(this.matrixWorld);var At=e.ray.origin.distanceTo(t);At<e.near||At>e.far||(a.push({distance:At,point:y.clone().applyMatrix4(this.matrixWorld),index:u,face:null,faceIndex:null,object:this}),u=L)}}}}ot.prototype.raycast=jt,ot.prototype.compareV3=function(e,a){var r=e*6,i=a*6;return this.positions[r]===this.positions[i]&&this.positions[r+1]===this.positions[i+1]&&this.positions[r+2]===this.positions[i+2]},ot.prototype.copyV3=function(e){var a=e*6;return[this.positions[a],this.positions[a+1],this.positions[a+2]]},ot.prototype.process=function(){var e=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var a,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 i=0;i<e;i++){if(this.side.push(1),this.side.push(-1),this.widthCallback?a=this.widthCallback(i/(e-1)):a=1,this.width.push(a),this.width.push(a),this.uvs.push(i/(e-1),0),this.uvs.push(i/(e-1),1),i<e-1){r=this.copyV3(i),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var n=i*2;this.indices_array.push(n,n+1,n+2),this.indices_array.push(n+2,n+1,n+3)}i>0&&(r=this.copyV3(i),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 f.BufferAttribute(new Float32Array(this.positions),3),previous:new f.BufferAttribute(new Float32Array(this.previous),3),next:new f.BufferAttribute(new Float32Array(this.next),3),side:new f.BufferAttribute(new Float32Array(this.side),1),width:new f.BufferAttribute(new Float32Array(this.width),1),uv:new f.BufferAttribute(new Float32Array(this.uvs),2),index:new f.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new f.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 Mt(e,a,r,i,n){var t;if(e=e.subarray||e.slice?e:e.buffer,r=r.subarray||r.slice?r:r.buffer,e=a?e.subarray?e.subarray(a,n&&a+n):e.slice(a,n&&a+n):e,r.set)r.set(e,i);else for(t=0;t<e.length;t++)r[t+i]=e[t];return r}ot.prototype.advance=function(e){var a=this._attributes.position.array,r=this._attributes.previous.array,i=this._attributes.next.array,n=a.length;Mt(a,0,r,0,n),Mt(a,6,a,0,n-6),a[n-6]=e.x,a[n-5]=e.y,a[n-4]=e.z,a[n-3]=e.x,a[n-2]=e.y,a[n-1]=e.z,Mt(a,6,i,0,n-6),i[n-6]=e.x,i[n-5]=e.y,i[n-4]=e.z,i[n-3]=e.x,i[n-2]=e.y,i[n-1]=e.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},f.ShaderChunk.meshline_vert=Vt,f.ShaderChunk.meshline_frag=Gt;var Pt=function(e){"use strict";T(r,e);var a=k(r);function r(i){M(this,r);var n;return n=a.call(this,{uniforms:Object.assign({},f.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new f.Color(16777215)},opacity:{value:1},resolution:{value:new f.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 f.Vector2(1,1)},offset:{value:new f.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new f.Vector2(0,0)},lightColor:{value:new f.Color(16777215)}}),vertexShader:f.ShaderChunk.meshline_vert,fragmentShader:f.ShaderChunk.meshline_frag}),n.isMeshLineMaterial=!0,n.type="MeshLineMaterial",Object.defineProperties(E(n),{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)}}}),n.setValues(i),n}return r}(f.ShaderMaterial);Pt.prototype.copy=function(e){return f.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 Ut(e,a){if(e==null)return{};var r={},i=Object.keys(e),n,t;for(t=0;t<i.length;t++)n=i[t],!(a.indexOf(n)>=0)&&(r[n]=e[n]);return r}function Ft(e,a){if(e==null)return{};var r=Ut(e,a),i,n;if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);for(n=0;n<t.length;n++)i=t[n],!(a.indexOf(i)>=0)&&(!Object.prototype.propertyIsEnumerable.call(e,i)||(r[i]=e[i]))}return r}var It={nodes:[],color:new f.Color("red"),lineWidth:3,sizeAttenuation:0},Zt=function(e){"use strict";T(r,e);var a=k(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};M(this,r);var t;return t=a.call(this),t.geometry=new f.BufferGeometry,t.meshline=new ot,t.options=(0,A.Z)({},It,n),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.nodes,s=t.duration,v=t.delay,y=t.onComplete,p=t.setPointWidth,b=Ft(t,["nodes","duration","delay","onComplete","setPointWidth"]),w=this.pencil.getSize(),m=w.width,h=w.height;delete b.key,this.geometry.setFromPoints(o),this.meshline.setGeometry(this.geometry,p);var l=new Pt(P((0,A.Z)({},b),{resolution:new f.Vector2(m,h)}));this.material=l,this.createMesh(this.meshline,l)},i.resize=function(t,o){this.material.uniforms.resolution.value.set(t,o)},i.animate=function(){var t=this.options,o=t.duration,s=t.delay,v=t.onComplete,y=this.material.uniforms.offset,p=new(yt()).Tween(y.value).to({x:0},o!=null?o:1e3).delay(s!=null?s:0).repeat(1/0);v&&p.onComplete(v),p.start(),this.tween=p},i.dispose=function(){this.tween&&yt().remove(this.tween)},r}(pt),Nt=Zt,Ht={position:new f.Vector3(0,0,0),onClick:void 0},Tt=function(e){"use strict";T(r,e);var a=k(r);function r(i){M(this,r);var n;n=a.call(this),n.options=(0,A.Z)({},Ht,i);var t=document.createElement("div");t.addEventListener("click",function(){var s,v;(v=(s=n.options).onClick)===null||v===void 0||v.call(s,n.options.key)}),n.options.children&&t.appendChild(n.options.children);var o=new ft(t);return o.position.copy(n.options.position),n.object3d=o,n}return r}(pt),$t={Css2dBind:Tt}})(),module.exports=St})();
@@ -0,0 +1 @@
1
+ export { default } from './line';
@@ -0,0 +1,41 @@
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;
@@ -0,0 +1,89 @@
1
+ import * as THREE from 'three';
2
+
3
+ export class MeshLine extends THREE.BufferGeometry {
4
+ constructor();
5
+
6
+ geometry: MeshLine;
7
+
8
+ points: Float32Array | Array<number>;
9
+
10
+ isMeshLine: boolean;
11
+
12
+ setPoints(
13
+ points: Float32Array | Array<number>,
14
+ wcb?: (p: number) => any
15
+ ): void;
16
+
17
+ setMatrixWorld(matrixWorld: THREE.Matrix4): void;
18
+
19
+ setGeometry(g: THREE.BufferGeometry, c?: (p: number) => any): void;
20
+
21
+ raycast: (
22
+ raycaster: THREE.Raycaster,
23
+ intersects: THREE.Intersection[]
24
+ ) => void;
25
+
26
+ compareV3(a: number, b: number): number;
27
+
28
+ copyV3(a: number): [number, number, number];
29
+ }
30
+
31
+ export class MeshLineMaterial extends THREE.ShaderMaterial {
32
+ constructor(parameters?: {
33
+ resolution: THREE.Vector2; // required
34
+ lineWidth?: number;
35
+ map?: THREE.Texture;
36
+ useMap?: number;
37
+ alphaMap?: THREE.Texture;
38
+ useAlphaMap?: number;
39
+ color?: string | THREE.Color | number;
40
+ opacity?: number;
41
+ sizeAttenuation?: number;
42
+ dashArray?: number;
43
+ dashOffset?: number;
44
+ dashRatio?: number;
45
+ useDash?: number;
46
+ visibility?: number;
47
+ alphaTest?: number;
48
+ repeat?: THREE.Vector2;
49
+ transparent?: boolean;
50
+ depthTest?: boolean;
51
+ });
52
+
53
+ lineWidth: number;
54
+
55
+ map: THREE.Texture;
56
+
57
+ useMap: number;
58
+
59
+ alphaMap: THREE.Texture;
60
+
61
+ useAlphaMap: number;
62
+
63
+ color: THREE.Color | string | number;
64
+
65
+ opacity: number;
66
+
67
+ resolution: THREE.Vector2;
68
+
69
+ sizeAttenuation: number;
70
+
71
+ dashArray: number;
72
+
73
+ dashOffset: number;
74
+
75
+ dashRatio: number;
76
+
77
+ useDesh: number;
78
+
79
+ visibility: number;
80
+
81
+ alphaTest: number;
82
+
83
+ repeat: THREE.Vector2;
84
+ }
85
+
86
+ export function MeshLineRaycast(
87
+ raycaster: THREE.Raycaster,
88
+ intersects: THREE.Intersection[]
89
+ ): void;
@@ -0,0 +1,2 @@
1
+ declare const _default: string;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: string;
2
+ export default _default;
@@ -0,0 +1,20 @@
1
+ import * as THREE from 'three';
2
+ import BaseObject from '../../core/BaseObject';
3
+ interface Options {
4
+ src: string;
5
+ scale?: number;
6
+ position?: THREE.Vector3;
7
+ transparent?: boolean;
8
+ blending?: THREE.Blending;
9
+ depthWrite?: boolean;
10
+ alphaTest?: number;
11
+ sizeAttenuation?: boolean;
12
+ }
13
+ export default class extends BaseObject {
14
+ options: Options;
15
+ texture: THREE.Texture;
16
+ constructor(options: Options);
17
+ init(): Promise<void>;
18
+ create(): void;
19
+ }
20
+ export {};
@@ -0,0 +1,29 @@
1
+ import * as THREE from 'three';
2
+ import BaseObject from '../../core/BaseObject';
3
+ import Cache from '../../plugins/Cache';
4
+ interface Options {
5
+ src: string;
6
+ scale?: number;
7
+ position?: THREE.Vector3;
8
+ cache?: Cache;
9
+ transparent?: boolean;
10
+ blending?: THREE.Blending;
11
+ depthWrite?: boolean;
12
+ alphaTest?: number;
13
+ autoPlay?: boolean;
14
+ loop?: boolean;
15
+ format?: THREE.PixelFormat;
16
+ }
17
+ export default class extends BaseObject {
18
+ options: Options & {
19
+ autoPlay: boolean;
20
+ loop: boolean;
21
+ };
22
+ video: HTMLVideoElement;
23
+ constructor(options: Options);
24
+ getMaterial(): Promise<any>;
25
+ create(): Promise<void>;
26
+ render(): void;
27
+ dispose(): void;
28
+ }
29
+ export {};
@@ -0,0 +1,24 @@
1
+ import * as THREE from 'three';
2
+ import BaseObject from '../../core/BaseObject';
3
+ interface Options {
4
+ position: THREE.Vector3;
5
+ text: string;
6
+ fontSize?: number;
7
+ scale?: number;
8
+ fontFamily?: string;
9
+ fontWeight?: string;
10
+ flipX?: boolean;
11
+ lookAt?: THREE.Vector3;
12
+ sprite?: boolean;
13
+ sizeAttenuation?: boolean;
14
+ }
15
+ export default class extends BaseObject {
16
+ options: Omit<Required<Options>, 'lookAt'> & Pick<Options, 'lookAt'>;
17
+ width: number;
18
+ canvas: HTMLCanvasElement;
19
+ constructor(options: Options);
20
+ init(): void;
21
+ create(): void;
22
+ setText(t: string, options?: Pick<Options, 'fontSize' | 'fontFamily' | 'flipX'>): void;
23
+ }
24
+ export {};
@@ -0,0 +1,29 @@
1
+ import * as THREE from 'three';
2
+ import BaseObject from '../../core/BaseObject';
3
+ import Cache from '../../plugins/Cache';
4
+ interface Options {
5
+ src: string;
6
+ scale?: number;
7
+ position?: THREE.Vector3;
8
+ cache?: Cache;
9
+ transparent?: boolean;
10
+ blending?: THREE.Blending;
11
+ depthWrite?: boolean;
12
+ alphaTest?: number;
13
+ autoPlay?: boolean;
14
+ loop?: boolean;
15
+ format?: THREE.PixelFormat;
16
+ }
17
+ export default class extends BaseObject {
18
+ options: Options & {
19
+ autoPlay: boolean;
20
+ loop: boolean;
21
+ };
22
+ video: HTMLVideoElement;
23
+ constructor(options: Options);
24
+ getMaterial(): Promise<any>;
25
+ create(): Promise<void>;
26
+ render(): void;
27
+ dispose(): void;
28
+ }
29
+ export {};
@@ -0,0 +1,10 @@
1
+ import Pencil from '../core/Pencil';
2
+ export default class {
3
+ cache: Map<any, any>;
4
+ pencil: Pencil;
5
+ install(pencil: Pencil): void;
6
+ init(key: string): void;
7
+ get(key: string): any;
8
+ set(key: string, value: any): void;
9
+ dispose(): void;
10
+ }
@@ -0,0 +1,32 @@
1
+ import { IBaseObject } from '../core/BaseObject';
2
+ import Pencil from '../core/Pencil';
3
+ declare type KeyOf<T extends object> = Extract<keyof T, string>;
4
+ export default class Draw<T extends {
5
+ [key: string]: new (...args: any[]) => IBaseObject;
6
+ }> {
7
+ pencil: Pencil;
8
+ private objects_;
9
+ private objectNamesToFactories;
10
+ private objects;
11
+ get objectsPromise(): Promise<any>[];
12
+ constructor(objects: T);
13
+ install(pencil: Pencil): void;
14
+ initObjectFactories(): void;
15
+ getObject<Y extends KeyOf<T>>(nameOrigin: Y, options?: {
16
+ key: string;
17
+ }): InstanceType<T[Y]>;
18
+ getAllObject<Y extends KeyOf<T>>(nameOrigin: Y, options?: {
19
+ key: string;
20
+ }): InstanceType<T[Y]>[];
21
+ draw<Y extends KeyOf<T>, U extends KeyOf<T> | `${KeyOf<T>}#${string}` | IBaseObject>(nameOrigin: Y, options?: ConstructorParameters<T[Y]>[0] & {
22
+ key?: string;
23
+ target?: U;
24
+ }, target?: U): Promise<InstanceType<T[Y]>>;
25
+ private addMesh;
26
+ erase(...args: (KeyOf<T> | `${KeyOf<T>}#${string}` | InstanceType<T[keyof T]>)[]): void;
27
+ private removeMesh;
28
+ update(delta: number, elapsed: number): void;
29
+ setSize(width: number, height: number): void;
30
+ dispose(): void;
31
+ }
32
+ export {};
@@ -0,0 +1,2 @@
1
+ export { default as Cache } from './Cache';
2
+ export { default as Draw } from './Draw';
@@ -0,0 +1 @@
1
+ (function(){var J={666:function(p){var v=function(s){"use strict";var A=Object.prototype,g=A.hasOwnProperty,d,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,O=Object.create(c.prototype),C=new N(f||[]);return O._invoke=_(e,n,C),O}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 D="suspendedStart",W="suspendedYield",z="executing",k="completed",P={};function m(){}function i(){}function o(){}var a={};w(a,y,function(){return this});var r=Object.getPrototypeOf,u=r&&r(r(U([])));u&&u!==A&&g.call(u,y)&&(a=u);var h=o.prototype=m.prototype=Object.create(a);i.prototype=o,w(h,"constructor",o),w(o,"constructor",i),i.displayName=w(o,j,"GeneratorFunction");function l(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===i||(t.displayName||t.name)==="GeneratorFunction":!1},s.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,o):(e.__proto__=o,w(e,j,"GeneratorFunction")),e.prototype=Object.create(h),e},s.awrap=function(e){return{__await:e}};function E(e,t){function n(O,C,M,B){var G=I(e[O],e,C);if(G.type==="throw")B(G.arg);else{var Y=G.arg,H=Y.value;return H&&typeof H=="object"&&g.call(H,"__await")?t.resolve(H.__await).then(function($){n("next",$,M,B)},function($){n("throw",$,M,B)}):t.resolve(H).then(function($){Y.value=$,M(Y)},function($){return n("throw",$,M,B)})}}var f;function c(O,C){function M(){return new t(function(B,G){n(O,C,B,G)})}return f=f?f.then(M,M):M()}this._invoke=c}l(E.prototype),w(E.prototype,T,function(){return this}),s.AsyncIterator=E,s.async=function(e,t,n,f,c){c===void 0&&(c=Promise);var O=new E(R(e,t,n,f),c);return s.isGeneratorFunction(t)?O:O.next().then(function(C){return C.done?C.value:O.next()})};function _(e,t,n){var f=D;return function(O,C){if(f===z)throw new Error("Generator is already running");if(f===k){if(O==="throw")throw C;return F()}for(n.method=O,n.arg=C;;){var M=n.delegate;if(M){var B=L(M,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===D)throw f=k,n.arg;n.dispatchException(n.arg)}else n.method==="return"&&n.abrupt("return",n.arg);f=z;var G=I(e,t,n);if(G.type==="normal"){if(f=n.done?k:W,G.arg===P)continue;return{value:G.arg,done:n.done}}else G.type==="throw"&&(f=k,n.method="throw",n.arg=G.arg)}}}function L(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,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=d);else return c;return t.delegate=null,P}l(h),w(h,j,"Generator"),w(h,y,function(){return this}),w(h,"toString",function(){return"[object Generator]"});function Z(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 x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(Z,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 U(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=d,c.done=!0,c};return f.next=f}}return{next:F}}s.values=U;function F(){return{value:d,done:!0}}return N.prototype={constructor:N,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(x),!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,G){return O.type="throw",O.arg=e,t.next=B,G&&(t.method="next",t.arg=d),!!G}for(var f=this.tryEntries.length-1;f>=0;--f){var c=this.tryEntries[f],O=c.completion;if(c.tryLoc==="root")return n("end");if(c.tryLoc<=this.prev){var C=g.call(c,"catchLoc"),M=g.call(c,"finallyLoc");if(C&&M){if(this.prev<c.catchLoc)return n(c.catchLoc,!0);if(this.prev<c.finallyLoc)return n(c.finallyLoc)}else if(C){if(this.prev<c.catchLoc)return n(c.catchLoc,!0)}else if(M){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 O=c?c.completion:{};return O.type=e,O.arg=t,c?(this.method="next",this.next=c.finallyLoc,P):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),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),x(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;x(n)}return c}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:U(e),resultName:t,nextLoc:n},this.method==="next"&&(this.arg=d),P}},s}(p.exports);try{regeneratorRuntime=v}catch(s){typeof globalThis=="object"?globalThis.regeneratorRuntime=v:Function("r","regeneratorRuntime = r")(v)}},519:function(p,v,s){"use strict";s.d(v,{makePromiseCreator:function(){return A.Z}});var A=s(282),g=s(666),d=s.n(g),b=null,y=s(644);function T(k){if(k.material){var P=Array.isArray(k.material)?k.material:[k.material];P.forEach(function(m){var i,o;(i=m.color)===null||i===void 0||i.convertSRGBToLinear(),(o=m.emissive)===null||o===void 0||o.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),D=null,W=null,z=function(){var k=(0,j.Z)(d().mark(function P(m,i){var o,a,r,u,h,l;return d().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return o=i.version,_.next=4,(0,R.get)(m);case 4:if(r=_.sent,!(r&&r[o])){_.next=9;break}a=r[o],_.next=15;break;case 9:return _.next=11,(0,I.Z)(fetch(m).then(function(L){if(L.ok)return L.blob();throw new Error}));case 11:u=_.sent,h=u.res,l=u.err,l||(a=h,(0,R.set)(m,(0,w.Z)({},o,h)));case 15:return _.abrupt("return",a?{url:URL.createObjectURL(a)}:{url:m});case 16:case"end":return _.stop()}},P)}));return function(m,i){return k.apply(this,arguments)}}()},282:function(p,v,s){"use strict";s.d(v,{Z:function(){return g}});var A=s(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]:{},y={};return y.promise=new Promise(function(T,j){y.resolve=T,y.reject=j}),d&&(y.promise=(0,A.Z)(y.promise,b)),y}},484:function(p,v,s){"use strict";s.d(v,{Z:function(){return g}});var A=s(42);function g(d){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return d.then(function(y){return(0,A.Z)({err:null,res:y},b)}).catch(function(y){return(0,A.Z)({err:y,res:void 0},b)})}},644:function(p){"use strict";p.exports=require("three")},568:function(p,v,s){"use strict";s.d(v,{Z:function(){return g}});function A(d,b,y,T,j,w,R){try{var I=d[w](R),D=I.value}catch(W){y(W);return}I.done?b(D):Promise.resolve(D).then(T,j)}function g(d){return function(){var b=this,y=arguments;return new Promise(function(T,j){var w=d.apply(b,y);function R(D){A(w,T,j,R,I,"next",D)}function I(D){A(w,T,j,R,I,"throw",D)}R(void 0)})}}},924:function(p,v,s){"use strict";s.d(v,{Z:function(){return A}});function A(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,s){"use strict";s.d(v,{Z:function(){return g}});var A=s(924);function g(d){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,A.Z)(d,j,y[j])})}return d}}},X={};function S(p){var v=X[p];if(v!==void 0)return v.exports;var s=X[p]={exports:{}};return J[p](s,s.exports,S),s.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 s in v)S.o(v,s)&&!S.o(p,s)&&Object.defineProperty(p,s,{enumerable:!0,get:v[s]})}}(),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 s},Draw:function(){return m}});function p(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}var v=S(519),s=function(){"use strict";function i(){p(this,i),this.cache=new Map}var o=i.prototype;return o.install=function(r){this.pencil=r},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}(),A=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 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 D(){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)||D()}var z=S(666),k=S.n(z),P=S(644),m=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 E(){p(this,E)}var _=E.prototype;return _.create=function(){var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new u[h](Z)},E}();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):""),E=this.objects.get(l);return E},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):""),E=[];return this.objects.forEach(function(_,L){(L.startsWith("".concat(l,"#"))||L===l)&&E.push(_)}),E},o.draw=function(r,u,h){var l=this;return(0,A.Z)(k().mark(function E(){var _,L,Z,x,N,U,F;return k().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(_=l.objectNamesToFactories.get(r),!_){t.next=15;break}return L=(u||{}).key,Z="".concat(r).concat(L?"#".concat(L):""),l.objects.has(Z)&&(x=P.MathUtils.generateUUID(),Z+="#".concat(x)),N=(u==null?void 0:u.target)||h,typeof N=="string"?U=l.objects.get(N):(N==null?void 0:N.objecttype__)==="BaseObject"?U=N:U=l.pencil.scene,F=new _().create(u),F.pencil=l.pencil,F.key=Z,l.objects.set(Z,F),t.next=14,l.addMesh(F,U);case 14:return t.abrupt("return",F);case 15:throw new Error("Unrecognized:".concat(r));case 16:case"end":return t.stop()}},E)}))()},o.addMesh=function(r,u){var h=this;return(0,A.Z)(k().mark(function l(){return k().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return _.next=2,r.init();case 2:return _.next=4,r.create();case 4:r.object3d&&(r.object3d.userData.BaseObject_=r,u.add(r.object3d)),r.isAdd||(r.isAdd=!0,r.visible=!0),r.render(),h.pencil.gui&&r.showGuiParams(h.pencil.gui),r.pm.resolve();case 9:case"end":return _.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(E){var _=[];if(typeof E=="string"){var L,Z=R(E.split("#"),2),x=Z[0],N=Z[1];(L=_).push.apply(L,W(l.getAllObject(x,{key:N})))}else _.push(E);_.forEach(function(U){l.removeMesh(U)})})},o.removeMesh=function(r){var u=this,h=r.parent;r.object3d&&h.remove(r.object3d),r.traverse(function(l){l.isAdd&&(l.isAdd=!1,l.visible=!1),l.dispose(),u.objects.delete(l.key)})},o.update=function(r,u){this.objects.forEach(function(h){h.objecttype__==="BaseObject"&&h.update(r,u)})},o.setSize=function(r,u){this.objects.forEach(function(h){h.objecttype__==="BaseObject"&&h.resize(r,u)})},o.dispose=function(){this.objects.forEach(function(r,u){r.objecttype__==="BaseObject"&&(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}()})(),module.exports=K})();
@@ -0,0 +1,5 @@
1
+ declare module '*.glsl' {
2
+ export default string;
3
+ }
4
+
5
+ declare module '*.scss';
@@ -0,0 +1,23 @@
1
+ interface Options {
2
+ isdev?: boolean;
3
+ }
4
+ export default class Chain {
5
+ options: Required<Options>;
6
+ index: number;
7
+ repeatCount: number;
8
+ repeatNum: number;
9
+ constructor(options?: Options);
10
+ isPlaying: boolean;
11
+ chainedList: (Function | Chain)[][];
12
+ children: Chain[];
13
+ start(): this | Promise<void>;
14
+ private stop1;
15
+ stop(): this;
16
+ dispose(): this;
17
+ private play;
18
+ chain(...args: (Function | Chain)[]): this;
19
+ repeat(number: number): this;
20
+ timeout(ms: number): this;
21
+ traverse(fn: (o: Chain) => void): void;
22
+ }
23
+ export {};
@@ -0,0 +1,2 @@
1
+ import * as THREE from 'three';
2
+ export default function colorCorrection(node: THREE.Mesh): void;