gl-draw 0.0.5 → 0.0.6
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.
|
@@ -10,9 +10,10 @@ export declare class Css2dBind extends BaseObject {
|
|
|
10
10
|
pickObject?: THREE.Sprite;
|
|
11
11
|
constructor(options: Partial<Options>);
|
|
12
12
|
create(): void;
|
|
13
|
-
createPickObject({ show, scale }: {
|
|
13
|
+
createPickObject({ show, scale, position, }: {
|
|
14
14
|
show?: boolean | undefined;
|
|
15
15
|
scale?: THREE.Vector3 | undefined;
|
|
16
|
+
position?: THREE.Vector3 | undefined;
|
|
16
17
|
}): void;
|
|
17
18
|
}
|
|
18
19
|
declare const _default: {
|
package/dist/objects/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){var je={666:function(A){var C=function(_){"use strict";var T=Object.prototype,M=T.hasOwnProperty,j,S=typeof Symbol=="function"?Symbol:{},R=S.iterator||"@@iterator",V=S.asyncIterator||"@@asyncIterator",k=S.toStringTag||"@@toStringTag";function L(l,s,f){return Object.defineProperty(l,s,{value:f,enumerable:!0,configurable:!0,writable:!0}),l[s]}try{L({},"")}catch(l){L=function(s,f,b){return s[f]=b}}function F(l,s,f,b){var m=s&&s.prototype instanceof O?s:O,G=Object.create(m.prototype),H=new de(b||[]);return G._invoke=$(l,f,H),G}_.wrap=F;function Z(l,s,f){try{return{type:"normal",arg:l.call(s,f)}}catch(b){return{type:"throw",arg:b}}}var E="suspendedStart",c="suspendedYield",ie="executing",D="completed",W={};function O(){}function z(){}function B(){}var Q={};L(Q,R,function(){return this});var q=Object.getPrototypeOf,ee=q&&q(q(le([])));ee&&ee!==T&&M.call(ee,R)&&(Q=ee);var J=B.prototype=O.prototype=Object.create(Q);z.prototype=B,L(J,"constructor",B),L(B,"constructor",z),z.displayName=L(B,k,"GeneratorFunction");function te(l){["next","throw","return"].forEach(function(s){L(l,s,function(f){return this._invoke(s,f)})})}_.isGeneratorFunction=function(l){var s=typeof l=="function"&&l.constructor;return s?s===z||(s.displayName||s.name)==="GeneratorFunction":!1},_.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,B):(l.__proto__=B,L(l,k,"GeneratorFunction")),l.prototype=Object.create(J),l},_.awrap=function(l){return{__await:l}};function oe(l,s){function f(G,H,X,I){var N=Z(l[G],l,H);if(N.type==="throw")I(N.arg);else{var me=N.arg,ue=me.value;return ue&&typeof ue=="object"&&M.call(ue,"__await")?s.resolve(ue.__await).then(function(ae){f("next",ae,X,I)},function(ae){f("throw",ae,X,I)}):s.resolve(ue).then(function(ae){me.value=ae,X(me)},function(ae){return f("throw",ae,X,I)})}}var b;function m(G,H){function X(){return new s(function(I,N){f(G,H,I,N)})}return b=b?b.then(X,X):X()}this._invoke=m}te(oe.prototype),L(oe.prototype,V,function(){return this}),_.AsyncIterator=oe,_.async=function(l,s,f,b,m){m===void 0&&(m=Promise);var G=new oe(F(l,s,f,b),m);return _.isGeneratorFunction(s)?G:G.next().then(function(H){return H.done?H.value:G.next()})};function $(l,s,f){var b=E;return function(G,H){if(b===ie)throw new Error("Generator is already running");if(b===D){if(G==="throw")throw H;return ye()}for(f.method=G,f.arg=H;;){var X=f.delegate;if(X){var I=se(X,f);if(I){if(I===W)continue;return I}}if(f.method==="next")f.sent=f._sent=f.arg;else if(f.method==="throw"){if(b===E)throw b=D,f.arg;f.dispatchException(f.arg)}else f.method==="return"&&f.abrupt("return",f.arg);b=ie;var N=Z(l,s,f);if(N.type==="normal"){if(b=f.done?D:c,N.arg===W)continue;return{value:N.arg,done:f.done}}else N.type==="throw"&&(b=D,f.method="throw",f.arg=N.arg)}}}function se(l,s){var f=l.iterator[s.method];if(f===j){if(s.delegate=null,s.method==="throw"){if(l.iterator.return&&(s.method="return",s.arg=j,se(l,s),s.method==="throw"))return W;s.method="throw",s.arg=new TypeError("The iterator does not provide a 'throw' method")}return W}var b=Z(f,l.iterator,s.arg);if(b.type==="throw")return s.method="throw",s.arg=b.arg,s.delegate=null,W;var m=b.arg;if(!m)return s.method="throw",s.arg=new TypeError("iterator result is not an object"),s.delegate=null,W;if(m.done)s[l.resultName]=m.value,s.next=l.nextLoc,s.method!=="return"&&(s.method="next",s.arg=j);else return m;return s.delegate=null,W}te(J),L(J,k,"Generator"),L(J,R,function(){return this}),L(J,"toString",function(){return"[object Generator]"});function pe(l){var s={tryLoc:l[0]};1 in l&&(s.catchLoc=l[1]),2 in l&&(s.finallyLoc=l[2],s.afterLoc=l[3]),this.tryEntries.push(s)}function ve(l){var s=l.completion||{};s.type="normal",delete s.arg,l.completion=s}function de(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(pe,this),this.reset(!0)}_.keys=function(l){var s=[];for(var f in l)s.push(f);return s.reverse(),function b(){for(;s.length;){var m=s.pop();if(m in l)return b.value=m,b.done=!1,b}return b.done=!0,b}};function le(l){if(l){var s=l[R];if(s)return s.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var f=-1,b=function m(){for(;++f<l.length;)if(M.call(l,f))return m.value=l[f],m.done=!1,m;return m.value=j,m.done=!0,m};return b.next=b}}return{next:ye}}_.values=le;function ye(){return{value:j,done:!0}}return de.prototype={constructor:de,reset:function(l){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(ve),!l)for(var s in this)s.charAt(0)==="t"&&M.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=j)},stop:function(){this.done=!0;var l=this.tryEntries[0],s=l.completion;if(s.type==="throw")throw s.arg;return this.rval},dispatchException:function(l){if(this.done)throw l;var s=this;function f(I,N){return G.type="throw",G.arg=l,s.next=I,N&&(s.method="next",s.arg=j),!!N}for(var b=this.tryEntries.length-1;b>=0;--b){var m=this.tryEntries[b],G=m.completion;if(m.tryLoc==="root")return f("end");if(m.tryLoc<=this.prev){var H=M.call(m,"catchLoc"),X=M.call(m,"finallyLoc");if(H&&X){if(this.prev<m.catchLoc)return f(m.catchLoc,!0);if(this.prev<m.finallyLoc)return f(m.finallyLoc)}else if(H){if(this.prev<m.catchLoc)return f(m.catchLoc,!0)}else if(X){if(this.prev<m.finallyLoc)return f(m.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(l,s){for(var f=this.tryEntries.length-1;f>=0;--f){var b=this.tryEntries[f];if(b.tryLoc<=this.prev&&M.call(b,"finallyLoc")&&this.prev<b.finallyLoc){var m=b;break}}m&&(l==="break"||l==="continue")&&m.tryLoc<=s&&s<=m.finallyLoc&&(m=null);var G=m?m.completion:{};return G.type=l,G.arg=s,m?(this.method="next",this.next=m.finallyLoc,W):this.complete(G)},complete:function(l,s){if(l.type==="throw")throw l.arg;return l.type==="break"||l.type==="continue"?this.next=l.arg:l.type==="return"?(this.rval=this.arg=l.arg,this.method="return",this.next="end"):l.type==="normal"&&s&&(this.next=s),W},finish:function(l){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.finallyLoc===l)return this.complete(f.completion,f.afterLoc),ve(f),W}},catch:function(l){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.tryLoc===l){var b=f.completion;if(b.type==="throw"){var m=b.arg;ve(f)}return m}}throw new Error("illegal catch attempt")},delegateYield:function(l,s,f){return this.delegate={iterator:le(l),resultName:s,nextLoc:f},this.method==="next"&&(this.arg=j),W}},_}(A.exports);try{regeneratorRuntime=C}catch(_){typeof globalThis=="object"?globalThis.regeneratorRuntime=C:Function("r","regeneratorRuntime = r")(C)}},695:function(A,C,_){"use strict";_.d(C,{Z:function(){return T}});function T(M){if(M.geometry&&M.geometry.dispose(),M.material){var j=Array.isArray(M.material)?M.material:[M.material];j.forEach(function(S){var R,V,k,L,F,Z,E,c,ie,D,W,O,z;(R=S.map)===null||R===void 0||R.dispose(),(V=S.lightMap)===null||V===void 0||V.dispose(),(k=S.bumpMap)===null||k===void 0||k.dispose(),(L=S.normalMap)===null||L===void 0||L.dispose(),(F=S.specularMap)===null||F===void 0||F.dispose(),(Z=S.envMap)===null||Z===void 0||Z.dispose(),(E=S.alphaMap)===null||E===void 0||E.dispose(),(c=S.aoMap)===null||c===void 0||c.dispose(),(ie=S.displacementMap)===null||ie===void 0||ie.dispose(),(D=S.emissiveMap)===null||D===void 0||D.dispose(),(W=S.gradientMap)===null||W===void 0||W.dispose(),(O=S.metalnessMap)===null||O===void 0||O.dispose(),(z=S.roughnessMap)===null||z===void 0||z.dispose(),S.dispose()})}}},519:function(A,C,_){"use strict";_.d(C,{disposeMesh:function(){return S.Z}});var T=_(666),M=_.n(T),j=null,S=_(695),R=_(644);function V(D){if(D.material){var W=Array.isArray(D.material)?D.material:[D.material];W.forEach(function(O){var z,B;(z=O.color)===null||z===void 0||z.convertSRGBToLinear(),(B=O.emissive)===null||B===void 0||B.convertSRGBToLinear(),O.map&&(O.map.encoding=THREE.sRGBEncoding),O.emissiveMap&&(O.emissiveMap.encoding=THREE.sRGBEncoding)})}}var k=_(568),L=_(924),F=require("idb-keyval"),Z=_(484),E=null,c=null,ie=function(){var D=(0,k.Z)(M().mark(function W(O,z){var B,Q,q,ee,J,te;return M().wrap(function($){for(;;)switch($.prev=$.next){case 0:return B=z.version,$.next=4,(0,F.get)(O);case 4:if(q=$.sent,!(q&&q[B])){$.next=9;break}Q=q[B],$.next=15;break;case 9:return $.next=11,(0,Z.Z)(fetch(O).then(function(se){if(se.ok)return se.blob();throw new Error}));case 11:ee=$.sent,J=ee.res,te=ee.err,te||(Q=J,(0,F.set)(O,(0,L.Z)({},B,J)));case 15:return $.abrupt("return",Q?{url:URL.createObjectURL(Q)}:{url:O});case 16:case"end":return $.stop()}},W)}));return function(O,z){return D.apply(this,arguments)}}()},484:function(A,C,_){"use strict";_.d(C,{Z:function(){return M}});var T=_(42);function M(j){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return j.then(function(R){return(0,T.Z)({err:null,res:R},S)}).catch(function(R){return(0,T.Z)({err:R,res:void 0},S)})}},644:function(A){"use strict";A.exports=require("three")},568:function(A,C,_){"use strict";_.d(C,{Z:function(){return M}});function T(j,S,R,V,k,L,F){try{var Z=j[L](F),E=Z.value}catch(c){R(c);return}Z.done?S(E):Promise.resolve(E).then(V,k)}function M(j){return function(){var S=this,R=arguments;return new Promise(function(V,k){var L=j.apply(S,R);function F(E){T(L,V,k,F,Z,"next",E)}function Z(E){T(L,V,k,F,Z,"throw",E)}F(void 0)})}}},924:function(A,C,_){"use strict";_.d(C,{Z:function(){return T}});function T(M,j,S){return j in M?Object.defineProperty(M,j,{value:S,enumerable:!0,configurable:!0,writable:!0}):M[j]=S,M}},42:function(A,C,_){"use strict";_.d(C,{Z:function(){return M}});var T=_(924);function M(j){for(var S=1;S<arguments.length;S++){var R=arguments[S]!=null?arguments[S]:{},V=Object.keys(R);typeof Object.getOwnPropertySymbols=="function"&&(V=V.concat(Object.getOwnPropertySymbols(R).filter(function(k){return Object.getOwnPropertyDescriptor(R,k).enumerable}))),V.forEach(function(k){(0,T.Z)(j,k,R[k])})}return j}}},Se={};function U(A){var C=Se[A];if(C!==void 0)return C.exports;var _=Se[A]={exports:{}};return je[A](_,_.exports,U),_.exports}(function(){U.n=function(A){var C=A&&A.__esModule?function(){return A.default}:function(){return A};return U.d(C,{a:C}),C}})(),function(){U.d=function(A,C){for(var _ in C)U.o(C,_)&&!U.o(A,_)&&Object.defineProperty(A,_,{enumerable:!0,get:C[_]})}}(),function(){U.o=function(A,C){return Object.prototype.hasOwnProperty.call(A,C)}}(),function(){U.r=function(A){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})}}();var be={};(function(){"use strict";U.r(be),U.d(be,{Css2dBind:function(){return Ce},Image:function(){return G},Line:function(){return We},MeshLine:function(){return re},MeshLineMaterial:function(){return we},MeshLineRaycast:function(){return Me},SpriteImage:function(){return H},SpriteVideo:function(){return ue},Text:function(){return s},Video:function(){return me}});function A(t,o){if(!(t instanceof o))throw new TypeError("Cannot call a class as a function")}function C(t,o){return C=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},C(t,o)}function _(t,o){return C(t,o)}function T(t,o){if(typeof o!="function"&&o!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(o&&o.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),o&&_(t,o)}var M=U(42);function j(t,o){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);o&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function S(t,o){return o=o!=null?o:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):j(Object(o)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(o,r))}),t}function R(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function V(t){return V=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},V(t)}function k(t){return V(t)}function L(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function F(t){return t&&t.constructor===Symbol?"symbol":typeof t}function Z(t,o){return o&&(F(o)==="object"||typeof o=="function")?o:L(t)}function E(t){var o=R();return function(){var n=k(t),i;if(o){var e=k(this).constructor;i=Reflect.construct(n,arguments,e)}else i=n.apply(this,arguments);return Z(this,i)}}var c=U(644);function ie(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}function D(t,o,r){return ie()?D=Reflect.construct:D=function(i,e,a){var u=[null];u.push.apply(u,e);var p=Function.bind.apply(i,u),v=new p;return a&&_(v,a.prototype),v},D.apply(null,arguments)}function W(t,o,r){return D.apply(null,arguments)}function O(t,o){for(var r=0;r<o.length;r++){var n=o[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function z(t,o,r){return o&&O(t.prototype,o),r&&O(t,r),t}function B(t,o){(o==null||o>t.length)&&(o=t.length);for(var r=0,n=new Array(o);r<o;r++)n[r]=t[r];return n}function Q(t){if(Array.isArray(t))return B(t)}function q(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ee(){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(t,o){if(!!t){if(typeof t=="string")return B(t,o);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return B(t,o)}}function te(t){return Q(t)||q(t)||J(t)||ee()}var oe=U(484);function $(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(n,i){r.resolve=n,r.reject=i}),t&&(r.promise=(0,oe.Z)(r.promise,o)),r}var se=require("@tweenjs/tween.js"),pe=U.n(se),ve=function(){"use strict";function t(){A(this,t),this.guiParams={}}var o=t.prototype;return o.showGuiParams=function(n){var i=this;!n||Object.keys(this.guiParams).forEach(function(e){var a=n.addFolder(e),u=i.guiParams[e];Object.keys(u).forEach(function(p){var v=u[p],d=v.min,y=v.max,P=v.step,g=v.name,w=v.to,x=v.paramMap,h=v.items,K=v.value,ne=v.target,xe=p.toLowerCase().indexOf("color")>-1,Y,ce=typeof K=="undefined"&&ne,he=ce?ne():u[p],fe=ce?p:"value";h?Y=a.add(he,fe,h):xe?Y=a.addColor(he,fe):Y=a.add(he,fe),Y=Y.name(g||p),typeof d!="undefined"&&(Y=Y.min(d)),typeof y!="undefined"&&(Y=Y.max(y)),typeof P!="undefined"&&(Y=Y.step(P)),Y=Y.onChange(function(){i.setGuiTargetValue(e,p,he[fe],x)}),(w||ce)&&Y.listen()})})},o.setGuiTargetValue=function(n,i,e,a){var u=this.guiParams[n][i],p=u.onChange,v=u.target,d=u.value,y=i.toLowerCase().indexOf("color")>-1,P=typeof d=="undefined"&&v;if(v&&!P){var g=v();Array.isArray(g)||(g=[g]),g.forEach(function(w){if(!!w)if(y)try{w[a||i].set(e)}catch(x){i!=="color"&&!a&&console.warn("".concat(i," is not a color,set paramMap"))}else w[a||i]=e})}p&&p(e)},o.setGuiTargetValueByParams=function(){var n=this;Object.keys(this.guiParams).forEach(function(i){Object.keys(n.guiParams[i]).forEach(function(e){var a=n.guiParams[i][e];typeof a.value!="undefined"&&n.setGuiTargetValue(i,e,a.value,a.paramMap)})})},o.guiParamTween=function(n,i,e){var a=e.duration,u=a===void 0?0:a,p=this,v=this.guiParams[n][i],d=v.to,y=v.paramMap,P=y===void 0?"":y;return new(pe()).Tween(this.guiParams[n][i]).to({value:d},u).onUpdate(function(g){p.setGuiTargetValue(n,i,g.value,P)})},t}(),de=require("three/examples/jsm/renderers/CSS2DRenderer"),le=require("three/examples/jsm/renderers/CSS3DRenderer"),ye=U(519),l=function(t){"use strict";T(r,t);var o=E(r);function r(i){A(this,r);var e;return e=o.call(this),e.objecttype__="BaseObject",e.isAdd=!1,e.userData={},e.pm=$(),e.visible=!1,e}var n=r.prototype;return n.init=function(){},n.create=function(){},n.render=function(){},n.update=function(e,a){},n.resize=function(e,a){},n.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},n.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},n.isVisible=function(){return this.visible},n.createMesh=function(){for(var e=arguments.length,a=new Array(e),u=0;u<e;u++)a[u]=arguments[u];return this.object3d=W(c.Mesh,te(a)),this},n.createGroup=function(){return this.object3d=new c.Group,this},n.createPoints=function(){for(var e=arguments.length,a=new Array(e),u=0;u<e;u++)a[u]=arguments[u];return this.object3d=W(c.Points,te(a)),this},n.createCSS2DObject=function(e){return this.object3d=new de.CSS2DObject(e),this},n.createCSS3DObject=function(e){return this.object3d=new le.CSS3DObject(e),this},n.createCSS3DSprite=function(e){return this.object3d=new le.CSS3DSprite(e),this},n.add=function(){for(var e=arguments.length,a=new Array(e),u=0;u<e;u++)a[u]=arguments[u];var p;return(p=this.object3d).add.apply(p,te(a)),this},n.remove=function(){for(var e=arguments.length,a=new Array(e),u=0;u<e;u++)a[u]=arguments[u];var p;return(p=this.object3d).remove.apply(p,te(a)),this},n.getSize=function(){var e=new c.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new c.Vector3)}},n.traverse=function(e){e(this),this.children.forEach(function(a){a.traverse(e)})},n.dispose=function(){var e;(e=this.object3d)===null||e===void 0||e.traverse(function(a){(0,ye.disposeMesh)(a)})},z(r,[{key:"parent",get:function(){var e=this.object3d.parent;return(e==null?void 0:e.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(e){return e.userData.BaseObject_}).filter(function(e){return!!e})}}]),r}(ve),s=function(t){"use strict";T(r,t);var o=E(r);function r(i){A(this,r);var e;return e=o.call(this),e.width=0,e.options=(0,M.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},i),e}var n=r.prototype;return n.init=function(){var e=document.createElement("canvas");this.canvas=e},n.create=function(){var e=this.options,a=e.position,u=e.lookAt,p=e.sprite,v=e.text,d=e.sizeAttenuation;if(p){var y=new c.Sprite(new c.SpriteMaterial({transparent:!0,sizeAttenuation:d}));this.object3d=y}else{var P=new c.MeshBasicMaterial({side:c.DoubleSide,transparent:!0}),g=new c.PlaneGeometry(1,1,1,1);this.createMesh(g,P)}this.object3d.position.copy(a),u&&this.object3d.lookAt(u),this.setText(v)},n.setText=function(e,a){var u=(0,M.Z)(S((0,M.Z)({},this.options),{text:e}),a||{}),p=u.text,v=u.fontSize,d=u.fontFamily,y=u.fontWeight,P=u.flipX,g=u.scale,w=this.canvas;w.width=v*p.length*2,w.height=v;var x=w.getContext("2d");x.font="".concat(y," ").concat(v,"px/1 ").concat(d);var h=x.measureText(p).width;w.width=h,this.width=h,x=w.getContext("2d"),x.clearRect(0,0,w.width,w.height),P&&x.scale(-1,1),x.font="".concat(y," ").concat(v,"px/1 ").concat(d),x.textBaseline="middle",x.fillStyle="#ffffff",x.fillText(p,P?h*-1:0,w.height/2),x.restore();var K=new c.Texture(w);K.anisotropy=16,K.needsUpdate=!0;var ne=this.object3d;ne.material.map&&ne.material.map.dispose(),ne.material.map=K,ne.material.needsUpdate=!0,ne.scale.set(K.image.width*g,K.image.height*g,1)},r}(l),f=U(568),b=U(666),m=U.n(b),G=function(t){"use strict";T(r,t);var o=E(r);function r(i){A(this,r);var e;return e=o.call(this),e.options=i,e}var n=r.prototype;return n.getMaterial=function(){var e=this;return(0,f.Z)(m().mark(function a(){var u,p,v,d,y,P,g,w;return m().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return u=e.options,p=u.transparent,v=u.blending,d=u.src,y=u.depthWrite,P=u.alphaTest,h.next=3,new c.TextureLoader().loadAsync(d);case 3:return g=h.sent,w=new c.MeshBasicMaterial({map:g,transparent:p!=null?p:!1,blending:v!=null?v:c.NormalBlending,depthWrite:y!=null?y:!0,alphaTest:P!=null?P:0}),h.abrupt("return",w);case 6:case"end":return h.stop()}},a)}))()},n.create=function(){var e=this;return(0,f.Z)(m().mark(function a(){var u,p,v,d,y,P,g,w;return m().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(u=e.options,p=u.scale,v=u.position,d=u.src,y=u.cache,!(y&&!y.get(d))){h.next=7;break}return y.init(d),h.next=5,e.getMaterial();case 5:P=h.sent,y.set(d,P);case 7:if(!y){h.next=13;break}return h.next=10,y.get(d);case 10:h.t0=h.sent,h.next=16;break;case 13:return h.next=15,e.getMaterial();case 15:h.t0=h.sent;case 16:g=h.t0,e.texture=g.map,w=new c.PlaneBufferGeometry(g.map.image.width,g.map.image.height),e.createMesh(w,g),p&&e.object3d.scale.set(p,p,1),v&&e.object3d.position.copy(v);case 22:case"end":return h.stop()}},a)}))()},r}(l),H=function(t){"use strict";T(r,t);var o=E(r);function r(i){A(this,r);var e;return e=o.call(this),e.options=i,e}var n=r.prototype;return n.init=function(){var e=this;return(0,f.Z)(m().mark(function a(){var u,p;return m().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return u=e.options.src,d.next=3,new c.TextureLoader().loadAsync(u);case 3:p=d.sent,e.texture=p;case 5:case"end":return d.stop()}},a)}))()},n.create=function(){var e=this.texture,a=this.options,u=a.scale,p=a.position,v=a.blending,d=a.transparent,y=a.depthWrite,P=a.alphaTest,g=a.sizeAttenuation,w=new c.Sprite(new c.SpriteMaterial({map:e,transparent:d!=null?d:!0,blending:v!=null?v:c.NormalBlending,depthWrite:y!=null?y:!0,alphaTest:P!=null?P:0,sizeAttenuation:g!=null?g:!0}));u&&w.scale.set(e.image.width*u,e.image.height*u,1),p&&w.position.copy(p),this.object3d=w},r}(l);function X(t,o){for(;!Object.prototype.hasOwnProperty.call(t,o)&&(t=k(t),t!==null););return t}function I(t,o,r){return typeof Reflect!="undefined"&&Reflect.get?I=Reflect.get:I=function(i,e,a){var u=X(i,e);if(!!u){var p=Object.getOwnPropertyDescriptor(u,e);return p.get?p.get.call(a||i):p.value}},I(t,o,r)}function N(t,o,r){return I(t,o,r)}var me=function(t){"use strict";T(r,t);var o=E(r);function r(i){A(this,r);var e;return e=o.call(this),e.options=(0,M.Z)({},{autoPlay:!0,loop:!0},i),e}var n=r.prototype;return n.getMaterial=function(){var e=this.options,a=e.src,u=e.transparent,p=e.blending,v=e.depthWrite,d=e.format,y=e.autoPlay,P=e.loop,g=e.alphaTest,w=$(),x=document.createElement("video");return x.addEventListener("loadedmetadata",function(){var h=new c.VideoTexture(x);h.format=d!=null?d:c.RGBAFormat,h.needsUpdate=!0;var K=new c.MeshBasicMaterial({map:h,transparent:u!=null?u:!0,blending:p!=null?p:c.AdditiveBlending,depthWrite:v!=null?v:!0,alphaTest:g!=null?g:0});w.resolve(K)},!1),x.src=a,x.muted=!0,x.autoplay=y,x.loop=P,x.preload="auto",w.promise},n.create=function(){var e=this;return(0,f.Z)(m().mark(function a(){var u,p,v,d,y,P,g,w;return m().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(u=e.options,p=u.scale,v=u.position,d=u.src,y=u.cache,!(y&&!y.get(d))){h.next=7;break}return y.init(d),h.next=5,e.getMaterial();case 5:P=h.sent,y.set(d,P);case 7:if(!y){h.next=13;break}return h.next=10,y.get(d);case 10:h.t0=h.sent,h.next=16;break;case 13:return h.next=15,e.getMaterial();case 15:h.t0=h.sent;case 16:g=h.t0,e.video=g.map.image,w=new c.PlaneBufferGeometry(e.video.videoWidth,e.video.videoHeight),e.createMesh(w,g),p&&e.object3d.scale.set(p,p,1),v&&e.object3d.position.copy(v);case 22:case"end":return h.stop()}},a)}))()},n.render=function(){var e=this.options.autoPlay;e&&this.video.play()},n.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),N(k(r.prototype),"dispose",this).call(this)},r}(l),ue=function(t){"use strict";T(r,t);var o=E(r);function r(i){A(this,r);var e;return e=o.call(this),e.options=(0,M.Z)({},{autoPlay:!0,loop:!0},i),e}var n=r.prototype;return n.getMaterial=function(){var e=this.options,a=e.src,u=e.transparent,p=e.blending,v=e.depthWrite,d=e.autoPlay,y=e.loop,P=e.alphaTest,g=e.format,w=$(),x=document.createElement("video");return x.addEventListener("loadedmetadata",function(){var h=new c.VideoTexture(x);h.format=g!=null?g:c.RGBAFormat,h.needsUpdate=!0;var K=new c.SpriteMaterial({map:h,transparent:u!=null?u:!0,blending:p!=null?p:c.AdditiveBlending,depthWrite:v!=null?v:!0,alphaTest:P!=null?P:0});w.resolve(K)},!1),x.src=a,x.muted=!0,x.autoplay=d,x.loop=y,x.preload="auto",w.promise},n.create=function(){var e=this;return(0,f.Z)(m().mark(function a(){var u,p,v,d,y,P,g,w;return m().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(u=e.options,p=u.scale,v=u.position,d=u.src,y=u.cache,!(y&&!y.get(d))){h.next=7;break}return y.init(d),h.next=5,e.getMaterial();case 5:P=h.sent,y.set(d,P);case 7:if(!y){h.next=13;break}return h.next=10,y.get(d);case 10:h.t0=h.sent,h.next=16;break;case 13:return h.next=15,e.getMaterial();case 15:h.t0=h.sent;case 16:g=h.t0,e.video=g.map.image,w=new c.Sprite(g),p&&w.scale.set(e.video.videoWidth*p,e.video.videoHeight*p,1),v&&w.position.copy(v),e.object3d=w;case 22:case"end":return h.stop()}},a)}))()},n.render=function(){var e=this.options.autoPlay;e&&this.video.play()},n.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),N(k(r.prototype),"dispose",this).call(this)},r}(l),ae=`
|
|
1
|
+
(function(){var je={666:function(A){var C=function(w){"use strict";var T=Object.prototype,M=T.hasOwnProperty,j,S=typeof Symbol=="function"?Symbol:{},R=S.iterator||"@@iterator",D=S.asyncIterator||"@@asyncIterator",k=S.toStringTag||"@@toStringTag";function L(l,s,f){return Object.defineProperty(l,s,{value:f,enumerable:!0,configurable:!0,writable:!0}),l[s]}try{L({},"")}catch(l){L=function(s,f,b){return s[f]=b}}function F(l,s,f,b){var d=s&&s.prototype instanceof O?s:O,G=Object.create(d.prototype),H=new de(b||[]);return G._invoke=$(l,f,H),G}w.wrap=F;function Z(l,s,f){try{return{type:"normal",arg:l.call(s,f)}}catch(b){return{type:"throw",arg:b}}}var E="suspendedStart",c="suspendedYield",ie="executing",V="completed",W={};function O(){}function z(){}function B(){}var Q={};L(Q,R,function(){return this});var q=Object.getPrototypeOf,ee=q&&q(q(le([])));ee&&ee!==T&&M.call(ee,R)&&(Q=ee);var J=B.prototype=O.prototype=Object.create(Q);z.prototype=B,L(J,"constructor",B),L(B,"constructor",z),z.displayName=L(B,k,"GeneratorFunction");function te(l){["next","throw","return"].forEach(function(s){L(l,s,function(f){return this._invoke(s,f)})})}w.isGeneratorFunction=function(l){var s=typeof l=="function"&&l.constructor;return s?s===z||(s.displayName||s.name)==="GeneratorFunction":!1},w.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,B):(l.__proto__=B,L(l,k,"GeneratorFunction")),l.prototype=Object.create(J),l},w.awrap=function(l){return{__await:l}};function oe(l,s){function f(G,H,X,I){var N=Z(l[G],l,H);if(N.type==="throw")I(N.arg);else{var me=N.arg,ue=me.value;return ue&&typeof ue=="object"&&M.call(ue,"__await")?s.resolve(ue.__await).then(function(ae){f("next",ae,X,I)},function(ae){f("throw",ae,X,I)}):s.resolve(ue).then(function(ae){me.value=ae,X(me)},function(ae){return f("throw",ae,X,I)})}}var b;function d(G,H){function X(){return new s(function(I,N){f(G,H,I,N)})}return b=b?b.then(X,X):X()}this._invoke=d}te(oe.prototype),L(oe.prototype,D,function(){return this}),w.AsyncIterator=oe,w.async=function(l,s,f,b,d){d===void 0&&(d=Promise);var G=new oe(F(l,s,f,b),d);return w.isGeneratorFunction(s)?G:G.next().then(function(H){return H.done?H.value:G.next()})};function $(l,s,f){var b=E;return function(G,H){if(b===ie)throw new Error("Generator is already running");if(b===V){if(G==="throw")throw H;return ye()}for(f.method=G,f.arg=H;;){var X=f.delegate;if(X){var I=se(X,f);if(I){if(I===W)continue;return I}}if(f.method==="next")f.sent=f._sent=f.arg;else if(f.method==="throw"){if(b===E)throw b=V,f.arg;f.dispatchException(f.arg)}else f.method==="return"&&f.abrupt("return",f.arg);b=ie;var N=Z(l,s,f);if(N.type==="normal"){if(b=f.done?V:c,N.arg===W)continue;return{value:N.arg,done:f.done}}else N.type==="throw"&&(b=V,f.method="throw",f.arg=N.arg)}}}function se(l,s){var f=l.iterator[s.method];if(f===j){if(s.delegate=null,s.method==="throw"){if(l.iterator.return&&(s.method="return",s.arg=j,se(l,s),s.method==="throw"))return W;s.method="throw",s.arg=new TypeError("The iterator does not provide a 'throw' method")}return W}var b=Z(f,l.iterator,s.arg);if(b.type==="throw")return s.method="throw",s.arg=b.arg,s.delegate=null,W;var d=b.arg;if(!d)return s.method="throw",s.arg=new TypeError("iterator result is not an object"),s.delegate=null,W;if(d.done)s[l.resultName]=d.value,s.next=l.nextLoc,s.method!=="return"&&(s.method="next",s.arg=j);else return d;return s.delegate=null,W}te(J),L(J,k,"Generator"),L(J,R,function(){return this}),L(J,"toString",function(){return"[object Generator]"});function pe(l){var s={tryLoc:l[0]};1 in l&&(s.catchLoc=l[1]),2 in l&&(s.finallyLoc=l[2],s.afterLoc=l[3]),this.tryEntries.push(s)}function ve(l){var s=l.completion||{};s.type="normal",delete s.arg,l.completion=s}function de(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(pe,this),this.reset(!0)}w.keys=function(l){var s=[];for(var f in l)s.push(f);return s.reverse(),function b(){for(;s.length;){var d=s.pop();if(d in l)return b.value=d,b.done=!1,b}return b.done=!0,b}};function le(l){if(l){var s=l[R];if(s)return s.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var f=-1,b=function d(){for(;++f<l.length;)if(M.call(l,f))return d.value=l[f],d.done=!1,d;return d.value=j,d.done=!0,d};return b.next=b}}return{next:ye}}w.values=le;function ye(){return{value:j,done:!0}}return de.prototype={constructor:de,reset:function(l){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(ve),!l)for(var s in this)s.charAt(0)==="t"&&M.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=j)},stop:function(){this.done=!0;var l=this.tryEntries[0],s=l.completion;if(s.type==="throw")throw s.arg;return this.rval},dispatchException:function(l){if(this.done)throw l;var s=this;function f(I,N){return G.type="throw",G.arg=l,s.next=I,N&&(s.method="next",s.arg=j),!!N}for(var b=this.tryEntries.length-1;b>=0;--b){var d=this.tryEntries[b],G=d.completion;if(d.tryLoc==="root")return f("end");if(d.tryLoc<=this.prev){var H=M.call(d,"catchLoc"),X=M.call(d,"finallyLoc");if(H&&X){if(this.prev<d.catchLoc)return f(d.catchLoc,!0);if(this.prev<d.finallyLoc)return f(d.finallyLoc)}else if(H){if(this.prev<d.catchLoc)return f(d.catchLoc,!0)}else if(X){if(this.prev<d.finallyLoc)return f(d.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(l,s){for(var f=this.tryEntries.length-1;f>=0;--f){var b=this.tryEntries[f];if(b.tryLoc<=this.prev&&M.call(b,"finallyLoc")&&this.prev<b.finallyLoc){var d=b;break}}d&&(l==="break"||l==="continue")&&d.tryLoc<=s&&s<=d.finallyLoc&&(d=null);var G=d?d.completion:{};return G.type=l,G.arg=s,d?(this.method="next",this.next=d.finallyLoc,W):this.complete(G)},complete:function(l,s){if(l.type==="throw")throw l.arg;return l.type==="break"||l.type==="continue"?this.next=l.arg:l.type==="return"?(this.rval=this.arg=l.arg,this.method="return",this.next="end"):l.type==="normal"&&s&&(this.next=s),W},finish:function(l){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.finallyLoc===l)return this.complete(f.completion,f.afterLoc),ve(f),W}},catch:function(l){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.tryLoc===l){var b=f.completion;if(b.type==="throw"){var d=b.arg;ve(f)}return d}}throw new Error("illegal catch attempt")},delegateYield:function(l,s,f){return this.delegate={iterator:le(l),resultName:s,nextLoc:f},this.method==="next"&&(this.arg=j),W}},w}(A.exports);try{regeneratorRuntime=C}catch(w){typeof globalThis=="object"?globalThis.regeneratorRuntime=C:Function("r","regeneratorRuntime = r")(C)}},695:function(A,C,w){"use strict";w.d(C,{Z:function(){return T}});function T(M){if(M.geometry&&M.geometry.dispose(),M.material){var j=Array.isArray(M.material)?M.material:[M.material];j.forEach(function(S){var R,D,k,L,F,Z,E,c,ie,V,W,O,z;(R=S.map)===null||R===void 0||R.dispose(),(D=S.lightMap)===null||D===void 0||D.dispose(),(k=S.bumpMap)===null||k===void 0||k.dispose(),(L=S.normalMap)===null||L===void 0||L.dispose(),(F=S.specularMap)===null||F===void 0||F.dispose(),(Z=S.envMap)===null||Z===void 0||Z.dispose(),(E=S.alphaMap)===null||E===void 0||E.dispose(),(c=S.aoMap)===null||c===void 0||c.dispose(),(ie=S.displacementMap)===null||ie===void 0||ie.dispose(),(V=S.emissiveMap)===null||V===void 0||V.dispose(),(W=S.gradientMap)===null||W===void 0||W.dispose(),(O=S.metalnessMap)===null||O===void 0||O.dispose(),(z=S.roughnessMap)===null||z===void 0||z.dispose(),S.dispose()})}}},519:function(A,C,w){"use strict";w.d(C,{disposeMesh:function(){return S.Z}});var T=w(666),M=w.n(T),j=null,S=w(695),R=w(644);function D(V){if(V.material){var W=Array.isArray(V.material)?V.material:[V.material];W.forEach(function(O){var z,B;(z=O.color)===null||z===void 0||z.convertSRGBToLinear(),(B=O.emissive)===null||B===void 0||B.convertSRGBToLinear(),O.map&&(O.map.encoding=THREE.sRGBEncoding),O.emissiveMap&&(O.emissiveMap.encoding=THREE.sRGBEncoding)})}}var k=w(568),L=w(924),F=require("idb-keyval"),Z=w(484),E=null,c=null,ie=function(){var V=(0,k.Z)(M().mark(function W(O,z){var B,Q,q,ee,J,te;return M().wrap(function($){for(;;)switch($.prev=$.next){case 0:return B=z.version,$.next=4,(0,F.get)(O);case 4:if(q=$.sent,!(q&&q[B])){$.next=9;break}Q=q[B],$.next=15;break;case 9:return $.next=11,(0,Z.Z)(fetch(O).then(function(se){if(se.ok)return se.blob();throw new Error}));case 11:ee=$.sent,J=ee.res,te=ee.err,te||(Q=J,(0,F.set)(O,(0,L.Z)({},B,J)));case 15:return $.abrupt("return",Q?{url:URL.createObjectURL(Q)}:{url:O});case 16:case"end":return $.stop()}},W)}));return function(O,z){return V.apply(this,arguments)}}()},484:function(A,C,w){"use strict";w.d(C,{Z:function(){return M}});var T=w(42);function M(j){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return j.then(function(R){return(0,T.Z)({err:null,res:R},S)}).catch(function(R){return(0,T.Z)({err:R,res:void 0},S)})}},644:function(A){"use strict";A.exports=require("three")},568:function(A,C,w){"use strict";w.d(C,{Z:function(){return M}});function T(j,S,R,D,k,L,F){try{var Z=j[L](F),E=Z.value}catch(c){R(c);return}Z.done?S(E):Promise.resolve(E).then(D,k)}function M(j){return function(){var S=this,R=arguments;return new Promise(function(D,k){var L=j.apply(S,R);function F(E){T(L,D,k,F,Z,"next",E)}function Z(E){T(L,D,k,F,Z,"throw",E)}F(void 0)})}}},924:function(A,C,w){"use strict";w.d(C,{Z:function(){return T}});function T(M,j,S){return j in M?Object.defineProperty(M,j,{value:S,enumerable:!0,configurable:!0,writable:!0}):M[j]=S,M}},42:function(A,C,w){"use strict";w.d(C,{Z:function(){return M}});var T=w(924);function M(j){for(var S=1;S<arguments.length;S++){var R=arguments[S]!=null?arguments[S]:{},D=Object.keys(R);typeof Object.getOwnPropertySymbols=="function"&&(D=D.concat(Object.getOwnPropertySymbols(R).filter(function(k){return Object.getOwnPropertyDescriptor(R,k).enumerable}))),D.forEach(function(k){(0,T.Z)(j,k,R[k])})}return j}}},Se={};function U(A){var C=Se[A];if(C!==void 0)return C.exports;var w=Se[A]={exports:{}};return je[A](w,w.exports,U),w.exports}(function(){U.n=function(A){var C=A&&A.__esModule?function(){return A.default}:function(){return A};return U.d(C,{a:C}),C}})(),function(){U.d=function(A,C){for(var w in C)U.o(C,w)&&!U.o(A,w)&&Object.defineProperty(A,w,{enumerable:!0,get:C[w]})}}(),function(){U.o=function(A,C){return Object.prototype.hasOwnProperty.call(A,C)}}(),function(){U.r=function(A){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})}}();var be={};(function(){"use strict";U.r(be),U.d(be,{Css2dBind:function(){return Ce},Image:function(){return G},Line:function(){return We},MeshLine:function(){return re},MeshLineMaterial:function(){return we},MeshLineRaycast:function(){return Me},SpriteImage:function(){return H},SpriteVideo:function(){return ue},Text:function(){return s},Video:function(){return me}});function A(t,o){if(!(t instanceof o))throw new TypeError("Cannot call a class as a function")}function C(t,o){return C=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},C(t,o)}function w(t,o){return C(t,o)}function T(t,o){if(typeof o!="function"&&o!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(o&&o.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),o&&w(t,o)}var M=U(42);function j(t,o){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);o&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function S(t,o){return o=o!=null?o:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):j(Object(o)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(o,r))}),t}function R(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function D(t){return D=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},D(t)}function k(t){return D(t)}function L(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function F(t){return t&&t.constructor===Symbol?"symbol":typeof t}function Z(t,o){return o&&(F(o)==="object"||typeof o=="function")?o:L(t)}function E(t){var o=R();return function(){var n=k(t),i;if(o){var e=k(this).constructor;i=Reflect.construct(n,arguments,e)}else i=n.apply(this,arguments);return Z(this,i)}}var c=U(644);function ie(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}function V(t,o,r){return ie()?V=Reflect.construct:V=function(i,e,a){var u=[null];u.push.apply(u,e);var p=Function.bind.apply(i,u),v=new p;return a&&w(v,a.prototype),v},V.apply(null,arguments)}function W(t,o,r){return V.apply(null,arguments)}function O(t,o){for(var r=0;r<o.length;r++){var n=o[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function z(t,o,r){return o&&O(t.prototype,o),r&&O(t,r),t}function B(t,o){(o==null||o>t.length)&&(o=t.length);for(var r=0,n=new Array(o);r<o;r++)n[r]=t[r];return n}function Q(t){if(Array.isArray(t))return B(t)}function q(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ee(){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(t,o){if(!!t){if(typeof t=="string")return B(t,o);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return B(t,o)}}function te(t){return Q(t)||q(t)||J(t)||ee()}var oe=U(484);function $(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(n,i){r.resolve=n,r.reject=i}),t&&(r.promise=(0,oe.Z)(r.promise,o)),r}var se=require("@tweenjs/tween.js"),pe=U.n(se),ve=function(){"use strict";function t(){A(this,t),this.guiParams={}}var o=t.prototype;return o.showGuiParams=function(n){var i=this;!n||Object.keys(this.guiParams).forEach(function(e){var a=n.addFolder(e),u=i.guiParams[e];Object.keys(u).forEach(function(p){var v=u[p],m=v.min,y=v.max,_=v.step,g=v.name,P=v.to,x=v.paramMap,h=v.items,K=v.value,ne=v.target,xe=p.toLowerCase().indexOf("color")>-1,Y,ce=typeof K=="undefined"&&ne,he=ce?ne():u[p],fe=ce?p:"value";h?Y=a.add(he,fe,h):xe?Y=a.addColor(he,fe):Y=a.add(he,fe),Y=Y.name(g||p),typeof m!="undefined"&&(Y=Y.min(m)),typeof y!="undefined"&&(Y=Y.max(y)),typeof _!="undefined"&&(Y=Y.step(_)),Y=Y.onChange(function(){i.setGuiTargetValue(e,p,he[fe],x)}),(P||ce)&&Y.listen()})})},o.setGuiTargetValue=function(n,i,e,a){var u=this.guiParams[n][i],p=u.onChange,v=u.target,m=u.value,y=i.toLowerCase().indexOf("color")>-1,_=typeof m=="undefined"&&v;if(v&&!_){var g=v();Array.isArray(g)||(g=[g]),g.forEach(function(P){if(!!P)if(y)try{P[a||i].set(e)}catch(x){i!=="color"&&!a&&console.warn("".concat(i," is not a color,set paramMap"))}else P[a||i]=e})}p&&p(e)},o.setGuiTargetValueByParams=function(){var n=this;Object.keys(this.guiParams).forEach(function(i){Object.keys(n.guiParams[i]).forEach(function(e){var a=n.guiParams[i][e];typeof a.value!="undefined"&&n.setGuiTargetValue(i,e,a.value,a.paramMap)})})},o.guiParamTween=function(n,i,e){var a=e.duration,u=a===void 0?0:a,p=this,v=this.guiParams[n][i],m=v.to,y=v.paramMap,_=y===void 0?"":y;return new(pe()).Tween(this.guiParams[n][i]).to({value:m},u).onUpdate(function(g){p.setGuiTargetValue(n,i,g.value,_)})},t}(),de=require("three/examples/jsm/renderers/CSS2DRenderer"),le=require("three/examples/jsm/renderers/CSS3DRenderer"),ye=U(519),l=function(t){"use strict";T(r,t);var o=E(r);function r(i){A(this,r);var e;return e=o.call(this),e.objecttype__="BaseObject",e.isAdd=!1,e.userData={},e.pm=$(),e.visible=!1,e}var n=r.prototype;return n.init=function(){},n.create=function(){},n.render=function(){},n.update=function(e,a){},n.resize=function(e,a){},n.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},n.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},n.isVisible=function(){return this.visible},n.createMesh=function(){for(var e=arguments.length,a=new Array(e),u=0;u<e;u++)a[u]=arguments[u];return this.object3d=W(c.Mesh,te(a)),this},n.createGroup=function(){return this.object3d=new c.Group,this},n.createPoints=function(){for(var e=arguments.length,a=new Array(e),u=0;u<e;u++)a[u]=arguments[u];return this.object3d=W(c.Points,te(a)),this},n.createCSS2DObject=function(e){return this.object3d=new de.CSS2DObject(e),this},n.createCSS3DObject=function(e){return this.object3d=new le.CSS3DObject(e),this},n.createCSS3DSprite=function(e){return this.object3d=new le.CSS3DSprite(e),this},n.add=function(){for(var e=arguments.length,a=new Array(e),u=0;u<e;u++)a[u]=arguments[u];var p;return(p=this.object3d).add.apply(p,te(a)),this},n.remove=function(){for(var e=arguments.length,a=new Array(e),u=0;u<e;u++)a[u]=arguments[u];var p;return(p=this.object3d).remove.apply(p,te(a)),this},n.getSize=function(){var e=new c.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new c.Vector3)}},n.traverse=function(e){e(this),this.children.forEach(function(a){a.traverse(e)})},n.dispose=function(){var e;(e=this.object3d)===null||e===void 0||e.traverse(function(a){(0,ye.disposeMesh)(a)})},z(r,[{key:"parent",get:function(){var e=this.object3d.parent;return(e==null?void 0:e.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(e){return e.userData.BaseObject_}).filter(function(e){return!!e})}}]),r}(ve),s=function(t){"use strict";T(r,t);var o=E(r);function r(i){A(this,r);var e;return e=o.call(this),e.width=0,e.options=(0,M.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},i),e}var n=r.prototype;return n.init=function(){var e=document.createElement("canvas");this.canvas=e},n.create=function(){var e=this.options,a=e.position,u=e.lookAt,p=e.sprite,v=e.text,m=e.sizeAttenuation;if(p){var y=new c.Sprite(new c.SpriteMaterial({transparent:!0,sizeAttenuation:m}));this.object3d=y}else{var _=new c.MeshBasicMaterial({side:c.DoubleSide,transparent:!0}),g=new c.PlaneGeometry(1,1,1,1);this.createMesh(g,_)}this.object3d.position.copy(a),u&&this.object3d.lookAt(u),this.setText(v)},n.setText=function(e,a){var u=(0,M.Z)(S((0,M.Z)({},this.options),{text:e}),a||{}),p=u.text,v=u.fontSize,m=u.fontFamily,y=u.fontWeight,_=u.flipX,g=u.scale,P=this.canvas;P.width=v*p.length*2,P.height=v;var x=P.getContext("2d");x.font="".concat(y," ").concat(v,"px/1 ").concat(m);var h=x.measureText(p).width;P.width=h,this.width=h,x=P.getContext("2d"),x.clearRect(0,0,P.width,P.height),_&&x.scale(-1,1),x.font="".concat(y," ").concat(v,"px/1 ").concat(m),x.textBaseline="middle",x.fillStyle="#ffffff",x.fillText(p,_?h*-1:0,P.height/2),x.restore();var K=new c.Texture(P);K.anisotropy=16,K.needsUpdate=!0;var ne=this.object3d;ne.material.map&&ne.material.map.dispose(),ne.material.map=K,ne.material.needsUpdate=!0,ne.scale.set(K.image.width*g,K.image.height*g,1)},r}(l),f=U(568),b=U(666),d=U.n(b),G=function(t){"use strict";T(r,t);var o=E(r);function r(i){A(this,r);var e;return e=o.call(this),e.options=i,e}var n=r.prototype;return n.getMaterial=function(){var e=this;return(0,f.Z)(d().mark(function a(){var u,p,v,m,y,_,g,P;return d().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return u=e.options,p=u.transparent,v=u.blending,m=u.src,y=u.depthWrite,_=u.alphaTest,h.next=3,new c.TextureLoader().loadAsync(m);case 3:return g=h.sent,P=new c.MeshBasicMaterial({map:g,transparent:p!=null?p:!1,blending:v!=null?v:c.NormalBlending,depthWrite:y!=null?y:!0,alphaTest:_!=null?_:0}),h.abrupt("return",P);case 6:case"end":return h.stop()}},a)}))()},n.create=function(){var e=this;return(0,f.Z)(d().mark(function a(){var u,p,v,m,y,_,g,P;return d().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(u=e.options,p=u.scale,v=u.position,m=u.src,y=u.cache,!(y&&!y.get(m))){h.next=7;break}return y.init(m),h.next=5,e.getMaterial();case 5:_=h.sent,y.set(m,_);case 7:if(!y){h.next=13;break}return h.next=10,y.get(m);case 10:h.t0=h.sent,h.next=16;break;case 13:return h.next=15,e.getMaterial();case 15:h.t0=h.sent;case 16:g=h.t0,e.texture=g.map,P=new c.PlaneBufferGeometry(g.map.image.width,g.map.image.height),e.createMesh(P,g),p&&e.object3d.scale.set(p,p,1),v&&e.object3d.position.copy(v);case 22:case"end":return h.stop()}},a)}))()},r}(l),H=function(t){"use strict";T(r,t);var o=E(r);function r(i){A(this,r);var e;return e=o.call(this),e.options=i,e}var n=r.prototype;return n.init=function(){var e=this;return(0,f.Z)(d().mark(function a(){var u,p;return d().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return u=e.options.src,m.next=3,new c.TextureLoader().loadAsync(u);case 3:p=m.sent,e.texture=p;case 5:case"end":return m.stop()}},a)}))()},n.create=function(){var e=this.texture,a=this.options,u=a.scale,p=a.position,v=a.blending,m=a.transparent,y=a.depthWrite,_=a.alphaTest,g=a.sizeAttenuation,P=new c.Sprite(new c.SpriteMaterial({map:e,transparent:m!=null?m:!0,blending:v!=null?v:c.NormalBlending,depthWrite:y!=null?y:!0,alphaTest:_!=null?_:0,sizeAttenuation:g!=null?g:!0}));u&&P.scale.set(e.image.width*u,e.image.height*u,1),p&&P.position.copy(p),this.object3d=P},r}(l);function X(t,o){for(;!Object.prototype.hasOwnProperty.call(t,o)&&(t=k(t),t!==null););return t}function I(t,o,r){return typeof Reflect!="undefined"&&Reflect.get?I=Reflect.get:I=function(i,e,a){var u=X(i,e);if(!!u){var p=Object.getOwnPropertyDescriptor(u,e);return p.get?p.get.call(a||i):p.value}},I(t,o,r)}function N(t,o,r){return I(t,o,r)}var me=function(t){"use strict";T(r,t);var o=E(r);function r(i){A(this,r);var e;return e=o.call(this),e.options=(0,M.Z)({},{autoPlay:!0,loop:!0},i),e}var n=r.prototype;return n.getMaterial=function(){var e=this.options,a=e.src,u=e.transparent,p=e.blending,v=e.depthWrite,m=e.format,y=e.autoPlay,_=e.loop,g=e.alphaTest,P=$(),x=document.createElement("video");return x.addEventListener("loadedmetadata",function(){var h=new c.VideoTexture(x);h.format=m!=null?m:c.RGBAFormat,h.needsUpdate=!0;var K=new c.MeshBasicMaterial({map:h,transparent:u!=null?u:!0,blending:p!=null?p:c.AdditiveBlending,depthWrite:v!=null?v:!0,alphaTest:g!=null?g:0});P.resolve(K)},!1),x.src=a,x.muted=!0,x.autoplay=y,x.loop=_,x.preload="auto",P.promise},n.create=function(){var e=this;return(0,f.Z)(d().mark(function a(){var u,p,v,m,y,_,g,P;return d().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(u=e.options,p=u.scale,v=u.position,m=u.src,y=u.cache,!(y&&!y.get(m))){h.next=7;break}return y.init(m),h.next=5,e.getMaterial();case 5:_=h.sent,y.set(m,_);case 7:if(!y){h.next=13;break}return h.next=10,y.get(m);case 10:h.t0=h.sent,h.next=16;break;case 13:return h.next=15,e.getMaterial();case 15:h.t0=h.sent;case 16:g=h.t0,e.video=g.map.image,P=new c.PlaneBufferGeometry(e.video.videoWidth,e.video.videoHeight),e.createMesh(P,g),p&&e.object3d.scale.set(p,p,1),v&&e.object3d.position.copy(v);case 22:case"end":return h.stop()}},a)}))()},n.render=function(){var e=this.options.autoPlay;e&&this.video.play()},n.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),N(k(r.prototype),"dispose",this).call(this)},r}(l),ue=function(t){"use strict";T(r,t);var o=E(r);function r(i){A(this,r);var e;return e=o.call(this),e.options=(0,M.Z)({},{autoPlay:!0,loop:!0},i),e}var n=r.prototype;return n.getMaterial=function(){var e=this.options,a=e.src,u=e.transparent,p=e.blending,v=e.depthWrite,m=e.autoPlay,y=e.loop,_=e.alphaTest,g=e.format,P=$(),x=document.createElement("video");return x.addEventListener("loadedmetadata",function(){var h=new c.VideoTexture(x);h.format=g!=null?g:c.RGBAFormat,h.needsUpdate=!0;var K=new c.SpriteMaterial({map:h,transparent:u!=null?u:!0,blending:p!=null?p:c.AdditiveBlending,depthWrite:v!=null?v:!0,alphaTest:_!=null?_:0});P.resolve(K)},!1),x.src=a,x.muted=!0,x.autoplay=m,x.loop=y,x.preload="auto",P.promise},n.create=function(){var e=this;return(0,f.Z)(d().mark(function a(){var u,p,v,m,y,_,g,P;return d().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(u=e.options,p=u.scale,v=u.position,m=u.src,y=u.cache,!(y&&!y.get(m))){h.next=7;break}return y.init(m),h.next=5,e.getMaterial();case 5:_=h.sent,y.set(m,_);case 7:if(!y){h.next=13;break}return h.next=10,y.get(m);case 10:h.t0=h.sent,h.next=16;break;case 13:return h.next=15,e.getMaterial();case 15:h.t0=h.sent;case 16:g=h.t0,e.video=g.map.image,P=new c.Sprite(g),p&&P.scale.set(e.video.videoWidth*p,e.video.videoHeight*p,1),v&&P.position.copy(v),e.object3d=P;case 22:case"end":return h.stop()}},a)}))()},n.render=function(){var e=this.options.autoPlay;e&&this.video.play()},n.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),N(k(r.prototype),"dispose",this).call(this)},r}(l),ae=`
|
|
2
2
|
`.concat(c.ShaderChunk.logdepthbuf_pars_vertex,`
|
|
3
3
|
`).concat(c.ShaderChunk.fog_pars_vertex,`
|
|
4
4
|
attribute vec3 previous;
|
|
@@ -129,4 +129,4 @@ void main() {
|
|
|
129
129
|
gl_FragColor.a *= step(vCounters, visibility);
|
|
130
130
|
`).concat(c.ShaderChunk.fog_fragment,`
|
|
131
131
|
}
|
|
132
|
-
`),re=function(t){"use strict";T(r,t);var o=E(r);function r(){A(this,r);var n;return n=o.call(this),n.isMeshLine=!0,n.type="MeshLine",n.positions=[],n.previous=[],n.next=[],n.side=[],n.width=[],n.indices_array=[],n.uvs=[],n.counters=[],n._points=[],n._geom=null,n.widthCallback=null,n.matrixWorld=new c.Matrix4,Object.defineProperties(L(n),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(e){this.setGeometry(e,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(e){this.setPoints(e,this.widthCallback)}}}),n}return r}(c.BufferGeometry);re.prototype.setMatrixWorld=function(t){this.matrixWorld=t},re.prototype.setGeometry=function(t,o){this._geometry=t,this.setPoints(t.getAttribute("position").array,o)},re.prototype.setPoints=function(t,o){if(!(t instanceof Float32Array)&&!(t instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=t,this.widthCallback=o,this.positions=[],this.counters=[],t.length&&t[0]instanceof c.Vector3)for(var r=0;r<t.length;r++){var n=t[r],i=r/t.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(i),this.counters.push(i)}else for(var r=0;r<t.length;r+=3){var i=r/t.length;this.positions.push(t[r],t[r+1],t[r+2]),this.positions.push(t[r],t[r+1],t[r+2]),this.counters.push(i),this.counters.push(i)}this.process()};function Me(t,o){var r=new c.Matrix4,n=new c.Ray,i=new c.Sphere,e=new c.Vector3,a=this.geometry;if(a.boundingSphere||a.computeBoundingSphere(),i.copy(a.boundingSphere),i.applyMatrix4(this.matrixWorld),t.ray.intersectSphere(i,e)!==!1){r.copy(this.matrixWorld).invert(),n.copy(t.ray).applyMatrix4(r);var u=new c.Vector3,p=new c.Vector3,v=new c.Vector3,d=this instanceof c.LineSegments?2:1,y=a.index,P=a.attributes;if(y!==null)for(var g=y.array,w=P.position.array,x=P.width.array,h=0,K=g.length-1;h<K;h+=d){var ne=g[h],xe=g[h+1];u.fromArray(w,ne*3),p.fromArray(w,xe*3);var Y=x[Math.floor(h/3)]!==void 0?x[Math.floor(h/3)]:1,ce=t.params.Line.threshold+this.material.lineWidth*Y/2,he=ce*ce,fe=n.distanceSqToSegment(u,p,e,v);if(!(fe>he)){e.applyMatrix4(this.matrixWorld);var Ae=t.ray.origin.distanceTo(e);Ae<t.near||Ae>t.far||(o.push({distance:Ae,point:v.clone().applyMatrix4(this.matrixWorld),index:h,face:null,faceIndex:null,object:this}),h=K)}}}}re.prototype.raycast=Me,re.prototype.compareV3=function(t,o){var r=t*6,n=o*6;return this.positions[r]===this.positions[n]&&this.positions[r+1]===this.positions[n+1]&&this.positions[r+2]===this.positions[n+2]},re.prototype.copyV3=function(t){var o=t*6;return[this.positions[o],this.positions[o+1],this.positions[o+2]]},re.prototype.process=function(){var t=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var o,r;this.compareV3(0,t-1)?r=this.copyV3(t-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var n=0;n<t;n++){if(this.side.push(1),this.side.push(-1),this.widthCallback?o=this.widthCallback(n/(t-1)):o=1,this.width.push(o),this.width.push(o),this.uvs.push(n/(t-1),0),this.uvs.push(n/(t-1),1),n<t-1){r=this.copyV3(n),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var i=n*2;this.indices_array.push(i,i+1,i+2),this.indices_array.push(i+2,i+1,i+3)}n>0&&(r=this.copyV3(n),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(t-1,0)?r=this.copyV3(1):r=this.copyV3(t-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new c.BufferAttribute(new Float32Array(this.positions),3),previous:new c.BufferAttribute(new Float32Array(this.previous),3),next:new c.BufferAttribute(new Float32Array(this.next),3),side:new c.BufferAttribute(new Float32Array(this.side),1),width:new c.BufferAttribute(new Float32Array(this.width),1),uv:new c.BufferAttribute(new Float32Array(this.uvs),2),index:new c.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new c.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function _e(t,o,r,n,i){var e;if(t=t.subarray||t.slice?t:t.buffer,r=r.subarray||r.slice?r:r.buffer,t=o?t.subarray?t.subarray(o,i&&o+i):t.slice(o,i&&o+i):t,r.set)r.set(t,n);else for(e=0;e<t.length;e++)r[e+n]=t[e];return r}re.prototype.advance=function(t){var o=this._attributes.position.array,r=this._attributes.previous.array,n=this._attributes.next.array,i=o.length;_e(o,0,r,0,i),_e(o,6,o,0,i-6),o[i-6]=t.x,o[i-5]=t.y,o[i-4]=t.z,o[i-3]=t.x,o[i-2]=t.y,o[i-1]=t.z,_e(o,6,n,0,i-6),n[i-6]=t.x,n[i-5]=t.y,n[i-4]=t.z,n[i-3]=t.x,n[i-2]=t.y,n[i-1]=t.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},c.ShaderChunk.meshline_vert=ae,c.ShaderChunk.meshline_frag=Te;var we=function(t){"use strict";T(r,t);var o=E(r);function r(n){A(this,r);var i;return i=o.call(this,{uniforms:Object.assign({},c.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new c.Color(16777215)},opacity:{value:1},resolution:{value:new c.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new c.Vector2(1,1)},offset:{value:new c.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new c.Vector2(0,0)},lightColor:{value:new c.Color(16777215)}}),vertexShader:c.ShaderChunk.meshline_vert,fragmentShader:c.ShaderChunk.meshline_frag}),i.isMeshLineMaterial=!0,i.type="MeshLineMaterial",Object.defineProperties(L(i),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(a){this.uniforms.lineWidth.value=a}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(a){this.uniforms.lineLightAnimation.value=a}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(a){this.uniforms.map.value=a}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(a){this.uniforms.useMap.value=a}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(a){this.uniforms.alphaMap.value=a}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(a){this.uniforms.useAlphaMap.value=a}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(a){this.uniforms.color.value=a}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(a){this.uniforms.lightColor.value=a}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(a){this.uniforms.time.value=a}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(a){this.uniforms.uCenter.value=a}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(a){this.uniforms.size.value=a}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(a){this.uniforms.opacity.value=a}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(a){this.uniforms.resolution.value.copy(a)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(a){this.uniforms.sizeAttenuation.value=a}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(a){this.uniforms.dashArray.value=a,this.useDash=a!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(a){this.uniforms.dashOffset.value=a}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(a){this.uniforms.dashRatio.value=a}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(a){this.uniforms.useDash.value=a}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(a){this.uniforms.visibility.value=a}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(a){this.uniforms.alphaTest.value=a}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(a){this.uniforms.repeat.value.copy(a)}}}),i.setValues(n),i}return r}(c.ShaderMaterial);we.prototype.copy=function(t){return c.ShaderMaterial.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.dashArray.copy(t.dashArray),this.dashOffset.copy(t.dashOffset),this.dashRatio.copy(t.dashRatio),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this};function Le(t,o){if(t==null)return{};var r={},n=Object.keys(t),i,e;for(e=0;e<n.length;e++)i=n[e],!(o.indexOf(i)>=0)&&(r[i]=t[i]);return r}function ke(t,o){if(t==null)return{};var r=Le(t,o),n,i;if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);for(i=0;i<e.length;i++)n=e[i],!(o.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,n)||(r[n]=t[n]))}return r}var Ee={nodes:[],color:new c.Color("red"),lineWidth:3,sizeAttenuation:0},Re=function(t){"use strict";T(r,t);var o=E(r);function r(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};A(this,r);var e;return e=o.call(this),e.geometry=new c.BufferGeometry,e.meshline=new re,e.options=(0,M.Z)({},Ee,i),e}var n=r.prototype;return n.create=function(){var e=this.options,a=e.nodes,u=e.duration,p=e.delay,v=e.onComplete,d=e.setPointWidth,y=ke(e,["nodes","duration","delay","onComplete","setPointWidth"]),P=this.pencil.getSize(),g=P.width,w=P.height;delete y.key,this.geometry.setFromPoints(a),this.meshline.setGeometry(this.geometry,d);var x=new we(S((0,M.Z)({},y),{resolution:new c.Vector2(g,w)}));this.material=x,this.createMesh(this.meshline,x)},n.resize=function(e,a){this.material.uniforms.resolution.value.set(e,a)},n.animate=function(){var e=this.options,a=e.duration,u=e.delay,p=e.onComplete,v=this.material.uniforms.offset,d=new(pe()).Tween(v.value).to({x:0},a!=null?a:1e3).delay(u!=null?u:0).repeat(1/0);p&&d.onComplete(p),d.start(),this.tween=d},n.dispose=function(){this.tween&&pe().remove(this.tween)},r}(l),We=Re,Be={position:new c.Vector3(0,0,0),onClick:void 0},ge=document.createElement("canvas");ge.width=256,ge.height=256;var Oe=ge.getContext("2d");Oe.fillStyle="#ff0000",Oe.fillRect(0,0,256,256);var Pe=new c.CanvasTexture(ge),Ce=function(t){"use strict";T(r,t);var o=E(r);function r(i){A(this,r);var e;return e=o.call(this),e.options=(0,M.Z)({},Be,i),e}var n=r.prototype;return n.create=function(){var e=document.createElement("div");this.options.children&&e.appendChild(this.options.children),this.createCSS2DObject(e),this.object3d.position.copy(this.options.position)},n.createPickObject=function(e){var a=e.show,u=a===void 0?!1:a,p=e.scale,v=p===void 0?new c.Vector3(1,1,1):p,d=new c.Sprite(new c.SpriteMaterial({map:Pe,opacity:u?1:0,transparent:!0,alphaTest:.1}));d.scale.set(Pe.image.width*v.x,Pe.image.height*v.y,1),this.add(d),this.pickObject=d},r}(l),ze={Css2dBind:Ce}})(),module.exports=be})();
|
|
132
|
+
`),re=function(t){"use strict";T(r,t);var o=E(r);function r(){A(this,r);var n;return n=o.call(this),n.isMeshLine=!0,n.type="MeshLine",n.positions=[],n.previous=[],n.next=[],n.side=[],n.width=[],n.indices_array=[],n.uvs=[],n.counters=[],n._points=[],n._geom=null,n.widthCallback=null,n.matrixWorld=new c.Matrix4,Object.defineProperties(L(n),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(e){this.setGeometry(e,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(e){this.setPoints(e,this.widthCallback)}}}),n}return r}(c.BufferGeometry);re.prototype.setMatrixWorld=function(t){this.matrixWorld=t},re.prototype.setGeometry=function(t,o){this._geometry=t,this.setPoints(t.getAttribute("position").array,o)},re.prototype.setPoints=function(t,o){if(!(t instanceof Float32Array)&&!(t instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=t,this.widthCallback=o,this.positions=[],this.counters=[],t.length&&t[0]instanceof c.Vector3)for(var r=0;r<t.length;r++){var n=t[r],i=r/t.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(i),this.counters.push(i)}else for(var r=0;r<t.length;r+=3){var i=r/t.length;this.positions.push(t[r],t[r+1],t[r+2]),this.positions.push(t[r],t[r+1],t[r+2]),this.counters.push(i),this.counters.push(i)}this.process()};function Me(t,o){var r=new c.Matrix4,n=new c.Ray,i=new c.Sphere,e=new c.Vector3,a=this.geometry;if(a.boundingSphere||a.computeBoundingSphere(),i.copy(a.boundingSphere),i.applyMatrix4(this.matrixWorld),t.ray.intersectSphere(i,e)!==!1){r.copy(this.matrixWorld).invert(),n.copy(t.ray).applyMatrix4(r);var u=new c.Vector3,p=new c.Vector3,v=new c.Vector3,m=this instanceof c.LineSegments?2:1,y=a.index,_=a.attributes;if(y!==null)for(var g=y.array,P=_.position.array,x=_.width.array,h=0,K=g.length-1;h<K;h+=m){var ne=g[h],xe=g[h+1];u.fromArray(P,ne*3),p.fromArray(P,xe*3);var Y=x[Math.floor(h/3)]!==void 0?x[Math.floor(h/3)]:1,ce=t.params.Line.threshold+this.material.lineWidth*Y/2,he=ce*ce,fe=n.distanceSqToSegment(u,p,e,v);if(!(fe>he)){e.applyMatrix4(this.matrixWorld);var Ae=t.ray.origin.distanceTo(e);Ae<t.near||Ae>t.far||(o.push({distance:Ae,point:v.clone().applyMatrix4(this.matrixWorld),index:h,face:null,faceIndex:null,object:this}),h=K)}}}}re.prototype.raycast=Me,re.prototype.compareV3=function(t,o){var r=t*6,n=o*6;return this.positions[r]===this.positions[n]&&this.positions[r+1]===this.positions[n+1]&&this.positions[r+2]===this.positions[n+2]},re.prototype.copyV3=function(t){var o=t*6;return[this.positions[o],this.positions[o+1],this.positions[o+2]]},re.prototype.process=function(){var t=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var o,r;this.compareV3(0,t-1)?r=this.copyV3(t-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var n=0;n<t;n++){if(this.side.push(1),this.side.push(-1),this.widthCallback?o=this.widthCallback(n/(t-1)):o=1,this.width.push(o),this.width.push(o),this.uvs.push(n/(t-1),0),this.uvs.push(n/(t-1),1),n<t-1){r=this.copyV3(n),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var i=n*2;this.indices_array.push(i,i+1,i+2),this.indices_array.push(i+2,i+1,i+3)}n>0&&(r=this.copyV3(n),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(t-1,0)?r=this.copyV3(1):r=this.copyV3(t-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new c.BufferAttribute(new Float32Array(this.positions),3),previous:new c.BufferAttribute(new Float32Array(this.previous),3),next:new c.BufferAttribute(new Float32Array(this.next),3),side:new c.BufferAttribute(new Float32Array(this.side),1),width:new c.BufferAttribute(new Float32Array(this.width),1),uv:new c.BufferAttribute(new Float32Array(this.uvs),2),index:new c.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new c.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function _e(t,o,r,n,i){var e;if(t=t.subarray||t.slice?t:t.buffer,r=r.subarray||r.slice?r:r.buffer,t=o?t.subarray?t.subarray(o,i&&o+i):t.slice(o,i&&o+i):t,r.set)r.set(t,n);else for(e=0;e<t.length;e++)r[e+n]=t[e];return r}re.prototype.advance=function(t){var o=this._attributes.position.array,r=this._attributes.previous.array,n=this._attributes.next.array,i=o.length;_e(o,0,r,0,i),_e(o,6,o,0,i-6),o[i-6]=t.x,o[i-5]=t.y,o[i-4]=t.z,o[i-3]=t.x,o[i-2]=t.y,o[i-1]=t.z,_e(o,6,n,0,i-6),n[i-6]=t.x,n[i-5]=t.y,n[i-4]=t.z,n[i-3]=t.x,n[i-2]=t.y,n[i-1]=t.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},c.ShaderChunk.meshline_vert=ae,c.ShaderChunk.meshline_frag=Te;var we=function(t){"use strict";T(r,t);var o=E(r);function r(n){A(this,r);var i;return i=o.call(this,{uniforms:Object.assign({},c.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new c.Color(16777215)},opacity:{value:1},resolution:{value:new c.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new c.Vector2(1,1)},offset:{value:new c.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new c.Vector2(0,0)},lightColor:{value:new c.Color(16777215)}}),vertexShader:c.ShaderChunk.meshline_vert,fragmentShader:c.ShaderChunk.meshline_frag}),i.isMeshLineMaterial=!0,i.type="MeshLineMaterial",Object.defineProperties(L(i),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(a){this.uniforms.lineWidth.value=a}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(a){this.uniforms.lineLightAnimation.value=a}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(a){this.uniforms.map.value=a}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(a){this.uniforms.useMap.value=a}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(a){this.uniforms.alphaMap.value=a}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(a){this.uniforms.useAlphaMap.value=a}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(a){this.uniforms.color.value=a}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(a){this.uniforms.lightColor.value=a}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(a){this.uniforms.time.value=a}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(a){this.uniforms.uCenter.value=a}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(a){this.uniforms.size.value=a}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(a){this.uniforms.opacity.value=a}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(a){this.uniforms.resolution.value.copy(a)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(a){this.uniforms.sizeAttenuation.value=a}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(a){this.uniforms.dashArray.value=a,this.useDash=a!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(a){this.uniforms.dashOffset.value=a}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(a){this.uniforms.dashRatio.value=a}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(a){this.uniforms.useDash.value=a}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(a){this.uniforms.visibility.value=a}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(a){this.uniforms.alphaTest.value=a}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(a){this.uniforms.repeat.value.copy(a)}}}),i.setValues(n),i}return r}(c.ShaderMaterial);we.prototype.copy=function(t){return c.ShaderMaterial.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.dashArray.copy(t.dashArray),this.dashOffset.copy(t.dashOffset),this.dashRatio.copy(t.dashRatio),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this};function Le(t,o){if(t==null)return{};var r={},n=Object.keys(t),i,e;for(e=0;e<n.length;e++)i=n[e],!(o.indexOf(i)>=0)&&(r[i]=t[i]);return r}function ke(t,o){if(t==null)return{};var r=Le(t,o),n,i;if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);for(i=0;i<e.length;i++)n=e[i],!(o.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,n)||(r[n]=t[n]))}return r}var Ee={nodes:[],color:new c.Color("red"),lineWidth:3,sizeAttenuation:0},Re=function(t){"use strict";T(r,t);var o=E(r);function r(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};A(this,r);var e;return e=o.call(this),e.geometry=new c.BufferGeometry,e.meshline=new re,e.options=(0,M.Z)({},Ee,i),e}var n=r.prototype;return n.create=function(){var e=this.options,a=e.nodes,u=e.duration,p=e.delay,v=e.onComplete,m=e.setPointWidth,y=ke(e,["nodes","duration","delay","onComplete","setPointWidth"]),_=this.pencil.getSize(),g=_.width,P=_.height;delete y.key,this.geometry.setFromPoints(a),this.meshline.setGeometry(this.geometry,m);var x=new we(S((0,M.Z)({},y),{resolution:new c.Vector2(g,P)}));this.material=x,this.createMesh(this.meshline,x)},n.resize=function(e,a){this.material.uniforms.resolution.value.set(e,a)},n.animate=function(){var e=this.options,a=e.duration,u=e.delay,p=e.onComplete,v=this.material.uniforms.offset,m=new(pe()).Tween(v.value).to({x:0},a!=null?a:1e3).delay(u!=null?u:0).repeat(1/0);p&&m.onComplete(p),m.start(),this.tween=m},n.dispose=function(){this.tween&&pe().remove(this.tween)},r}(l),We=Re,Be={position:new c.Vector3(0,0,0),onClick:void 0},ge=document.createElement("canvas");ge.width=256,ge.height=256;var Oe=ge.getContext("2d");Oe.fillStyle="#ff0000",Oe.fillRect(0,0,256,256);var Pe=new c.CanvasTexture(ge),Ce=function(t){"use strict";T(r,t);var o=E(r);function r(i){A(this,r);var e;return e=o.call(this),e.options=(0,M.Z)({},Be,i),e}var n=r.prototype;return n.create=function(){var e=document.createElement("div");this.options.children&&e.appendChild(this.options.children),this.createCSS2DObject(e),this.object3d.position.copy(this.options.position)},n.createPickObject=function(e){var a=e.show,u=a===void 0?!1:a,p=e.scale,v=p===void 0?new c.Vector3(1,1,1):p,m=e.position,y=m===void 0?new c.Vector3(0,0,0):m,_=new c.Sprite(new c.SpriteMaterial({map:Pe,opacity:u?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}));_.scale.set(Pe.image.width*v.x,Pe.image.height*v.y,1),_.position.copy(y),this.add(_),this.pickObject=_},r}(l),ze={Css2dBind:Ce}})(),module.exports=be})();
|