phantasmal-world/3.784962574f2acf8a739c.js

1 line
12 KiB
JavaScript
Raw Normal View History

2020-01-29 20:34:43 +08:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{458:function(t,e,i){"use strict";i.d(e,"b",(function(){return s})),i.d(e,"e",(function(){return n})),i.d(e,"c",(function(){return a})),i.d(e,"a",(function(){return h})),i.d(e,"d",(function(){return u}));var r=i(38);class s{constructor(t,e){this.x=t,this.y=e}get u(){return this.x}get v(){return this.y}}function n(t,e){return new s(t.x-e.x,t.y-e.y)}class a{constructor(t,e,i){this.x=t,this.y=e,this.z=i}}class o{constructor(t){this.data=t,Object(r.d)(9===t.length,"data should be of length 9.")}static of(t,e,i,r,s,n,a,h,u){return new o(new Float32Array([t,r,a,e,s,h,i,n,u]))}static identity(){return o.of(1,0,0,0,1,0,0,0,1)}get(t,e){return this.data[t+3*e]}set(t,e,i){this.data[t+3*e]=i}clone(){return new o(new Float32Array(this.data))}transpose(){let t;const e=this.data;t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t}inverse(){const t=this.clone();return t.invert(),t}invert(){const t=this.data[0],e=this.data[1],i=this.data[2],r=this.data[3],s=this.data[4],n=this.data[5],a=this.data[6],o=this.data[7],h=this.data[8],u=h*s-n*o,d=n*a-h*r,c=o*r-s*a,f=t*u+e*d+i*c;if(0===f)return this.data[0]=1,this.data[1]=0,this.data[2]=0,this.data[3]=0,this.data[4]=1,this.data[5]=0,this.data[6]=0,this.data[7]=0,void(this.data[8]=1);const l=1/f;this.data[0]=u*l,this.data[1]=(i*o-h*e)*l,this.data[2]=(n*e-i*s)*l,this.data[3]=d*l,this.data[4]=(h*t-i*a)*l,this.data[5]=(i*r-n*t)*l,this.data[6]=c*l,this.data[7]=(e*a-o*t)*l,this.data[8]=(s*t-e*r)*l}}class h{constructor(t){this.data=t,Object(r.d)(16===t.length,"data should be of length 16.")}static of(t,e,i,r,s,n,a,o,u,d,c,f,l,_,m,p){return new h(new Float32Array([t,s,u,l,e,n,d,_,i,a,c,m,r,o,f,p]))}static identity(){return h.of(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)}static translation(t,e,i){return h.of(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1)}static scale(t,e,i){return h.of(t,0,0,1,0,e,0,1,0,0,i,1,0,0,0,1)}static compose(t,e,i){const r=e.w,s=e.x,n=e.y,a=e.z,o=s+s,u=n+n,d=a+a,c=s*o,f=s*u,l=s*d,_=n*u,m=n*d,p=a*d,g=r*o,v=r*u,x=r*d,y=i.x,w=i.y,b=i.z;return h.of((1-(_+p))*y,(f-x)*w,(l+v)*b,t.x,(f+x)*y,(1-(c+p))*w,(m-g)*b,t.y,(l-v)*y,(m+g)*w,(1-(c+_))*b,t.z,0,0,0,1)}get(t,e){return this.data[t+4*e]}set(t,e,i){this.data[t+4*e]=i}clone(){return new h(new Float32Array(this.data))}normal_mat3(){const t=o.of(this.data[0],this.data[4],this.data[8],this.data[1],this.data[5],this.data[9],this.data[2],this.data[6],this.data[10]);return t.invert(),t.transpose(),t}}function u(t,e){const i=new h(new Float32Array(16));return d(i.data,t,e),i}function d(t,e,i){for(let r=0;r<4;r++)for(let s=0;s<4;s++)for(let n=0;n<4;n++)t[r+4*s]+=e.data[r+4*n]*i.data[n+4*s]}},477:function(t,e,i){"use strict";var r;i.d(e,"d",(function(){return r})),i.d(e,"b",(function(){return s})),i.d(e,"a",(function(){return n})),i.d(e,"c",(function(){return a})),i.d(e,"f",(function(){return o})),i.d(e,"e",(function(){return h})),i.d(e,"g",(function(){return u})),function(t){t[t.PosNorm=0]="PosNorm",t[t.PosTex=1]="PosTex",t[t.PosNormTex=2]="PosNormTex"}(r||(r={}));const s=0,n=1,a=2;function o(t){switch(t){case r.PosNorm:return 24;case r.PosTex:return 16;case r.PosNormTex:return 28}}function h(t){switch(t){case r.PosTex:return-1;case r.PosNorm:case r.PosNormTex:return 12}}function u(t){switch(t){case r.PosNorm:return-1;case r.PosTex:return 12;case r.PosNormTex:return 24}}},495:function(t,e,i){"use strict";var r;i.d(e,"b",(function(){return r})),i.d(e,"a",(function(){return s})),function(t){t[t.RGBA_S3TC_DXT1=0]="RGBA_S3TC_DXT1",t[t.RGBA_S3TC_DXT3=1]="RGBA_S3TC_DXT3"}(r||(r={}));class s{constructor(t,e,i,r,s){this.gfx=t,this.format=e,this.width=i,this.height=r,this.data=s}upload(){null==this.gfx_texture&&(this.gfx_texture=this.gfx.create_texture(this.format,this.width,this.height,this.data))}destroy(){this.gfx.destroy_texture(this.gfx_texture)}}},507:function(t,e,i){"use strict";i.d(e,"c",(function(){return n})),i.d(e,"a",(function(){return a})),i.d(e,"b",(function(){return o}));const r=180/Math.PI,s=Math.PI/180;function n(t){return t*r}function a(t){return t*s}function o(t,e){return(t%e+e)%e}},