gl-draw 0.0.4 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/BaseObject.d.ts +1 -0
- package/dist/index.js +5 -1986
- package/dist/objects/image/index.d.ts +3 -1
- package/dist/objects/index.d.ts +1 -3
- package/dist/objects/index.js +11 -11
- package/dist/objects/node/index.d.ts +19 -0
- package/dist/objects/video/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/objects/css2dbind/index.d.ts +0 -16
- package/dist/objects/spriteImage/index.d.ts +0 -20
- package/dist/objects/spriteVideo/index.d.ts +0 -29
|
@@ -10,12 +10,14 @@ interface Options {
|
|
|
10
10
|
cache?: Cache;
|
|
11
11
|
depthWrite?: boolean;
|
|
12
12
|
alphaTest?: number;
|
|
13
|
+
sprite?: boolean;
|
|
14
|
+
sizeAttenuation?: boolean;
|
|
13
15
|
}
|
|
14
16
|
export default class extends BaseObject {
|
|
15
17
|
options: Options;
|
|
16
18
|
texture: THREE.Texture;
|
|
17
19
|
constructor(options: Options);
|
|
18
|
-
getMaterial(): Promise<THREE.MeshBasicMaterial>;
|
|
20
|
+
getMaterial(): Promise<THREE.MeshBasicMaterial | THREE.SpriteMaterial>;
|
|
19
21
|
create(): Promise<void>;
|
|
20
22
|
}
|
|
21
23
|
export {};
|
package/dist/objects/index.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
export { default as Text } from './text';
|
|
2
2
|
export { default as Image } from './image';
|
|
3
|
-
export { default as SpriteImage } from './spriteImage';
|
|
4
3
|
export { default as Video } from './video';
|
|
5
|
-
export { default as
|
|
4
|
+
export { default as Node } from './node';
|
|
6
5
|
export { MeshLine, MeshLineMaterial, MeshLineRaycast } from './line/meshLine';
|
|
7
6
|
export { default as Line } from './line';
|
|
8
|
-
export { Css2dBind } from './css2dbind';
|
package/dist/objects/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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(
|
|
3
|
-
`).concat(
|
|
1
|
+
(function(){var Ot={666:function(P){var M=function(g){"use strict";var L=Object.prototype,S=L.hasOwnProperty,C,w=typeof Symbol=="function"?Symbol:{},k=w.iterator||"@@iterator",V=w.asyncIterator||"@@asyncIterator",E=w.toStringTag||"@@toStringTag";function T(u,s,f){return Object.defineProperty(u,s,{value:f,enumerable:!0,configurable:!0,writable:!0}),u[s]}try{T({},"")}catch(u){T=function(s,f,m){return s[f]=m}}function Z(u,s,f,m){var d=s&&s.prototype instanceof O?s:O,B=Object.create(d.prototype),$=new dt(m||[]);return B._invoke=K(u,f,$),B}g.wrap=Z;function I(u,s,f){try{return{type:"normal",arg:u.call(s,f)}}catch(m){return{type:"throw",arg:m}}}var z="suspendedStart",l="suspendedYield",ot="executing",D="completed",R={};function O(){}function G(){}function W(){}var q={};T(q,k,function(){return this});var tt=Object.getPrototypeOf,et=tt&&tt(tt(ct([])));et&&et!==L&&S.call(et,k)&&(q=et);var Q=W.prototype=O.prototype=Object.create(q);G.prototype=W,T(Q,"constructor",W),T(W,"constructor",G),G.displayName=T(W,E,"GeneratorFunction");function rt(u){["next","throw","return"].forEach(function(s){T(u,s,function(f){return this._invoke(s,f)})})}g.isGeneratorFunction=function(u){var s=typeof u=="function"&&u.constructor;return s?s===G||(s.displayName||s.name)==="GeneratorFunction":!1},g.mark=function(u){return Object.setPrototypeOf?Object.setPrototypeOf(u,W):(u.__proto__=W,T(u,E,"GeneratorFunction")),u.prototype=Object.create(Q),u},g.awrap=function(u){return{__await:u}};function st(u,s){function f(B,$,U,J){var X=I(u[B],u,$);if(X.type==="throw")J(X.arg);else{var mt=X.arg,nt=mt.value;return nt&&typeof nt=="object"&&S.call(nt,"__await")?s.resolve(nt.__await).then(function(it){f("next",it,U,J)},function(it){f("throw",it,U,J)}):s.resolve(nt).then(function(it){mt.value=it,U(mt)},function(it){return f("throw",it,U,J)})}}var m;function d(B,$){function U(){return new s(function(J,X){f(B,$,J,X)})}return m=m?m.then(U,U):U()}this._invoke=d}rt(st.prototype),T(st.prototype,V,function(){return this}),g.AsyncIterator=st,g.async=function(u,s,f,m,d){d===void 0&&(d=Promise);var B=new st(Z(u,s,f,m),d);return g.isGeneratorFunction(s)?B:B.next().then(function($){return $.done?$.value:B.next()})};function K(u,s,f){var m=z;return function(B,$){if(m===ot)throw new Error("Generator is already running");if(m===D){if(B==="throw")throw $;return yt()}for(f.method=B,f.arg=$;;){var U=f.delegate;if(U){var J=ut(U,f);if(J){if(J===R)continue;return J}}if(f.method==="next")f.sent=f._sent=f.arg;else if(f.method==="throw"){if(m===z)throw m=D,f.arg;f.dispatchException(f.arg)}else f.method==="return"&&f.abrupt("return",f.arg);m=ot;var X=I(u,s,f);if(X.type==="normal"){if(m=f.done?D:l,X.arg===R)continue;return{value:X.arg,done:f.done}}else X.type==="throw"&&(m=D,f.method="throw",f.arg=X.arg)}}}function ut(u,s){var f=u.iterator[s.method];if(f===C){if(s.delegate=null,s.method==="throw"){if(u.iterator.return&&(s.method="return",s.arg=C,ut(u,s),s.method==="throw"))return R;s.method="throw",s.arg=new TypeError("The iterator does not provide a 'throw' method")}return R}var m=I(f,u.iterator,s.arg);if(m.type==="throw")return s.method="throw",s.arg=m.arg,s.delegate=null,R;var d=m.arg;if(!d)return s.method="throw",s.arg=new TypeError("iterator result is not an object"),s.delegate=null,R;if(d.done)s[u.resultName]=d.value,s.next=u.nextLoc,s.method!=="return"&&(s.method="next",s.arg=C);else return d;return s.delegate=null,R}rt(Q),T(Q,E,"Generator"),T(Q,k,function(){return this}),T(Q,"toString",function(){return"[object Generator]"});function pt(u){var s={tryLoc:u[0]};1 in u&&(s.catchLoc=u[1]),2 in u&&(s.finallyLoc=u[2],s.afterLoc=u[3]),this.tryEntries.push(s)}function vt(u){var s=u.completion||{};s.type="normal",delete s.arg,u.completion=s}function dt(u){this.tryEntries=[{tryLoc:"root"}],u.forEach(pt,this),this.reset(!0)}g.keys=function(u){var s=[];for(var f in u)s.push(f);return s.reverse(),function m(){for(;s.length;){var d=s.pop();if(d in u)return m.value=d,m.done=!1,m}return m.done=!0,m}};function ct(u){if(u){var s=u[k];if(s)return s.call(u);if(typeof u.next=="function")return u;if(!isNaN(u.length)){var f=-1,m=function d(){for(;++f<u.length;)if(S.call(u,f))return d.value=u[f],d.done=!1,d;return d.value=C,d.done=!0,d};return m.next=m}}return{next:yt}}g.values=ct;function yt(){return{value:C,done:!0}}return dt.prototype={constructor:dt,reset:function(u){if(this.prev=0,this.next=0,this.sent=this._sent=C,this.done=!1,this.delegate=null,this.method="next",this.arg=C,this.tryEntries.forEach(vt),!u)for(var s in this)s.charAt(0)==="t"&&S.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=C)},stop:function(){this.done=!0;var u=this.tryEntries[0],s=u.completion;if(s.type==="throw")throw s.arg;return this.rval},dispatchException:function(u){if(this.done)throw u;var s=this;function f(J,X){return B.type="throw",B.arg=u,s.next=J,X&&(s.method="next",s.arg=C),!!X}for(var m=this.tryEntries.length-1;m>=0;--m){var d=this.tryEntries[m],B=d.completion;if(d.tryLoc==="root")return f("end");if(d.tryLoc<=this.prev){var $=S.call(d,"catchLoc"),U=S.call(d,"finallyLoc");if($&&U){if(this.prev<d.catchLoc)return f(d.catchLoc,!0);if(this.prev<d.finallyLoc)return f(d.finallyLoc)}else if($){if(this.prev<d.catchLoc)return f(d.catchLoc,!0)}else if(U){if(this.prev<d.finallyLoc)return f(d.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(u,s){for(var f=this.tryEntries.length-1;f>=0;--f){var m=this.tryEntries[f];if(m.tryLoc<=this.prev&&S.call(m,"finallyLoc")&&this.prev<m.finallyLoc){var d=m;break}}d&&(u==="break"||u==="continue")&&d.tryLoc<=s&&s<=d.finallyLoc&&(d=null);var B=d?d.completion:{};return B.type=u,B.arg=s,d?(this.method="next",this.next=d.finallyLoc,R):this.complete(B)},complete:function(u,s){if(u.type==="throw")throw u.arg;return u.type==="break"||u.type==="continue"?this.next=u.arg:u.type==="return"?(this.rval=this.arg=u.arg,this.method="return",this.next="end"):u.type==="normal"&&s&&(this.next=s),R},finish:function(u){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.finallyLoc===u)return this.complete(f.completion,f.afterLoc),vt(f),R}},catch:function(u){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.tryLoc===u){var m=f.completion;if(m.type==="throw"){var d=m.arg;vt(f)}return d}}throw new Error("illegal catch attempt")},delegateYield:function(u,s,f){return this.delegate={iterator:ct(u),resultName:s,nextLoc:f},this.method==="next"&&(this.arg=C),R}},g}(P.exports);try{regeneratorRuntime=M}catch(g){typeof globalThis=="object"?globalThis.regeneratorRuntime=M:Function("r","regeneratorRuntime = r")(M)}},695:function(P,M,g){"use strict";g.d(M,{Z:function(){return L}});function L(S){if(S.geometry&&S.geometry.dispose(),S.material){var C=Array.isArray(S.material)?S.material:[S.material];C.forEach(function(w){var k,V,E,T,Z,I,z,l,ot,D,R,O,G;(k=w.map)===null||k===void 0||k.dispose(),(V=w.lightMap)===null||V===void 0||V.dispose(),(E=w.bumpMap)===null||E===void 0||E.dispose(),(T=w.normalMap)===null||T===void 0||T.dispose(),(Z=w.specularMap)===null||Z===void 0||Z.dispose(),(I=w.envMap)===null||I===void 0||I.dispose(),(z=w.alphaMap)===null||z===void 0||z.dispose(),(l=w.aoMap)===null||l===void 0||l.dispose(),(ot=w.displacementMap)===null||ot===void 0||ot.dispose(),(D=w.emissiveMap)===null||D===void 0||D.dispose(),(R=w.gradientMap)===null||R===void 0||R.dispose(),(O=w.metalnessMap)===null||O===void 0||O.dispose(),(G=w.roughnessMap)===null||G===void 0||G.dispose(),w.dispose()})}}},519:function(P,M,g){"use strict";g.d(M,{disposeMesh:function(){return w.Z}});var L=g(666),S=g.n(L),C=null,w=g(695),k=g(644);function V(D){if(D.material){var R=Array.isArray(D.material)?D.material:[D.material];R.forEach(function(O){var G,W;(G=O.color)===null||G===void 0||G.convertSRGBToLinear(),(W=O.emissive)===null||W===void 0||W.convertSRGBToLinear(),O.map&&(O.map.encoding=THREE.sRGBEncoding),O.emissiveMap&&(O.emissiveMap.encoding=THREE.sRGBEncoding)})}}var E=g(568),T=g(924),Z=require("idb-keyval"),I=g(484),z=null,l=null,ot=function(){var D=(0,E.Z)(S().mark(function R(O,G){var W,q,tt,et,Q,rt;return S().wrap(function(K){for(;;)switch(K.prev=K.next){case 0:return W=G.version,K.next=4,(0,Z.get)(O);case 4:if(tt=K.sent,!(tt&&tt[W])){K.next=9;break}q=tt[W],K.next=15;break;case 9:return K.next=11,(0,I.Z)(fetch(O).then(function(ut){if(ut.ok)return ut.blob();throw new Error}));case 11:et=K.sent,Q=et.res,rt=et.err,rt||(q=Q,(0,Z.set)(O,(0,T.Z)({},W,Q)));case 15:return K.abrupt("return",q?{url:URL.createObjectURL(q)}:{url:O});case 16:case"end":return K.stop()}},R)}));return function(O,G){return D.apply(this,arguments)}}()},484:function(P,M,g){"use strict";g.d(M,{Z:function(){return S}});var L=g(42);function S(C){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return C.then(function(k){return(0,L.Z)({err:null,res:k},w)}).catch(function(k){return(0,L.Z)({err:k,res:void 0},w)})}},644:function(P){"use strict";P.exports=require("three")},568:function(P,M,g){"use strict";g.d(M,{Z:function(){return S}});function L(C,w,k,V,E,T,Z){try{var I=C[T](Z),z=I.value}catch(l){k(l);return}I.done?w(z):Promise.resolve(z).then(V,E)}function S(C){return function(){var w=this,k=arguments;return new Promise(function(V,E){var T=C.apply(w,k);function Z(z){L(T,V,E,Z,I,"next",z)}function I(z){L(T,V,E,Z,I,"throw",z)}Z(void 0)})}}},924:function(P,M,g){"use strict";g.d(M,{Z:function(){return L}});function L(S,C,w){return C in S?Object.defineProperty(S,C,{value:w,enumerable:!0,configurable:!0,writable:!0}):S[C]=w,S}},42:function(P,M,g){"use strict";g.d(M,{Z:function(){return S}});var L=g(924);function S(C){for(var w=1;w<arguments.length;w++){var k=arguments[w]!=null?arguments[w]:{},V=Object.keys(k);typeof Object.getOwnPropertySymbols=="function"&&(V=V.concat(Object.getOwnPropertySymbols(k).filter(function(E){return Object.getOwnPropertyDescriptor(k,E).enumerable}))),V.forEach(function(E){(0,L.Z)(C,E,k[E])})}return C}}},St={};function N(P){var M=St[P];if(M!==void 0)return M.exports;var g=St[P]={exports:{}};return Ot[P](g,g.exports,N),g.exports}(function(){N.n=function(P){var M=P&&P.__esModule?function(){return P.default}:function(){return P};return N.d(M,{a:M}),M}})(),function(){N.d=function(P,M){for(var g in M)N.o(M,g)&&!N.o(P,g)&&Object.defineProperty(P,g,{enumerable:!0,get:M[g]})}}(),function(){N.o=function(P,M){return Object.prototype.hasOwnProperty.call(P,M)}}(),function(){N.r=function(P){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(P,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(P,"__esModule",{value:!0})}}();var gt={};(function(){"use strict";N.r(gt),N.d(gt,{Image:function(){return B},Line:function(){return Wt},MeshLine:function(){return at},MeshLineMaterial:function(){return wt},MeshLineRaycast:function(){return At},Node:function(){return Ct},Text:function(){return s},Video:function(){return X}});function P(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}function M(e,a){return M=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},M(e,a)}function g(e,a){return M(e,a)}function L(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&&g(e,a)}var S=N(42);function C(e,a){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);a&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function w(e,a){return a=a!=null?a:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):C(Object(a)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(a,r))}),e}function k(){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 V(e){return V=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},V(e)}function E(e){return V(e)}function T(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Z(e){return e&&e.constructor===Symbol?"symbol":typeof e}function I(e,a){return a&&(Z(a)==="object"||typeof a=="function")?a:T(e)}function z(e){var a=k();return function(){var n=E(e),i;if(a){var t=E(this).constructor;i=Reflect.construct(n,arguments,t)}else i=n.apply(this,arguments);return I(this,i)}}var l=N(644);function ot(){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 D(e,a,r){return ot()?D=Reflect.construct:D=function(i,t,o){var c=[null];c.push.apply(c,t);var h=Function.bind.apply(i,c),p=new h;return o&&g(p,o.prototype),p},D.apply(null,arguments)}function R(e,a,r){return D.apply(null,arguments)}function O(e,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(e,n.key,n)}}function G(e,a,r){return a&&O(e.prototype,a),r&&O(e,r),e}function W(e,a){(a==null||a>e.length)&&(a=e.length);for(var r=0,n=new Array(a);r<a;r++)n[r]=e[r];return n}function q(e){if(Array.isArray(e))return W(e)}function tt(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function et(){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,a){if(!!e){if(typeof e=="string")return W(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 W(e,a)}}function rt(e){return q(e)||tt(e)||Q(e)||et()}var st=N(484);function K(){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(n,i){r.resolve=n,r.reject=i}),e&&(r.promise=(0,st.Z)(r.promise,a)),r}var ut=require("@tweenjs/tween.js"),pt=N.n(ut),vt=function(){"use strict";function e(){P(this,e),this.guiParams={}}var a=e.prototype;return a.showGuiParams=function(n){var i=this;!n||Object.keys(this.guiParams).forEach(function(t){var o=n.addFolder(t),c=i.guiParams[t];Object.keys(c).forEach(function(h){var p=c[h],b=p.min,y=p.max,x=p.step,A=p.name,_=p.to,j=p.paramMap,v=p.items,H=p.value,F=p.target,xt=h.toLowerCase().indexOf("color")>-1,Y,lt=typeof H=="undefined"&&F,ft=lt?F():c[h],ht=lt?h:"value";v?Y=o.add(ft,ht,v):xt?Y=o.addColor(ft,ht):Y=o.add(ft,ht),Y=Y.name(A||h),typeof b!="undefined"&&(Y=Y.min(b)),typeof y!="undefined"&&(Y=Y.max(y)),typeof x!="undefined"&&(Y=Y.step(x)),Y=Y.onChange(function(){i.setGuiTargetValue(t,h,ft[ht],j)}),(_||lt)&&Y.listen()})})},a.setGuiTargetValue=function(n,i,t,o){var c=this.guiParams[n][i],h=c.onChange,p=c.target,b=c.value,y=i.toLowerCase().indexOf("color")>-1,x=typeof b=="undefined"&&p;if(p&&!x){var A=p();Array.isArray(A)||(A=[A]),A.forEach(function(_){if(!!_)if(y)try{_[o||i].set(t)}catch(j){i!=="color"&&!o&&console.warn("".concat(i," is not a color,set paramMap"))}else _[o||i]=t})}h&&h(t)},a.setGuiTargetValueByParams=function(){var n=this;Object.keys(this.guiParams).forEach(function(i){Object.keys(n.guiParams[i]).forEach(function(t){var o=n.guiParams[i][t];typeof o.value!="undefined"&&n.setGuiTargetValue(i,t,o.value,o.paramMap)})})},a.guiParamTween=function(n,i,t){var o=t.duration,c=o===void 0?0:o,h=this,p=this.guiParams[n][i],b=p.to,y=p.paramMap,x=y===void 0?"":y;return new(pt()).Tween(this.guiParams[n][i]).to({value:b},c).onUpdate(function(A){h.setGuiTargetValue(n,i,A.value,x)})},e}(),dt=require("three/examples/jsm/renderers/CSS2DRenderer"),ct=require("three/examples/jsm/renderers/CSS3DRenderer"),yt=N(519),u=function(e){"use strict";L(r,e);var a=z(r);function r(i){P(this,r);var t;return t=a.call(this),t.objecttype__="BaseObject",t.isAdd=!1,t.userData={},t.pm=K(),t.visible=!1,t}var n=r.prototype;return n.init=function(){},n.create=function(){},n.render=function(){},n.update=function(t,o){},n.resize=function(t,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 t=arguments.length,o=new Array(t),c=0;c<t;c++)o[c]=arguments[c];return this.object3d=R(l.Mesh,rt(o)),this},n.createGroup=function(){return this.object3d=new l.Group,this},n.createPoints=function(){for(var t=arguments.length,o=new Array(t),c=0;c<t;c++)o[c]=arguments[c];return this.object3d=R(l.Points,rt(o)),this},n.createCSS2DObject=function(t){return this.object3d=new dt.CSS2DObject(t),this},n.createCSS3DObject=function(t){return this.object3d=new ct.CSS3DObject(t),this},n.createCSS3DSprite=function(t){return this.object3d=new ct.CSS3DSprite(t),this},n.createSprite=function(t){return this.object3d=new l.Sprite(t),this},n.add=function(){for(var t=arguments.length,o=new Array(t),c=0;c<t;c++)o[c]=arguments[c];var h;return(h=this.object3d).add.apply(h,rt(o)),this},n.remove=function(){for(var t=arguments.length,o=new Array(t),c=0;c<t;c++)o[c]=arguments[c];var h;return(h=this.object3d).remove.apply(h,rt(o)),this},n.getSize=function(){var t=new l.Box3().setFromObject(this.object3d);return{min:t.min,max:t.max,size:t.getSize(new l.Vector3)}},n.traverse=function(t){t(this),this.children.forEach(function(o){o.traverse(t)})},n.dispose=function(){var t;(t=this.object3d)===null||t===void 0||t.traverse(function(o){(0,yt.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}(vt),s=function(e){"use strict";L(r,e);var a=z(r);function r(i){P(this,r);var t;return t=a.call(this),t.width=0,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},i),t}var n=r.prototype;return n.init=function(){var t=document.createElement("canvas");this.canvas=t},n.create=function(){var t=this.options,o=t.position,c=t.lookAt,h=t.sprite,p=t.text,b=t.sizeAttenuation;if(h){var y=new l.Sprite(new l.SpriteMaterial({transparent:!0,sizeAttenuation:b}));this.object3d=y}else{var x=new l.MeshBasicMaterial({side:l.DoubleSide,transparent:!0}),A=new l.PlaneGeometry(1,1,1,1);this.createMesh(A,x)}this.object3d.position.copy(o),c&&this.object3d.lookAt(c),this.setText(p)},n.setText=function(t,o){var c=(0,S.Z)(w((0,S.Z)({},this.options),{text:t}),o||{}),h=c.text,p=c.fontSize,b=c.fontFamily,y=c.fontWeight,x=c.flipX,A=c.scale,_=this.canvas;_.width=p*h.length*2,_.height=p;var j=_.getContext("2d");j.font="".concat(y," ").concat(p,"px/1 ").concat(b);var v=j.measureText(h).width;_.width=v,this.width=v,j=_.getContext("2d"),j.clearRect(0,0,_.width,_.height),x&&j.scale(-1,1),j.font="".concat(y," ").concat(p,"px/1 ").concat(b),j.textBaseline="middle",j.fillStyle="#ffffff",j.fillText(h,x?v*-1:0,_.height/2),j.restore();var H=new l.Texture(_);H.anisotropy=16,H.needsUpdate=!0;var F=this.object3d;F.material.map&&F.material.map.dispose(),F.material.map=H,F.material.needsUpdate=!0,F.scale.set(H.image.width*A,H.image.height*A,1)},r}(u),f=N(568),m=N(666),d=N.n(m),B=function(e){"use strict";L(r,e);var a=z(r);function r(i){P(this,r);var t;return t=a.call(this),t.options=i,t}var n=r.prototype;return n.getMaterial=function(){var t=this;return(0,f.Z)(d().mark(function o(){var c,h,p,b,y,x,A,_,j,v;return d().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return c=t.options,h=c.transparent,p=c.blending,b=c.src,y=c.depthWrite,x=c.alphaTest,A=c.sprite,_=c.sizeAttenuation,F.next=3,new l.TextureLoader().loadAsync(b);case 3:return j=F.sent,v=A?new l.SpriteMaterial({map:j,transparent:h!=null?h:!1,blending:p!=null?p:l.NormalBlending,depthWrite:y!=null?y:!0,alphaTest:x!=null?x:0,sizeAttenuation:_!=null?_:!0}):new l.MeshBasicMaterial({map:j,transparent:h!=null?h:!1,blending:p!=null?p:l.NormalBlending,depthWrite:y!=null?y:!0,alphaTest:x!=null?x:0}),F.abrupt("return",v);case 6:case"end":return F.stop()}},o)}))()},n.create=function(){var t=this;return(0,f.Z)(d().mark(function o(){var c,h,p,b,y,x,A,_;return d().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(c=t.options,h=c.scale,p=c.position,b=c.src,y=c.cache,x=c.sprite,!(y&&!y.get(b))){v.next=7;break}return y.init(b),v.next=5,t.getMaterial();case 5:A=v.sent,y.set(b,A);case 7:if(!y){v.next=13;break}return v.next=10,y.get(b);case 10:v.t0=v.sent,v.next=16;break;case 13:return v.next=15,t.getMaterial();case 15:v.t0=v.sent;case 16:_=v.t0,t.texture=_.map,x?t.createSprite(_):t.createMesh(new l.PlaneBufferGeometry(1,1),_),h&&t.object3d.scale.set(_.map.image.width*h,_.map.image.height*h,1),p&&t.object3d.position.copy(p);case 21:case"end":return v.stop()}},o)}))()},r}(u);function $(e,a){for(;!Object.prototype.hasOwnProperty.call(e,a)&&(e=E(e),e!==null););return e}function U(e,a,r){return typeof Reflect!="undefined"&&Reflect.get?U=Reflect.get:U=function(i,t,o){var c=$(i,t);if(!!c){var h=Object.getOwnPropertyDescriptor(c,t);return h.get?h.get.call(o||i):h.value}},U(e,a,r)}function J(e,a,r){return U(e,a,r)}var X=function(e){"use strict";L(r,e);var a=z(r);function r(i){P(this,r);var t;return t=a.call(this),t.options=(0,S.Z)({},{autoPlay:!0,loop:!0},i),t}var n=r.prototype;return n.getMaterial=function(){var t=this.options,o=t.src,c=t.transparent,h=t.blending,p=t.depthWrite,b=t.format,y=t.autoPlay,x=t.loop,A=t.alphaTest,_=t.sprite,j=K(),v=document.createElement("video");return v.addEventListener("loadedmetadata",function(){var H=new l.VideoTexture(v);H.format=b!=null?b:l.RGBAFormat,H.needsUpdate=!0;var F=_?new l.SpriteMaterial({map:H,transparent:c!=null?c:!1,blending:h!=null?h:l.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:A!=null?A:0}):new l.MeshBasicMaterial({map:H,transparent:c!=null?c:!1,blending:h!=null?h:l.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:A!=null?A:0});j.resolve(F)},!1),v.src=o,v.muted=!0,v.autoplay=y,v.loop=x,v.preload="auto",j.promise},n.create=function(){var t=this;return(0,f.Z)(d().mark(function o(){var c,h,p,b,y,x,A,_;return d().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(c=t.options,h=c.scale,p=c.position,b=c.src,y=c.cache,x=c.sprite,!(y&&!y.get(b))){v.next=7;break}return y.init(b),v.next=5,t.getMaterial();case 5:A=v.sent,y.set(b,A);case 7:if(!y){v.next=13;break}return v.next=10,y.get(b);case 10:v.t0=v.sent,v.next=16;break;case 13:return v.next=15,t.getMaterial();case 15:v.t0=v.sent;case 16:_=v.t0,t.video=_.map.image,x?t.createSprite(_):t.createMesh(new l.PlaneBufferGeometry(1,1),_),h&&t.object3d.scale.set(t.video.videoWidth*h,t.video.videoWidth*h,1),p&&t.object3d.position.copy(p);case 21:case"end":return v.stop()}},o)}))()},n.render=function(){var t=this.options.autoPlay;t&&this.video.play()},n.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),J(E(r.prototype),"dispose",this).call(this)},r}(u),mt={position:new l.Vector3(0,0,0),onClick:void 0},nt=document.createElement("canvas");nt.width=256,nt.height=256;var it=nt.getContext("2d");it.fillStyle="#ff0000",it.fillRect(0,0,256,256);var bt=new l.CanvasTexture(nt),Mt=function(e){"use strict";L(r,e);var a=z(r);function r(i){P(this,r);var t;return t=a.call(this),t.options=(0,S.Z)({},mt,i),t}var n=r.prototype;return n.create=function(){var t=document.createElement("div");this.options.children&&t.appendChild(this.options.children),this.createCSS2DObject(t),this.object3d.position.copy(this.options.position)},n.createPickObject=function(t){var o=t.show,c=o===void 0?!1:o,h=t.scale,p=h===void 0?new l.Vector3(1,1,1):h,b=t.position,y=b===void 0?new l.Vector3(0,0,0):b,x=new l.Sprite(new l.SpriteMaterial({map:bt,opacity:c?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}));x.scale.set(bt.image.width*p.x,bt.image.height*p.y,1),x.position.copy(y),this.add(x),this.pickObject=x},r}(u),Ct=Mt,jt=`
|
|
2
|
+
`.concat(l.ShaderChunk.logdepthbuf_pars_vertex,`
|
|
3
|
+
`).concat(l.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(l.ShaderChunk.logdepthbuf_vertex,`
|
|
95
95
|
vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
|
|
96
|
-
`).concat(
|
|
96
|
+
`).concat(l.ShaderChunk.fog_vertex,`
|
|
97
97
|
}
|
|
98
|
-
`),
|
|
99
|
-
`.concat(
|
|
100
|
-
`).concat(
|
|
98
|
+
`),Tt=`
|
|
99
|
+
`.concat(l.ShaderChunk.fog_pars_fragment,`
|
|
100
|
+
`).concat(l.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(l.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(l.ShaderChunk.fog_fragment,`
|
|
131
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})();
|
|
132
|
+
`),at=function(e){"use strict";L(r,e);var a=z(r);function r(){P(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(T(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}(l.BufferGeometry);at.prototype.setMatrixWorld=function(e){this.matrixWorld=e},at.prototype.setGeometry=function(e,a){this._geometry=e,this.setPoints(e.getAttribute("position").array,a)},at.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 l.Vector3)for(var r=0;r<e.length;r++){var n=e[r],i=r/e.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<e.length;r+=3){var i=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(i),this.counters.push(i)}this.process()};function At(e,a){var r=new l.Matrix4,n=new l.Ray,i=new l.Sphere,t=new l.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),i.copy(o.boundingSphere),i.applyMatrix4(this.matrixWorld),e.ray.intersectSphere(i,t)!==!1){r.copy(this.matrixWorld).invert(),n.copy(e.ray).applyMatrix4(r);var c=new l.Vector3,h=new l.Vector3,p=new l.Vector3,b=this instanceof l.LineSegments?2:1,y=o.index,x=o.attributes;if(y!==null)for(var A=y.array,_=x.position.array,j=x.width.array,v=0,H=A.length-1;v<H;v+=b){var F=A[v],xt=A[v+1];c.fromArray(_,F*3),h.fromArray(_,xt*3);var Y=j[Math.floor(v/3)]!==void 0?j[Math.floor(v/3)]:1,lt=e.params.Line.threshold+this.material.lineWidth*Y/2,ft=lt*lt,ht=n.distanceSqToSegment(c,h,t,p);if(!(ht>ft)){t.applyMatrix4(this.matrixWorld);var Pt=e.ray.origin.distanceTo(t);Pt<e.near||Pt>e.far||(a.push({distance:Pt,point:p.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this}),v=H)}}}}at.prototype.raycast=At,at.prototype.compareV3=function(e,a){var r=e*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]},at.prototype.copyV3=function(e){var a=e*6;return[this.positions[a],this.positions[a+1],this.positions[a+2]]},at.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 n=0;n<e;n++){if(this.side.push(1),this.side.push(-1),this.widthCallback?a=this.widthCallback(n/(e-1)):a=1,this.width.push(a),this.width.push(a),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 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(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 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 _t(e,a,r,n,i){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,i&&a+i):e.slice(a,i&&a+i):e,r.set)r.set(e,n);else for(t=0;t<e.length;t++)r[t+n]=e[t];return r}at.prototype.advance=function(e){var a=this._attributes.position.array,r=this._attributes.previous.array,n=this._attributes.next.array,i=a.length;_t(a,0,r,0,i),_t(a,6,a,0,i-6),a[i-6]=e.x,a[i-5]=e.y,a[i-4]=e.z,a[i-3]=e.x,a[i-2]=e.y,a[i-1]=e.z,_t(a,6,n,0,i-6),n[i-6]=e.x,n[i-5]=e.y,n[i-4]=e.z,n[i-3]=e.x,n[i-2]=e.y,n[i-1]=e.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},l.ShaderChunk.meshline_vert=jt,l.ShaderChunk.meshline_frag=Tt;var wt=function(e){"use strict";L(r,e);var a=z(r);function r(n){P(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(T(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);wt.prototype.copy=function(e){return l.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 Lt(e,a){if(e==null)return{};var r={},n=Object.keys(e),i,t;for(t=0;t<n.length;t++)i=n[t],!(a.indexOf(i)>=0)&&(r[i]=e[i]);return r}function kt(e,a){if(e==null)return{};var r=Lt(e,a),n,i;if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);for(i=0;i<t.length;i++)n=t[i],!(a.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(e,n)||(r[n]=e[n]))}return r}var Et={nodes:[],color:new l.Color("red"),lineWidth:3,sizeAttenuation:0},Rt=function(e){"use strict";L(r,e);var a=z(r);function r(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};P(this,r);var t;return t=a.call(this),t.geometry=new l.BufferGeometry,t.meshline=new at,t.options=(0,S.Z)({},Et,i),t}var n=r.prototype;return n.create=function(){var t=this.options,o=t.nodes,c=t.duration,h=t.delay,p=t.onComplete,b=t.setPointWidth,y=kt(t,["nodes","duration","delay","onComplete","setPointWidth"]),x=this.pencil.getSize(),A=x.width,_=x.height;delete y.key,this.geometry.setFromPoints(o),this.meshline.setGeometry(this.geometry,b);var j=new wt(w((0,S.Z)({},y),{resolution:new l.Vector2(A,_)}));this.material=j,this.createMesh(this.meshline,j)},n.resize=function(t,o){this.material.uniforms.resolution.value.set(t,o)},n.animate=function(){var t=this.options,o=t.duration,c=t.delay,h=t.onComplete,p=this.material.uniforms.offset,b=new(pt()).Tween(p.value).to({x:0},o!=null?o:1e3).delay(c!=null?c:0).repeat(1/0);h&&b.onComplete(h),b.start(),this.tween=b},n.dispose=function(){this.tween&&pt().remove(this.tween)},r}(u),Wt=Rt})(),module.exports=gt})();
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
}
|
|
8
|
+
export declare class Node extends BaseObject {
|
|
9
|
+
options: Options;
|
|
10
|
+
pickObject?: THREE.Sprite;
|
|
11
|
+
constructor(options: Partial<Options>);
|
|
12
|
+
create(): void;
|
|
13
|
+
createPickObject({ show, scale, position, }: {
|
|
14
|
+
show?: boolean | undefined;
|
|
15
|
+
scale?: THREE.Vector3 | undefined;
|
|
16
|
+
position?: THREE.Vector3 | undefined;
|
|
17
|
+
}): void;
|
|
18
|
+
}
|
|
19
|
+
export default Node;
|
package/package.json
CHANGED
|
@@ -1,16 +0,0 @@
|
|
|
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;
|
|
@@ -1,20 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,29 +0,0 @@
|
|
|
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 {};
|