Created
September 9, 2016 17:19
-
-
Save mikebelanger/0398c102de64037d501b0db287915a3c to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ud={},xd;for(xd in window)ud[xd]=!0;var b4w="object"===typeof b4w?b4w:function(a){var m={};a.module=m;var h={};a.fa=function(a,e){var u=m[a];u&&(u.tk=null);h[e||"__b4w_default"]=null};a.register=function(a,e){m[a]||(m[a]=e)};a.require=function(a,e){if(!m[a])throw Error('Module "'+a+'" not found');e=e||"__b4w_default";h[e]||(h[e]=function(a){return function(c){var e=m[c];if(!e)throw Error('Module "'+c+'" not found');e.tk||(e.tk={});e.tk[a]||(e.tk[a]={},e(e.tk[a],h[a]));return e.tk[a]}}(e));return h[e](a)};a.module_check=function(a){return m[a]? | |
!0:!1};a.get_namespace=function(a){for(var e in h)if(h[e]==a)return e;return""};a.worker_listeners=[];a.worker_namespaces=[];return a}({});b4w.module.app=function(a,m){function h(){var a=I.Vq();document.addEventListener("visibilitychange",function(){document.hidden?(a=I.Vq(),I.pause()):a||I.wf()},!1)}function c(a,d,l,r){var q=document.createElement("canvas"),c=document.getElementById(a);q.style.position="absolute";q.style.left=0;q.style.top=0;q.style.width=c.offsetWidth+"px";q.style.height=c.offsetHeight+"px";q.width=c.offsetWidth*window.devicePixelRatio;q.height=c.offsetHeight*window.devicePixelRatio;d?(d=document.createElement("canvas"), | |
d.style.position="absolute",q.style.left=0,q.style.top=0,d.style.pointerEvents="none"):d=null;c||(M.error('Warning: canvas container "'+a+'" not found, appending to body'),c=document.body);c.appendChild(q);if(!I.wd(q,d))return l&&G("Browser could not initialize WebGL","For more info visit","https://www.blend4web.com/troubleshooting",r),!1;d&&b.Nq(d,"LAST");return!0}function e(a,d){a?(d&&(document.getElementById(d).style.display="block"),w=document.getElementById(a)):(w=document.createElement("div"), | |
w.innerHTML=0,w.style.cssText="position:absolute;top: 23px;right: 20px;font-size: 45px;line-height: 50px;font-weight: bold;color: #000;",b.Nq(w,"JUST_AFTER_CANVAS"))}function u(a,b){var d=String(a);b&&(d+="/"+String(b));w.innerHTML=d}function g(a){a=document.getElementById(a);var b=a.cloneNode(!0);a.parentNode.replaceChild(b,a);return b}function z(){var a=b.Yc();b.resize(a.clientWidth,a.clientHeight,!0)}function t(a,b,d){var r=Math.max(B.QN(a),1),c=l.mf(a,J);b=q.hb(c,b,da);b[1]=0;D.normalize(b,b); | |
D.scale(b,r*d,b);d=l.Oe(a,ba);D.add(d,b,d);B.ac(a,d)}function p(a,b){var d=B.RC(a,W);if(d.up!=d.down){var l=B.Qg(a,Z)[1],d=(d.down-l)/(d.down-d.up),l=B.QC(a,W),d=Math.max(d,2/l.max);B.SC(a,0,d*b)}}function f(a,b,d,q){l.Bd(a,5*b,5*d,5*q)}function v(a,b,d){var q=B.Kx(a),r=Math.abs(b);d=Math.pow(r*d,1-Math.pow(r*d,.15));l.Bd(a,0,0>b?.001<q?-q*d:0:d/(1-d)*q,0)}function k(a,b,d,l){for(var q=d*b;0<a;--a)d+=q,l+=q,q=d*b;return l}function n(a,b,d,l,q){q?(q=B.BR(a,da),a=B.Oe(a),a=D.dist(q,a)+l,l=0<b?k(b,-d, | |
a,l):k(-b,d/(1-d),a,l)):l-=2*b*d;return l}function A(a,b,c,e,w){function x(a,b,T,l){if(1==T){B.bl(a,W);var q=M?.003*W.trans:.003*W.rot;T=d.fd(a,b,0);d.nf(a,b,0)===d.fp?(Sa+="X"==l?-T*q:0,sb+="Y"==l?-T*q:0):d.nf(a,b,0)===d.dp&&(a=M?.003*W.rot:7.5E-4*W.trans,ma+="X"==l?-T*a:0,Nb+="Y"==l?-T*a:0)}}function h(a,b,l,q){if(1==l){l=d.fd(a,b,1);B.bl(a,W);if(M)r=.003*W.trans,c=7.5E-4*W.rot;else var r=.003*W.rot,c=7.5E-4*W.trans;if(1===d.nf(a,b,0))ta+="X"==q?-l*r:0,ia+="Y"==q?-l*r:0;else if(2===d.nf(a,b,0)|| | |
3===d.nf(a,b,0))T+="X"==q?-l*c:0,wa+="Y"==q?-l*c:0}}function g(a){return a[0]&&(a[1]||a[2])}function k(a,b,T){if(1==T)switch(T=d.fd(a,b,0),B.bl(a,W),b){case "FORWARD":A?u[0]=1:M?(b=B.Qg(a,Z)[1],b=Math.abs(b)>=Math.PI/4?q.Bh:q.xc,t(a,b,.5*W.trans*T)):S?v(a,-W.zoom,T):f(a,0,-W.trans*T,0);break;case "BACKWARD":A?u[0]=-1:M?(b=B.Qg(a,Z)[1],b=Math.abs(b)>=Math.PI/4?q.Rd:q.Db,t(a,b,.5*W.trans*T)):S?v(a,W.zoom,T):f(a,0,W.trans*T,0);break;case "UP":M?p(a,30*-W.zoom*T):A||f(a,0,0,-W.trans*T);break;case "DOWN":M? | |
p(a,30*W.zoom*T):A||f(a,0,0,W.trans*T);break;case "LEFT":A?u[1]=1:M?t(a,q.Xs,.5*W.trans*T):f(a,-W.trans*T,0,0);break;case "RIGHT":A?u[1]=-1:M?t(a,q.ye,.5*W.trans*T):f(a,W.trans*T,0,0);break;case "ROT_LEFT":S?B.yo(a,2*-W.rot*T,0):B.ij(a,2*W.rot*T,0);break;case "ROT_RIGHT":S?B.yo(a,2*W.rot*T,0):B.ij(a,2*-W.rot*T,0);break;case "ROT_UP":S?B.yo(a,0,2*-W.rot*T):B.ij(a,0,2*W.rot*T);break;case "ROT_DOWN":S?B.yo(a,0,2*W.rot*T):B.ij(a,0,2*-W.rot*T)}else switch(b){case "FORWARD":case "BACKWARD":A&&(u[0]=0); | |
break;case "LEFT":case "RIGHT":A&&(u[1]=0)}A&&(O.Uw(A,u[0],u[1]),a=B.qq(a,ca),O.Vr(A,a[0],a[1]))}P=a;V=b;R=c;var C=F.Th();L(C);var S=!1,A=null,M=!1;switch(B.Ne(C)){case B.Ra:S=!a;break;case B.Tb:A=F.SB();break;case B.od:return;case B.kc:M=!0}var W=B.bl(C,pa);a=d.$i();if(O.qv(C)){var I=d.ku(C,null,!0);d.X(C,"CAMERA_COLLISION",d.vg,[I],null,function(a,T){var b=d.nf(a,T,0).coll_dist;if(0>b){var q=d.nf(a,T,0).coll_norm,r=da;D.scale(q,-.25*b,r);b=l.Oe(a,ba);D.add(b,r,b);l.xF(a,b)}})}if(A){var I=l.Oe(C), | |
y=l.mf(C),y=q.Rt(y);I[1]-=.5;O.bs(A,I,y);Q.oJ(C,A);var u=new Float32Array(2),z=!0;O.Ur(A,O.ty);d.Ik(C,"TOGGLE_CHAR_MOVE_TYPE",d.ze,d.KH,function(){z=!z;O.Ur(A,z?O.ty:O.kH)})}if(b)b=I=y=J=E=G=d.Wp(0);else{b=d.Wb(d.Ey);var I=d.Wb(d.Cy),y=d.Wb(d.xy),J=d.Wb(d.yy),E=d.Wb(d.QH),G=d.Wb(d.LH)}var m=d.Wb(d.Dy),va=d.Wb(d.zy),K=d.Wb(d.Ay),Ia=d.Wb(d.By);M||(d.X(C,"FORWARD",d.Qa,[a,b],null,k),d.X(C,"BACKWARD",d.Qa,[a,I],null,k));S?(d.X(C,"ROT_UP",d.Qa,[a,m,E],g,k),d.X(C,"ROT_DOWN",d.Qa,[a,va,G],g,k),d.X(C,"ROT_LEFT", | |
d.Qa,[a,K,y],g,k),d.X(C,"ROT_RIGHT",d.Qa,[a,Ia,J],g,k)):M?(d.X(C,"LEFT",d.Qa,[a,K,y],g,k),d.X(C,"RIGHT",d.Qa,[a,Ia,J],g,k),d.X(C,"FORWARD",d.Qa,[a,m,b],g,k),d.X(C,"BACKWARD",d.Qa,[a,va,I],g,k),d.X(C,"UP",d.Qa,[a,G],g,k),d.X(C,"DOWN",d.Qa,[a,E],g,k)):(d.X(C,"UP",d.Qa,[a,E],g,k),d.X(C,"DOWN",d.Qa,[a,G],g,k),d.X(C,"LEFT",d.Qa,[a,y],g,k),d.X(C,"RIGHT",d.Qa,[a,J],g,k),d.X(C,"ROT_UP",d.Qa,[a,m],g,k),d.X(C,"ROT_DOWN",d.Qa,[a,va],g,k),d.X(C,"ROT_LEFT",d.Qa,[a,K],g,k),d.X(C,"ROT_RIGHT",d.Qa,[a,Ia],g,k));if(!c){var Ea= | |
0;c=d.ou(e);var Da=0;b=d.Zp(e);d.X(C,"MOUSE_WHEEL",d.Jf,[c],null,function(a,T,b){1==b&&(T=d.fd(a,T,0),B.bl(a,W),S||M?Ea=n(a,T,W.zoom,Ea,S):(W.trans*=1+T*W.zoom,B.NQ(a,W)))});d.X(C,"TOUCH_ZOOM",d.Jf,[b],null,function(a,T,b){1==b&&(b=d.fd(a,T,0),B.bl(a,W),d.nf(a,T,0)===d.ep&&(Da=n(a,b,.03*W.zoom,Da,S)))});d.X(C,"ZOOM_INTERPOL",d.vg,[a],null,function(a,T){if(S||M)if(1E-5<Math.abs(Ea)||1E-5<Math.abs(Da)){var b=d.fd(a,T,0),l=q.Gc(Ea,0,b,.1*r);Ea-=l;b=q.Gc(Da,0,b,.15*r);Da-=b;M?p(a,-(l+b)):(l=B.Kx(a)+l+ | |
b,l=Math.max(l,.001),B.DR(a,l))}else Da=Ea=0})}var ta=0,ia=0,T=0,wa=0;if(w){w=d.Hg("X",window);c=d.Hg("Y",window);b=d.aj(e);var I=d.aj(window),uc=!1,y=function(a){a[2]?uc=!0:a[0]||(uc=!1);return uc&&a[0]};d.X(C,"MOUSE_X",d.vg,[I,w,b],y,h,"X");d.X(C,"MOUSE_Y",d.vg,[I,c,b],y,h,"Y");w=H.za(H.Ic,window);H.Ix(w,!1)}else w=d.Hg("X",e),c=d.Hg("Y",e),b=d.aj(e),d.X(C,"MOUSE_X",d.Jf,[b,w],null,h,"X"),d.X(C,"MOUSE_Y",d.Jf,[b,c],null,h,"Y");var Sa=0,sb=0,ma=0,Nb=0;w=d.Xm("X",e);e=d.Xm("Y",e);d.X(C,"TOUCH_X", | |
d.Jf,[w],null,x,"X");d.X(C,"TOUCH_Y",d.Jf,[e],null,x,"Y");d.X(C,"ROT_TRANS_INTERPOL",d.vg,[a],null,function(a,b){if(1E-5<Math.abs(ta)||1E-5<Math.abs(ia)||1E-5<Math.abs(Sa)||1E-5<Math.abs(sb)||1E-5<Math.abs(T)||1E-5<Math.abs(wa)||1E-5<Math.abs(ma)||1E-5<Math.abs(Nb)){var l=d.fd(a,b,0),c=q.Gc(ta,0,l,.08*r),e=q.Gc(ia,0,l,.08*r);ta-=c;ia-=e;var w=q.Gc(Sa,0,l,.12*r),f=q.Gc(sb,0,l,.12*r);Sa-=w;sb-=f;var n=q.Gc(T,0,l,.08*r),g=q.Gc(wa,0,l,.08*r);T-=n;wa-=g;var D=q.Gc(ma,0,l,.12*r),l=q.Gc(Nb,0,l,.12*r);ma-= | |
D;Nb-=l;S?(B.yo(a,c+w,e+f),e=B.Kx(a),B.CR(a,e*(n+D),e*(g+l))):M?(c+w&&t(a,q.ye,.2*(c+w)),e+f&&(g=B.Qg(a,Z)[1],t(a,Math.abs(g)>Math.PI/4?q.Rd:q.Db,.2*(e+f))),B.SC(a,n+D,0)):(B.ij(a,.5*(c+w),.5*(e+f)),A&&(n=B.qq(a,ca),O.Vr(A,n[0],n[1])))}});d.Ik(C,"DEC_STEREO_DIST",d.ze,d.OH,function(a){var b=B.rC(a);B.vF(a,.9*b)});d.Ik(C,"INC_STEREO_DIST",d.ze,d.RH,function(a){var b=B.rC(a);B.vF(a,1.1*b)})}function L(a){var b=B.Ne(a),l=d.ju(function(){var d=B.Ne(a),l=d!=b;b=d;return l});d.X(a,"CHANGE_MOVE_STYLE",d.vg, | |
[l],null,function(){K();A(P,V,R)})}function K(){for(var a=F.Th(),b="FORWARD BACKWARD ROT_UP ROT_DOWN ROT_LEFT ROT_RIGHT UP DOWN LEFT RIGHT MOUSE_WHEEL TOUCH_ZOOM ZOOM_INTERPOL MOUSE_X MOUSE_Y TOUCH_X TOUCH_Y ROT_TRANS_INTERPOL CHANGE_MOVE_STYLE".split(" "),l=0;l<b.length;l++)d.mh(a,b[l]);B.Ne(a)==B.Tb&&F.SB()&&Q.remove(a)}function G(a,b,d,l){var q=document.createElement("div"),r=document.createElement("div"),c=document.createElement("div");if(l)for(var e=0;e<l.length;e++){var w=document.getElementById(l[e]); | |
w&&w.parentNode.removeChild(w)}q.style.cssText="z-index:10;width:100%;height:auto;position:absolute;top:50%;margin-top:150px;text-align:center;";r.style.cssText="color:#fff;font-size:24px;";c.style.cssText="color:#fff;font-size:20px;";r.innerHTML=a;c.innerHTML=b+' <a style="color:#fff;font-size:20px;width:100%;" href="'+d+'">'+d.replace("https://www.","")+"</a>";q.appendChild(r);q.appendChild(c);document.body.appendChild(q)}function E(a,b,d,l,q){function r(){var e=performance.now()-c;q(b+e*(d-b)/ | |
l);(e>=l||!a.parentNode)&&I.OP(r)}var c=performance.now();I.yp(r)}m("animation");var B=m("camera"),y=m("config"),Q=m("constraints"),b=m("container"),d=m("controls"),x=m("data"),C=m("debug"),H=m("input"),I=m("main"),O=m("physics"),M=m("print"),F=m("scenes"),l=m("transform"),q=m("util"),D=m("vec3"),r=1,w=null,P=!1,V=!1,R=!1,ca=new Float32Array(2),Z=new Float32Array(2),da=new Float32Array(3),ba=new Float32Array(3);new Float32Array(3);var J=new Float32Array(4),pa={},W={};a.wd=function(a){function l(){var a= | |
c(f,O,W,n),d=b.rq();if(a){var q=b.Yc();z();I.Vw(k);p&&(e(g,C),I.sQ(u));A&&h();D&&I.yp(function(){q.style.height=q.clientWidth/D+"px"});w&&I.yp(function(){var a=q.clientWidth,l=q.clientHeight;a==d.clientWidth&&l==d.clientHeight||b.resize(a,l,!0)});v&&I.yp(function(){b.Uu()});r(d,!0)}else r(d,!1)}function q(a){a.keyCode==d.PH&&(I.Vq()?I.wf():I.pause())}function r(){}a=a||{};var w=!1,f=null,n=null,g=null,D=0,C=null,k=!1,P=!0,A=!0,W=!0,H=!1,p=!1,M=!1,v=!1,V;for(V in a)switch(V){case "canvas_container_id":f= | |
a.canvas_container_id;break;case "callback":r=a.callback;break;case "autoresize":w=a.autoresize;break;case "do_not_use_onload":break;case "gl_debug":k=a.gl_debug;break;case "show_hud_debug_info":M=a.show_hud_debug_info;break;case "sfx_mix_mode":H=a.sfx_mix_mode;break;case "show_fps":p=a.show_fps;break;case "track_container_position":v=a.track_container_position;break;case "fps_wrapper_id":C=a.fps_wrapper_id;break;case "fps_elem_id":g=a.fps_elem_id;break;case "error_purge_elements":n=a.error_purge_elements; | |
break;case "report_init_failure":W=a.report_init_failure;break;case "pause_invisible":A=a.pause_invisible;break;case "key_pause_enabled":P=a.key_pause_enabled;break;case "force_container_ratio":D=a.force_container_ratio;break;default:y.set(V,a[V])}P&&document.addEventListener("keydown",q,!1);y.set("show_hud_debug_info",M);y.set("sfx_mix_mode",H);var O=M||H||null;"complete"==document.readyState?window.setTimeout(l,0):window.addEventListener("load",l,!1);window.addEventListener("unload",function(){x.fa()}, | |
!1)};a.ZP=z;a.l_=function(a,b){var d=g(a);d.addEventListener("mouseup",function(){b(d.value)},!1)};a.k_=function(a,b){var d=g(a);d.addEventListener("change",function(){var a=d.checked;b(void 0!=a?a:d.value)},!1)};a.m_=function(a,b){var d=g(a);d.addEventListener("keypress",function(a){b(a.keyCode,d.value)},!1)};a.bM=A;a.fW=K;a.SZ=function(a){M.Yf("app.set_camera_move_style",["camera.static_setup","camera.eye_setup","camera.target_setup","camera.hover_setup","camera.hover_setup_rel"]);var b=F.Th(); | |
B.bx(b,a)};a.pW=function(a){function b(a){return a[0]&&(a[1]||a[2])}function q(a,b,c){if(1==c)switch(c=d.fd(a,b,0),b){case "FORWARD":r?O.pm(a,1):l.Bd(a,0,0,1*c);break;case "BACKWARD":r?O.pm(a,-1):l.Bd(a,0,0,-1*c);break;case "LEFT":r?O.om(a,-1):l.Bd(a,1*c,0,0);break;case "RIGHT":r?O.om(a,1):l.Bd(a,-1*c,0,0)}else switch(b){case "FORWARD":case "BACKWARD":r&&O.pm(a,0);break;case "LEFT":case "RIGHT":r&&O.om(a,0)}}var r=O.yd(a)||O.zd(a),c=d.$i(),e=d.Wb(d.Ey),w=d.Wb(d.Cy),f=d.Wb(d.xy),n=d.Wb(d.yy),g=d.Wb(d.Dy), | |
D=d.Wb(d.zy),h=d.Wb(d.Ay),x=d.Wb(d.By);d.X(a,"FORWARD",d.Qa,[c,e,g],b,q);d.X(a,"BACKWARD",d.Qa,[c,w,D],b,q);d.X(a,"LEFT",d.Qa,[c,f,h],b,q);d.X(a,"RIGHT",d.Qa,[c,n,x],b,q)};a.iW=function(a){for(var b=["FORWARD","BACKWARD","LEFT","RIGHT"],l=0;l<b.length;l++)d.mh(a,b[l])};a.nW=function(){M.Cc("app.enable_controls() deprecated")};a.gW=function(){M.Cc("app.disable_controls() deprecated")};a.oW=function(){d.Ik(null,"CAMERA_SHOT",d.ze,d.MH,function(){C.QO()});d.Ik(null,"LIGHT_SHOT",d.ze,d.NH,function(){C.TO()}); | |
d.Ik(null,"TELEMETRY",d.ze,d.SH,function(){C.sw()})};a.XP=function(a,b){var d=document.body;function l(){document.fullscreenElement===d||document.webkitFullScreenElement===d||document.mozFullScreenElement===d||document.webkitIsFullScreen||document.msFullscreenElement===d?a():(document.removeEventListener("fullscreenchange",l,!1),document.removeEventListener("webkitfullscreenchange",l,!1),document.removeEventListener("mozfullscreenchange",l,!1),document.removeEventListener("MSFullscreenChange",l,!1), | |
b())}a=a||function(){};b=b||function(){};document.addEventListener("fullscreenchange",l,!1);document.addEventListener("webkitfullscreenchange",l,!1);document.addEventListener("mozfullscreenchange",l,!1);document.addEventListener("MSFullscreenChange",l,!1);d.requestFullScreen=d.requestFullScreen||d.webkitRequestFullScreen||d.mozRequestFullScreen||d.msRequestFullscreen;d.requestFullScreen()};a.jM=function(){var a=document.exitFullscreen||document.webkitExitFullscreen||document.mozCancelFullScreen|| | |
document.msExitFullscreen;if("function"!=typeof a)throw"B4W App: exit fullscreen method is not supported";a.apply(document)};a.xK=function(){return window.document.fullscreenEnabled||window.document.mozFullScreenEnabled||window.document.msFullscreenEnabled||window.document.webkitFullscreenEnabled?!0:!1};a.JZ=G;a.xq=function(a){a=!!a;var b=decodeURIComponent(location.href.toString());if(-1==b.indexOf("?"))return null;for(var b=b.split("?")[1].split("&"),d={},l=0;l<b.length;l++){var q=b[l].split("="), | |
r=q[0];1<q.length?(q=q[1],a?r in d?d[r].push(q):d[r]=[q]:d[r]=q):a?r in d||(d[r]=[]):d[r]=""}return d};a.Ee=function(a,b,d,l,q,r,c,e){function w(q){a&&(f[b]=r+q+c,d>l&&q<=l||d<l&&q>=l)&&(f[b]=r+l+c,e())}if(a&&b&&isFinite(d)&&isFinite(l)&&isFinite(q)){r=r||"";c=c||"";e=e||function(){};var f=a.style,n=b.charAt(0).toUpperCase()+b.slice(1);if(void 0==f[b])if(void 0!=f["webkit"+n])b="webkit"+n;else if(void 0!=f["ms"+n])b="ms"+n;else if(void 0!=f["moz"+n])b="moz"+n;else return;E(a,d,l,q,w)}};a.LJ=function(a, | |
b,d,l,q,r){function c(q){a&&(0<=q&&a.setAttribute(b,q),d>l&&q<=l||d<l&&q>=l)&&(a.setAttribute(b,l),r())}a&&b&&isFinite(d)&&isFinite(l)&&isFinite(q)&&(r=r||function(){},E(a,d,l,q,c))};a.DE=function(b){if(b.length){var d=b.shift(),l=d.elem,q=d.prop,r=d.from,c=d.to,e=d.duration,w=d.opt_prefix,f=d.opt_suffix,n=function(){d.cb&&d.cb();a.DE(b)};"css"==d.type?a.Ee(l,q,r,c,e,w,f,n):"attr"==d.type&&a.LJ(l,q,r,c,e,n)}};a.TZ=function(a){r=a};a.XW=function(){return r}};b4w.module.animation=function(a,m){var h=m("__animation"),c=m("__armature"),e=m("__obj_util"),u=m("__print"),g=m("__tsr");a.lc=h.lc;a.Sy=h.Sy;a.Ty=h.Ty;a.Uy=h.Uy;a.Vy=h.Vy;a.Wy=h.Wy;a.Xy=h.Xy;a.gt=h.gt;a.pk=h.pk;a.Iy=h.Iy;a.Gy=h.Gy;a.Jy=h.Jy;a.My=h.My;a.Ly=h.Ly;a.Ky=h.Ky;a.Hy=h.Hy;a.ky=h.ky;a.ly=h.ly;a.Us=h.Us;var z=g.create();a.Qb=function(a){return h.Qb(a)};a.zB=function(a){return h.cE(a)?h.zB(a):[]};a.bX=function(a,c){if(!h.Qb(a))return null;c=c||h.lc;return h.cN(a,c)};a.apply=function(a,c,e){if(e> | |
h.gt)u.error("Can't apply animation to slot "+e+' for object "'+a.name+'". Object can have maximum of 8 animation slots');else{e=e||h.lc;if(h.Qb(a)){var g=h.jv(a,c);if(-1!=g&&g!=e){u.error('Animation "'+c+'" is already applied to object "'+a.name+'" (slot "'+g+'").');return}}h.PS(a,c)?h.apply(a,c,e):u.error('No fcurves in action "'+c+'"')}};a.remove=function(a){h.remove(a)};a.ME=function(a,c){h.Qb(a)&&(c=c||h.lc,h.ME(a,c))};a.Ap=function(a){h.Ap(a)};a.play=function(a,c,e){h.Qb(a)?(e=e||h.lc,h.play(a, | |
c,e),h.jS(a,0,e,!0)):u.error('Object "'+a.name+'" has no applied animation')};a.stop=function(a,c){h.Qb(a)&&(c=c||h.lc,h.stop(a,c))};a.Wg=function(a,c){if(!h.Qb(a))return!1;c=c||h.lc;return h.Wg(a,c)};a.Ol=function(a,c,e){h.Qb(a)&&(e=e||h.lc,h.Ol(a,c,e))};a.Zw=function(a,c){h.Qb(a)&&h.Zw(a,c)};a.b_=function(a,c){if(h.Qb(a)){c=c||h.lc;var e=h.dv(a,c),g=h.cv(a,c);h.Ol(a,e+g-h.TH,c)}};a.xn=function(a,c){if(!h.Qb(a))return 0;c=c||h.lc;return h.KB(a,c)};a.tF=function(a,c,e){h.Qb(a)&&(e=e||h.lc,h.tF(a, | |
c||1,e))};a.nC=function(a,c){if(!h.Qb(a))return 0;c=c||h.lc;return a.T[c]?h.nC(a,c):0};a.dv=function(a,c){return h.Qb(a)&&(c=c||h.lc,a.T[c])?h.dv(a,c):-1};a.cv=function(a,c){return h.Qb(a)&&(c=c||h.lc,a.T[c])?h.cv(a,c):-1};a.po=function(a,c,e){h.Qb(a)&&(e=e||h.lc,h.po(a,c,e))};a.CB=function(a,c){if(!h.Qb(a))return null;c=c||h.lc;return h.CB(a,c)};a.Bz=function(a,c,e,g){g=g||h.lc;h.Qb(a)&&h.Bz(a,c,e,g)};a.oB=function(a){return h.oB(a)};a.VW=function(a,g,f){u.ab("get_bone_translation","armature.get_bone_tsr"); | |
if(!e.yj(a))return null;if(!c.qK(a,g))return u.error('There is no bone: "',g,'" in "',a.name,'".'),null;f||(f=new Float32Array(3));c.pq(a,g,!1,z);f[0]=z[0];f[1]=z[1];f[2]=z[2];return f};a.iX=function(){u.Cc("get_first_armature_object() deprecated");return null};a.jv=function(a,c){return h.Qb(a)&&c?h.jv(a,c):null};a.AB=function(a,c){return h.Qb(a)?h.AB(a,c):null};a.Cz=function(a,c){return h.Cz(a,c)};a.VX=function(a){return a.g.Eh};a.rF=function(a,c,f){e.yj(a)?(c=Math.min(Math.max(c,0),1),a.g.Eh!=c&& | |
h.rF(a,c,f||0)):u.error("Can't blend animation. Object \""+a.name+'" is not armature')}};b4w.module.__animation=function(a,m){function h(a,b){var d=a.T[b];d&&d.Ru&&d.on&&(d.on=!1,d.Ru(a,b))}function c(a,b,d){d=a.T[d];d.type=30;var l=b.ga,q=b.Da-l+1;d.start=l;d.length=q;d.$d=l;d.Ag=b.name;for(q=l=0;q<a.Qc.length;q++){var r=a.Qc[q];if(r==b)break;else l+=r.Da-r.ga+1}d.KG=l}function e(a,b){a.type=50;a.Ag=b.name;a.start=b.ga;a.length=b.Da-a.start;b.Kc||(a.length+=b.Jv)}function u(a){return a.replace(/_B4W_BAKED$/,"")}function g(a,b){if(a.animation_data){var d=a.animation_data.action;d&&d.k.type== | |
S&&b.push(d)}for(var d=a.nodes,l=0;l<d.length;l++){var q=d[l];q.node_group&&(q=q.node_group.node_tree)&&g(q,b)}}function z(a){return w.Lc(a)&&a.g.Qc?!0:!1}function t(a,b,d){var l=a.T;if(-1==d)for(d=0;8>d;d++){var q=l[d];q&&(q.$d=b,f(a,0,d,!0))}else if(q=l[d])q.$d=b,f(a,0,d,!0)}function p(a,b,d){if(-1==b)for(b=0;8>b;b++){var l=a[b];l&&d(l)}else(l=a[b])&&d(l)}function f(a,b,d,l){G(a,b,d,l);h(a,d);a.g.Ni&&(y(a,b),B(a,b))}function v(a,d,l){var q=d.frame_range;if(q[0]>q[1])return R.warn('Incompatible action "'+ | |
d.name+'" has been applied to object "'+a.name+'"'),!1;var r=d.k,c=a.T[l];c.Ag=d.name;c.nt=q;c.rz=r.nE;c.pz=r.Nz;c.Vi.set(r.Vi);c.start=q[0];c.length=q[1]-q[0];c.$d=q[0];switch(r.type){case za:if(w.yj(a)){c.type=10;var e=k(a,d);if(!e){for(var e=a.g.Ce,q=[],T=[],wa=d.k.gw,f=0;f<wa;f++){for(var g in e){var D=e[g],h=D.Ds,x=d.k.Jt[g];x?pa.copy(x.subarray(8*f,8*f+8),h):pa.identity(h);D.Es=!1}D=Q(e);q.push(D.trans);T.push(D.Oa)}e={trans:q,Oa:T};a.uk.push(d,e)}c.trans=e.trans;c.Oa=e.Oa;c=e;e=a.g;g=e.ls; | |
T=a.T[l];q=T.rx;a:{wa=e.EF;for(f=0;f<wa.length;f+=2)if(d==wa[f]){wa=wa[f+1];break a}wa=null}if(wa)T.rx=wa;else{for(T=0;T<g.length;T++){for(var wa=g[T].Dk,f=[],D=[],h=c.trans,x=c.Oa,C=0;C<h.length;C++){var W=b(h[C],x[C],wa);f.push(W.trans);D.push(W.Oa)}q.push({trans:f,Oa:D})}e.EF.push(d,q)}e.Ni&&(d=e.Hs,l>d[1]?(c=d[1],d[1]=l,d[0]=c):l>d[0]&&l<d[1]&&(d[0]=l),n(a))}break;case la:w.ll(a)&&(c.volume=r.P.volume||null,c.pitch=r.P.pitch||null,c.type=40);break;case ea:w.Sq(a)&&(c.color=r.P.color||null,c.Kg= | |
r.P.energy||null,c.type=70);break;case S:if("MESH"==a.type){c.type=60;g=k(a,d);if(!g){g=[];q=[];T=[];wa=[];f=[];D=d.k;for(e in D.P)for(h=d.name+"%join%"+e,x=0;x<a.D.length;x++)for(C=a.D[x].W,W=0;W<C.length;W++){var H=C[W],M=H.TD,p=H.UD;M&&(M=L(e,h,D,q,g,M),p=L(e,h,D,wa,T,p),(M||p)&&f.push(H))}g={OS:g,values:q,$P:T,aQ:wa,or:f};a.uk.push(d,g)}c.zl=g.OS;c.WD=g.values;c.yl=g.$P;c.VD=g.aQ;c.or=g.or}break;case ga:if(e=r.P.tsr){c.type=20;g=k(a,d);if(!g){g=d.k.gw;q=[];T=[];for(wa=0;wa<g;wa++)q.push(e.subarray(8* | |
wa,8*wa+4)),T.push(e.subarray(8*wa+4,8*wa+8));g={trans:q,Oa:T};a.uk.push(d,g)}c.trans=g.trans;c.Oa=g.Oa;P.iw(a)&&P.uS(a,c.trans[0],c.Oa[0])}else return R.warn('Incompatible action "'+d.name+'" has been applied to object "'+a.name+'"'),!1;break;case Fa:w.Cv(a)&&(c.Kg=r.P["light_settings.environment_energy"]||null,c.YC=Boolean(r.P["light_settings.environment_energy"]),c.Qe=r.P.horizon_color||null,c.eD=Boolean(r.P.horizon_color),c.af=r.P.zenith_color||null,c.kD=Boolean(r.P.zenith_color),c.CM=r.P["mist_settings.intensity"]|| | |
null,c.cD=Boolean(r.P["mist_settings.intensity"]),c.AM=r.P["mist_settings.depth"]||null,c.aD=Boolean(r.P["mist_settings.depth"]),c.DM=r.P["mist_settings.start"]||null,c.dD=Boolean(r.P["mist_settings.start"]),c.BM=r.P["mist_settings.height"]||null,c.bD=Boolean(r.P["mist_settings.height"]),c.zM=r.P.b4w_fog_color||null,c.$C=Boolean(r.P.b4w_fog_color),c.type=80)}w.yj(a)&&r.type!=za&&A(a,l);return!0}function k(a,b){for(var d=a.uk,l=0;l<d.length;l+=2)if(b==d[l])return d[l+1];return null}function n(a){var b= | |
a.g.Hs;if(-1!=b[0]&&-1!=b[1]){var d=a.T;a=d[b[1]].$d;var l=Math.floor(a),q=a-l,b=d[b[0]];a=b.$d;l=Math.floor(a);b.$d=l+q}}function A(a,b){var d=a.g.Hs,l=d[1];d[0]=-1;d[1]=-1;if(-1!=b)for(var q=a.T;0<=l;l--){var r=q[l];if(r&&10==r.type)if(l>d[1])d[1]=l;else{l>d[0]&&(d[1]=l);break}}}function L(a,b,d,l,q,r){for(var c=!1,T=0;T<r.length;T+=2)b==r[T]&&(q.push(r[T+1]),l.push(new Float32Array(d.P[a])),c=!0);return c}function K(a){a=a.k;for(var b in a.P)if(-1!=b.indexOf("nodes"))return!0;return!1}function G(a, | |
b,d,l){if((d=a.T[d])&&null!=d.type&&(d.play||l)){var q=a.g,r=d.$d,c=d.start,T=d.length,r=r+d.speed*b*ba.pc(),e=d.type,w=d.speed;if(0<=w&&r>=c+T||0>w&&r<c)switch(l||(d.on=!0),d.behavior){case 10:r=0<=w?(r-c)%T+c:c+T-1E-6;break;case 20:r=0<=w?c:c+T-1E-6;d.play=!1;break;case 30:r=0<=w?c+T-1E-6:c,d.play=!1}d.$d=r;switch(e){case 10:if(!q.Ni){l=E(d);b=l[0];r=l[1];l=l[2];q.Ed=d.Oa[b];q.ke=d.Oa[r];q.Od=d.trans[b];q.ue=d.trans[r];q.Ke=l;l=q.ls;d=d.rx;for(c=0;c<l.length;c++)T=l[c],e=d[c],T.Ed=e.Oa[b],T.ke= | |
e.Oa[r],T.Od=e.trans[b],T.ue=e.trans[r],T.Ke=q.Ke;J.o(a)}break;case 20:l=E(d);var q=xa,r=l[0],c=l[1],T=l[2],e=d.trans,w=e[r][1],f=e[r][2],g=e[c][1],n=e[c][2];q[0]=(1-T)*e[r][0]+T*e[c][0];q[1]=(1-T)*w+T*g;q[2]=(1-T)*f+T*n;r=Y;f=l[0];c=l[1];T=l[2];e=d.Oa;w=sa;w[0]=e[f][0];w[1]=e[f][1];w[2]=e[f][2];w[3]=e[f][3];f=N;f[0]=e[c][0];f[1]=e[c][1];f[2]=e[c][2];f[3]=e[c][3];ca.slerp(w,f,T,r);c=l[2];T=d.trans;l=(1-c)*T[l[0]][3]+c*T[l[1]][3];a.parent&&a.Br&&(c=pa.create(),pa.yf(q,l,r,c),pa.multiply(a.Br,c,c), | |
q=pa.m(c),r=pa.v(c),l=pa.qc(c));d.Sx&&(c=aa,J.Oe(a,c),W.Tl(q,c,b,d.Sx,q));d.Aw&&(c=sa,J.mf(a,c),W.JF(r,c,b,d.Aw,r));T=d.Vi;T[0]&&J.cs(a,q);T[1]&&J.$r(a,r);T[2]&&J.hx(a,l);J.o(a);V.r(a);break;case 30:l=d.$d-d.start;0>l&&(l=0);l>=d.length&&(l=d.length);a=Math.floor(l);b=a+1;l-=a;10!=d.behavior&&b==d.length&&(b=--a,l=1);d=d.KG;oa[0]=a+d;oa[1]=b+d;oa[2]=l;l=oa;q.$x=l[0];q.JG=l[2];break;case 40:l=E(d);b=l[0];q=l[1];l=l[2];d.volume&&da.lx(a,(1-l)*d.volume[b]+l*d.volume[q]);d.pitch&&da.rw(a,(1-l)*d.pitch[b]+ | |
l*d.pitch[q]);break;case 50:b=10==d.behavior?(r-c)/ba.pc():r/ba.pc();P.MQ(a,d.Ag,b);break;case 60:l=E(d);b=l[0];q=l[1];l=l[2];e=d.WD;w=d.zl;a=d.VD;c=d.yl;d=d.or;for(r=0;r<w.length;r++)for(f=e[r],T=w[r],g=(1-l)*f[b]+l*f[q],f=0;f<d.length;f++)d[f].Kj[T]=g;for(r=0;r<c.length;r++)for(e=a[r],T=c[r],e=na.lerp(e.subarray(3*b,3*b+3),e.subarray(3*q,3*q+3),l,xa),f=0;f<d.length;f++)d[f].he[3*T]=e[0],d[f].he[3*T+1]=e[1],d[f].he[3*T+2]=e[2];break;case 70:l=E(d);b=l[0];q=l[1];l=l[2];T=d.Vi;(c=d.Kg)&&T[0]&&ha.AQ(a.hc, | |
(1-l)*c[b]+l*c[q]);(d=d.color)&&T[1]&&(xa[0]=(1-l)*d[3*b]+l*d[3*q],xa[1]=(1-l)*d[3*b+1]+l*d[3*q+1],xa[2]=(1-l)*d[3*b+2]+l*d[3*q+2],ha.zQ(a.hc,xa));T=a.D;for(r=0;r<T.length;r++)ra.gS(a,T[r].Ia);break;case 80:l=E(d);b=l[0];q=l[1];l=l[2];T=a.D;r=ra.da(T[0].Ia,"MAIN_OPAQUE");c=d.Kg;c=d.YC?(1-l)*c[b]+l*c[q]:r.Kg;e=d.Qe;d.eD?(xa[0]=(1-l)*e[3*b]+l*e[3*q],xa[1]=(1-l)*e[3*b+1]+l*e[3*q+1],xa[2]=(1-l)*e[3*b+2]+l*e[3*q+2],e=xa):e=r.Qe;w=d.af;d.kD?(aa[0]=(1-l)*w[3*b]+l*w[3*q],aa[1]=(1-l)*w[3*b+1]+l*w[3*q+1],aa[2]= | |
(1-l)*w[3*b+2]+l*w[3*q+2],w=aa):w=r.af;f=d.CM;d.cD&&(f=(1-l)*f[b]+l*f[q]);g=d.AM;d.aD&&(g=(1-l)*g[b]+l*g[q]);n=d.DM;d.dD&&(n=(1-l)*n[b]+l*n[q]);var D=d.BM;d.bD&&(D=(1-l)*D[b]+l*D[q]);var h=d.zM;d.$C&&(Y[0]=(1-l)*h[3*b]+l*h[3*q],Y[1]=(1-l)*h[3*b+1]+l*h[3*q+1],Y[2]=(1-l)*h[3*b+2]+l*h[3*q+2],h=Y);for(r=0;r<T.length;r++)b=a.D[r].Ia,(d.YC||d.eD||d.kD)&&ra.Ww(b,c,e,w),d.cD&&ra.qQ(b,f),d.aD&&ra.oQ(b,g),d.dD&&ra.rQ(b,n),d.bD&&ra.pQ(b,D),d.$C&&ra.$w(b,h);break;default:W.ha("Unknown animation type:"+e)}}}function E(a){var b= | |
a.nt[0],d=a.nt[1]-b,b=a.$d-b;0>b&&(b=0);b>=d&&(b=d);b/=a.rz;d=Math.floor(b);a=a.pz[d]?b-d:0;b=Math.ceil(d+a);oa[0]=d;oa[1]=b;oa[2]=a;return oa}function B(a,b){var d=a.g,l=d.Eh,q=d.Hs,r=q[0],q=q[1];if(-1!=q){if(-1!=r){var c=a.T[r];if(c.play||0==b){var T=E(c),e=T[0],w=T[1];d.Ke=T[2];var T=c.Oa[e],f=c.Oa[w],e=c.trans[e],w=c.trans[w]}else l=1}else l=1;q=a.T[q];if(q.play||0==b){var r=E(q),g=r[0],n=r[1];d.Ke=r[2]}else if(-1!=r&&c.play)l=0;else return;r=q.Oa[g];c=q.Oa[n];g=q.trans[g];n=q.trans[n];if(1== | |
l)d.Ed.set(r),d.ke.set(c),d.Od.set(g),d.ue.set(n);else if(0==l)d.Ed.set(T),d.ke.set(f),d.Od.set(e),d.ue.set(w);else{for(q=0;q<T.length;q+=4){for(var D=Y,h=sa,x=0;4>x;x++)D[x]=T[q+x],h[x]=r[q+x];ca.slerp(D,h,l,D);for(x=0;4>x;x++)d.Ed[q+x]=D[x];for(x=0;4>x;x++)D[x]=f[q+x],h[x]=c[q+x];ca.slerp(D,h,l,D);for(x=0;4>x;x++)d.ke[q+x]=D[x]}W.Pz(e,g,l,d.Od);W.Pz(w,n,l,d.ue)}J.o(a);ka.sS(a)}}function y(a,b){var d=a.g,l=d.Eh,q=d.st;if(0!=q){var l=d.rt-l,r=q*b;W.sign(l)==W.sign(q)&&Math.abs(r)<Math.abs(l)?d.Eh+= | |
r:(d.Eh=d.rt,d.st=0)}}function Q(a){var b=[],d=[],l=new Float32Array(4),q=new Float32Array(4),r;for(r in a){var c=a[r],T=l,e=q,w=c.Mp,f=w[w.length-1],g=f.Ux;f.Es||pa.identity(g);for(f=w.length-1;0<=f;f--){var n=w[f],D=n.Ux;if(n.Es)g=D;else{var x=n.wi,h=n.Ds;pa.invert(x,Aa);pa.multiply(h,Aa,Aa);pa.multiply(x,Aa,Aa);pa.multiply(g,Aa,D);g=D;n.Es=!0}}w=n.Ux;T[0]=w[0];T[1]=w[1];T[2]=w[2];T[3]=w[3];e[0]=w[4];e[1]=w[5];e[2]=w[6];e[3]=w[7];ca.normalize(e,e);c=c.Ih;for(T=0;4>T;T++)e=4*c+T,b[e]=l[T],d[e]=q[T]}return{trans:b, | |
Oa:d}}function b(a,b,d){var l=[],q=[];new Float32Array(4);new Float32Array(4);for(var r in d)for(var c=d[r],T=c.Ih,c=c.Au,e=0;4>e;e++){var w=4*c+e,f=4*T+e;l[w]=a[f];q[w]=b[f]}l=new Float32Array(l);q=new Float32Array(q);return{trans:l,Oa:q}}function d(a){var b=a.k,d;if(b.Jt)d=za;else if(b.P)if("volume"in b.P||"pitch"in b.P)d=la;else if(K(a))d=S;else{a:{if(a.k.P){a=a.fcurves;for(d in a)if("color"==d&&!a[d][3]){d=!0;break a}if("energy"==d){d=!0;break a}}d=!1}d=d?ea:"light_settings.environment_energy"in | |
b.P||"horizon_color"in b.P||"zenith_color"in b.P||"mist_settings.intensity"in b.P||"mist_settings.depth"in b.P||"mist_settings.start"in b.P||"mist_settings.height"in b.P||"b4w_fog_color"in b.P?Fa:ga}else d=U;b.type=d}function K(a){if(a=a.k.P)for(var b in a)if(-1!=b.indexOf("nodes"))return!0;return!1}function x(a,b){b[0]=b[1]=b[2]=0;for(var d in a)"location"==d?b[0]=1:"rotation_quaternion"==d?b[1]=1:"scale"==d&&(b[2]=1)}function C(a,b){b[0]=b[1]=0;for(var d in a)"energy"==d?b[0]=1:"color"==d&&(b[1]= | |
1)}function H(a,b,d,l,q,r,c){var T=a+(b-a)/2,e=I(T,l,q,r,c)-d;return.02>Math.abs(e)?T:0<e?H(a,T,d,l,q,r,c):H(T,b,d,l,q,r,c)}function I(a,b,d,l,q){var r=1-a;return b*r*r*r+3*d*r*r*a+3*l*r*a*a+q*a*a*a}function O(a,b){var d={type:null,Ag:null,nt:null,rz:0,pz:null,Vi:new Int8Array(3),Oa:null,trans:null,rx:[],play:!1,behavior:20,$d:0,start:0,length:0,Sx:0,Aw:0,on:!1,KG:null,speed:1,volume:null,pitch:null,color:null,Kg:null,WD:[],zl:[],VD:[],yl:[],or:null};if(!a.T.length)for(var l=0;8>l;l++)a.T.push(null); | |
a.T[b]=d;-1==qa.indexOf(a)&&qa.push(a)}function M(a,b){J.o(a);V.r(a);f(a,0,b,!0)}function F(a,b,d){d=d||0;if(w.Lc(a)){var r=l(a,b);if(r)return O(a,d),c(a,r,d),M(a,d),!0;if((r=q(a,b))&&"EMITTER"==r.lw){O(a,d);b=r.name;for(var r=d,f=a.D,g=0;g<f.length;g++)for(var n=f[g].W,T=0;T<n.length;T++){var wa=n[T].La;wa&&wa.name==b&&e(a.T[r],wa)}M(a,d);return!0}}if(r=W.Fc("name",b,X)||W.Fc("name",b+"_B4W_BAKED",X)){O(a,d);if(v(a,r,d))return M(a,d),!0;a.T[d]=null}R.error('Unsupported object: "'+a.name+'" or animation name: "'+ | |
b+'"');return!1}function l(a,b){for(var d=0;d<a.Qc.length;d++){var l=a.Qc[d];if(l.name===b)return l}return null}function q(a,b){for(var d=a.D,l=0;l<d.length;l++)for(var q=d[l].W,r=0;r<q.length;r++){var c=q[r].La;if(c&&c.name===b)return c}return null}function D(a){a=a.modifiers;for(var b=0;b<a.length;b++){var d=a[b];if("ARMATURE"==d.type)return d.object}return null}var r=m("__config"),w=m("__obj_util"),P=m("__particles"),V=m("__physics"),R=m("__print"),ca=m("__quat"),Z=m("__reformer"),da=m("__sfx"), | |
ba=m("__time"),J=m("__transform"),pa=m("__tsr"),W=m("__util"),na=m("__vec3"),ka=m("__armature"),ha=m("__lights"),ra=m("__scenes"),ja=r.Oi,fa=r.u;a.TH=1E-6;a.Iy=0;a.Gy=10;a.Jy=20;a.My=30;a.Ly=40;a.Ky=50;a.Hy=60;a.IU=70;a.HU=80;a.lc=0;a.Sy=1;a.Ty=2;a.Uy=3;a.Vy=4;a.Wy=5;a.Xy=6;a.gt=7;a.pk=-1;a.ky=10;a.ly=20;a.Us=30;var U=a.eT=0,za=a.gH=1,la=a.fT=2,ga=a.jH=3,S=a.sy=4,ea=a.iH=5,Fa=a.hH=6,oa=Array(3),xa=new Float32Array(3),aa=new Float32Array(3),Y=new Float32Array(4),sa=new Float32Array(4),N=new Float32Array(4), | |
Aa=pa.create();new Float32Array(16);var qa=[],X=[];a.XB=function(){return W.trunc((fa.ID-50)/4)};a.oB=function(a){return a/ba.pc()};a.update=function(a){for(var b=0;b<qa.length;b++){for(var d=qa[b],l=0;8>l;l++)G(d,a,l);d.g.Ni&&(y(d,a),B(d,a))}for(b=0;b<qa.length;b++)for(d=qa[b],l=0;8>l&&d.T.length;l++)h(d,l)};a.bN=function(){return X};a.zB=function(a){var b=[];if(z(a))for(var d=0;d<a.Qc.length;d++)b.push(a.Qc[d].name);for(var l=[],d=0;d<X.length;d++){var q=X[d],r=q.k;r.type==ga?l.push(q):r.type== | |
za&&"ARMATURE"==a.type?l.push(q):r.type==la&&"SPEAKER"==a.type?l.push(q):r.type==Fa&&"WORLD"==a.type&&l.push(q)}if("MESH"==a.type)for(d=0;d<a.df.length;d++)q=a.df[d],q.k.type==S&&l.push(q);for(d=0;d<l.length;d++)b.push(u(l[d].name));if(P.iw(a)&&P.aE(a))for(a=a.D,d=0;d<a.length;d++)for(l=a[d].W,q=0;q<l.length;q++)(r=l[q].La)&&b.push(r.name);return b};a.T_=u;a.AB=function(a,b){var d=a.T[b];return d?d.type:0};a.Ap=function(a){for(var b=0,d=a.D,l=0;l<d.length;l++)for(var q=d[l].W,r=0;r<q.length;r++){var w= | |
q[r].La;w&&"EMITTER"==w.lw&&!q[r].$f&&(O(a,b),e(a.T[b],w),M(a,b),a.T[b].behavior=w.Kc?10:a.Bm,b++)}d=a.df.slice();for(l=0;l<d.length;l++)q=d[l],O(a,b),v(a,q,b)?(M(a,b),a.T[b].behavior=a.Bm,b++):a.T[b]=null;z(a)&&(O(a,b),c(a,a.Qc[0],b),M(a,b),a.T[b].behavior=a.Bm)};a.qt=function(a){switch(a){case "CYCLIC":return 10;case "FINISH_RESET":return 20;case "FINISH_STOP":return 30;default:W.ha("Wrong animation behavior")}};a.gN=function(a){var b=[];a=a.data.materials;for(var d=0;d<a.length;d++){var l=a[d].node_tree; | |
l&&g(l,b)}return b};a.play=function(a,b,d){p(a.T,d,function(a){a.play=!0;a.Ru=b?b:null;a.on=!1});a.g.Ni&&n(a)};a.stop=function(a,b){p(a.T,b,function(a){a.play=!1;a.Ru=null;a.on=!1})};a.Wg=function(a,b){var d=a.T;if(-1==b)for(var l=0;8>l;l++){if(d[l]&&d[l].play)return!0}else if(d=d[b])return d.play;return!1};a.Ol=t;a.Zw=function(a,b){b=b||0;p(a.T,b,function(d){t(a,d.start,b)})};a.KB=function(a,b){var d=a.T[b];return d&&d.$d?d.$d:0};a.Pq=function(a,b){var d=a.T[b];return d&&10==d.behavior};a.po=function(a, | |
b,d){p(a.T,d,function(a){a.behavior=b})};a.CB=function(a,b){var d=a.T[b];return d&&d.behavior};a.Bz=function(a,b,d,l){p(a.T,l,function(a){a.Sx=b||0;a.Aw=d||0})};a.ME=function(a,b){if(-1==b)for(var d=0;8>d;d++)a.T[d]=null;else a.T[b]=null;a.g.Ni&&A(a,b)};a.jS=f;a.cE=function(a){if("ARMATURE"==a.type||a.Bp||"WORLD"==a.type)return!0;for(var b=0;b<a.df.length;b++){var d=a.df[b].k.type;if(d==ga||d==za||d==la&&"SPEAKER"==a.type||d==ea&&"LAMP"==a.type||d==S&&"MESH"==a.type)return!0}return P.iw(a)&&P.aE(a)|| | |
"MESH"==a.type&&a.Qc.length?!0:!1};a.Tz=function(a,b){if("ARMATURE"==b.type||D(a))return!0;for(var d=0;d<b.df.length;d++){var l=b.df[d].k.type;if(l==ga||l==za||l==la&&"SPEAKER"==b.type||l==S&&"MESH"==b.type)return!0}return P.XJ(a)&&P.WJ(a)||"MESH"==b.type&&a.data.b4w_vertex_anim.length||"WORLD"==b.type?!0:!1};a.Qb=function(a){return Boolean(a.T.length)};a.cK=Q;a.pM=b;a.bJ=function(a){function b(a,d){for(var l=0;l<d;l++){var T=a.subarray(8*l+4,8*l+8);ca.normalize(T,T)}}function l(a,b){if(-1<a.indexOf("location"))var d= | |
0,T=b;else-1<a.indexOf("rotation_quaternion")?(d=4,T=0==b?3:b-1):-1<a.indexOf("scale")?(d=3,T=0):(d=0,T=b);return d+T}function q(a,b,d,l,T){if(-1<d.search(r)){a=b;d=d.split('"')[1];var e=c}else 8==T?(d="tsr",e=c):e=1<T?new Float32Array(T):0;if(!a[d]){T=a;b=d;if("object"==typeof e&&e.length)for(var w=e.length,f=new Float32Array(l*w),wa=0;wa<l;wa++)for(var g=0;g<w;g++)f[wa*w+g]=e[g];else if("number"==typeof e)for(f=new Float32Array(l),wa=0;wa<l;wa++)f[wa]=e;else W.ha("Wrong storage default value"); | |
T[b]=f}return a[d]}var r=new RegExp(/pose.bones\[\".+\"\]/g),c=pa.create(),e=a.k={type:U,gw:0,nE:0,P:null,Jt:null,Nz:null,Vi:new Int8Array(3)};e.nE=1/ja.mj;var T=a.fcurves,w={},f={},g=0,n;for(n in T){var D=T[n],h;for(h in D){var k=D[h],P=k.Wd;Z.nK(k,a);k=k.num_channels;g||(g=P.length);for(var k=q(w,f,n,g,k),S=k.length/g,A=l(n,h|0),H=0;H<g;H++)k[H*S+A]=P[H]}}if(W.wn(w)){for(var M in w)"tsr"==M&&b(w[M],g);e.P=w}if(W.wn(f)){for(var p in f)b(f[p],g);e.Jt=f}e.gw=g;e.Nz=a.TI;"tsr"in w&&x(T,e.Vi);("color"in | |
w||"energy"in w)&&C(T,e.Vi);d(a);X.push(a)};a.eN=function(a,b){return(b-a)*ja.mj+1};a.BJ=function(a,b,d,l,q,r){var c=new Float32Array(2),T=new Float32Array(2),e=new Float32Array(2),w=new Float32Array(2),f=b[1],g=b[2],n=b[a.last_frame_offset+1];a=b[a.last_frame_offset+2];for(var D=0,x=0,h=null;q<=r;q++)if(q<f)for(var C=0;C<ja.mj;C++)d[D++]=g;else if(q>n)for(C=0;C<ja.mj;C++)d[D++]=a;else{var k=b[x],P=3;0===k&&(P+=2);0===h&&(P+=2);var S=2===k?0:1;if(b[x+1]==b[x+P+1])h=k,x+=P;else{C=0;q==b[x+1]&&(S&& | |
(l[D]=1),d[D]=b[x+2],D++,C++);if(q==n)for(;C<ja.mj;C++)d[D++]=a;else for(c[0]=b[x+1],c[1]=b[x+2],0!==k?(T[0]=0,T[1]=0):0===h?(T[0]=b[x+5],T[1]=b[x+6]):(T[0]=b[x+3],T[1]=b[x+4]),0!==k?(e[0]=0,e[1]=0):(e[0]=b[x+P+3],e[1]=b[x+P+4]),w[0]=b[x+P+1],w[1]=b[x+P+2];C<ja.mj;C++){var A=q+C/ja.mj;switch(k){case 0:var M=c,p=T,v=e,y=w,V=[],u=[],O=void 0,F=void 0,ea=void 0,O=void 0;V[0]=M[0]-p[0];V[1]=M[1]-p[1];u[0]=y[0]-v[0];u[1]=y[1]-v[1];ea=y[0]-M[0];O=Math.abs(V[0]);F=Math.abs(u[0]);0!=O+F&&O+F>ea&&(O=ea/(O+ | |
F),p[0]=M[0]-O*V[0],p[1]=M[1]-O*V[1],v[0]=y[0]-O*u[0],v[1]=y[1]-O*u[1]);S&&(l[D]=1);d[D]=I(H(0,1,A,c[0],T[0],e[0],w[0]),c[1],T[1],e[1],w[1]);D++;break;case 1:S&&(l[D]=1);M=c[0];p=c[1];v=(w[1]-p)/(w[0]-M);d[D]=v*A+(p-v*M);D++;break;case 2:S&&(l[D]=1);d[D]=b[x+2];D++;break;default:W.ha("Unknown keyframe interpolation mode: "+k)}}q+1==b[x+P+1]&&(h=k,x+=P)}}};a.apply=F;a.wJ=function(a,b,d){d=d||0;var l=W.Fc("uuid",b,X);if(l){O(a,d);if(v(a,l,d)){M(a,d);return}a.T[d]=null}R.error('Unsupported object: "'+ | |
a.name+'" or animation uuid: "'+b+'"')};a.PS=function(a,b){var d=W.Fc("name",b,X)||W.Fc("name",b+"_B4W_BAKED",X);if(d){if(d.k.type==U)return!1}else if(!(q(a,b)||w.Lc(a)&&l(a,b)))return!1;return!0};a.jv=function(a,b){for(var d=a.T,l=0;l<d.length;l++){var q=d[l];if(q&&u(q.Ag)==u(b))return l}return-1};a.cN=function(a,b){var d=a.T[b];return d&&d.Ag?u(d.Ag):null};a.remove=function(a){a.T.length=0;a=qa.indexOf(a);-1!=a&&qa.splice(a,1)};a.NP=function(a){for(var b=X.length-1;0<=b;b--)X[b].UI==a&&X.splice(b, | |
1)};a.Cz=function(a,b){if(!a.T.length)return F(a,b,0)?0:-1;for(var d=0;d<a.T.length;d++)if(!a.T[d])return F(a,b,d)?d:-1};a.rF=function(a,b,d){a.g.st=(b-a.g.Eh)/d;a.g.rt=b};a.tF=function(a,b,d){p(a.T,d,function(a){a.speed=b})};a.nC=function(a,b){return a.T[b].speed};a.dv=function(a,b){return a.T[b].start};a.cv=function(a,b){return a.T[b].length};a.fa=function(){qa.length=0;X.length=0};a.uM=function(a){var b=(a[0]||a[1]||a[2]).Wd.length,d=Y,l=xa,q=Boolean(a[0]);q||(a[0]={Wd:new Float32Array(b),num_channels:8}); | |
var r=Boolean(a[1]);r||(a[1]={Wd:new Float32Array(b),num_channels:8});var c=Boolean(a[2]);c||(a[2]={Wd:new Float32Array(b),num_channels:8});a[3]={Wd:new Float32Array(b),num_channels:8};for(var T=0;T<b;T++)l[0]=q?a[0].Wd[T]:0,l[1]=r?a[1].Wd[T]:0,l[2]=c?a[2].Wd[T]:0,W.Sh(l,d),a[0].Wd[T]=d[3],a[1].Wd[T]=d[0],a[2].Wd[T]=d[1],a[3].Wd[T]=d[2]};a.EB=D};b4w.module.__config=function(a,m){function h(){return b4w.module_check(a.hd.Kp)}function c(){for(var c=a.hd,h=null,u=document.getElementsByTagName("script"),p=0;p<u.length;p++){for(var f=u[p].src,v=0;v<c.nD.length;v++)if(0<=f.indexOf(c.nD[v])){h=f;break}if(null!==h)break}h||(e.warn("Couldn't determine path to ancillary resources, fallback to the current page directory"),h=document.location.href);c=h.indexOf("?");0<=c&&(h=h.substring(0,c));return h.substring(0,h.lastIndexOf("/")+1)}var e=m("__print"), | |
u=m("__util");a.Lf=1;a.Kf=2;a.wg=3;a.ft=4;a.context={alpha:!0,antialias:!1,premultipliedAlpha:!0};a.MK=u.Ma(a.context);a.u={alpha_sort:!0,alpha_sort_threshold:.1,Gj:[5,7],tf:1E4,console_verbose:!1,do_not_load_resources:!1,Ks:!1,nB:1.5,EM:10,background_color:[0,0,0,0],Fj:.01,canvas_resolution_factor:1,im:3,allow_cors:!1,Tu:!1,vp:!0,show_hud_debug_info:!1,dW:!0,Pl:!0,stereo:"NONE",co:!0,le:!0,Md:!0,Mk:!0,cl:!0,Ip:!0,Hj:!0,Gk:!0,antialiasing:!0,smaa:!1,wireframe_debug:!1,$G:!1,pn:!0,Sn:!0,Bc:!0,Er:!0, | |
water_dynamic:!0,mi:!0,hs:!0,Lb:1024,$h:512,GG:!0,precision:"highp",quality:a.Kf,tp:!0,iP:!1,CF:!1,Fu:!1,OG:!1,ag:!1,Gu:!1,wA:!1,uv:!1,$t:!1,G_:!1,oo:!1,allow_hidpi:!1,gyro_use:!1,kB:!1,Wv:!1,enable_selectable:!0,enable_outlining:!0,Tg:!0,ID:128,Hq:!1,OO:!1,Ov:[0,0],jn:!1,yE:!0,pt:!1,url_params:null,nd:!0,gd:4,VE:!1,QE:!1,media_auto_activation:!0,HD:4,fr:!1,uz:!1};a.JL=u.Ma(a.u);a.Oi={nq:-1,pB:!1,mj:1};a.controls={cP:1/120};a.Pf={dir:"ASSETS=../../assets/",YO:15,ww:!0,Uv:!1,yu:!1};a.EJ=u.Ma(a.Pf); | |
a.hd={shaders_dir:"",ZQ:"include/",A_:"postprocessing/",Kp:"built_in_data",nD:"b4w.min.js b4w.full.min.js b4w.simple.min.js b4w.whitespace.min.js src/b4w.js webplayer.min.js".split(" "),RE:"./",smaa_search_texture_path:"",smaa_area_texture_path:""};a.ON={oculus:{distortion_coefs:[.22,.28],chromatic_aberration_coefs:[-.015,.02,.025,.02]},cardboard_1:{Wh:.06,Fh:.035,ph:.042,distortion_coefs:[.441,.156],chromatic_aberration_coefs:[0,0,0,0]},cardboard_2:{Wh:.064,Fh:.035,ph:.039,distortion_coefs:[.34, | |
.55],chromatic_aberration_coefs:[0,0,0,0]},"default":{Wh:.064,Fh:.035,ph:.039,distortion_coefs:[0,0],chromatic_aberration_coefs:[0,0,0,0]}};a.OL={Nexus6:{Ou:/Nexus 6 /,Fi:.132,Ug:.074,Hh:.004},GalaxyNote4:{Ou:/SM-N910C/,Fi:.126,Ug:.071,Hh:.004},YotaPhone2:{Ou:/YD201/,Fi:.11,Ug:.062,Hh:.004},"default":{Fi:.11,Ug:.062,Hh:.004}};a.p={enabled:!0,tf:60,Bo:"",Ot:!1,ping:!1,Go:!0};a.uP=u.Ma(a.p);a.Ml={Aq:1024,$m:384,MA:32,CL:128,BL:256,oE:.25,CP:.5,BP:1};a.gQ=u.Ma(a.Ml);a.M={gy:!0,jr:!1,Jz:!1,kA:!1,ZA:!1}; | |
a.YQ=u.Ma(a.M);a.Zb={outlining_overview_mode:!1,hh:[1,.4,.05],Dl:.2,El:3.8,Fl:1};a.zu={enabled:!1,xR:"COPY",wR:0,bR:"COLOR"};a.FL=u.Ma(a.zu);a.zJ=function(){var c=a.u,e=a.p,h=a.Ml;switch(c.quality){case a.wg:c.Pl=!0;c.mi=!0;c.Md=!0;c.Mk=!0;c.cl=!0;c.Ip=!0;c.co=!0;c.le=!0;c.pn=!0;c.Sn=!0;c.Bc=!0;c.Er=!0;h.Aq=2048;c.im=3;c.vp=!0;c.Ks=!1;c.precision="highp";c.water_dynamic=!0;c.hs=!0;c.antialiasing=!0;c.smaa=!1;c.Gk=!0;c.Hj=!0;c.allow_hidpi=!0;c.enable_outlining=!0;c.Tg=!0;c.gd=16;e.tf=120;break;case a.Kf:c.Pl= | |
!0;c.mi=!0;c.Md=!0;c.Mk=!0;c.cl=!0;c.Ip=!0;c.co=!0;c.le=!0;c.pn=!0;c.Sn=!0;c.Bc=!0;c.Er=!0;h.Aq=1024;c.im=3;c.vp=!0;c.Ks=!1;c.precision="highp";c.water_dynamic=!0;c.hs=!0;c.antialiasing=!0;c.smaa=!1;c.Gk=!0;c.Hj=!0;c.allow_hidpi=!1;c.enable_outlining=!0;c.Tg=!0;c.gd=4;e.tf=60;break;case a.Lf:c.Pl=!1,c.mi=!1,c.Md=!1,c.Mk=!1,c.cl=!1,c.Ip=!1,c.co=!1,c.le=!1,c.pn=!1,c.Sn=!1,c.Bc=!1,c.Er=!1,h.Aq=512,c.im=2,c.vp=!1,c.Ks=!0,c.precision="mediump",c.water_dynamic=!1,c.hs=!1,c.antialiasing=!1,c.smaa=!1,c.Gk= | |
!1,c.Hj=!1,c.allow_hidpi=!1,c.enable_outlining=!1,c.Tg=!1,c.gd=1,e.tf=60}};a.set=function(c,h){switch(c){case "allow_cors":a.u.allow_cors=h;break;case "allow_hidpi":a.u.allow_hidpi=h;break;case "alpha":a.context.alpha=h;break;case "alpha_sort":a.u.alpha_sort=h;break;case "alpha_sort_threshold":a.u.alpha_sort_threshold=h;break;case "anaglyph_use":e.hM();a.u.stereo=h?"ANAGLYPH":a.u.stereo;break;case "animation_framerate":a.Oi.nq=h;break;case "antialiasing":a.u.antialiasing=h;break;case "assets_dds_available":a.Pf.yu= | |
h;break;case "assets_min50_available":a.Pf.Uv=h;break;case "audio":a.M.gy=h;break;case "background_color":a.u.background_color=h;break;case "built_in_module_name":a.hd.Kp=h;break;case "canvas_resolution_factor":a.u.canvas_resolution_factor=h;break;case "console_verbose":a.u.console_verbose=h;break;case "do_not_load_resources":a.u.do_not_load_resources=h;break;case "gyro_use":a.u.gyro_use=h;break;case "stereo":a.u.stereo=h;break;case "media_auto_activation":a.u.media_auto_activation=h;break;case "physics_enabled":a.p.enabled= | |
h;break;case "physics_uranium_path":a.p.Bo=h;break;case "physics_calc_fps":a.p.Ot=h;break;case "physics_use_workers":a.p.Go=h;break;case "precision":a.u.precision=h;break;case "quality":a.u.quality=h;break;case "sfx_mix_mode":a.M.jr=h;break;case "shaders_dir":a.hd.shaders_dir=h;break;case "show_hud_debug_info":a.u.show_hud_debug_info=h;break;case "smaa":a.u.smaa=h;break;case "smaa_search_texture_path":a.hd.smaa_search_texture_path=h;break;case "smaa_area_texture_path":a.hd.smaa_area_texture_path= | |
h;break;case "wireframe_debug":a.u.wireframe_debug=h;break;case "enable_selectable":a.u.enable_selectable=h;break;case "enable_outlining":a.u.enable_outlining=h;break;case "outlining_overview_mode":a.Zb.outlining_overview_mode=h;break;case "glow_materials":a.u.Tg=h;break;case "url_params":a.u.url_params=h;break;default:e.error("Unknown config property: "+c)}};a.get=function(c){switch(c){case "allow_cors":return a.u.allow_cors;case "allow_hidpi":return a.u.allow_hidpi;case "alpha":return a.context.alpha; | |
case "alpha_sort":return a.u.alpha_sort;case "alpha_sort_threshold":return a.u.alpha_sort_threshold;case "anaglyph_use":return"ANAGLYPH"==a.u.stereo;case "animation_framerate":return a.Oi.nq;case "antialiasing":return a.u.antialiasing;case "assets_dds_available":return a.Pf.yu;case "assets_min50_available":return a.Pf.Uv;case "audio":return a.M.gy;case "background_color":return a.u.background_color;case "built_in_module_name":return a.hd.Kp;case "canvas_resolution_factor":return a.u.canvas_resolution_factor; | |
case "console_verbose":return a.u.console_verbose;case "do_not_load_resources":return a.u.do_not_load_resources;case "gyro_use":return a.u.gyro_use;case "is_mobile_device":return a.u.ag;case "stereo":return a.u.stereo;case "media_auto_activation":return a.u.media_auto_activation;case "physics_enabled":return a.p.enabled;case "physics_uranium_path":return a.p.Bo;case "physics_calc_fps":return a.p.Ot;case "physics_use_workers":return a.p.Go;case "precision":return a.u.precision;case "quality":return a.u.quality; | |
case "sfx_mix_mode":return a.M.jr;case "shaders_dir":return a.hd.shaders_dir;case "show_hud_debug_info":return a.u.show_hud_debug_info;case "smaa":return a.u.smaa;case "smaa_search_texture_path":return a.hd.smaa_search_texture_path;case "smaa_area_texture_path":return a.hd.smaa_area_texture_path;case "wireframe_debug":return a.u.wireframe_debug;case "enable_selectable":return a.u.enable_selectable;case "enable_outlining":return a.u.enable_outlining;case "outlining_overview_mode":return a.Zb.outlining_overview_mode; | |
case "glow_materials":return a.u.Tg;case "url_params":return a.u.url_params;default:e.error("Unknown config property: "+c)}};a.reset=function(){a.context=u.Ma(a.MK);a.u=u.Ma(a.JL);a.Pf=u.Ma(a.EJ);a.p=u.Ma(a.uP);a.Ml=u.Ma(a.gQ);a.M=u.Ma(a.YQ);a.zu=u.Ma(a.FL)};a.bO=h;a.GQ=function(){var e=a.hd,u=a.p;h()||""!=e.shaders_dir||(e.shaders_dir=c()+"../shaders/");if(h())e.smaa_search_texture_path="smaa_search_texture.png",e.smaa_area_texture_path="smaa_area_texture.png";else if(""==e.smaa_search_texture_path|| | |
""==e.smaa_area_texture_path){var t=c()+e.RE;e.smaa_search_texture_path=e.smaa_search_texture_path||t+"smaa_search_texture.png";e.smaa_area_texture_path=e.smaa_area_texture_path||t+"smaa_area_texture.png"}u.enabled&&""==u.Bo&&(t=c()+e.RE,u.Bo=t+"uranium.js")};a.qC=function(){return a.Pf.dir.replace("ASSETS=","")}};b4w.module.__print=function(a){function m(a,c){var e=[];-1<a[0].indexOf("%c")?e.push(a[0].replace("%c","%c"+c+": ")):e.push(c+": "+a[0]);for(var h=1;h<a.length;h++)e.push(a[h]);return e}function h(){g++;var a=m(arguments,"B4W ERROR");console.error.apply(console,a)}function c(a){a in t||(t[a]=a,h([a]))}function e(a,e){c(a+"() is deprecated, use "+e+"() instead.")}var u=!1,g=0,z=0,t={};a.OQ=function(a){u=a};a.Pv=function(){console.log.apply(console,arguments)};a.log=function(){if(u){var a=m(arguments, | |
"B4W LOG");console.log.apply(console,a)}};a.error=h;a.Cc=c;a.ab=e;a.Yf=function(a,f){switch(1<f.length){case !0:c(a+"() is deprecated, use "+f.slice(0,-1).join("(), ")+"() or "+f[f.length-1]+"() instead.");break;case !1:e(a,f[0])}};a.hM=function(){c('Config option "anaglyph_use" is deprecated, use "stereo" instead.')};a.warn=function(){z++;var a=m(arguments,"B4W WARN");console.warn.apply(console,a)};a.info=function(){var a=m(arguments,"B4W INFO");console.info.apply(console,a)};a.lM=function(){g++; | |
var a=m(arguments,"B4W EXPORT ERROR");console.error.apply(console,a)};a.mM=function(){z++;var a=m(arguments,"B4W EXPORT WARNING");console.warn.apply(console,a)};a.time=function(){u&&console.time.apply(console,arguments)};a.timeEnd=function(){u&&console.timeEnd.apply(console,arguments)};a.group=function(){u&&console.group.apply(console,arguments)};a.groupCollapsed=function(){u&&console.groupCollapsed.apply(console,arguments)};a.groupEnd=function(){u&&console.groupEnd.apply(console,arguments)};a.clear= | |
function(){"function"==typeof console.clear&&console.clear.apply(console,arguments)};a.DN=function(){return z};a.mN=function(){return g};a.nA=function(){g=z=0}};b4w.module.print=b4w.module.__print;b4w.module.__util=function(a,m){function h(a){return 0<a?1:0>a?-1:0}function c(a){var b=a[0],d=a[1],l=a[2],c=a[3],q=Math.sqrt(b*b+d*d+l*l),q=1/q;a[0]=b*q;a[1]=d*q;a[2]=l*q;a[3]=c*q}function e(a,b){var d=b;switch(typeof a){case "number":return u(a,d);case "string":return g(a,d);case "boolean":return u(a|0,d);case "function":case "undefined":return u(0,d);case "object":if(a){var l=a instanceof Array;if(a.buffer instanceof ArrayBuffer&&"undefined"!==a.byteLength)for(l=0;l<a.length;l++)d=u(a[l],d);else if(l)for(l= | |
0;l<a.length;l++)d=e(a[l],d);else for(var q in a)d=e(a[q],d)}else d=u(0,d)}return d}function u(a,b){var d=b;w[0]=a;d=(d<<5)-d+P[0];d&=d;d=(d<<5)-d+P[1];return d&d}function g(a,b){for(var d=b,l=0;l<a.length;l++)d=(d<<5)-d+a.charCodeAt(l),d&=d;return d}function z(a){return(34*a+1)*a%289}function t(a){return a-Math.floor(a)}function p(a){return f((34*a+5)*a)}function f(a){return a-289*Math.floor(a/289)}function v(a){return a-7*Math.floor(a/7)}function k(a,b,d){a-=b;d-=b;return b+(a-Math.floor(a/d)*d)} | |
function n(a){return k(a,0,2*Math.PI)}function A(a,b){if(a&&b){var d=a instanceof Array,l=a.buffer instanceof ArrayBuffer&&"undefined"!==a.byteLength,q=b.buffer instanceof ArrayBuffer&&"undefined"!==b.byteLength;if(d!=b instanceof Array||l!=q)return!1;if(d){if(a.length!=b.length)return!1;for(d=0;d<a.length;d++)if(!L(a[d],b[d]))return!1}else if(l){if(a.length!=b.length)return!1;for(d=0;d<a.length;d++)if(a[d]!=b[d])return!1}else{for(var c in a)if(!L(a[c],b[c]))return!1;for(c in b)if(!(c in a))return!1}return!0}return!(a|| | |
b)}function L(a,b){if(typeof a!=typeof b)return!1;switch(typeof a){case "number":case "string":case "boolean":return a==b;case "object":return A(a,b);default:return!0}}function K(a){if(""==a)return".";var b=0==a.indexOf("/")|0;b&&0==a.indexOf("//")&&0!=a.indexOf("///")&&(b=2);a=a.split("/");for(var d=[],l=0;l<a.length;l++){var q=a[l];""!=q&&"."!=q&&(".."!=q||!b&&!d.length||d.length&&".."==d[d.length-1]?d.push(q):d.length&&d.pop())}a=d.join("/");for(l=0;l<b;l++)a="/"+a;return a||"."}var G=m("__mat3"), | |
E=m("__mat4"),B=m("__math"),y=m("__print"),Q=m("__tsr"),b=m("__quat"),d=m("__vec3"),x=m("__vec4"),C=0,H={},I=[ka,ha,ra,ja,fa],O=new Float32Array(3),M=new Float32Array(3),F=new Float32Array(4),l=new Float32Array(4),q=new Float32Array(9),D=new Float32Array(16),r=new Float32Array(16),w=new Float64Array(1),P=new Uint32Array(w.buffer),V=new Float32Array([0,0,0]),R=new Float32Array([0,0,0,1]),ca=new Float32Array([0,0,0,1,0,0,0,1]),Z=new Float32Array([1,1,1]),da=new Float32Array([1,0,0]),ba=new Float32Array([0, | |
1,0]),J=new Float32Array([0,0,1]),pa=new Float32Array([-1,0,0]),W=new Float32Array([0,-1,0]),na=new Float32Array([0,0,-1]),ka=0,ha=1,ra=2,ja=4,fa=5,U=Math.floor(44488.07041494893),za=[new Float32Array([0,0,-1,0,0,-1,0,0,-1,0,0,0,0,0,0,1]),new Float32Array([0,0,1,0,0,-1,0,0,1,0,0,0,0,0,0,1]),new Float32Array([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),new Float32Array([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]),new Float32Array([1,0,0,0,0,-1,0,0,0,0,-1,0,0,0,0,1]),new Float32Array([-1,0,0,0,0,-1,0,0,0,0,1,0,0,0,0, | |
1])];a.Zy=V;a.Ry=R;a.LU=ca;a.it=Z;a.ye=da;a.Db=ba;a.Rd=J;a.Xs=pa;a.xc=W;a.Bh=na;a.$y=ka;a.gz=ha;a.iz=ra;a.bz=3;a.dz=ja;a.kz=fa;a.az=6;a.fz=7;a.lt=8;a.cz=9;a.ez=10;a.jz=11;a.tH=za;a.qf=function(a){return"undefined"!=typeof a};a.qD=function(a,b,d){for(var l=[],q=d.length,c=0;c<q;c++){var r=d[c];r[a]==b&&l.push(r)}return l};a.yM=function(a,b){var d=a.length,l=new Float32Array(d+b.length);l.set(a);l.set(b,d);return l};a.NR=function(a,b){var d=a.length,l=new Uint32Array(d+b.length);l.set(a);l.set(b,d); | |
return l};a.wK=function(){var a=new Uint16Array([255]);return 255==(new DataView(a.buffer)).getUint16(0,!0)};a.CJ=function(a,b){var d=[],l={},q=b.length,c,r;for(c=0;c<q;c++)l[b[c]]=!0;q=a.length;for(c=0;c<q;c++)r=a[c],r in l&&d.push(r);return d};a.sign=h;a.YY=function(a,b,d){for(var l=d.length,c=0;c<l;c++)if(d[c][a]==b)return!0;return!1};a.Fc=function(a,b,d){for(var l=0;l<d.length;l++){var c=d[l];if(c[a]===b)return c}return null};a.WY=function(a,b,d,l,c){for(var q=0;q<c.length;q++){var r=c[q];if(r[a]== | |
b&&r[d]==l)return r}return null};a.rN=function(a,b){for(var d=0;d<a.length;d++)if(a[d].uuid==b)return d;return-1};a.vJ=function(a,b){for(var d=0;d<a.length;d++)if(a[d]==b)return;a.push(b)};a.IV=function(a){for(var b=0;b<a.length-1;b++)for(var d=a[b],l=b+1;l<a.length;l++)if(d==a[l])return!1;return!0};a.IR=function(a,b,d,l){l||(l=new Float32Array(16));E.identity(l);l[12]=a;l[13]=b;l[14]=d};var la=1;a.LP=function(){la=(69069*la+5)%Math.pow(2,32);return Math.round(la/65536)%32768/32767};a.oR=function(a){la= | |
a};a.Xe=function(a){var b=a[0]%U*48271-3399*Math.floor(a[0]/U);a[0]=0<b?b:b+2147483647;return(a[0]-1)/2147483646};a.Lq=function(a,b){b||(b=[]);b[0]=5E4+Math.floor(a);return b};a.Sh=function(a,b){b||(b=new Float32Array(4));var d=Math.cos(a[1]/2),l=Math.cos(a[2]/2),c=Math.cos(a[0]/2),q=Math.sin(a[1]/2),r=Math.sin(a[2]/2),e=Math.sin(a[0]/2);b[0]=d*l*e+q*r*c;b[1]=q*l*c+d*r*e;b[2]=d*r*c-q*l*e;b[3]=d*l*c-q*r*e;return b};a.jw=function(a,b,d){var l=a[0],c=a[1];a=a[2];var q=Math.cos(l/2),r=Math.cos(c/2),e= | |
Math.cos(a/2),w=Math.sin(l/2),c=Math.sin(c/2),f=Math.sin(a/2);if(-1<I.indexOf(b))var h=Math.cos((l+a)/2),n=Math.sin((l+a)/2),D=Math.cos((l-a)/2),x=Math.sin((l-a)/2),g=Math.cos((a-l)/2),C=Math.sin((a-l)/2);switch(b){case ka:d[0]=r*n;d[1]=c*D;d[2]=c*x;d[3]=r*h;break;case ha:d[0]=c*x;d[1]=r*n;d[2]=c*D;d[3]=r*h;break;case ra:d[0]=c*D;d[1]=c*x;d[2]=r*n;d[3]=r*h;break;case 3:d[0]=r*n;d[1]=c*C;d[2]=c*g;d[3]=r*h;break;case ja:d[0]=c*g;d[1]=r*n;d[2]=c*C;d[3]=r*h;break;case fa:d[0]=c*C;d[1]=c*g;d[2]=r*n;d[3]= | |
r*h;break;case 6:d[0]=w*r*e+q*c*f;d[1]=q*c*e-w*r*f;d[2]=q*r*f+w*c*e;d[3]=q*r*e-w*c*f;break;case 7:d[0]=q*r*f+w*c*e;d[1]=w*r*e+q*c*f;d[2]=q*c*e-w*r*f;d[3]=q*r*e-w*c*f;break;case 8:d[0]=q*c*e-w*r*f;d[1]=q*r*f+w*c*e;d[2]=w*r*e+q*c*f;d[3]=q*r*e-w*c*f;break;case 9:d[0]=w*r*e-q*c*f;d[1]=q*r*f-w*c*e;d[2]=q*c*e+w*r*f;d[3]=q*r*e+w*c*f;break;case 10:d[0]=q*c*e+w*r*f;d[1]=w*r*e-q*c*f;d[2]=q*r*f-w*c*e;d[3]=q*r*e+w*c*f;break;case 11:d[0]=q*r*f-w*c*e,d[1]=q*c*e+w*r*f,d[2]=w*r*e-q*c*f,d[3]=q*r*e+w*c*f}return d}; | |
a.CE=function(a,b,d){var l=a[0],c=a[1],q=a[2];a=a[3];switch(b){case ka:d[0]=Math.atan2(l*c+q*a,c*a-l*q);d[1]=Math.acos(1-2*(c*c+q*q));d[2]=Math.atan2(l*c-q*a,l*q+c*a);break;case ha:d[0]=Math.atan2(l*a+c*q,q*a-l*c);d[1]=Math.acos(1-2*(l*l+q*q));d[2]=Math.atan2(c*q-l*a,l*c+q*a);break;case ra:d[0]=Math.atan2(l*q+c*a,l*a-c*q);d[1]=Math.acos(1-2*(l*l+c*c));d[2]=Math.atan2(l*q-c*a,l*a+c*q);break;case 3:d[0]=Math.atan2(l*q-c*a,l*c+q*a);d[1]=Math.acos(1-2*(c*c+q*q));d[2]=Math.atan2(l*q+c*a,q*a-l*c);break; | |
case ja:d[0]=Math.atan2(l*c-q*a,l*a+c*q);d[1]=Math.acos(1-2*(l*l+q*q));d[2]=Math.atan2(l*c+q*a,l*a-c*q);break;case fa:d[0]=Math.atan2(c*q-l*a,l*q+c*a);d[1]=Math.acos(1-2*(l*l+c*c));d[2]=Math.atan2(l*a+c*q,c*a-l*q);break;case 6:d[0]=Math.atan2(2*(l*a-c*q),1-2*(l*l+c*c));d[1]=Math.asin(2*(l*q+c*a));d[2]=Math.atan2(2*(q*a-l*c),1-2*(c*c+q*q));break;case 7:d[0]=Math.atan2(2*(c*a-l*q),1-2*(c*c+q*q));d[1]=Math.asin(2*(l*c+q*a));d[2]=Math.atan2(2*(l*a-c*q),1-2*(l*l+q*q));break;case 8:d[0]=Math.atan2(2*(q* | |
a-l*c),1-2*(l*l+q*q));d[1]=Math.asin(2*(l*a+c*q));d[2]=Math.atan2(2*(c*a-l*q),1-2*(l*l+c*c));break;case 9:d[0]=Math.atan2(2*(l*a+c*q),1-2*(l*l+q*q));d[1]=Math.asin(2*(q*a-l*c));d[2]=Math.atan2(2*(l*q+c*a),1-2*(c*c+q*q));break;case 10:d[0]=Math.atan2(2*(l*q+c*a),1-2*(l*l+c*c));d[1]=Math.asin(2*(l*a-c*q));d[2]=Math.atan2(2*(l*c+q*a),1-2*(l*l+q*q));break;case 11:d[0]=Math.atan2(2*(l*c+q*a),1-2*(c*c+q*q)),d[1]=Math.asin(2*(c*a-l*q)),d[2]=Math.atan2(2*(l*a+c*q),1-2*(l*l+c*c))}return d};a.iM=function(a){var d= | |
G.create(),b=Math.cos(a[0]),l=Math.cos(a[1]),c=Math.cos(a[2]),q=Math.sin(a[0]),r=Math.sin(a[1]);a=Math.sin(a[2]);var e=b*c,w=b*a,f=q*c,h=q*a;d[0]=l*c;d[1]=l*a;d[2]=-r;d[3]=r*f-w;d[4]=r*h+e;d[5]=l*q;d[6]=r*e+h;d[7]=r*w-f;d[8]=l*b;return d};a.BE=function(a,d){var b=a[0],l=a[1],c=a[2],q=a[3],r=c*c,e=b*l+c*q;.499999<e?(d[0]=0,d[1]=2*Math.atan2(b,q),d[2]=Math.PI/2):-.499999>e?(d[0]=0,d[1]=-2*Math.atan2(b,q),d[2]=-Math.PI/2):(d[0]=Math.atan2(2*b*q-2*l*c,1-2*b*b-2*r),d[1]=Math.atan2(2*l*q-2*b*c,1-2*l*l- | |
2*r),d[2]=Math.asin(2*b*l+2*c*q));return d};a.hb=function(a,b,l){l||(l=new Float32Array(3));d.transformQuat(b,a,l);return l};a.QL=function(a,b,l){l||(l=new Float32Array(4));a=d.normalize(a,O);var c=d.dot(b,a);a=d.cross(b,a,M);c=Math.acos(c);l[0]=a[0]*Math.sin(c/2);l[1]=a[1]*Math.sin(c/2);l[2]=a[2]*Math.sin(c/2);l[3]=Math.cos(c/2)};a.JR=function(a,b,l,c){c||(c=new Float32Array(4));d.transformQuat(l,b,c);c[3]=-d.dot(a,c)};a.PL=function(a){var b=Q.v(a.g.i);switch(a.type){case "CAMERA":O[0]=0;O[1]=-1; | |
O[2]=0;d.transformQuat(O,b,O);M[0]=0;M[1]=0;M[2]=-1;break;case "MESH":O[0]=0;O[1]=0;O[2]=1;d.transformQuat(O,b,O);M[0]=0;M[1]=0;M[2]=1;break;case "EMPTY":O[0]=0,O[1]=1,O[2]=0,d.transformQuat(O,b,O),M[0]=0,M[1]=1,M[2]=0}O[1]=0;d.normalize(O,O);a=d.dot(O,M);return Math.acos(a)*(0<-O[0]*M[2]?-1:1)};a.Pz=function(a,d,b,l){if(0!=b){l=l||[];for(var c=0;c<a.length;c++)l[c]=(1-b)*a[c]+b*d[c]}};a.j0=function(){C++;return C.toString(16)};a.km=function(a){H[a]||(H[a]=0);var d=a+H[a];H[a]++;return d};a.hf=function(){return{a_position:new Float32Array(0), | |
a_tangent:new Float32Array(0),a_normal:new Float32Array(0)}};a.oc=function(a){var d={a_influence:new Float32Array(0),a_color:new Float32Array(0),a_texcoord:new Float32Array(0)};return{name:a,ma:0,Ta:null,H:[],U:d,Ea:[]}};a.Wi=function(a){return JSON.parse(JSON.stringify(a))};a.Ma=function(d){if(!(d instanceof Object))return d;var b;b=d.constructor;switch(b){case Float32Array:case Uint32Array:case Uint16Array:b=new b(d);break;case Array:b=new b(d.length);for(var l=0;l<d.length;l++)b[l]=a.Ma(d[l]); | |
break;default:for(l in b=new b,d)b[l]=a.Ma(d[l])}return b};a.Om=function(a){var d=a instanceof Array?[]:{},b;for(b in a)if(a[b]instanceof Object){var l=a[b].constructor;switch(l){case Float32Array:case Uint32Array:case Uint16Array:d[b]=new l(a[b]);break;case Array:d[b]=a[b].slice(0);break;default:d[b]=a[b]}}else d[b]=a[b];return d};a.hr=function(a,d){d||(d=new Float32Array(4));G.fromMat4(a,q);var l=q[0],c=q[3],r=q[6],e=q[1],w=q[4],f=q[7],h=q[2],n=q[5],D=q[8],l=Math.sqrt(l*l+c*c+r*r)||1,e=Math.sqrt(e* | |
e+w*w+f*f)||1,h=Math.sqrt(h*h+n*n+D*D)||1;q[0]/=l;q[3]/=l;q[6]/=l;q[1]/=e;q[4]/=e;q[7]/=e;q[2]/=h;q[5]/=h;q[8]/=h;b.fromMat3(q,d);b.normalize(d,d);return d};a.GD=function(a,d){d||(d=new Float32Array(3));d[0]=a[12];d[1]=a[13];d[2]=a[14];return d};a.FD=function(a){F[0]=.577350269189626;F[1]=.577350269189626;F[2]=.577350269189626;F[3]=0;x.transformMat4(F,a,F);return x.length(F)};a.jq=function(a,d){var b=d.left,l=d.right,q=d.top,r=d.bottom,e=d.near,w=d.far;b[0]=a[3]+a[0];b[1]=a[7]+a[4];b[2]=a[11]+a[8]; | |
b[3]=a[15]+a[12];l[0]=a[3]-a[0];l[1]=a[7]-a[4];l[2]=a[11]-a[8];l[3]=a[15]-a[12];q[0]=a[3]-a[1];q[1]=a[7]-a[5];q[2]=a[11]-a[9];q[3]=a[15]-a[13];r[0]=a[3]+a[1];r[1]=a[7]+a[5];r[2]=a[11]+a[9];r[3]=a[15]+a[13];e[0]=a[3]+a[2];e[1]=a[7]+a[6];e[2]=a[11]+a[10];e[3]=a[15]+a[14];w[0]=a[3]-a[2];w[1]=a[7]-a[6];w[2]=a[11]-a[10];w[3]=a[15]-a[14];c(b);c(l);c(q);c(r);c(e);c(w)};a.H_=function(a,d,b){return b<-B.We(a,d.left)||b<-B.We(a,d.right)||b<-B.We(a,d.top)||b<-B.We(a,d.bottom)||b<-B.We(a,d.near)||b<-B.We(a,d.far)? | |
!0:!1};a.aM=function(a,b,l,c,q){r=d.dot(l,b.far);e=d.dot(c,b.far);w=d.dot(q,b.far);r=Math.sqrt(r*r+e*e+w*w);if(r<-B.We(a,b.near)||r<-B.We(a,b.far))return!0;var r=d.dot(l,b.left),e=d.dot(c,b.left),w=d.dot(q,b.left);if(Math.sqrt(r*r+e*e+w*w)<-B.We(a,b.left))return!0;r=d.dot(l,b.right);e=d.dot(c,b.right);w=d.dot(q,b.right);if(Math.sqrt(r*r+e*e+w*w)<-B.We(a,b.right))return!0;r=d.dot(l,b.top);e=d.dot(c,b.top);w=d.dot(q,b.top);if(Math.sqrt(r*r+e*e+w*w)<-B.We(a,b.top))return!0;r=d.dot(l,b.bottom);e=d.dot(c, | |
b.bottom);w=d.dot(q,b.bottom);return Math.sqrt(r*r+e*e+w*w)<-B.We(a,b.bottom)?!0:!1};a.Il=function(a,d,b,l){l||(l=0);for(var c=a.length,q=0;q<c;q+=3){var r=a[q],e=a[q+1],w=a[q+2];b[l+q]=d[0]*r+d[4]*e+d[8]*w+d[12];b[l+q+1]=d[1]*r+d[5]*e+d[9]*w+d[13];b[l+q+2]=d[2]*r+d[6]*e+d[10]*w+d[14]}};a.SS=function(a,d,b){for(var l=0,l=0,c=a.length,q=0;q<c;q+=3){var r=a[q],e=a[q+1],w=a[q+2];b[l+q]=d[0]*r+d[4]*e+d[8]*w;b[l+q+1]=d[1]*r+d[5]*e+d[9]*w;b[l+q+2]=d[2]*r+d[6]*e+d[10]*w}};a.zR=function(a,d,b){for(var l= | |
0,l=0,c=a.length,q=0;q<c;q+=4){var r=a[q],e=a[q+1],w=a[q+2];b[l+q]=d[0]*r+d[4]*e+d[8]*w;b[l+q+1]=d[1]*r+d[5]*e+d[9]*w;b[l+q+2]=d[2]*r+d[6]*e+d[10]*w;b[l+q+3]=a[q+3]}};a.QS=function(a,d,b){b||(b=new Float32Array(3));F[0]=a[0];F[1]=a[1];F[2]=a[2];F[3]=0;x.transformMat4(F,d,F);b[0]=F[0];b[1]=F[1];b[2]=F[2]};a.JW=function(a,d){var b=a.length;if(!b)throw"flatten(): Wrong or empty array";var l=a[0].length;if(!l)throw"flatten(): Wrong or empty subarray";d||(d=new Float32Array(b*l));for(var c=0;c<b;c++)for(var q= | |
0;q<l;q++)d[c*l+q]=a[c][q];return d};a.RS=function(a){for(var d=[],b=0;b<a.length;b+=3){var l=new Float32Array([a[b],a[b+1],a[b+2]]);d[b/3]=l}return d};a.Hp=function(d,b,l,c){if(c<l)return l;var q=l+Math.floor((c-l)/2);return d[q]>b?a.Hp(d,b,l,q-1):d[q]<b?a.Hp(d,b,q+1,c):q};a.Mh=function(a,d){for(var b=0;b<a.length;b++)if(a[b]!=d[b])return!1;return!0};a.QV=function(a,d,b){for(var l=0;l<a.length;l++)if(Math.abs(a[l]-d[l])>b)return!1;return!0};a.PZ=function(a,d,b){b||(b=new Float32Array(16));for(var l= | |
0;12>l;l++)b[l]=a[l]*d;b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b};a.LR=function(a,d,b,l,c){c||(c=new Float32Array(16));d=E.fromRotationTranslation(b,l,D);E.multiply(d,a,c);return c};a.bc=function(a,b,l,c,q){q||(q=new Float32Array(3));l=E.fromRotationTranslation(l,c,D);1!==b&&(c=E.identity(r),b=d.set(b,b,b,O),E.scale(c,b,c),E.multiply(l,c,l));d.transformMat4(a,l,q);return q};a.g0=function(a,b,d,l,c){c||(c=new Float32Array(4));b=E.fromRotationTranslation(d,l,D);x.transformMat4(a,b,c); | |
return c};a.KY=function(a,b,l,c,q){q||(q=new Float32Array(3));b=E.fromRotationTranslation(l,c,D);E.invert(b,b);d.transformMat4(a,b,q);return q};a.f0=function(a,b,d){d||(d=new Float32Array(16));E.fromRotationTranslation(b,a,d);a=a[3];for(b=0;12>b;b++)d[b]*=a;return d};a.gZ=function(b,d,l){a.GD(b,d);d[3]=a.FD(b);a.hr(b,l)};a.fV=function(a){for(var b=[],d=0;d<a.length;d++)b.push(a[d]);return JSON.stringify(b)};a.bQ=function(a,b,l,c){c||(c=new Float32Array(3));d.subtract(b,a,O);d.transformQuat(O,l,O); | |
d.subtract(b,O,c)};a.QM=function(){O[0]=0;O[1]=0;O[2]=0;var a=new Float32Array(16),b=new Float32Array(16),d=new Float32Array(16),l=new Float32Array(16),c=new Float32Array(16),q=new Float32Array(16);E.lookAt(O,[-1,0,0],[0,-1,0],a);E.scale(a,[-1,1,1],a);E.scale(a,[-1,1,-1],b);E.lookAt(O,[0,-1,0],[0,0,-1],d);E.scale(d,[1,1,-1],d);E.scale(d,[1,-1,-1],l);E.lookAt(O,[0,0,-1],[0,-1,0],c);E.scale(c,[-1,1,1],c);E.scale(c,[-1,1,-1],q);return[a,b,d,l,c,q]};a.UM=function(){O[0]=0;O[1]=0;O[2]=0;var a=new Float32Array(16), | |
b=new Float32Array(16),d=new Float32Array(16),l=new Float32Array(16),c=new Float32Array(16),q=new Float32Array(16);E.lookAt(O,[1,0,0],[0,-1,0],a);E.scale(a,[-1,1,-1],b);E.lookAt(O,[0,1,0],[0,0,1],d);E.scale(d,[1,-1,-1],l);E.lookAt(O,[0,0,1],[0,-1,0],c);E.scale(c,[-1,1,-1],q);return[a,b,d,l,c,q]};a.Uz=function(a,b){return e(a,b)};a.NC=e;a.wY=g;a.UO=function(a,b){b[15]=1;b[14]=0;b[13]=0;b[12]=0;b[11]=0;b[10]=a[8];b[9]=a[7];b[8]=a[6];b[7]=0;b[6]=a[5];b[5]=a[4];b[4]=a[3];b[3]=0;b[2]=a[2];b[1]=a[1];b[0]= | |
a[0];return b};a.AE=function(a,b){b||(b=a);var d=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0<d?(b[3]=2*Math.acos(a[3]),d=1/Math.sqrt(d),b[0]=a[0]*d,b[1]=a[1]*d,b[2]=a[2]*d):(b[3]=0,b[0]=1,b[1]=0,b[2]=0);return b};a.trunc=function(a){return isNaN(a)||"undefined"==typeof a?NaN:a|0};a.lb=function(a){return a*Math.PI/180};a.Fd=function(a){return 180*a/Math.PI};a.ux=function(a){var b=.366025403784439*a[0]+.366025403784439*a[1],d=Math.floor(a[0]+b),l=Math.floor(a[1]+b),c=.211324865405187*d+.211324865405187*l,b=a[0]- | |
d+c;a=a[1]-l+c;var q=b>a?1:0,r=1-q,c=b+.211324865405187-q,e=a+.211324865405187-r,w=b+-.577350269189626,f=a+-.577350269189626,d=d%289,l=l%289,h=z(z(l)+d),r=z(z(l+r)+d+q),n=z(z(l+1)+d+1),d=Math.max(.5-(b*b+a*a),0),l=Math.max(.5-(c*c+e*e),0),q=Math.max(.5-(w*w+f*f),0),D=2*t(.024390243902439*h)-1,x=2*t(.024390243902439*r)-1,g=2*t(.024390243902439*n)-1,h=Math.abs(D)-.5,r=Math.abs(x)-.5,n=Math.abs(g)-.5,D=D-Math.floor(D+.5),x=x-Math.floor(x+.5),g=g-Math.floor(g+.5),d=d*d*d*d*(1.79284291400159-.85373472095314* | |
(D*D+h*h)),l=l*l*l*l*(1.79284291400159-.85373472095314*(x*x+r*r)),q=q*q*q*q*(1.79284291400159-.85373472095314*(g*g+n*n));return 130*(d*(D*b+h*a)+l*(x*c+r*e)+q*(g*w+n*f))};a.Zz=function(a){var b=1/7,d=b/2,l=f(Math.floor(a[0])),c=f(Math.floor(a[1])),q=t(a[0]);a=t(a[1]);var r=q-.5,e=q-1.5,q=a-.5;a-=1.5;var w=p(l),h=p(l+1),n=w,l=h,w=p(w+c),h=p(h+c),n=p(n+c+1),l=p(l+c+1),c=r+.7*(v(w)*b+d),D=e+.7*(v(h)*b+d),r=r+.7*(v(n)*b+d),e=e+.7*(v(l)*b+d),w=q+.7*(v(Math.floor(w*b))*b+d),q=q+.7*(v(Math.floor(h*b))*b+ | |
d),n=a+.7*(v(Math.floor(n*b))*b+d),b=a+.7*(v(Math.floor(l*b))*b+d);return Math.min(c*c+w*w,D*D+q*q,r*r+n*n,e*e+b*b)};a.Hr=function(a,l,c,r,e){e||(e=new Float32Array(4));a=d.transformQuat(l,a,O);l=c[0];var w=c[1];c=c[2];q[0]=w*w+c*c;q[1]=-w*l;q[2]=-c*l;q[3]=-l*w;q[4]=l*l+c*c;q[5]=-c*w;q[6]=-l*c;q[7]=-w*c;q[8]=l*l+w*w;d.transformMat3(a,q,a);d.normalize(a,a);b.rotationTo(r,a,e);return e};a.Rt=function(a,d){d||(d=new Float32Array(4));var c=F,q=l,c=b.setAxisAngle([0,1,0],Math.PI,b.create()),q=b.setAxisAngle([1, | |
0,0],Math.PI/2,b.create());b.multiply(c,q,c);b.multiply(a,c,d);return d};a.fa=function(){C=0;H={}};a.J=function(a,b,d){return Math.min(Math.max(a,b),d)};a.Gc=function(a,b,d,l){d=Math.exp(-d/l);return(1-d)*a+d*b};a.Tl=function(a,b,d,l,c){c||(c=new Float32Array(a.length));d=Math.exp(-d/l);for(l=0;l<c.length;l++)c[l]=(1-d)*a[l]+d*b[l];return c};a.JF=function(a,d,l,c,q){q||(q=new Float32Array(a.length));b.slerp(a,d,Math.exp(-l/c),q)};a.LY=function(a){return"object"===typeof a&&a.buffer&&a.buffer instanceof | |
ArrayBuffer?!0:!1};a.pf=function(a,b){if(a instanceof Array||a.buffer&&a.buffer instanceof ArrayBuffer)if(b&&b==a.length||!b)return!0;return!1};a.hu=function(a,c){var r=G.fromQuat(a,q);M[0]=0;M[1]=1;M[2]=0;O[0]=r[3];O[1]=r[4];O[2]=r[5];var e=d.cross(M,O,O);d.normalize(e,e);var w=r[7];!c&&0<w&&(e[0]*=-1,e[1]*=-1,e[2]*=-1);M[0]=r[0];M[1]=r[1];M[2]=r[2];d.normalize(M,M);b.rotationTo(M,e,l);b.multiply(l,a,a)};a.BB=function(a,b,d,l){d=d*b-.5;var c=l*b-.5;l=d-Math.floor(d);var q=c-Math.floor(c);d=Math.floor(d); | |
var c=Math.floor(c),r=b-1,e=a[c*b+d],w=a[c*b+Math.min(d+1,r)],f=a[Math.min(c+1,r)*b+d];a=a[Math.min(c+1,r)*b+Math.min(d+1,r)];return(e*(1-l)+w*l)*(1-q)+(f*(1-l)+a*l)*q};a.Xj=function(a){for(var b=0,d=0;3>d;d++)0<(a&1<<d)&&b++;return b};a.SE=function(a){for(var b=[0,0,0],d=0;3>d;d++)0<(a&1<<d)&&(b[2-d]=1);return b};a.ko=function(a,b){var d=0;(1==b||2==b)&&0<(a&4)&&d++;2==b&&0<(a&2)&&d++;return d};a.Zu=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()| | |
0;return("x"==a?b:b&3|8).toString(16)})};a.wn=function(a){var b=0,d;for(d in a)a.hasOwnProperty(d)&&b++;return b};a.FE=function(a){if(!a.length)return null;var b=Math.floor(Math.random()*a.length);return a[b]};a.dH=function(a,b,l){l||(l=new Float32Array(3));l[0]=a[0]-b[0];l[1]=0;l[2]=a[2]-b[2];d.normalize(l,l)};a.KR=function(a,b,d){var l=a[0],c=a[1];a=a[2];var q=b[0],r=b[1],e=b[2];b=b[3];var w=r*a-e*c,f=e*l-q*a,h=q*c-r*l,n=r*h-e*f,e=e*w-q*h,q=q*f-r*w;d[0]=l+2*w*b+2*n;d[1]=c+2*f*b+2*e;d[2]=a+2*h*b+ | |
2*q};a.assert=function(a){if(!a)throw Error("Assertion failed");};a.ha=function(a){a&&y.error.apply(y,arguments);throw"engine panic:\nThe engine tried to perform an invalid operation and halted.\nPlease copy the console contents above and submit it to the Blend4Web forum at\nhttps://www.blend4web.com/en/forums/forum/17/";};a.ef=k;a.Ae=n;a.hv=function(a){return/(?:\.([^.]+))?$/.exec(a)[1]};a.WF=function(a,b){for(var d in a){var l=!0,c=a[d],q=b[d];switch(typeof c){case "number":case "string":case "boolean":l= | |
c==q;break;case "object":l=A(c,q)}if(!l)return!1}return!0};a.zw=function(a,b){var d=a[0],l=a[2],c=a[3];b[0]=a[1];b[1]=l;b[2]=c;b[3]=d};a.sB=function(a){a+=1;132651<a&&y.error("Color ID pool depleted");var b=Math.floor(a/2601);a%=2601;var d=Math.floor(a/51);return new Float32Array([b/51,d/51,a%51/51])};a.Mv=function(a,b,c,q){F.set(a);F[3]=b;O[0]=c[3];O[1]=c[4];O[2]=c[5];l.set(O);l[3]=0;a=x.dot(F,l);if(0==a)return null;d.copy(c,O);l.set(O);l[3]=1;a=-x.dot(F,l)/a;q[0]=c[0]+a*c[3];q[1]=c[1]+a*c[4];q[2]= | |
c[2]+a*c[5];return q};a.vN=function(a,b,d,l){var c=b[0]-a[0],q=d[0]-a[0],r=b[1]-a[1],e=d[1]-a[1];b=b[2]-a[2];a=d[2]-a[2];l[0]=r*a-b*e;l[1]=q*b-c*a;l[2]=c*e-r*q;return l};a.TV=function(a,b){for(var d=0;d<a.length;d++)b[d]=a[d];return b};a.UE=function(a,l,c){var q=d.dot(a,l);-.9999999>q?(d.cross(da,a,O),1E-6>d.length(O)&&d.cross(ba,a,O),d.normalize(O,O),b.setAxisAngle(O,Math.PI,c)):(d.cross(a,l,O),c.set(O),c[3]=1+q,b.normalize(c,c));return c};a.Ui=function(a,b,d){if(b==d)return d-a;a=n(a);b=n(b);d= | |
n(d);b=2*Math.PI-b;d=n(d+b);a=n(a+b);return a>d?(d-=a,a=2*Math.PI-a,-d>a?a:d):0};a.pi=function(a,b,d){isFinite(b)&&isFinite(d)&&(a=clamp(a,b,d));return a*a*(3-2*a)};a.lerp=function(a,b,d){return b+a*(d-b)};a.DJ=function(a,b){for(var d=0;d<a.length;d++)for(var l=0;l<b.length;l++)if(b[l]==a[d])return!0;return!1};a.$V=function(a){for(var b=Array(a),d=0;d<a;d++)b[d]=0;return b};a.NG=function(a,b){for(var d=Math.max(a.length,b.length),l=0;l<d;l++){var c=h((l>=a.length?0:a[l])-(l>=b.length?0:b[l]));if(c)return c}return 0}; | |
a.Bi=function(a){return a.join(".")};a.UF=function(a){return a.split(".").map(function(a){return a|0})};a.J_=function(a,b){b[0]=Math.pow(a[0],2.2);b[1]=Math.pow(a[1],2.2);b[2]=Math.pow(a[2],2.2);return b};a.ZY=function(a,b){b[0]=Math.pow(a[0],1/2.2);b[1]=Math.pow(a[1],1/2.2);b[2]=Math.pow(a[2],1/2.2);return b};a.Mn=function(a){var b=a.split("://",2);return 1<b.length?(b[1]=K(b[1]),b.join("://")):K(a)};a.Mm=function(a){return 0!=parseInt(a.toString(2).substr(1),2)}};b4w.module.__vec3=function(a){var m="undefined"!==typeof Float32Array?Float32Array:Array,h=Math.random;a.create=function(){var a=new m(3);a[0]=0;a[1]=0;a[2]=0;return a};a.clone=function(a){var e=new m(3);e[0]=a[0];e[1]=a[1];e[2]=a[2];return e};a.fromValues=function(a,e,h){var g=new m(3);g[0]=a;g[1]=e;g[2]=h;return g};a.copy=function(a,e){e[0]=a[0];e[1]=a[1];e[2]=a[2];return e};a.set=function(a,e,h,g){g[0]=a;g[1]=e;g[2]=h;return g};a.add=function(a,e,h){h[0]=a[0]+e[0];h[1]=a[1]+e[1];h[2]=a[2]+e[2]; | |
return h};a.subtract=function(a,e,h){h[0]=a[0]-e[0];h[1]=a[1]-e[1];h[2]=a[2]-e[2];return h};a.sub=a.subtract;a.multiply=function(a,e,h){h[0]=a[0]*e[0];h[1]=a[1]*e[1];h[2]=a[2]*e[2];return h};a.mul=a.multiply;a.divide=function(a,e,h){h[0]=a[0]/e[0];h[1]=a[1]/e[1];h[2]=a[2]/e[2];return h};a.div=a.divide;a.min=function(a,e,h){h[0]=Math.min(a[0],e[0]);h[1]=Math.min(a[1],e[1]);h[2]=Math.min(a[2],e[2]);return h};a.max=function(a,e,h){h[0]=Math.max(a[0],e[0]);h[1]=Math.max(a[1],e[1]);h[2]=Math.max(a[2], | |
e[2]);return h};a.scale=function(a,e,h){h[0]=a[0]*e;h[1]=a[1]*e;h[2]=a[2]*e;return h};a.scaleAndAdd=function(a,e,h,g){g[0]=a[0]+e[0]*h;g[1]=a[1]+e[1]*h;g[2]=a[2]+e[2]*h;return g};a.distance=function(a,e){var h=e[0]-a[0],g=e[1]-a[1],z=e[2]-a[2];return Math.sqrt(h*h+g*g+z*z)};a.dist=a.distance;a.squaredDistance=function(a,e){var h=e[0]-a[0],g=e[1]-a[1],z=e[2]-a[2];return h*h+g*g+z*z};a.sqrDist=a.squaredDistance;a.length=function(a){var e=a[0],h=a[1];a=a[2];return Math.sqrt(e*e+h*h+a*a)};a.len=a.length; | |
a.squaredLength=function(a){var e=a[0],h=a[1];a=a[2];return e*e+h*h+a*a};a.sqrLen=a.squaredLength;a.negate=function(a,e){e[0]=-a[0];e[1]=-a[1];e[2]=-a[2];return e};a.inverse=function(a,e){e[0]=1/a[0];e[1]=1/a[1];e[2]=1/a[2];return e};a.normalize=function(a,e){var h=a[0],g=a[1],z=a[2],h=h*h+g*g+z*z;0<h&&(h=1/Math.sqrt(h),e[0]=a[0]*h,e[1]=a[1]*h,e[2]=a[2]*h);return e};a.dot=function(a,e){return a[0]*e[0]+a[1]*e[1]+a[2]*e[2]};a.cross=function(a,e,h){var g=a[0],z=a[1];a=a[2];var t=e[0],p=e[1];e=e[2]; | |
h[0]=z*e-a*p;h[1]=a*t-g*e;h[2]=g*p-z*t;return h};a.lerp=function(a,e,h,g){var z=a[0],t=a[1];a=a[2];g[0]=z+h*(e[0]-z);g[1]=t+h*(e[1]-t);g[2]=a+h*(e[2]-a);return g};a.random=function(a,e){a=a||1;var u=2*h()*Math.PI,g=2*h()-1,z=Math.sqrt(1-g*g)*a;e[0]=Math.cos(u)*z;e[1]=Math.sin(u)*z;e[2]=g*a;return e};a.transformMat4=function(a,e,h){var g=a[0],z=a[1];a=a[2];var t=e[3]*g+e[7]*z+e[11]*a+e[15],t=t||1;h[0]=(e[0]*g+e[4]*z+e[8]*a+e[12])/t;h[1]=(e[1]*g+e[5]*z+e[9]*a+e[13])/t;h[2]=(e[2]*g+e[6]*z+e[10]*a+e[14])/ | |
t;return h};a.transformMat3=function(a,e,h){var g=a[0],z=a[1];a=a[2];h[0]=g*e[0]+z*e[3]+a*e[6];h[1]=g*e[1]+z*e[4]+a*e[7];h[2]=g*e[2]+z*e[5]+a*e[8];return h};a.transformQuat=function(a,e,h){var g=a[0],z=a[1],t=a[2];a=e[0];var p=e[1],f=e[2];e=e[3];var v=e*g+p*t-f*z,k=e*z+f*g-a*t,n=e*t+a*z-p*g,g=-a*g-p*z-f*t;h[0]=v*e+g*-a+k*-f-n*-p;h[1]=k*e+g*-p+n*-a-v*-f;h[2]=n*e+g*-f+v*-p-k*-a;return h};a.rotateX=function(a,e,h,g){var z=[],t=[];z[0]=a[0]-e[0];z[1]=a[1]-e[1];z[2]=a[2]-e[2];t[0]=z[0];t[1]=z[1]*Math.cos(h)- | |
z[2]*Math.sin(h);t[2]=z[1]*Math.sin(h)+z[2]*Math.cos(h);g[0]=t[0]+e[0];g[1]=t[1]+e[1];g[2]=t[2]+e[2];return g};a.rotateY=function(a,e,h,g){var z=[],t=[];z[0]=a[0]-e[0];z[1]=a[1]-e[1];z[2]=a[2]-e[2];t[0]=z[2]*Math.sin(h)+z[0]*Math.cos(h);t[1]=z[1];t[2]=z[2]*Math.cos(h)-z[0]*Math.sin(h);g[0]=t[0]+e[0];g[1]=t[1]+e[1];g[2]=t[2]+e[2];return g};a.rotateZ=function(a,e,h,g){var z=[],t=[];z[0]=a[0]-e[0];z[1]=a[1]-e[1];z[2]=a[2]-e[2];t[0]=z[0]*Math.cos(h)-z[1]*Math.sin(h);t[1]=z[0]*Math.sin(h)+z[1]*Math.cos(h); | |
t[2]=z[2];g[0]=t[0]+e[0];g[1]=t[1]+e[1];g[2]=t[2]+e[2];return g};a.forEach=function(){var c=a.create();return function(a,h,g,z,t,p){h||(h=3);g||(g=0);for(z=z?Math.min(z*h+g,a.length):a.length;g<z;g+=h)c[0]=a[g],c[1]=a[g+1],c[2]=a[g+2],t(c,p,c),a[g]=c[0],a[g+1]=c[1],a[g+2]=c[2];return a}}();a.QU=function(c,e){var h=a.fromValues(c[0],c[1],c[2]),g=a.fromValues(e[0],e[1],e[2]);a.normalize(h,h);a.normalize(g,g);h=a.dot(h,g);return 1<h?0:Math.acos(h)};a.str=function(a){return"vec3("+a[0]+", "+a[1]+", "+ | |
a[2]+")"};"undefined"!==typeof a&&(a.vec3=a)};b4w.module.vec3=b4w.module.__vec3; | |
b4w.module.__vec4=function(a){var m="undefined"!==typeof Float32Array?Float32Array:Array,h=Math.random;a.create=function(){var a=new m(4);a[0]=0;a[1]=0;a[2]=0;a[3]=0;return a};a.clone=function(a){var e=new m(4);e[0]=a[0];e[1]=a[1];e[2]=a[2];e[3]=a[3];return e};a.fromValues=function(a,e,h,g){var z=new m(4);z[0]=a;z[1]=e;z[2]=h;z[3]=g;return z};a.copy=function(a,e){e[0]=a[0];e[1]=a[1];e[2]=a[2];e[3]=a[3];return e};a.set=function(a,e,h,g,z){z[0]=a;z[1]=e;z[2]=h;z[3]=g;return z};a.add=function(a,e,h){h[0]= | |
a[0]+e[0];h[1]=a[1]+e[1];h[2]=a[2]+e[2];h[3]=a[3]+e[3];return h};a.subtract=function(a,e,h){h[0]=a[0]-e[0];h[1]=a[1]-e[1];h[2]=a[2]-e[2];h[3]=a[3]-e[3];return h};a.sub=a.subtract;a.multiply=function(a,e,h){h[0]=a[0]*e[0];h[1]=a[1]*e[1];h[2]=a[2]*e[2];h[3]=a[3]*e[3];return h};a.mul=a.multiply;a.divide=function(a,e,h){h[0]=a[0]/e[0];h[1]=a[1]/e[1];h[2]=a[2]/e[2];h[3]=a[3]/e[3];return h};a.div=a.divide;a.min=function(a,e,h){h[0]=Math.min(a[0],e[0]);h[1]=Math.min(a[1],e[1]);h[2]=Math.min(a[2],e[2]);h[3]= | |
Math.min(a[3],e[3]);return h};a.max=function(a,e,h){h[0]=Math.max(a[0],e[0]);h[1]=Math.max(a[1],e[1]);h[2]=Math.max(a[2],e[2]);h[3]=Math.max(a[3],e[3]);return h};a.scale=function(a,e,h){h[0]=a[0]*e;h[1]=a[1]*e;h[2]=a[2]*e;h[3]=a[3]*e;return h};a.scaleAndAdd=function(a,e,h,g){g[0]=a[0]+e[0]*h;g[1]=a[1]+e[1]*h;g[2]=a[2]+e[2]*h;g[3]=a[3]+e[3]*h;return g};a.distance=function(a,e){var h=e[0]-a[0],g=e[1]-a[1],z=e[2]-a[2],t=e[3]-a[3];return Math.sqrt(h*h+g*g+z*z+t*t)};a.dist=a.distance;a.squaredDistance= | |
function(a,e){var h=e[0]-a[0],g=e[1]-a[1],z=e[2]-a[2],t=e[3]-a[3];return h*h+g*g+z*z+t*t};a.sqrDist=a.squaredDistance;a.length=function(a){var e=a[0],h=a[1],g=a[2];a=a[3];return Math.sqrt(e*e+h*h+g*g+a*a)};a.len=a.length;a.squaredLength=function(a){var e=a[0],h=a[1],g=a[2];a=a[3];return e*e+h*h+g*g+a*a};a.sqrLen=a.squaredLength;a.negate=function(a,e){e[0]=-a[0];e[1]=-a[1];e[2]=-a[2];e[3]=-a[3];return e};a.inverse=function(a,e){e[0]=1/a[0];e[1]=1/a[1];e[2]=1/a[2];e[3]=1/a[3];return e};a.normalize= | |
function(a,e){var h=a[0],g=a[1],z=a[2],t=a[3],h=h*h+g*g+z*z+t*t;0<h&&(h=1/Math.sqrt(h),e[0]=a[0]*h,e[1]=a[1]*h,e[2]=a[2]*h,e[3]=a[3]*h);return e};a.dot=function(a,e){return a[0]*e[0]+a[1]*e[1]+a[2]*e[2]+a[3]*e[3]};a.lerp=function(a,e,h,g){var z=a[0],t=a[1],p=a[2];a=a[3];g[0]=z+h*(e[0]-z);g[1]=t+h*(e[1]-t);g[2]=p+h*(e[2]-p);g[3]=a+h*(e[3]-a);return g};a.random=function(c,e){c=c||1;e[0]=h();e[1]=h();e[2]=h();e[3]=h();a.normalize(e,e);a.scale(e,c,e);return e};a.transformMat4=function(a,e,h){var g=a[0], | |
z=a[1],t=a[2];a=a[3];h[0]=e[0]*g+e[4]*z+e[8]*t+e[12]*a;h[1]=e[1]*g+e[5]*z+e[9]*t+e[13]*a;h[2]=e[2]*g+e[6]*z+e[10]*t+e[14]*a;h[3]=e[3]*g+e[7]*z+e[11]*t+e[15]*a;return h};a.transformQuat=function(a,e,h){var g=a[0],z=a[1],t=a[2],p=e[0],f=e[1],v=e[2];e=e[3];var k=e*g+f*t-v*z,n=e*z+v*g-p*t,A=e*t+p*z-f*g,g=-p*g-f*z-v*t;h[0]=k*e+g*-p+n*-v-A*-f;h[1]=n*e+g*-f+A*-p-k*-v;h[2]=A*e+g*-v+k*-f-n*-p;h[3]=a[3];return h};a.forEach=function(){var c=a.create();return function(a,h,g,z,t,p){h||(h=4);g||(g=0);for(z=z?Math.min(z* | |
h+g,a.length):a.length;g<z;g+=h)c[0]=a[g],c[1]=a[g+1],c[2]=a[g+2],c[3]=a[g+3],t(c,p,c),a[g]=c[0],a[g+1]=c[1],a[g+2]=c[2],a[g+3]=c[3];return a}}();a.str=function(a){return"vec4("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+")"};"undefined"!==typeof a&&(a.vec4=a)};b4w.module.vec4=b4w.module.__vec4; | |
b4w.module.__quat=function(a,m){var h=m("__vec3"),c=m("__vec4"),e=m("__mat3"),u="undefined"!==typeof Float32Array?Float32Array:Array;a.create=function(){var a=new u(4);a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};a.rotationTo=function(){var c=h.create(),e=h.fromValues(1,0,0),t=h.fromValues(0,1,0);return function(p,f,v){var k=h.dot(p,f);if(-.9999999>k)return h.cross(e,p,c),1E-6>h.length(c)&&h.cross(t,p,c),h.normalize(c,c),a.setAxisAngle(c,Math.PI,v),v;if(.9999999<k)return v[0]=0,v[1]=0,v[2]=0,v[3]=1,v;h.cross(p, | |
f,c);v[0]=c[0];v[1]=c[1];v[2]=c[2];v[3]=1+k;return a.normalize(v,v)}}();a.setAxes=function(){var c=e.create();return function(e,h,p,f){c[0]=h[0];c[3]=h[1];c[6]=h[2];c[1]=p[0];c[4]=p[1];c[7]=p[2];c[2]=-e[0];c[5]=-e[1];c[8]=-e[2];return a.normalize(a.fromMat3(c,f),f)}}();a.clone=c.clone;a.fromValues=c.fromValues;a.copy=c.copy;a.set=c.set;a.identity=function(a){a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};a.setAxisAngle=function(a,c,e){c*=.5;var h=Math.sin(c);e[0]=h*a[0];e[1]=h*a[1];e[2]=h*a[2];e[3]=Math.cos(c); | |
return e};a.add=c.add;a.multiply=function(a,c,e){var h=a[0],f=a[1],v=a[2];a=a[3];var k=c[0],n=c[1],A=c[2];c=c[3];e[0]=h*c+a*k+f*A-v*n;e[1]=f*c+a*n+v*k-h*A;e[2]=v*c+a*A+h*n-f*k;e[3]=a*c-h*k-f*n-v*A;return e};a.mul=a.multiply;a.scale=c.scale;a.rotateX=function(a,c,e){c*=.5;var h=a[0],f=a[1],v=a[2];a=a[3];var k=Math.sin(c);c=Math.cos(c);e[0]=h*c+a*k;e[1]=f*c+v*k;e[2]=v*c-f*k;e[3]=a*c-h*k;return e};a.rotateY=function(a,c,e){c*=.5;var h=a[0],f=a[1],v=a[2];a=a[3];var k=Math.sin(c);c=Math.cos(c);e[0]=h* | |
c-v*k;e[1]=f*c+a*k;e[2]=v*c+h*k;e[3]=a*c-f*k;return e};a.rotateZ=function(a,c,e){c*=.5;var h=a[0],f=a[1],v=a[2];a=a[3];var k=Math.sin(c);c=Math.cos(c);e[0]=h*c+f*k;e[1]=f*c-h*k;e[2]=v*c+a*k;e[3]=a*c-v*k;return e};a.calculateW=function(a,c){var e=a[0],h=a[1],f=a[2];c[0]=e;c[1]=h;c[2]=f;c[3]=Math.sqrt(Math.abs(1-e*e-h*h-f*f));return c};a.dot=c.dot;a.lerp=c.lerp;a.slerp=function(a,c,e,h){var f=a[0],v=a[1],k=a[2];a=a[3];var n=c[0],A=c[1],L=c[2];c=c[3];var u,G,E;G=f*n+v*A+k*L+a*c;0>G&&(G=-G,n=-n,A=-A, | |
L=-L,c=-c);1E-6<1-G?(u=Math.acos(G),E=Math.sin(u),G=Math.sin((1-e)*u)/E,e=Math.sin(e*u)/E):G=1-e;h[0]=G*f+e*n;h[1]=G*v+e*A;h[2]=G*k+e*L;h[3]=G*a+e*c;return h};a.invert=function(a,c){var e=a[0],h=a[1],f=a[2],v=a[3],k=e*e+h*h+f*f+v*v,k=k?1/k:0;c[0]=-e*k;c[1]=-h*k;c[2]=-f*k;c[3]=v*k;return c};a.conjugate=function(a,c){c[0]=-a[0];c[1]=-a[1];c[2]=-a[2];c[3]=a[3];return c};a.length=c.length;a.len=a.length;a.squaredLength=c.squaredLength;a.sqrLen=a.squaredLength;a.normalize=c.normalize;a.fromMat3=function(a, | |
c){var e=a[0]+a[4]+a[8];if(0<e)e=Math.sqrt(e+1),c[3]=.5*e,e=.5/e,c[0]=(a[5]-a[7])*e,c[1]=(a[6]-a[2])*e,c[2]=(a[1]-a[3])*e;else{var h=0;a[4]>a[0]&&(h=1);a[8]>a[3*h+h]&&(h=2);var f=(h+1)%3,v=(h+2)%3,e=Math.sqrt(a[3*h+h]-a[3*f+f]-a[3*v+v]+1);c[h]=.5*e;e=.5/e;c[3]=(a[3*f+v]-a[3*v+f])*e;c[f]=(a[3*f+h]+a[3*h+f])*e;c[v]=(a[3*v+h]+a[3*h+v])*e}return c};a.str=function(a){return"quat("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+")"};"undefined"!==typeof a&&(a.quat=a)};b4w.module.quat=b4w.module.__quat; | |
b4w.module.__mat3=function(a){var m="undefined"!==typeof Float32Array?Float32Array:Array;a.create=function(){var a=new m(9);a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a};a.fromMat4=function(a,c){c[0]=a[0];c[1]=a[1];c[2]=a[2];c[3]=a[4];c[4]=a[5];c[5]=a[6];c[6]=a[8];c[7]=a[9];c[8]=a[10];return c};a.clone=function(a){var c=new m(9);c[0]=a[0];c[1]=a[1];c[2]=a[2];c[3]=a[3];c[4]=a[4];c[5]=a[5];c[6]=a[6];c[7]=a[7];c[8]=a[8];return c};a.copy=function(a,c){c[0]=a[0];c[1]=a[1];c[2]= | |
a[2];c[3]=a[3];c[4]=a[4];c[5]=a[5];c[6]=a[6];c[7]=a[7];c[8]=a[8];return c};a.identity=function(a){a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a};a.transpose=function(a,c){if(c===a){var e=a[1],u=a[2],g=a[5];c[1]=a[3];c[2]=a[6];c[3]=e;c[5]=a[7];c[6]=u;c[7]=g}else c[0]=a[0],c[1]=a[3],c[2]=a[6],c[3]=a[1],c[4]=a[4],c[5]=a[7],c[6]=a[2],c[7]=a[5],c[8]=a[8];return c};a.invert=function(a,c){var e=a[0],u=a[1],g=a[2],z=a[3],t=a[4],p=a[5],f=a[6],v=a[7],k=a[8],n=k*t-p*v,A=-k*z+p*f,L= | |
v*z-t*f,m=e*n+u*A+g*L;if(!m)return null;m=1/m;c[0]=n*m;c[1]=(-k*u+g*v)*m;c[2]=(p*u-g*t)*m;c[3]=A*m;c[4]=(k*e-g*f)*m;c[5]=(-p*e+g*z)*m;c[6]=L*m;c[7]=(-v*e+u*f)*m;c[8]=(t*e-u*z)*m;return c};a.adjoint=function(a,c){var e=a[0],u=a[1],g=a[2],m=a[3],t=a[4],p=a[5],f=a[6],v=a[7],k=a[8];c[0]=t*k-p*v;c[1]=g*v-u*k;c[2]=u*p-g*t;c[3]=p*f-m*k;c[4]=e*k-g*f;c[5]=g*m-e*p;c[6]=m*v-t*f;c[7]=u*f-e*v;c[8]=e*t-u*m;return c};a.determinant=function(a){var c=a[3],e=a[4],u=a[5],g=a[6],m=a[7],t=a[8];return a[0]*(t*e-u*m)+a[1]* | |
(-t*c+u*g)+a[2]*(m*c-e*g)};a.multiply=function(a,c,e){var u=a[0],g=a[1],m=a[2],t=a[3],p=a[4],f=a[5],v=a[6],k=a[7];a=a[8];var n=c[0],A=c[1],L=c[2],K=c[3],G=c[4],E=c[5],B=c[6],y=c[7];c=c[8];e[0]=n*u+A*t+L*v;e[1]=n*g+A*p+L*k;e[2]=n*m+A*f+L*a;e[3]=K*u+G*t+E*v;e[4]=K*g+G*p+E*k;e[5]=K*m+G*f+E*a;e[6]=B*u+y*t+c*v;e[7]=B*g+y*p+c*k;e[8]=B*m+y*f+c*a;return e};a.mul=a.multiply;a.translate=function(a,c,e){var u=a[0],g=a[1],m=a[2],t=a[3],p=a[4],f=a[5],v=a[6],k=a[7];a=a[8];var n=c[0];c=c[1];e[0]=u;e[1]=g;e[2]=m; | |
e[3]=t;e[4]=p;e[5]=f;e[6]=n*u+c*t+v;e[7]=n*g+c*p+k;e[8]=n*m+c*f+a;return e};a.rotate=function(a,c,e){var u=a[0],g=a[1],m=a[2],t=a[3],p=a[4],f=a[5],v=a[6],k=a[7];a=a[8];var n=Math.sin(c);c=Math.cos(c);e[0]=c*u+n*t;e[1]=c*g+n*p;e[2]=c*m+n*f;e[3]=c*t-n*u;e[4]=c*p-n*g;e[5]=c*f-n*m;e[6]=v;e[7]=k;e[8]=a;return e};a.scale=function(a,c,e){var u=c[0];c=c[1];e[0]=u*a[0];e[1]=u*a[1];e[2]=u*a[2];e[3]=c*a[3];e[4]=c*a[4];e[5]=c*a[5];e[6]=a[6];e[7]=a[7];e[8]=a[8];return e};a.LM=function(a,c){c[0]=1;c[1]=0;c[2]= | |
0;c[3]=0;c[4]=1;c[5]=0;c[6]=a[0];c[7]=a[1];c[8]=1;return c};a.JM=function(a,c){var e=Math.sin(a),u=Math.cos(a);c[0]=u;c[1]=e;c[2]=0;c[3]=-e;c[4]=u;c[5]=0;c[6]=0;c[7]=0;c[8]=1;return c};a.KM=function(a,c){c[0]=a[0];c[1]=0;c[2]=0;c[3]=0;c[4]=a[1];c[5]=0;c[6]=0;c[7]=0;c[8]=1;return c};a.fromMat2d=function(a,c){c[0]=a[0];c[1]=a[1];c[2]=0;c[3]=a[2];c[4]=a[3];c[5]=0;c[6]=a[4];c[7]=a[5];c[8]=1;return c};a.fromQuat=function(a,c){var e=a[0],u=a[1],g=a[2],m=a[3],t=e+e,p=u+u,f=g+g,e=e*t,v=u*t,u=u*p,k=g*t,n= | |
g*p,g=g*f,t=m*t,p=m*p,m=m*f;c[0]=1-u-g;c[3]=v-m;c[6]=k+p;c[1]=v+m;c[4]=1-e-g;c[7]=n-t;c[2]=k-p;c[5]=n+t;c[8]=1-e-u;return c};a.normalFromMat4=function(a,c){var e=a[0],u=a[1],g=a[2],m=a[3],t=a[4],p=a[5],f=a[6],v=a[7],k=a[8],n=a[9],A=a[10],L=a[11],K=a[12],G=a[13],E=a[14],B=a[15],y=e*p-u*t,Q=e*f-g*t,b=e*v-m*t,d=u*f-g*p,x=u*v-m*p,C=g*v-m*f,H=k*G-n*K,I=k*E-A*K,k=k*B-L*K,O=n*E-A*G,n=n*B-L*G,A=A*B-L*E,L=y*A-Q*n+b*O+d*k-x*I+C*H;if(!L)return null;L=1/L;c[0]=(p*A-f*n+v*O)*L;c[1]=(f*k-t*A-v*I)*L;c[2]=(t*n-p* | |
k+v*H)*L;c[3]=(g*n-u*A-m*O)*L;c[4]=(e*A-g*k+m*I)*L;c[5]=(u*k-e*n-m*H)*L;c[6]=(G*C-E*x+B*d)*L;c[7]=(E*b-K*C-B*Q)*L;c[8]=(K*x-G*b+B*y)*L;return c};a.str=function(a){return"mat3("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+")"};a.IM=function(a){return Math.sqrt(Math.pow(a[0],2)+Math.pow(a[1],2)+Math.pow(a[2],2)+Math.pow(a[3],2)+Math.pow(a[4],2)+Math.pow(a[5],2)+Math.pow(a[6],2)+Math.pow(a[7],2)+Math.pow(a[8],2))};"undefined"!==typeof a&&(a.mat3=a)}; | |
b4w.module.mat3=b4w.module.__mat3; | |
b4w.module.__mat4=function(a){var m="undefined"!==typeof Float32Array?Float32Array:Array;a.create=function(){var a=new m(16);a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a};a.clone=function(a){var c=new m(16);c[0]=a[0];c[1]=a[1];c[2]=a[2];c[3]=a[3];c[4]=a[4];c[5]=a[5];c[6]=a[6];c[7]=a[7];c[8]=a[8];c[9]=a[9];c[10]=a[10];c[11]=a[11];c[12]=a[12];c[13]=a[13];c[14]=a[14];c[15]=a[15];return c};a.copy=function(a,c){c[0]=a[0]; | |
c[1]=a[1];c[2]=a[2];c[3]=a[3];c[4]=a[4];c[5]=a[5];c[6]=a[6];c[7]=a[7];c[8]=a[8];c[9]=a[9];c[10]=a[10];c[11]=a[11];c[12]=a[12];c[13]=a[13];c[14]=a[14];c[15]=a[15];return c};a.identity=function(a){a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a};a.transpose=function(a,c){if(c===a){var e=a[1],u=a[2],g=a[3],m=a[6],t=a[7],p=a[11];c[1]=a[4];c[2]=a[8];c[3]=a[12];c[4]=e;c[6]=a[9];c[7]=a[13];c[8]=u;c[9]=m;c[11]=a[14];c[12]=g;c[13]= | |
t;c[14]=p}else c[0]=a[0],c[1]=a[4],c[2]=a[8],c[3]=a[12],c[4]=a[1],c[5]=a[5],c[6]=a[9],c[7]=a[13],c[8]=a[2],c[9]=a[6],c[10]=a[10],c[11]=a[14],c[12]=a[3],c[13]=a[7],c[14]=a[11],c[15]=a[15];return c};a.invert=function(a,c){var e=a[0],u=a[1],g=a[2],m=a[3],t=a[4],p=a[5],f=a[6],v=a[7],k=a[8],n=a[9],A=a[10],L=a[11],K=a[12],G=a[13],E=a[14],B=a[15],y=e*p-u*t,Q=e*f-g*t,b=e*v-m*t,d=u*f-g*p,x=u*v-m*p,C=g*v-m*f,H=k*G-n*K,I=k*E-A*K,O=k*B-L*K,M=n*E-A*G,F=n*B-L*G,l=A*B-L*E,q=y*l-Q*F+b*M+d*O-x*I+C*H;if(!q)return null; | |
q=1/q;c[0]=(p*l-f*F+v*M)*q;c[1]=(g*F-u*l-m*M)*q;c[2]=(G*C-E*x+B*d)*q;c[3]=(A*x-n*C-L*d)*q;c[4]=(f*O-t*l-v*I)*q;c[5]=(e*l-g*O+m*I)*q;c[6]=(E*b-K*C-B*Q)*q;c[7]=(k*C-A*b+L*Q)*q;c[8]=(t*F-p*O+v*H)*q;c[9]=(u*O-e*F-m*H)*q;c[10]=(K*x-G*b+B*y)*q;c[11]=(n*b-k*x-L*y)*q;c[12]=(p*I-t*M-f*H)*q;c[13]=(e*M-u*I+g*H)*q;c[14]=(G*Q-K*d-E*y)*q;c[15]=(k*d-n*Q+A*y)*q;return c};a.adjoint=function(a,c){var e=a[0],u=a[1],g=a[2],m=a[3],t=a[4],p=a[5],f=a[6],v=a[7],k=a[8],n=a[9],A=a[10],L=a[11],K=a[12],G=a[13],E=a[14],B=a[15]; | |
c[0]=p*(A*B-L*E)-n*(f*B-v*E)+G*(f*L-v*A);c[1]=-(u*(A*B-L*E)-n*(g*B-m*E)+G*(g*L-m*A));c[2]=u*(f*B-v*E)-p*(g*B-m*E)+G*(g*v-m*f);c[3]=-(u*(f*L-v*A)-p*(g*L-m*A)+n*(g*v-m*f));c[4]=-(t*(A*B-L*E)-k*(f*B-v*E)+K*(f*L-v*A));c[5]=e*(A*B-L*E)-k*(g*B-m*E)+K*(g*L-m*A);c[6]=-(e*(f*B-v*E)-t*(g*B-m*E)+K*(g*v-m*f));c[7]=e*(f*L-v*A)-t*(g*L-m*A)+k*(g*v-m*f);c[8]=t*(n*B-L*G)-k*(p*B-v*G)+K*(p*L-v*n);c[9]=-(e*(n*B-L*G)-k*(u*B-m*G)+K*(u*L-m*n));c[10]=e*(p*B-v*G)-t*(u*B-m*G)+K*(u*v-m*p);c[11]=-(e*(p*L-v*n)-t*(u*L-m*n)+k* | |
(u*v-m*p));c[12]=-(t*(n*E-A*G)-k*(p*E-f*G)+K*(p*A-f*n));c[13]=e*(n*E-A*G)-k*(u*E-g*G)+K*(u*A-g*n);c[14]=-(e*(p*E-f*G)-t*(u*E-g*G)+K*(u*f-g*p));c[15]=e*(p*A-f*n)-t*(u*A-g*n)+k*(u*f-g*p);return c};a.determinant=function(a){var c=a[0],e=a[1],m=a[2],g=a[3],z=a[4],t=a[5],p=a[6],f=a[7],v=a[8],k=a[9],n=a[10],A=a[11],L=a[12],K=a[13],G=a[14];a=a[15];return(c*t-e*z)*(n*a-A*G)-(c*p-m*z)*(k*a-A*K)+(c*f-g*z)*(k*G-n*K)+(e*p-m*t)*(v*a-A*L)-(e*f-g*t)*(v*G-n*L)+(m*f-g*p)*(v*K-k*L)};a.multiply=function(a,c,e){var m= | |
a[0],g=a[1],z=a[2],t=a[3],p=a[4],f=a[5],v=a[6],k=a[7],n=a[8],A=a[9],L=a[10],K=a[11],G=a[12],E=a[13],B=a[14];a=a[15];var y=c[0],Q=c[1],b=c[2],d=c[3];e[0]=y*m+Q*p+b*n+d*G;e[1]=y*g+Q*f+b*A+d*E;e[2]=y*z+Q*v+b*L+d*B;e[3]=y*t+Q*k+b*K+d*a;y=c[4];Q=c[5];b=c[6];d=c[7];e[4]=y*m+Q*p+b*n+d*G;e[5]=y*g+Q*f+b*A+d*E;e[6]=y*z+Q*v+b*L+d*B;e[7]=y*t+Q*k+b*K+d*a;y=c[8];Q=c[9];b=c[10];d=c[11];e[8]=y*m+Q*p+b*n+d*G;e[9]=y*g+Q*f+b*A+d*E;e[10]=y*z+Q*v+b*L+d*B;e[11]=y*t+Q*k+b*K+d*a;y=c[12];Q=c[13];b=c[14];d=c[15];e[12]=y*m+ | |
Q*p+b*n+d*G;e[13]=y*g+Q*f+b*A+d*E;e[14]=y*z+Q*v+b*L+d*B;e[15]=y*t+Q*k+b*K+d*a;return e};a.mul=a.multiply;a.translate=function(a,c,e){var m=c[0],g=c[1];c=c[2];var z,t,p,f,v,k,n,A,L,K,G,E;a===e?(e[12]=a[0]*m+a[4]*g+a[8]*c+a[12],e[13]=a[1]*m+a[5]*g+a[9]*c+a[13],e[14]=a[2]*m+a[6]*g+a[10]*c+a[14],e[15]=a[3]*m+a[7]*g+a[11]*c+a[15]):(z=a[0],t=a[1],p=a[2],f=a[3],v=a[4],k=a[5],n=a[6],A=a[7],L=a[8],K=a[9],G=a[10],E=a[11],e[0]=z,e[1]=t,e[2]=p,e[3]=f,e[4]=v,e[5]=k,e[6]=n,e[7]=A,e[8]=L,e[9]=K,e[10]=G,e[11]=E, | |
e[12]=z*m+v*g+L*c+a[12],e[13]=t*m+k*g+K*c+a[13],e[14]=p*m+n*g+G*c+a[14],e[15]=f*m+A*g+E*c+a[15]);return e};a.scale=function(a,c,e){var m=c[0],g=c[1];c=c[2];e[0]=a[0]*m;e[1]=a[1]*m;e[2]=a[2]*m;e[3]=a[3]*m;e[4]=a[4]*g;e[5]=a[5]*g;e[6]=a[6]*g;e[7]=a[7]*g;e[8]=a[8]*c;e[9]=a[9]*c;e[10]=a[10]*c;e[11]=a[11]*c;e[12]=a[12];e[13]=a[13];e[14]=a[14];e[15]=a[15];return e};a.rotate=function(a,c,e,m){var g=e[0],z=e[1];e=e[2];var t=Math.sqrt(g*g+z*z+e*e),p,f,v,k,n,A,L,K,G,E,B,y,Q,b,d,x,C,H,I,O;if(1E-7>Math.abs(t))return null; | |
t=1/t;g*=t;z*=t;e*=t;p=Math.sin(c);f=Math.cos(c);v=1-f;c=a[0];t=a[1];k=a[2];n=a[3];A=a[4];L=a[5];K=a[6];G=a[7];E=a[8];B=a[9];y=a[10];Q=a[11];b=g*g*v+f;d=z*g*v+e*p;x=e*g*v-z*p;C=g*z*v-e*p;H=z*z*v+f;I=e*z*v+g*p;O=g*e*v+z*p;g=z*e*v-g*p;z=e*e*v+f;m[0]=c*b+A*d+E*x;m[1]=t*b+L*d+B*x;m[2]=k*b+K*d+y*x;m[3]=n*b+G*d+Q*x;m[4]=c*C+A*H+E*I;m[5]=t*C+L*H+B*I;m[6]=k*C+K*H+y*I;m[7]=n*C+G*H+Q*I;m[8]=c*O+A*g+E*z;m[9]=t*O+L*g+B*z;m[10]=k*O+K*g+y*z;m[11]=n*O+G*g+Q*z;a!==m&&(m[12]=a[12],m[13]=a[13],m[14]=a[14],m[15]=a[15]); | |
return m};a.rotateX=function(a,c,e){var m=Math.sin(c);c=Math.cos(c);var g=a[4],z=a[5],t=a[6],p=a[7],f=a[8],v=a[9],k=a[10],n=a[11];a!==e&&(e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]);e[4]=g*c+f*m;e[5]=z*c+v*m;e[6]=t*c+k*m;e[7]=p*c+n*m;e[8]=f*c-g*m;e[9]=v*c-z*m;e[10]=k*c-t*m;e[11]=n*c-p*m;return e};a.rotateY=function(a,c,e){var m=Math.sin(c);c=Math.cos(c);var g=a[0],z=a[1],t=a[2],p=a[3],f=a[8],v=a[9],k=a[10],n=a[11];a!==e&&(e[4]=a[4],e[5]=a[5],e[6]=a[6], | |
e[7]=a[7],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]);e[0]=g*c-f*m;e[1]=z*c-v*m;e[2]=t*c-k*m;e[3]=p*c-n*m;e[8]=g*m+f*c;e[9]=z*m+v*c;e[10]=t*m+k*c;e[11]=p*m+n*c;return e};a.rotateZ=function(a,c,e){var m=Math.sin(c);c=Math.cos(c);var g=a[0],z=a[1],t=a[2],p=a[3],f=a[4],v=a[5],k=a[6],n=a[7];a!==e&&(e[8]=a[8],e[9]=a[9],e[10]=a[10],e[11]=a[11],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]);e[0]=g*c+f*m;e[1]=z*c+v*m;e[2]=t*c+k*m;e[3]=p*c+n*m;e[4]=f*c-g*m;e[5]=v*c-z*m;e[6]=k*c-t*m;e[7]=n*c-p*m;return e}; | |
a.LM=function(a,c){c[0]=1;c[1]=0;c[2]=0;c[3]=0;c[4]=0;c[5]=1;c[6]=0;c[7]=0;c[8]=0;c[9]=0;c[10]=1;c[11]=0;c[12]=a[0];c[13]=a[1];c[14]=a[2];c[15]=1;return c};a.KM=function(a,c){c[0]=a[0];c[1]=0;c[2]=0;c[3]=0;c[4]=0;c[5]=a[1];c[6]=0;c[7]=0;c[8]=0;c[9]=0;c[10]=a[2];c[11]=0;c[12]=0;c[13]=0;c[14]=0;c[15]=1;return c};a.JM=function(a,c,e){var m=c[0],g=c[1];c=c[2];var z=Math.sqrt(m*m+g*g+c*c),t;if(1E-7>Math.abs(z))return null;z=1/z;m*=z;g*=z;c*=z;z=Math.sin(a);a=Math.cos(a);t=1-a;e[0]=m*m*t+a;e[1]=g*m*t+c* | |
z;e[2]=c*m*t-g*z;e[3]=0;e[4]=m*g*t-c*z;e[5]=g*g*t+a;e[6]=c*g*t+m*z;e[7]=0;e[8]=m*c*t+g*z;e[9]=g*c*t-m*z;e[10]=c*c*t+a;e[11]=0;e[12]=0;e[13]=0;e[14]=0;e[15]=1;return e};a.LW=function(a,c){var e=Math.sin(a),m=Math.cos(a);c[0]=1;c[1]=0;c[2]=0;c[3]=0;c[4]=0;c[5]=m;c[6]=e;c[7]=0;c[8]=0;c[9]=-e;c[10]=m;c[11]=0;c[12]=0;c[13]=0;c[14]=0;c[15]=1;return c};a.MW=function(a,c){var e=Math.sin(a),m=Math.cos(a);c[0]=m;c[1]=0;c[2]=-e;c[3]=0;c[4]=0;c[5]=1;c[6]=0;c[7]=0;c[8]=e;c[9]=0;c[10]=m;c[11]=0;c[12]=0;c[13]=0; | |
c[14]=0;c[15]=1;return c};a.NW=function(a,c){var e=Math.sin(a),m=Math.cos(a);c[0]=m;c[1]=e;c[2]=0;c[3]=0;c[4]=-e;c[5]=m;c[6]=0;c[7]=0;c[8]=0;c[9]=0;c[10]=1;c[11]=0;c[12]=0;c[13]=0;c[14]=0;c[15]=1;return c};a.fromRotationTranslation=function(a,c,e){var m=a[0],g=a[1],z=a[2],t=a[3],p=m+m,f=g+g,v=z+z;a=m*p;var k=m*f,m=m*v,n=g*f,g=g*v,z=z*v,p=t*p,f=t*f,t=t*v;e[0]=1-(n+z);e[1]=k+t;e[2]=m-f;e[3]=0;e[4]=k-t;e[5]=1-(a+z);e[6]=g+p;e[7]=0;e[8]=m+f;e[9]=g-p;e[10]=1-(a+n);e[11]=0;e[12]=c[0];e[13]=c[1];e[14]=c[2]; | |
e[15]=1;return e};a.fromQuat=function(a,c){var e=a[0],m=a[1],g=a[2],z=a[3],t=e+e,p=m+m,f=g+g,e=e*t,v=m*t,m=m*p,k=g*t,n=g*p,g=g*f,t=z*t,p=z*p,z=z*f;c[0]=1-m-g;c[1]=v+z;c[2]=k-p;c[3]=0;c[4]=v-z;c[5]=1-e-g;c[6]=n+t;c[7]=0;c[8]=k+p;c[9]=n-t;c[10]=1-e-m;c[11]=0;c[12]=0;c[13]=0;c[14]=0;c[15]=1;return c};a.frustum=function(a,c,e,m,g,z,t){var p=1/(c-a),f=1/(m-e),v=1/(g-z);t[0]=2*g*p;t[1]=0;t[2]=0;t[3]=0;t[4]=0;t[5]=2*g*f;t[6]=0;t[7]=0;t[8]=(c+a)*p;t[9]=(m+e)*f;t[10]=(z+g)*v;t[11]=-1;t[12]=0;t[13]=0;t[14]= | |
z*g*2*v;t[15]=0;return t};a.perspective=function(a,c,e,m,g){a=1/Math.tan(a/2);var z=1/(e-m);g[0]=a/c;g[1]=0;g[2]=0;g[3]=0;g[4]=0;g[5]=a;g[6]=0;g[7]=0;g[8]=0;g[9]=0;g[10]=(m+e)*z;g[11]=-1;g[12]=0;g[13]=0;g[14]=2*m*e*z;g[15]=0;return g};a.xZ=function(a,c,e,m){var g=Math.tan(a.upDegrees*Math.PI/180),z=Math.tan(a.downDegrees*Math.PI/180),t=Math.tan(a.leftDegrees*Math.PI/180);a=Math.tan(a.rightDegrees*Math.PI/180);var p=2/(t+a),f=2/(g+z);m[0]=p;m[1]=0;m[2]=0;m[3]=0;m[4]=0;m[5]=f;m[6]=0;m[7]=0;m[8]=-((t- | |
a)*p*.5);m[9]=(g-z)*f*.5;m[10]=e/(c-e);m[11]=-1;m[12]=0;m[13]=0;m[14]=e*c/(c-e);m[15]=0;return m};a.ortho=function(a,c,e,m,g,z,t){var p=1/(a-c),f=1/(e-m),v=1/(g-z);t[0]=-2*p;t[1]=0;t[2]=0;t[3]=0;t[4]=0;t[5]=-2*f;t[6]=0;t[7]=0;t[8]=0;t[9]=0;t[10]=2*v;t[11]=0;t[12]=(a+c)*p;t[13]=(m+e)*f;t[14]=(z+g)*v;t[15]=1;return t};a.lookAt=function(h,c,e,m){var g,z,t,p,f,v,k,n,A=h[0],L=h[1];h=h[2];t=e[0];p=e[1];z=e[2];k=c[0];e=c[1];g=c[2];if(1E-7>Math.abs(A-k)&&1E-7>Math.abs(L-e)&&1E-7>Math.abs(h-g))return a.identity(m); | |
c=A-k;e=L-e;k=h-g;n=1/Math.sqrt(c*c+e*e+k*k);c*=n;e*=n;k*=n;g=p*k-z*e;z=z*c-t*k;t=t*e-p*c;(n=Math.sqrt(g*g+z*z+t*t))?(n=1/n,g*=n,z*=n,t*=n):t=z=g=0;p=e*t-k*z;f=k*g-c*t;v=c*z-e*g;(n=Math.sqrt(p*p+f*f+v*v))?(n=1/n,p*=n,f*=n,v*=n):v=f=p=0;m[0]=g;m[1]=p;m[2]=c;m[3]=0;m[4]=z;m[5]=f;m[6]=e;m[7]=0;m[8]=t;m[9]=v;m[10]=k;m[11]=0;m[12]=-(g*A+z*L+t*h);m[13]=-(p*A+f*L+v*h);m[14]=-(c*A+e*L+k*h);m[15]=1;return m};a.str=function(a){return"mat4("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+ | |
a[7]+", "+a[8]+", "+a[9]+", "+a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+")"};a.IM=function(a){return Math.sqrt(Math.pow(a[0],2)+Math.pow(a[1],2)+Math.pow(a[2],2)+Math.pow(a[3],2)+Math.pow(a[4],2)+Math.pow(a[5],2)+Math.pow(a[6],2)+Math.pow(a[7],2)+Math.pow(a[8],2)+Math.pow(a[9],2)+Math.pow(a[10],2)+Math.pow(a[11],2)+Math.pow(a[12],2)+Math.pow(a[13],2)+Math.pow(a[14],2)+Math.pow(a[15],2))};"undefined"!==typeof a&&(a.mat4=a)};b4w.module.mat4=b4w.module.__mat4;b4w.module.__math=function(a,m){function h(a,c){for(var e=a[1],f=1,g=2;g<a.length;g++)4!=g&&8!=g&&Math.abs(a[g])>Math.abs(e)&&(e=a[g],f=g);for(var h=Math.floor(f/3),f=f%3,e=.5*Math.atan(2*e/(a[3*h+h]-a[3*f+f])),g=0;g<c.length;g++)c[g]=0==g||4==g||8==g?1:0;c[f+3*h]=-Math.sin(e);c[h+3*f]=Math.sin(e);c[h+3*h]=Math.cos(e);c[f+3*f]=Math.cos(e);return c}function c(a){return Math.sqrt(a[1]*a[1]+a[2]*a[2]+a[5]*a[5])}var e=m("__vec3");m("__util");var u=m("__mat3"),g=new Float32Array(3),z=new Float32Array(9), | |
t=new Float32Array(9),p=new Float32Array(9),f=new Float32Array(9);a.OX=function(a,c){c=c||new Float32Array(3);c[0]=a[3];c[1]=a[4];c[2]=a[5];return c};a.PX=function(a,c){c=c||new Float32Array(3);return e.copy(a,c)};a.pF=function(a,c){e.copy(c,a)};a.cx=function(a,c){e.normalize(c,g);a[3]=g[0];a[4]=g[1];a[5]=g[2]};a.rV=function(a,c,e){e=e||new Float32Array(3);e[0]=a[0]+a[3]*c;e[1]=a[1]+a[4]*c;e[2]=a[2]+a[5]*c};a.fK=function(a,c){for(var f=0;f<a.length;f+=3)c[0]+=a[f],c[1]+=a[f+1],c[2]+=a[f+2];return e.scale(c, | |
3/a.length,c)};a.aK=function(a,c,e){for(var f=0;f<e.length;f++)e[f]=0;for(f=0;f<a.length;f+=3){var g=a[f]-c[0],h=a[f+1]-c[1],p=a[f+2]-c[2];e[0]+=g*g;e[1]+=g*h;e[2]+=g*p;e[4]+=h*h;e[5]+=h*p;e[8]+=p*p}e[3]=e[1];e[6]=e[2];e[7]=e[5];for(f=0;f<e.length;f++)e[f]*=3/a.length;return e};a.vM=function(a,e){var n=u.copy(a,z);if(5E-4>c(n))return u.identity(e);var g=h(n,t),m=u.transpose(g,p);u.multiply(n,m,f);u.multiply(g,f,n);for(var K=u.copy(g,e),G=1;5E-4<=c(n)&&100>G;)g=h(n,t),m=u.transpose(g,p),u.multiply(n, | |
m,f),u.multiply(g,f,n),u.multiply(g,K,K),G++;return K};a.We=function(a,c){return c[0]*a[0]+c[1]*a[1]+c[2]*a[2]+c[3]}};b4w.module.__tsr=function(a,m){function h(){var a=new Float32Array(8);a[3]=1;a[7]=1;return a}function c(){var a=new Float32Array(9);a[3]=1;a[7]=1;return a}function e(a,c,e,f){f[0]=a[0];f[1]=a[1];f[2]=a[2];f[3]=c;f[4]=e[0];f[5]=e[1];f[6]=e[2];f[7]=e[3];return f}function u(a,c,e){var f=c[0],k=c[1],g=c[2],h=c[3],y=c[4],p=c[5],b=c[6];c=c[7];var d=a[0]*h,x=a[1]*h,C=a[2]*h;a=c*d+p*C-b*x;var h=c*x+b*d-y*C,H=c*C+y*x-p*d,d=-y*d-p*x-b*C;e[0]=a*c+d*-y+h*-b-H*-p;e[1]=h*c+d*-p+H*-y-a*-b;e[2]=H*c+d*-b+a*-p-h*-y; | |
e[0]+=f;e[1]+=k;e[2]+=g;return e}m("__mat3");var g=m("__mat4"),z=m("__quat"),t=m("__util"),p=m("__vec3"),f=new Float32Array(3),v=new Float32Array(4),k=new Float32Array(16);a.create=h;a.qB=function(a,c,e,f,k,g,p,y){var m=h();m[0]=a;m[1]=c;m[2]=e;m[3]=f;m[4]=k;m[5]=g;m[6]=p;m[7]=y;return m};a.Xp=c;a.OW=function(a,e,f,k,g,h,p,y){var m=c();m[0]=a;m[1]=e;m[2]=f;m[3]=k;m[4]=g;m[5]=h;m[6]=p;m[7]=y;return m};a.copy=function(a,c){c[0]=a[0];c[1]=a[1];c[2]=a[2];c[3]=a[3];c[4]=a[4];c[5]=a[5];c[6]=a[6];c[7]=a[7]; | |
return c};a.identity=function(a){a[0]=0;a[1]=0;a[2]=0;a[3]=1;a[4]=0;a[5]=0;a[6]=0;a[7]=1;return a};a.yf=e;a.Jd=function(a,c){c[0]=a[0];c[1]=a[1];c[2]=a[2];return c};a.ld=function(a,c){c[3]=a;return c};a.ix=function(a,c){c[0]=a[0];c[1]=a[1];c[2]=a[2];c[3]=a[3];return c};a.lg=function(a,c){c[4]=a[0];c[5]=a[1];c[6]=a[2];c[7]=a[3];return c};a.m=function(a){return a.subarray(0,3)};a.rj=function(a,c){c[0]=a[0];c[1]=a[1];c[2]=a[2];return c};a.qc=function(a){return a[3]};a.v=function(a){return a.subarray(4, | |
8)};a.dC=function(a,c){c[0]=a[4];c[1]=a[5];c[2]=a[6];c[3]=a[7];return c};a.invert=function(a,c){var e=1/a[3];if(!e)return null;var f=a[0],k=a[1],g=a[2];v[0]=a[4];v[1]=a[5];v[2]=a[6];v[3]=a[7];z.invert(v,v);var h=v[0],y=v[1],p=v[2],b=v[3],f=f*e,k=k*e,d=g*e,g=b*f+y*d-p*k,x=b*k+p*f-h*d,C=b*d+h*k-y*f,f=-h*f-y*k-p*d;c[0]=-(g*b+f*-h+x*-p-C*-y);c[1]=-(x*b+f*-y+C*-h-g*-p);c[2]=-(C*b+f*-p+g*-y-x*-h);c[3]=e;c[4]=h;c[5]=y;c[6]=p;c[7]=b;return c};a.zs=function(a,c){var e=a[3];g.fromRotationTranslation(a.subarray(4, | |
8),a.subarray(0,3),c);for(var f=0;12>f;f++)c[f]*=e;return c};a.lf=function(a,c){var k=t.GD(a,f),g=t.FD(a),h=t.hr(a,v);e(k,g,h,c);return c};a.multiply=function(a,c,e){u(c,a,e);e[3]=a[3]*c[3];var f=a[4],k=a[5],g=a[6];a=a[7];var h=c[4],y=c[5],p=c[6];c=c[7];e[4]=f*c+a*h+k*p-g*y;e[5]=k*c+a*y+g*h-f*p;e[6]=g*c+a*p+f*y-k*h;e[7]=a*c-f*h-k*y-g*p;return e};a.LR=function(a,c,e){var f=c[3];c=g.fromRotationTranslation(c.subarray(4,8),c.subarray(0,3),k);for(var h=0;12>h;h++)c[h]*=f;g.multiply(c,a,e);return e};a.bc= | |
u;a.qG=function(a,c,e){var f=c[3],k=a[0]-c[0],g=a[1]-c[1],h=a[2]-c[2];a=c[4];var y=c[5],p=c[6];c=c[7];var b=a*a+y*y+p*p+c*c,b=b?1/b:0;a=-a*b;y=-y*b;p=-p*b;c*=b;var b=c*k+y*h-p*g,d=c*g+p*k-a*h,x=c*h+a*g-y*k,k=-a*k-y*g-p*h;e[0]=b*c+k*-a+d*-p-x*-y;e[1]=d*c+k*-y+x*-a-b*-p;e[2]=x*c+k*-p+b*-y-d*-a;e[0]/=f;e[1]/=f;e[2]/=f;return e};a.ui=function(a,c,e,f){f||(f=0);var k=a.length,g=c[0],h=c[1],p=c[2],m=c[3],b=c[4],d=c[5],x=c[6];c=c[7];for(var C=0;C<k;C+=3){var H=a[C]*m,I=a[C+1]*m,O=a[C+2]*m,M=c*H+d*O-x*I, | |
v=c*I+x*H-b*O,l=c*O+b*I-d*H,H=-b*H-d*I-x*O;e[f+C]=M*c+H*-b+v*-x-l*-d;e[f+C+1]=v*c+H*-d+l*-b-M*-x;e[f+C+2]=l*c+H*-x+M*-d-v*-b;e[f+C]+=g;e[f+C+1]+=h;e[f+C+2]+=p}return e};a.Bs=function(a,c,e,f){f||(f=0);var k=a.length,g=c[3],h=c[4],p=c[5],m=c[6];c=c[7];for(var b=0;b<k;b+=3){var d=a[b]*g,x=a[b+1]*g,C=a[b+2]*g,H=c*d+p*C-m*x,I=c*x+m*d-h*C,O=c*C+h*x-p*d,d=-h*d-p*x-m*C;e[f+b]=H*c+d*-h+I*-m-O*-p;e[f+b+1]=I*c+d*-p+O*-h-H*-m;e[f+b+2]=O*c+d*-m+H*-p-I*-h}return e};a.vc=function(a,c,e){var f=c[3],k=c[4],g=c[5], | |
h=c[6];c=c[7];var p=a[0]*f,m=a[1]*f,b=a[2]*f;a=c*p+g*b-h*m;var f=c*m+h*p-k*b,d=c*b+k*m-g*p,p=-k*p-g*m-h*b;e[0]=a*c+p*-k+f*-h-d*-g;e[1]=f*c+p*-g+d*-k-a*-h;e[2]=d*c+p*-h+a*-g-f*-k;return e};a.Cs=function(a,c,e,f){f||(f=0);var k=a.length,g=c[3],h=c[4],p=c[5],m=c[6];c=c[7];for(var b=0;b<k;b+=4){var d=a[b]*g,x=a[b+1]*g,C=a[b+2]*g,H=c*d+p*C-m*x,I=c*x+m*d-h*C,O=c*C+h*x-p*d,d=-h*d-p*x-m*C;e[f+b]=H*c+d*-h+I*-m-O*-p;e[f+b+1]=I*c+d*-p+O*-h-H*-m;e[f+b+2]=O*c+d*-m+H*-p-I*-h;e[f+b+3]=a[b+3]}return e};a.translate= | |
function(a,c,e){var f=a[3],k=a[4],g=a[5],h=a[6],p=a[7],m=c[0]*f,b=c[1]*f,d=c[2]*f;c=p*m+g*d-h*b;var f=p*b+h*m-k*d,x=p*d+k*b-g*m,m=-k*m-g*b-h*d;e[0]=a[0]+c*p+m*-k+f*-h-x*-g;e[1]=a[1]+f*p+m*-g+x*-k-c*-h;e[2]=a[2]+x*p+m*-h+c*-g-f*-k;e[3]=a[3];e[4]=a[4];e[5]=a[5];e[6]=a[6];e[7]=a[7];return e};a.hl=function(a,c,e,f){p.lerp(a.subarray(0,3),c.subarray(0,3),e,f.subarray(0,3));var k=a[3];f[3]=k+e*(c[3]-k);z.slerp(a.subarray(4,8),c.subarray(4,8),e,f.subarray(4,8));return f};a.yW=function(a,c,e,f){var k=a.subarray(0, | |
3),g=c.subarray(0,3),h=f.subarray(0,3);h[0]=g[0]*(e+1)-k[0]*e;h[1]=g[1]*(e+1)-k[1]*e;h[2]=g[2]*(e+1)-k[2]*e;f[3]=c[3]*(e+1)-a[3]*e;a=a.subarray(4,8);c=c.subarray(4,8);k=f.subarray(4,8);k[0]=c[0]*(e+1)-a[0]*e;k[1]=c[1]*(e+1)-a[1]*e;k[2]=c[2]*(e+1)-a[2]*e;k[3]=c[3]*(e+1)-a[3]*e;z.normalize(k,k);return f};a.YN=function(a,c,e,f,k){k[0]=a[0]+c*e[0];k[1]=a[1]+c*e[1];k[2]=a[2]+c*e[2];k[3]=a[3];e=f[0];var g=f[1];f=f[2];var h=a[4],p=a[5],m=a[6],b=a[7];k[4]=.5*(e*b+g*m-f*p);k[5]=.5*(g*b+f*h-e*m);k[6]=.5*(f* | |
b+e*p-g*h);k[7]=.5*(-e*h-g*p-f*m);k[4]=a[4]+k[4]*c;k[5]=a[5]+k[5]*c;k[6]=a[6]+k[6]*c;k[7]=a[7]+k[7]*c;a=k[4];c=k[5];e=k[6];g=k[7];a=a*a+c*c+e*e+g*g;0<a&&(a=1/Math.sqrt(a),k[4]*=a,k[5]*=a,k[6]*=a,k[7]*=a)}};b4w.module.__obj_util=function(a,m){function h(a){if(!(a instanceof Object))return a;var c=null,e=null,g=null;a.ba&&(c=a.ba,a.ba=null);a.Pc&&(e=a.Pc,a.Pc=null);a.Ea&&(g=a.Ea,a.Ea=null);var p;p=a.constructor;switch(p){case Float32Array:case Uint32Array:case Uint16Array:p=new p(a);break;case Array:p=new p(a.length);for(var m=0;m<a.length;m++)p[m]=h(a[m]);break;case WebGLUniformLocation:case WebGLProgram:case WebGLShader:p=a;break;case WebGLFramebuffer:case WebGLTexture:case WebGLBuffer:p=null;break; | |
case Function:p=a;break;default:for(m in p=new p,a)p[m]=h(a[m])}c&&(p.ba=c,a.ba=c);e&&(p.Pc=e,a.Pc=e);g&&(p.Ea=g,a.Ea=g);return p}function c(a,c){for(var e=a.D,g=0;g<e.length;g++){var h=e[g];if(h.Ia==c)return h}return null}function e(a){return a.fi?a.parent:a.parent?e(a.parent):null}var u=m("__tsr"),g=m("__util"),z=m("__vec3"),t=m("__vec4"),p=m("__config").u;new Float32Array(4);new Float32Array(4);new Float32Array(4);u.create();u.create();a.bj=function(a){a={id:0,type:a,rd:0,HN:[0,0],i:u.Xp(),pivot:new Float32Array(3), | |
sb:new Float32Array(3),el:0,fl:0,XC:!1,Pp:null,ih:0,vs:!1,Ff:z.create(),use_panning:!1,gb:0,Io:1,Ho:1,Jo:1,dof_distance:0,dof_front:0,dof_rear:0,dof_power:0,be:null,OR:!1,rb:null,la:null,Xa:null,Ec:null,Dc:null,Ve:null,nn:!0,S:null,mx:null,Cl:{Dl:1,El:1,Fl:0},Fe:null,je:null,tc:new Float32Array(4),sn:0,kn:0,Ln:0,Fj:0,Lk:!1,pe:!1,Ld:!1,Kd:!1,kd:!1,Zc:!1,Gd:!1,ig:"",Eg:!1,xe:!1,eq:!1,Xf:!1,Bc:!1,gj:!1,uj:!1,$q:!1,ii:!1,sr:!1,Zb:!1,rr:!1,gE:!1,Rq:!1,Yq:!1,Vu:!1,No:0,ug:0,yh:0,Jg:0,Ig:0,Dg:0,$g:"",Wc:null, | |
Gp:!1,ff:!1,Gt:!1,Em:"",Dm:!1,Ke:0,time:0,$x:0,JG:0,ah:0,rn:!1,Qc:!1,Ef:!1,li:[],kl:!1,Ni:!1,Eh:1,st:0,rt:1,Hs:new Int8Array([-1,-1]),ls:[],JD:[],EF:[],Ed:null,ke:null,Od:null,ue:null,Ce:null,Dk:null,tw:null,yt:null,xt:null,Bk:null,zc:null,Dt:null,Bt:null,Ct:null,Jb:null,De:null,Ac:null,Cg:null,Gh:null,Zh:1E4};z.copy(g.Db,a.Ff);return a};a.Jk=function(a,c,e){e||(e=a);return{name:a,zi:g.Zu(),Nj:e,type:c,Ti:!1,Aa:!1,In:!1,Eo:!1,g:null,vb:null,M:null,hc:null,Bp:null,anchor:null,Rk:null,ir:null,D:[], | |
Qc:[],gf:[],fu:[],T:[],eo:[],Te:[],uk:[],xf:null,Yj:[],parent:null,fi:!1,Tn:"",Qs:null,Br:null,fk:!1,kb:"",Tp:"AUTO",xd:!1,Re:!1,Aj:!1,p:null,l:null,Ie:null,Pd:null,Sk:null,dA:null,qw:[],vf:{Ar:"NO_COLLISION",Fo:!1,IG:!1,cg:0,MG:0,LG:0,wu:0,Nw:0,HO:!1,IO:!1,JO:!1,KO:!1,LO:!1,MO:!1,Rm:0,Pm:0,Sm:0,Xx:!1,Op:"BOX",Do:!1},fE:{ws:0,kw:0,ie:0,Ew:0},Bm:0,df:[],aw:!1,KD:[]}};a.gu=function(a){return a instanceof Array?a.slice():a};a.Hk=h;a.Aa=function(a){return a.Aa};a.dO=function(a){return"MESH"==a.type&& | |
a.Aa};a.yk=function(a,c){a.D.push({Ia:c,Oq:!1,W:[],hg:[],Oh:null,ox:[],Cj:0,bE:!1})};a.xp=function(a,e,k){c(a,e).W.push(k)};a.IZ=function(a,c){for(var e=a.D,g=0;g<e.length;g++)if(e[g].Ia==c){e.splice(g,1);break}};a.bb=c;a.BG=function(a,c){for(var e=0;e<a.length;e++)t.copy(c,a[e].g.tc)};a.Ow=function(a,c,e){for(var g=0;g<a.D.length;g++){var h=a.D[g];e&&h.Ia!=e||(h.Oq=c)}};a.vq=function(a,c){for(var e=[],g=c?p.HD-1:p.HD,h=0;h<a.length;h++){var m=a[h];m.hc.wB&&e.length<g&&e.push(m)}return e.length?e: | |
a[0]?[a[0]]:[]};a.hA=function(a,c){if(c.b4w_enable_soft_particles&&0<c.b4w_particles_softness){var e=c.material-1,g=a.data.materials;if(0<=e&&e<g.length&&("ADD"==g[e].game_settings.alpha_blend||"ALPHA"==g[e].game_settings.alpha_blend||"ALPHA_SORT"==g[e].game_settings.alpha_blend))return!0}return!1};a.tB=function(a,c){return a+"*"+c};a.aC=function(a){return a.fi?null:a.parent};a.Rg=e;a.gv=function(a,c){for(var g=[],h=0;h<c.length;h++){var p=c[h];e(p)==a&&g.push(p)}return g};a.Lc=function(a){return"MESH"=== | |
a.type};a.yj=function(a){return"ARMATURE"===a.type};a.ll=function(a){return"SPEAKER"===a.type};a.ea=function(a){return"CAMERA"===a.type};a.Sq=function(a){return"LAMP"===a.type};a.Gn=function(a){return"EMPTY"===a.type};a.SY=function(a){return"LINE"===a.type};a.Cv=function(a){return"WORLD"===a.type}};b4w.module.__particles=function(a,m){function h(){throw"_rand() undefined";}function c(a,c,e,g,k,b){var d=a.cq,x=a.kf,C=a.time;a=a.sE;for(var h=0;h<d.length;h+=4){var n=d[h];if(C>a&&C>=n&&n>a||C<a&&(n>a||C>=n))for(n=0;8>n;n++)x[8*h+n]=g[n],A[n]=g[n];else for(n=0;8>n;n++)A[n]=x[8*h+n];n=L;n[0]=c[3*h];n[1]=c[3*h+1];n[2]=c[3*h+2];f.bc(n,A,n);k[3*h]=n[0];k[3*h+1]=n[1];k[3*h+2]=n[2];var p=L;p[0]=e[3*h];p[1]=e[3*h+1];p[2]=e[3*h+2];f.vc(p,A,p);b[3*h]=p[0];b[3*h+1]=p[1];b[3*h+2]=p[2];for(n=1;4>n;n++)k[3* | |
(h+n)]=k[3*h],k[3*(h+n)+1]=k[3*h+1],k[3*(h+n)+2]=k[3*h+2],b[3*(h+n)]=p[0],b[3*(h+n)+1]=p[1],b[3*(h+n)+2]=p[2]}}function e(a){a?(v.oR(a),h=function(){return v.LP()}):h=function(){return Math.random()}}var u=m("__config"),g=m("__batch"),z=m("__geometry");m("__scenes");var t=m("__textures"),p=m("__time"),f=m("__tsr"),v=m("__util"),k=m("__vec3"),n=u.u,A=new Float32Array(8),L=new Float32Array(3),K=[];a.update=function(){for(var a=0;a<K.length;a++)for(var e=K[a],f=e.D,g=0;g<f.length;g++)for(var k=e,b=f[g].W, | |
d=0;d<b.length;d++){var x=b[d],C=x.La;C&&C.Ms&&!x.$f&&(c(C,C.Hl,C.YD,k.g.i,C.uw,C.fw),C.hP=!0)}};a.iw=function(a){a=a.D;for(var c=0;c<a.length;c++)for(var e=a[c].W,f=0;f<e.length;f++)if(e[f].La)return!0;return!1};a.aE=function(a){a=a.D;for(var c=0;c<a.length;c++)for(var e=a[c].W,f=0;f<e.length;f++){var g=e[f].La;if(g&&"EMITTER"==g.lw)return!0}return!1};a.XJ=function(a){return 0<a.particle_systems.length};a.WJ=function(a){for(var c=0;c<a.particle_systems.length;c++)if("EMITTER"==a.particle_systems[c].settings.type)return!0; | |
return!1};a.KN=function(a){for(var c=0;c<a.particle_systems.length;c++){var e=a.particle_systems[c].settings;if("HAIR"==e.type&&e.b4w_dynamic_grass)return!0}return!1};a.WN=function(a,c,e){var f=a.La={name:c.name,lw:c.settings.type,time:0,sE:-1,Ms:!1,ga:0,Da:0,gG:0,Jv:0,vD:0,Kc:!1,cg:0,bw:0,CC:0,kj:0,ce:0,aH:0,size:0,wz:0,vz:0,sA:0,rA:new Float32Array(16),Hl:null,uw:null,YD:null,fw:null,cq:null,Bu:null,kf:null,iE:null};f.ga=c.settings.frame_start;f.Da=c.settings.frame_end;f.gG=(f.Da-f.ga)/p.pc();f.Jv= | |
c.settings.lifetime;f.vD=f.Jv/p.pc();f.Kc=c.settings.b4w_cyclic?1:0;f.cg=c.settings.mass;f.bw=c.settings.normal_factor;f.CC=9.81*c.settings.effector_weights.gravity;f.kj=c.settings.b4w_fade_in/p.pc();f.ce=c.settings.b4w_fade_out/p.pc();f.aH=c.settings.effector_weights.wind;f.Ms="WORLD"==c.settings.b4w_coordinate_system?!0:!1;var k,b,d;a.ov?(k=e.halo.size,b=e.halo.hardness,30>b?(b=.5,d=.9):40>b?(b=.1,d=1):50>b?(b=0,d=.8):(b=0,d=.5)):(k=c.settings.particle_size,d=b=1);f.size=k;f.wz=b;f.vz=d;e.use_nodes&& | |
"BILLBOARD"==c.settings.render_type&&(g.Id(a,"NODES",1),g.Id(a,"PARTICLE_BATCH",1),a.JS=!0,a.Cn=!0);c=c.settings.texture_slots;c[0]&&c[0].use_map_size&&c[0].texture&&"BLEND"==c[0].texture.type&&c[0].texture.use_color_ramp&&n.tp&&(k=[],t.$J(c[0].texture.color_ramp,t.Qy,k),k=new Uint8Array(k.map(function(a){return v.J(255*a,0,255)})),g.sJ(a,k,"u_color_ramp_tex",t.Qy),g.Id(a,"USE_COLOR_RAMP",1));e=e.texture_slots;a=[-1,0,0,0,-1,0,0,0,-1,0,0,0,-1,0,0,0];if(e[0]&&"STRAND"==e[0].texture_coords&&e[0].texture&& | |
"BLEND"==e[0].texture.type&&e[0].texture.use_color_ramp){e=e[0].texture.color_ramp.elements;c=Math.min(4*e.length,a.length);for(k=0;k<c;k+=4)b=e[k/4],a[k]=b.position,a[k+1]=b.color[0],a[k+2]=b.color[1],a[k+3]=b.color[2];f.sA=e.length}f.rA.set(a)};a.RM=function(a,f,g,n){var m=a.La,b=g.settings.count,d=g.settings.frame_start/p.pc(),x=g.settings.frame_end/p.pc(),C=g.settings.lifetime/p.pc(),H=g.settings.lifetime_random,I=g.settings.emit_from,O=g.settings.factor_random,M=g.settings.angular_velocity_mode, | |
F=g.settings.angular_velocity_factor,l=g.settings.b4w_randomize_emission,q=g.settings.b4w_cyclic;e(g.seed);f=z.iB(f,["a_position","a_normal"],null);switch(I){case "VERT":g=f.H[0].a_position;f=f.H[0].a_normal;for(var D=g.length/3,I=[],r=0;r<b;r++){var w=Math.round((D-1)*h());I.push(w);I.push(w);I.push(w);I.push(w)}D=[];for(r=0;r<I.length;r++)D.push(g[3*I[r]]),D.push(g[3*I[r]+1]),D.push(g[3*I[r]+2]);g=new Float32Array(D);D=[];for(r=0;r<I.length;r++)D.push(f[3*I[r]]),D.push(f[3*I[r]+1]),D.push(f[3*I[r]+ | |
2]);I=new Float32Array(D);break;case "FACE":g=[];I=[];r=[];v.Lq(0,r);D=z.av(f,b,!1,r);v.Lq(0,r);f=z.av(f,b,!0,r);for(r=0;r<D.length;r++)g.push(D[r][0],D[r][1],D[r][2]),g.push(D[r][0],D[r][1],D[r][2]),g.push(D[r][0],D[r][1],D[r][2]),g.push(D[r][0],D[r][1],D[r][2]),I.push(f[r][0],f[r][1],f[r][2]),I.push(f[r][0],f[r][1],f[r][2]),I.push(f[r][0],f[r][1],f[r][2]),I.push(f[r][0],f[r][1],f[r][2]);g=new Float32Array(g);I=new Float32Array(I);break;case "VOLUME":throw"Particle emission from volume is not supported"; | |
default:throw"Wrong emit from option";}I=[g,I];f=I[0];I=I[1];m.Hl=new Float32Array(f);m.YD=new Float32Array(I);m.uw=new Float32Array(f.length);m.fw=new Float32Array(I.length);g=[];x=(x-d)/b;for(D=0;D<b;D++)r=l?x*D+10*x*(.5-h()):x*D,q||(r+=d),g.push(r),g.push(r),g.push(r),g.push(r);d=new Float32Array(g);m.cq=new Float32Array(d);m.Bu=new Float32Array(d);if(m.Ms){m.kf=new Float32Array(8*d.length);for(l=0;l<8*d.length;l++)for(q=0;8>q;q++)m.kf[8*l+q]=n[q];c(m,f,I,n,f,I)}n=v.oc("EMITTER_PARTICLES");l=v.hf(); | |
l.a_position=f;l.a_normal=I;n.H[0]=l;a.Rh=z.Uo;a=[];for(l=0;l<b;l++)a.push(4*l,4*l+2,4*l+1,4*l,4*l+3,4*l+2);a=new Uint16Array(a);n.Ta=a;a=n.U;l=[];for(q=0;q<b;q++)l.push(-.5,-.5,-.5,.5,.5,.5,.5,-.5);l=new Float32Array(l);a.a_p_bb_vertex=l;n.ma=f.length/3;a=[];H*=C;for(l=0;l<b;l++)q=H*h(),a.push(C-q),a.push(C-q),a.push(C-q),a.push(C-q);C=n.U;H=[];for(l=0;l<b;l++)q=Math.random(),H.push(a[4*l],d[4*l],q),H.push(a[4*l+1],d[4*l+1],q),H.push(a[4*l+2],d[4*l+2],q),H.push(a[4*l+3],d[4*l+3],q);H=new Float32Array(H); | |
C.a_p_data=H;C=n.U;H=[];for(a=0;a<b;a++){d=[h()-.5,h()-.5,h()-.5];k.normalize(d,d);H.push(O*d[0]);H.push(O*d[1]);H.push(O*d[2]);switch(M){case "NONE":H.push(0);break;case "SPIN":case "VELOCITY":H.push(F);break;case "RAND":H.push(2*F*(h()-.5));break;default:throw"Undefined velocity factor";}d=H.slice(-4);for(l=0;12>l;l++)H.push(d[l%4])}b=new Float32Array(H);C.a_p_vels=b;m.iE=new Float32Array(n.U.a_p_data);return n};a.MQ=function(a,c,e){a=a.D;for(var f=0;f<a.length;f++)for(var g=a[f].W,b=0;b<g.length;b++){var d= | |
g[b].La;d&&d.name==c&&!g[b].$f&&(d.sE=d.time,d.time=e)}};a.FP=function(a){for(var c=a.ma,e=a.H[0].a_position,f=a.U.a_texcoord,g=[],b=[],d=0;d<c;d++)b.push(e[3*d]),b.push(e[3*d+1]),g.push(e[3*d+2]);g=new Float32Array(g);b=new Float32Array(b);a.U.a_lf_dist=g;a.U.a_lf_bb_vertex=b;a.U.a_texcoord=f;return a};a.u_=function(a,c,e){a=a.D;for(var f=0;f<a.length;f++)for(var g=a[f].W,b=0;b<g.length;b++){var d=g[b].La;d&&d.name==c&&(d.size=e)}};a.j_=function(a,c,e){a=a.D;for(var f=0;f<a.length;f++)for(var g= | |
a[f].W,b=0;b<g.length;b++){var d=g[b].La;d&&d.name==c&&(d.bw=e)}};a.ZZ=function(a,c,e){a=a.D;for(var f=0;f<a.length;f++)for(var g=a[f].W,b=0;b<g.length;b++){var d=g[b],x=d.La;if(x&&x.name==c){var k=x.cq;if(1==e)var h=k;else if(0==e)for(var h=x.Bu,n=0;n<h.length;n+=4)h[n]=1E4,h[n+1]=h[n],h[n+2]=h[n],h[n+3]=h[n];else for(var p=4/e,h=x.Bu,M=0,n=0;n<h.length;n+=4)n>=M?(h[n]=k[n],M+=p):h[n]=1E4,h[n+1]=h[n],h[n+2]=h[n],h[n+3]=h[n];d=d.pa;if(d.jd.a_p_data){x=x.iE;for(n=0;n<x.length;n+=3)x[n+1]=h[Math.round(n/ | |
3)];z.aS(d,x)}}}};a.uS=function(a,c,e){a=a.D;for(var f=0;f<a.length;f++)for(var g=a[f].W,b=0;b<g.length;b++){var d=g[b].La;if(d&&d.Ms)for(var x=0;x<8*d.cq.length;x++)d.kf[8*x]=c[0],d.kf[8*x+1]=c[1],d.kf[8*x+2]=c[2],d.kf[8*x+3]=c[3],d.kf[8*x+4]=e[0],d.kf[8*x+5]=e[1],d.kf[8*x+6]=e[2],d.kf[8*x+7]=e[3]}};a.oS=function(a,c,e){if(c.wr){for(var f=[],g=0;g<e;g++)f.push(1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1);a.U.a_tangent=new Float32Array(f)}if(c.mw){f=[];for(g=0;g<e;g++)f.push(g,g,g,g);a.U[c.mw.name]=new Float32Array(f)}}; | |
a.nS=function(a){-1==K.indexOf(a)&&K.push(a)};a.PP=function(a){a=K.indexOf(a);-1!=a&&K.splice(a,1)};a.fa=function(){K.length=0}};b4w.module.__batch=function(a,m){function h(a){a={type:a,ub:"",id:0,RP:0,Bl:"",ba:[],Pc:[],sf:[],Um:[],hk:null,wc:{},uc:null,Rb:{qm:null,Uk:null,Qh:[],Jj:[]},Cp:[],wZ:null,pa:null,Ef:!1,dj:!1,QA:!1,wireframe_mode:0,hw:0,Nn:0,lD:0,mD:0,BC:0,lv:0,td:new Float32Array(3),Zd:new Float32Array(16),Mi:!1,Ua:!1,qA:!1,Fa:!1,zh:!1,Bb:!1,ve:!1,Xf:!1,pe:!1,Kd:!1,Ld:!1,kd:!1,Zc:!1,Gd:!1,Bc:!1,uE:!1,Rh:fa.um,Ah:fa.zg,Tt:!1,$f:!1,KP:"",B_:"",EC:!1,IC:0,FC:0,JC:0,KC:0,HC:new Float32Array(3),GC:new Float32Array(3), | |
ov:!1,vk:0,Pk:0,dn:1,Jr:0,ps:0,wx:1,ur:0,cn:0,Am:1,XD:0,Vv:0,Mj:0,LE:0,ae:Array(2),Ul:new Float32Array(3),ti:new Float32Array(3),uo:new Float32Array(3),jf:new Float32Array(4),nj:new Float32Array(4),nl:null,Gv:null,Ev:null,Dv:null,Fv:null,Cn:!1,kk:!1,water_dynamic:!1,dy:!1,XG:!1,YG:0,ZG:0,WG:0,Rs:.1,fs:0,ks:0,mq:0,mB:new Float32Array(2),lB:new Float32Array(2),Su:new Float32Array(2),es:new Float32Array(3),js:new Float32Array(3),Lj:null,fo:!1,La:null,wD:0,wr:!1,mw:null,Kj:null,zl:null,TD:null,he:null, | |
yl:null,UD:null};a.jf[3]=1;a.qA=!0;a.Fa=!0;a.wD=1;return a}function c(a){switch(a.type){case "MAIN":case "PARTICLES":case "LINE":a.ub=a.Ua?a.zh?"XRAY":"BLEND":"OPAQUE";break;case "SHADOW":a.ub=a.Kd?"CAST":"RECEIVE";break;case "COLOR_ID":a.ub=a.zh?"COLOR_ID_XRAY":"COLOR_ID"}}function e(a){var b=a.pa;a.pa=null;var d=la.Hk(a);a.pa=b;d.pa=b;return d}function u(a,b){for(var d=[],l=0;l<a.length;l++){var c=a[l],q=c.ya.g,e=ka.Qd();ka.Sp(q.Bk,e);var r=c.data.b4w_bounding_cylinder_radius,f=c.data.b4w_bounding_sphere_radius, | |
w=c.data.b4w_bounding_sphere_center,D=c.data.b4w_bounding_ellipsoid_axes,g=c.data.b4w_bounding_ellipsoid_center;if(q.ff){var r=Math.max(Math.abs(e.max_x),Math.abs(e.min_x)),f=Math.max(Math.abs(e.max_y),Math.abs(e.min_y)),x=Math.max(Math.abs(e.max_z),Math.abs(e.min_z)),x=Math.sqrt(r*r+f*f+x*x),r=Math.sqrt(r*r+f*f);e.max_x=e.max_y=e.max_z=x;e.min_x=e.min_y=e.min_z=-x;f=x;w[0]=w[1]=w[2]=0;D[0]=D[1]=D[2]=x;g[0]=g[1]=g[2]=0}q.zc=e;x=ka.Kt(e,q.i);q.Jb=x;t(q,r,r,e);e=ka.Vp(f,w);q.De=e;e=ka.Mt(e,q.i);q.Ac= | |
e;D=ka.Up([D[0],0,0],[0,D[1],0],[0,0,D[2]],g,[0,0,0,1]);q.Cg=D;D=ka.Lt(D,q.i);q.Gh=D;d=d.concat(z(c,q,b))}return d}function g(a,b,d){for(var l=[],c=[],q={},e=0;e<a.length;e++){var r=a[e],f=r.ya.g,w=ka.Qd();ka.Sp(f.Bk,w);var D=ka.Kt(w,f.i),x=ka.Vp(r.data.b4w_bounding_sphere_radius,r.data.b4w_bounding_sphere_center),g=ka.Mt(x,f.i),k=r.data.b4w_bounding_ellipsoid_axes,k=ka.Up([k[0],0,0],[0,k[1],0],[0,0,k[2]],r.data.b4w_bounding_ellipsoid_center,[0,0,0,1]),C=ka.Lt(k,f.i);f.zc=w;f.Jb=D;f.De=x;f.Ac=g;f.Cg= | |
k;f.Gh=C;w={};w.pe=f.pe;w.Kd=f.Kd;w.Ld=f.Ld;w.ii=f.ii;w.sr=f.sr;w.Zb=f.Zb;w.rr=f.rr;w.Cl=f.Cl;w.kd=f.kd;w.Zc=f.Zc;w.Gd=f.Gd;w.Fe=f.Fe;w.je=f.je;w.ig=f.ig;w.Eg=f.Eg;w.xe=f.xe;w.$g=f.$g;w.Wc=f.Wc;w.ff=f.ff;w.Em=f.Em;w.Dm=f.Dm;w.Bc=f.Bc;w.gj=f.gj;w.eq=f.eq;w.Xf=f.Xf;D=f.Ac.N;w.HN=0==d?[0,0]:[Math.floor(D[0]/d),Math.floor(D[2]/d)];w.Zh=f.Zh;w.Ln=f.Ln;w.Fj=f.Fj;w.Lk=f.Lk;f=JSON.stringify(w);q[f]=q[f]||[];q[f].push(r)}for(var h in q){w=JSON.parse(h);d=q[h];var r=la.bj("STATIC"),n;for(n in w)r[n]=w[n];r.rd= | |
a[0].ya.g.rd;r.ug=0;r.yh=0;r.Jg=0;r.Ig=0;r.Dg=0;r.uj=!1;f=[];for(e=0;e<d.length;e++){w=d[e].ya;ka.gB(w.g.Jb,ta);for(D=0;D<ta.length;D++)f.push(ta[D]);0==e?(r.Jb=N.Ma(w.g.Jb),r.Ac=N.Ma(w.g.Ac)):(ka.dB(r.Jb,w.g.Jb),ka.kM(r.Ac,w.g.Ac))}r.Gh=ka.TK(f);ka.WR(r);r.zc=N.Ma(r.Jb);r.De=N.Ma(r.Ac);c.push({g:r,YJ:d})}for(a=0;a<c.length;a++)for(q=c[a].g,e=c[a].YJ,h=0;h<e.length;h++){n=e[h];d=n.ya.g;r=z(n,q,b);f=sa.create();d.ff&&!d.Gt?(w=sa.m(d.i),sa.Jd(w,f)):sa.copy(d.i,f);w={};if(q.xe||q.ff)w.au_center_pos= | |
[f[0],f[1],f[2]];q.xe&&(w.au_wind_bending_amp=[d.ug],w.au_wind_bending_freq=[n.b4w_wind_bending_freq],w.au_detail_bending_amp=[n.b4w_detail_bending_amp],w.au_detail_bending_freq=[n.b4w_detail_bending_freq],w.au_branch_bending_amp=[n.b4w_branch_bending_amp]);for(D=0;D<r.length;D++)k=r[D].g,x=r[D].re,g=r[D].I,k.Rq?k.ff?fa.sR(x,f):fa.Cx(x,f):("COLOR_ID"==g.type&&(r[D].g=d,g.Bl=n.uuid,O(g,d),k=V(d),P(g,k)),x=fa.Cx(x,f),fa.rR(x,w));l=l.concat(r)}return l}function z(a,b,d){var l=[],c=p(d,b,!b.Lk,!1),e= | |
V(b),D=a.data,x=D.materials,g=Array(x.length),k=xa.Pb(d,"MAIN_OPAQUE"),C=!1;k&&(C=k.cr.length?!0:!1);for(var n=0;n<c.length;n++)for(var ia=c[n],W=0;W<x.length;W++){var M=x[W];if(("LENS_FLARES"!=M.name||C)&&!fa.MC(D,W)){var H=h(ia);"COLOR_ID"==ia&&(H.Tt=!(a.b4w_do_not_render||M.b4w_do_not_render));"MAIN"==ia&&(g[W]=H);if(w(H,M)){"SHADOW"==ia&&g[W]&&(H.ve=g[W].ve);H.Rh=b.Ef||b.Xf?fa.Uo:fa.um;O(H,b);for(var m=H,I=a.particle_systems,F=0;F<I.length;F++){var v=I[F].settings.b4w_vcol_from_name,y=I[F].settings.b4w_vcol_to_name; | |
""!==v&&""!==y&&(m.wc[v]={oj:!1,src:[{name:v,Se:7}]})}"DYNAMIC"==b.type&&(H.Bl=a.uuid);P(H,e);var Z=fa.hB(D,W,H.Um,b.Dk,H.wc,H.hk);"LENS_FLARES"==M.name&&(Z=ga.FP(Z));l.push({I:H,re:Z,Ad:[M.name],g:b,me:[a]})}}}var J=a.particle_systems;if(0<J.length&&l.length){for(var ba=!1,A=!1,n=0;n<J.length;n++){var Da=J[n],t=Da.settings;t.use_render_emitter&&(ba=!0);"HAIR"!=t.type||"OBJECT"!=t.render_type&&"GROUP"!=t.render_type&&Da.transforms.length||(A=!0);if(ba&&A)break}var B=l[0].I.wc,ka;if(A){var Q;if(1< | |
x.length){for(var ta={},R=0;R<J.length;R++){var z=J[R].settings;if("HAIR"==z.type&&("OBJECT"==z.render_type||"GROUP"==z.render_type)){var na=z.b4w_vcol_from_name,L=z.b4w_vcol_to_name;""!==na&&""!==L&&(ta[na]=N.Ma(B[na]))}}"a_bending_col_main"in B&&(ta.a_bending_col_main=N.Ma(B.a_bending_col_main));"a_bending_col_detail"in B&&(ta.a_bending_col_detail=N.Ma(B.a_bending_col_detail));Q=fa.iB(D,[],ta)}else Q=l[0].re;ka=Q}else ka=null;for(var S,E=ka,yb=a.ya,Pa=[],da=a.particle_systems,u=a.data,pa=0;pa<da.length;pa++){var G= | |
da[pa],ha=G.settings;if(ha.count)if("EMITTER"==ha.type){if("DYNAMIC"==b.type){var ca=h("PARTICLES"),K,X=u.materials,U=G.settings.material-1;U>=X.length&&(ra.warn('Wrong material used for rendering particle system "'+G.name+'"'),U=0);K=X[U];"HALO"===G.settings.render_type&&(ca.ov=!0);f(ca,K);var ea=ca,ja=a,Ba=G.settings;switch(Ba.b4w_billboard_align){case "VIEW":q(ea,"BILLBOARD_ALIGN","BILLBOARD_ALIGN_VIEW");break;case "XY":q(ea,"BILLBOARD_ALIGN","BILLBOARD_ALIGN_XY");break;case "YZ":q(ea,"BILLBOARD_ALIGN", | |
"BILLBOARD_ALIGN_YZ");break;case "ZX":q(ea,"BILLBOARD_ALIGN","BILLBOARD_ALIGN_ZX");break;default:throw"Wrong billboard align value";}q(ea,"BILLBOARD",0);var Ia=Ba.b4w_enable_soft_particles&&la.hA(ja,Ba);q(ea,"SOFT_PARTICLES",0<Ba.b4w_particles_softness&&Ia&&va.dq?1:0);q(ea,"SOFT_STRENGTH",aa.K(Ba.b4w_particles_softness));aa.R(ea.Rb,"WORLD_SPACE","WORLD"==Ba.b4w_coordinate_system?1:0);ca.Xf=!0;ca.Bl=yb.name+"_"+ha.uuid;ca.KP=G.name;P(ca,e);ga.WN(ca,G,K);var za=ga.RM(ca,u,G,yb.g.i);ga.oS(za,ca,ha.count); | |
ga.nS(yb);ca.JS&&O(ca,yb.g);Pa.push({I:ca,re:za,Ad:[K.name],g:b,me:[a]})}}else if("HAIR"==ha.type){var Ea=N.Lq(G.seed);ha.b4w_dynamic_grass&&(b.gj=!0);var Y=Fa.iA(va.Ov)&&!ha.b4w_initial_rand_rotation&&!ha.b4w_hair_billboard,oa=4;Y&&(oa=8);if(G.transforms.length)var Aa=G.transforms;else for(var nc=fa.av(E,ha.count,!1,Ea),Aa=new Float32Array(nc.length*oa),$a=0;$a<nc.length;$a++){var $c=.75+.5*N.Xe(Ea);Aa[$a*oa]=nc[$a][0];Aa[$a*oa+1]=nc[$a][1];Aa[$a*oa+2]=nc[$a][2];Aa[$a*oa+3]=$c;Y&&(Aa[$a*oa+4]=1, | |
Aa[$a*oa+5]=0,Aa[$a*oa+6]=0,Aa[$a*oa+7]=0)}var Fc=xa.Pb(d,"GRASS_MAP")?!0:!1;if("OBJECT"==ha.render_type)var Mc=[p(d,ha.dupli_object.ya.g,!b.Lk,!0)],eb=r(a,b,B,E,[ha.dupli_object],Mc,[Aa],ha,G,Fc,Ea,!1),Pa=Pa.concat(eb);else if("GROUP"==ha.render_type){for(var nb=ha.dupli_group.objects,Mc=[],$a=0;$a<nb.length;$a++){var Ob=p(d,nb[$a].ya.g,!b.Lk,!0);Mc.push(Ob)}for(var sc=!1,Ub=[],$a=0;$a<nb.length;$a++)Ub.push(nb[$a].ya);if(ha.use_whole_group){for(var Ab,Bb=Aa,Vb=Ub,Gc=Y,oc=oa,tb={},ob=new Float32Array([0, | |
0,0,1]),Ta=0;Ta<Bb.length;Ta+=oc)for(var cb=0;cb<Vb.length;cb++){var Ga=qa.create(),Cb=sa.qc(Vb[cb].g.i),fb=sa.m(Vb[cb].g.i);qa.scale(fb,Cb,Ga);var Db=qa.clone([Bb[Ta],Bb[Ta+1],Bb[Ta+2]]);tb[cb]||(tb[cb]=new Float32Array(Bb.length));Gc&&(tb[cb][Ta+4]=ob[0]=Bb[Ta+4],tb[cb][Ta+5]=ob[1]=Bb[Ta+5],tb[cb][Ta+6]=ob[2]=Bb[Ta+6],tb[cb][Ta+7]=ob[3]=Bb[Ta+7],N.zw(ob,ob),N.KR(Ga,ob,Ga));qa.add(Db,Ga,Db);tb[cb][Ta]=Db[0];tb[cb][Ta+1]=Db[1];tb[cb][Ta+2]=Db[2];tb[cb][Ta+3]=Bb[Ta+3]}Ab=tb;sc=!0}else{var pb;if(ha.use_group_count){for(var Kb= | |
Aa,dc=Ub,qb=ha.dupli_weights,vc=Ea,Fb=Y,ec=oa,Va={},Xa=[],Ua=0;Ua<dc.length;Ua++)for(var Ca=dc[Ua],Pb=Ca.Nj||Ca.name,ib=0;ib<qb.length;ib++){var rb=qb[ib];Pb==rb.name&&Xa.push(rb)}qb.length!=Xa.length&&ra.error("dupli weights match failed");for(Ua=0;Ua<Kb.length;Ua+=ec){for(var Ka,wc=Xa,gb=[0],Ja=0;Ja<wc.length;Ja++)gb[Ja+1]=gb[Ja]+wc[Ja].count;for(var ub=gb[gb.length-1]*N.Xe(vc),pc=0,Ja=0;Ja<gb.length;Ja++)if(ub>=gb[Ja]&&ub<gb[Ja+1]){pc=Ja;break}Ka=pc;Va[Ka]=Va[Ka]||[];Va[Ka].push(Kb[Ua],Kb[Ua+1], | |
Kb[Ua+2],Kb[Ua+3]);Fb&&Va[Ka].push(Kb[Ua+4],Kb[Ua+5],Kb[Ua+6],Kb[Ua+7])}for(Ka in Va)Va[Ka]=new Float32Array(Va[Ka]);pb=Va}else{for(var Ya=Aa,Gb=Ea,Lb=Y,ab=oa,vb=Ub.length,wb={},Ra=0;Ra<Ya.length;Ra+=ab){var jb=Math.floor(vb*N.Xe(Gb));wb[jb]=wb[jb]||[];wb[jb].push(Ya[Ra],Ya[Ra+1],Ya[Ra+2],Ya[Ra+3]);Lb&&wb[jb].push(Ya[Ra+4],Ya[Ra+5],Ya[Ra+6],Ya[Ra+7])}for(jb in wb)wb[jb]=new Float32Array(wb[jb]);pb=wb}Ab=pb}eb=r(a,b,B,E,nb,Mc,Ab,ha,G,Fc,Ea,sc);Pa=Pa.concat(eb)}"INSTANCE"==ha.b4w_wind_bend_inheritance&& | |
yb.g.xe&&ra.warn('Emitter object "'+yb.name+"\" has a particle system with wind bending inheritance from the particle instance. Wind bending on the emitter isn't disabled. Expect unforeseen behavior.")}else throw"Unknown particle settings type";}S=Pa;l=ba?l.concat(S):S}return l}function t(a,b,d,l){a.Dt=ka.zA(b,l);a.Bt=ka.xA(d,l);a.Ct=ka.yA(b,l)}function p(a,b,d,l){var c=[];l||(b.ii&&xa.Pb(a,"COLOR_PICKING")||b.Zb&&xa.Pb(a,"OUTLINE_MASK"))&&c.push("COLOR_ID");d&&(c.push("MAIN"),c.push("NODES_GLOW"), | |
xa.Pb(a,"WIREFRAME")&&c.push("WIREFRAME"),xa.Pb(a,"SHADOW_RECEIVE")&&c.push("SHADOW"),xa.Pb(a,"GRASS_MAP")&&c.push("GRASS_MAP"));c.push("PHYSICS");if(b.Kd||b.Zc)for(a=null,b.Kd&&(a=["MAIN","NODES_GLOW","COLOR_ID","PHYSICS","WIREFRAME"]),b.Zc&&(b=["COLOR_ID","PHYSICS","SHADOW","WIREFRAME"],a=null!==a?N.CJ(a,b):b),b=a,a=0;a<b.length;a++)d=c.indexOf(b[a]),-1!==d&&c.splice(d,1);return c}function f(a,b){var d;switch(a.type){case "MAIN":if(b.b4w_do_not_render)d=!1;else{if(b.use_nodes&&"HALO"!=b.type)B(a, | |
b,"MAIN");else{n(a,b);d=b.game_settings.alpha_blend;a.zh=b.b4w_render_above_all&&"OPAQUE"!=d&&"CLIP"!=d;a.Mj=b.offset_z;a.ti.set([1,1,1]);var c=b.texture_slots;X.set(b.diffuse_color[0],b.diffuse_color[1],b.diffuse_color[2],b.alpha,a.jf);switch(b.name){case "LENS_FLARES":ca(a,"special_lens_flares.glslv","special_lens_flares.glslf");l(a,"a_position");l(a,"a_texcoord");var e=A(c[0],null);Z(a,e);break;default:ca(a,"main.glslv","main_stack.glslf");b.use_shadeless||(d=za.nu(b.uuid,b.name,{ve:b.use_shadeless, | |
en:b.diffuse_shader,Vl:b.specular_shader}),a.Rb.Jj=za.Qp(d));var r=L("use_map_color_diffuse",c),f=L("use_map_color_spec",c),w=L("use_map_normal",c),D=L("use_map_mirror",c),x=L("use_stencil",c);d=r[0];f=f[0];w=w[0];D=D[0];r=r[1];c=x[0]&&L("use_rgb_to_intensity",c)[0];if(d){switch(d.blend_type){case "MIX":q(a,"TEXTURE_BLEND_TYPE","TEXTURE_BLEND_TYPE_MIX");break;case "MULTIPLY":q(a,"TEXTURE_BLEND_TYPE","TEXTURE_BLEND_TYPE_MULTIPLY")}e=A(d,null);Z(a,e,"u_colormap0");a.cn=d.diffuse_color_factor;a.Am=d.use_map_alpha? | |
d.alpha_factor:0;a.ti.set(d.scale)}x=d&&d==f;f&&(x||(e=A(f,null),Z(a,e,"u_specmap0")),a.ps=f.specular_color_factor);if(w&&(l(a,"a_normal"),l(a,"a_tangent"),a.wr=!0,e=A(w,null),Z(a,e,"u_normalmap0"),a.XD=w.normal_factor,e=w.texture,e.b4w_use_map_parallax&&va.Sn)){var g=aa.K(e.b4w_parallax_steps),C=aa.K(e.b4w_parallax_lod_dist);q(a,"PARALLAX",1);q(a,"PARALLAX_STEPS",g);q(a,"PARALLAX_LOD_DIST",C);a.ur=e.b4w_parallax_scale}D&&(e=A(D,null),Z(a,e,"u_mirrormap"),a.Vv=D.mirror_factor);if(D=d&&r&&c?1:0)e= | |
A(r,null),Z(a,e,"u_colormap1"),e=A(c,null),Z(a,e,"u_stencil0");(e=d||f||w)&&a.ti.set(e.scale);q(a,"TEXTURE_SPEC",void 0==f?0:1);q(a,"ALPHA_AS_SPEC",x?1:0);q(a,"TEXTURE_STENCIL_ALPHA_MASK",D);l(a,"a_position");l(a,"a_normal");(d||f||w)&&l(a,"a_texcoord");if(b.b4w_water){a.kk=!0;a.water_dynamic=b.b4w_water_dynamic;b.b4w_water_shore_smoothing&&!a.Ua?(ra.warn('Material: "'+b.name+'" is opaque.',"Disabling shore smoothing."),a.dy=!1):a.dy=b.b4w_water_shore_smoothing;ca(a,"special_water.glslv","special_water.glslf"); | |
D=za.nu(b.uuid,b.name,{ve:!1,en:b.diffuse_shader,Vl:b.specular_shader});a.Rb.Jj=za.Qp(D);l(a,"a_position");va.$G?(l(a,"a_polyindex"),a.Fa=!0,a.wireframe_edge_color=[0,0,0],ja.pC()?q(a,"DEBUG_WIREFRAME",1):q(a,"DEBUG_WIREFRAME",2)):q(a,"DEBUG_WIREFRAME",0);x=b.texture_slots;D=L("use_map_normal",x);e=L("use_map_mirror",x)[0];D.length&&(g=A(D[0]),Z(a,g,"u_normalmap0"),a.Rs=b.b4w_water_norm_uv_velocity);q(a,"NUM_NORMALMAPS",D.length);a.Lj=Array(D.length);for(g=0;g<D.length;g++)a.Lj[g]=new Float32Array(2), | |
a.Lj[g].set([D[g].scale[0],D[g].scale[1]]);e&&(g=A(e),Z(a,g,"u_mirrormap"),a.Vv=e.mirror_factor);e=null;if(va.pn)for(g=0;g<x.length;g++){var P=x[g];if(!0===P.texture.b4w_water_foam){e=P;break}}e?(q(a,"FOAM",1),g=A(e),Z(a,g,"u_foam"),a.mq=b.b4w_foam_factor,a.mB.set(e.texture.b4w_foam_uv_freq),a.lB.set(e.texture.b4w_foam_uv_magnitude),a.Su[0]=e.scale[0],a.Su[1]=e.scale[1]):q(a,"FOAM",0);for(g=0;g<x.length;g++)if(P=x[g],!0===P.texture.b4w_shore_dist_map){var h=P;break}h&&va.tp?(h=A(h),Z(a,h,"u_shore_dist_map"), | |
q(a,"SHORE_PARAMS",1),h=P.texture.b4w_shore_boundings,q(a,"MAX_SHORE_DIST",aa.K(P.texture.b4w_max_shore_dist)),q(a,"SHORE_MAP_SIZE_X",aa.K(h[0]-h[1])),q(a,"SHORE_MAP_SIZE_Y",aa.K(h[2]-h[3])),q(a,"SHORE_MAP_CENTER_X",aa.K((h[0]+h[1])/2)),q(a,"SHORE_MAP_CENTER_Y",aa.K((h[2]+h[3])/2))):q(a,"SHORE_PARAMS",0);if(b.b4w_generated_mesh)q(a,"GENERATED_MESH",1),a.XG=!0,a.YG=b.b4w_water_num_cascads,a.ZG=b.b4w_water_subdivs,a.WG=b.b4w_water_detailed_dist;else{l(a,"a_normal");if(e||D.length)l(a,"a_texcoord"), | |
l(a,"a_tangent"),a.wr=!0;q(a,"GENERATED_MESH",0)}if(b.b4w_water_dynamic){var P=aa.K(b.b4w_water_dst_noise_scale0),h=aa.K(b.b4w_water_dst_noise_scale1),D=aa.K(b.b4w_water_dst_noise_freq0),x=aa.K(b.b4w_water_dst_noise_freq1),e=aa.K(b.b4w_water_dir_min_shore_fac),g=aa.K(b.b4w_water_dir_freq),C=aa.K(b.b4w_water_dir_noise_scale),W=aa.K(b.b4w_water_dir_noise_freq),ia=aa.K(b.b4w_water_dir_min_noise_fac),M=aa.K(b.b4w_water_dst_min_fac),H=aa.K(b.b4w_water_waves_hor_fac);q(a,"DST_NOISE_SCALE_0",P);q(a,"DST_NOISE_SCALE_1", | |
h);q(a,"DST_NOISE_FREQ_0",D);q(a,"DST_NOISE_FREQ_1",x);q(a,"DIR_MIN_SHR_FAC",e);q(a,"DIR_FREQ",g);q(a,"DIR_NOISE_SCALE",C);q(a,"DIR_NOISE_FREQ",W);q(a,"DIR_MIN_NOISE_FAC",ia);q(a,"DST_MIN_FAC",M);q(a,"WAVES_HOR_FAC",H)}G(a,b);E(a,b);a.es.set(b.b4w_shallow_water_col);a.js.set(b.b4w_shore_water_col);a.fs=b.b4w_shallow_water_col_fac;a.ks=b.b4w_shore_water_col_fac;q(a,"ABSORB",aa.K(b.b4w_water_absorb_factor));q(a,"SSS_STRENGTH",aa.K(b.b4w_water_sss_strength));q(a,"SSS_WIDTH",aa.K(b.b4w_water_sss_width))}"HALO"=== | |
b.type&&(ca(a,"halo.glslv","halo.glslf"),v(a,b),a.Um=["a_position"]);q(a,"TEXCOORD",0);q(a,"NORMAL_TEXCOORD",0);d&&k(a,d,"TEXTURE_COLOR0_CO");r&&k(a,r,"TEXTURE_COLOR1_CO");c&&k(a,c,"TEXTURE_STENCIL_ALPHA_MASK_CO");f&&k(a,f,"TEXTURE_SPEC_CO");w&&k(a,w,"TEXTURE_NORM_CO");q(a,"SHADELESS",b.use_shadeless?1:0);a.ve=b.use_shadeless}d=b.game_settings.alpha_blend;q(a,"ALPHA","OPAQUE"===d?0:1);q(a,"ALPHA_CLIP","CLIP"===d?1:0);q(a,"DOUBLE_SIDED_LIGHTING",b.b4w_double_sided_lighting?1:0);b.use_vertex_color_paint? | |
(q(a,"VERTEX_COLOR",1),l(a,"a_color")):q(a,"VERTEX_COLOR",0);a.vk=b.ambient;a.dn=b.diffuse_intensity;a.Pk=b.emit;a.uo.set(b.specular_color);a.wx=b.specular_alpha;G(a,b);E(a,b);b.b4w_wettable?q(a,"WETTABLE",1):q(a,"WETTABLE",0);K(a,b);b.b4w_refractive&&!a.Ua?(ra.warn('Material "'+b.name+'" is not blend. Disabling refractions.'),a.fo=!1):a.fo=b.b4w_refractive;a.LE=b.b4w_refr_bump}d=!0}break;case "NODES_GLOW":d=B(a,b,"GLOW");break;case "SHADOW":if("LENS_FLARES"===b.name||b.b4w_water||b.b4w_do_not_render|| | |
"HALO"===b.type)d=!1;else if(n(a,b),a.Ua)d=!1;else{f=b.game_settings.alpha_blend;b.use_nodes&&"CLIP"==f?B(a,b,"SHADOW"):(ca(a,"shadow.glslv","shadow.glslf"),X.set(b.diffuse_color[0],b.diffuse_color[1],b.diffuse_color[2],b.alpha,a.jf));l(a,"a_position");l(a,"a_normal");q(a,"ALPHA","OPAQUE"===f?0:1);a.ti.set([1,1,1]);if((d=L("use_map_color_diffuse",b.texture_slots)[0])&&"CLIP"===f){switch(d.blend_type){case "MIX":q(a,"TEXTURE_BLEND_TYPE","TEXTURE_BLEND_TYPE_MIX");break;case "MULTIPLY":q(a,"TEXTURE_BLEND_TYPE", | |
"TEXTURE_BLEND_TYPE_MULTIPLY")}a.ti.set(d.scale);q(a,"TEXTURE_COLOR",1);l(a,"a_texcoord");if("IMAGE"==d.texture.k.source||"ENVIRONMENT_MAP"==d.texture.k.source||"CANVAS"==d.texture.k.source)f=A(d),Z(a,f,"u_colormap0");"NONE"==d.texture.k.source&&(f=A(d),Z(a,f,"u_colormap0"))}else q(a,"TEXTURE_COLOR",0);d=!0}break;case "PHYSICS":b.b4w_collision?(a.Fo=b.b4w_use_ghost,a.kb=b.b4w_collision_id,a.Rm=b.b4w_collision_margin,a.Pm=b.b4w_collision_group,a.Sm=b.b4w_collision_mask,a.sn=b.physics.friction,a.kn= | |
b.physics.elasticity,d=!0):b.b4w_water?(a.kk=!0,a.ZS=b.b4w_water_dynamic,a.dst_noise_scale0=b.b4w_water_dst_noise_scale0,a.dst_noise_scale1=b.b4w_water_dst_noise_scale1,a.dst_noise_freq0=b.b4w_water_dst_noise_freq0,a.dst_noise_freq1=b.b4w_water_dst_noise_freq1,a.dir_min_shore_fac=b.b4w_water_dir_min_shore_fac,a.dir_freq=b.b4w_water_dir_freq,a.dir_noise_scale=b.b4w_water_dir_noise_scale,a.dir_noise_freq=b.b4w_water_dir_noise_freq,a.dir_min_noise_fac=b.b4w_water_dir_min_noise_fac,a.dst_min_fac=b.b4w_water_dst_min_fac, | |
a.waves_hor_fac=b.b4w_water_waves_hor_fac,d=!0):d=!1;break;case "COLOR_ID":if("LENS_FLARES"===b.name||"HALO"===b.type)d=!1;else{n(a,b);a.Ah=fa.zg;a.Fa=!0;a.Ua=!1;f=b.game_settings.alpha_blend;a.zh=b.b4w_render_above_all&&"OPAQUE"!=f&&"CLIP"!=f;b.use_nodes&&"CLIP"==f?B(a,b,"COLOR_ID"):(ca(a,"color_id.glslv","color_id.glslf"),X.set(b.diffuse_color[0],b.diffuse_color[1],b.diffuse_color[2],b.alpha,a.jf));l(a,"a_position");q(a,"ALPHA","OPAQUE"===f?0:1);a.ti.set([1,1,1]);if((d=L("use_map_color_diffuse", | |
b.texture_slots)[0])&&"CLIP"===f){switch(d.blend_type){case "MIX":q(a,"TEXTURE_BLEND_TYPE","TEXTURE_BLEND_TYPE_MIX");break;case "MULTIPLY":q(a,"TEXTURE_BLEND_TYPE","TEXTURE_BLEND_TYPE_MULTIPLY")}a.ti.set(d.scale);q(a,"TEXTURE_COLOR",1);l(a,"a_texcoord");if("IMAGE"==d.texture.k.source||"ENVIRONMENT_MAP"==d.texture.k.source)f=A(d),Z(a,f,"u_colormap0");"NONE"==d.texture.k.source&&(f=A(d),Z(a,f,"u_colormap0"))}else q(a,"TEXTURE_COLOR",0);d=!0}break;case "GRASS_MAP":!b.b4w_terrain||b.b4w_do_not_render? | |
d=!1:(n(a,b),a.Ua=!1,a.Ah=fa.zg,a.Fa=!0,ca(a,"grass_map.glslv","grass_map.glslf"),l(a,"a_position"),d=b.b4w_dynamic_grass_size?b.b4w_dynamic_grass_size:null,f=b.b4w_dynamic_grass_color?b.b4w_dynamic_grass_color:null,a.wc.a_grass_size={oj:!0,src:[]},d?(a.wc.a_grass_size.src.push({name:d,Se:4}),q(a,"DYNAMIC_GRASS_SIZE",1)):q(a,"DYNAMIC_GRASS_SIZE",0),a.wc.a_grass_color={oj:!0,src:[]},f?(a.wc.a_grass_color.src.push({name:f,Se:7}),q(a,"DYNAMIC_GRASS_COLOR",1)):q(a,"DYNAMIC_GRASS_COLOR",0),d=!0);break; | |
case "WIREFRAME":"LENS_FLARES"===b.name||b.b4w_water||b.b4w_do_not_render||"HALO"===b.type?d=!1:(ca(a,"wireframe.glslv","wireframe.glslf"),l(a,"a_position"),l(a,"a_normal"),l(a,"a_polyindex"),a.Fa=!0,a.wireframe_mode=0,a.wireframe_edge_color=[0,0,0],d=!0);break;case "PARTICLES":a:if(b.b4w_do_not_render)d=!1;else{d=b.texture_slots;if(a.ov)ca(a,"particle_system.glslv","particle_system_stack.glslf"),q(a,"HALO_PARTICLES",1),v(a,b);else{f={ve:!1,en:b.diffuse_shader,Vl:b.specular_shader};if(b.use_nodes){ca(a, | |
"particle_system.glslv","particle_system.glslf");B(a,b,"PARTICLES");d=!0;break a}ca(a,"particle_system.glslv","particle_system_stack.glslf");f=za.nu(b.uuid,b.name,f);a.Rb.Jj=za.Qp(f);if(d=L("use_map_color_diffuse",d)[0]){q(a,"TEXTURE_COLOR",1);switch(d.blend_type){case "MIX":q(a,"TEXTURE_BLEND_TYPE","TEXTURE_BLEND_TYPE_MIX");break;case "MULTIPLY":q(a,"TEXTURE_BLEND_TYPE","TEXTURE_BLEND_TYPE_MULTIPLY")}a.cn=d.diffuse_color_factor;a.Am=d.use_map_alpha?d.alpha_factor:0;d=A(d);Z(a,d)}}X.set(b.diffuse_color[0], | |
b.diffuse_color[1],b.diffuse_color[2],b.alpha,a.jf);a.vk=b.ambient;a.dn=b.diffuse_intensity;a.Pk=b.emit;a.uo.set(b.specular_color);a.wx=b.specular_alpha;l(a,"a_position");l(a,"a_normal");d=b.game_settings.alpha_blend;q(a,"ALPHA","OPAQUE"===d?0:1);q(a,"ALPHA_CLIP","CLIP"===d?1:0);q(a,"PARTICLES_SHADELESS",b.use_shadeless?1:0);G(a,b);E(a,b);n(a,b);d=b.game_settings.alpha_blend;a.zh=b.b4w_render_above_all&&"OPAQUE"!=d&&"CLIP"!=d;a.Mj=b.offset_z;d=!0}break;default:throw"Wrong batch type: "+a.type;}return d} | |
function v(a,b){var d=b.halo;q(a,"NUM_RINGS",d.ring_count);q(a,"NUM_LINES",d.line_count);q(a,"NUM_STARS",d.star_tip_count);q(a,"SKY_STARS",b.b4w_halo_sky_stars?1:0);a.IC=d.size;a.FC=d.hardness/20;a.HC.set(d.b4w_halo_rings_color);a.GC.set(d.b4w_halo_lines_color);a.JC=1/b.b4w_halo_stars_blend_height;a.KC=b.b4w_halo_stars_min_height;a.EC=!0}function k(a,b,d){switch(b.texture_coords){case "UV":case "ORCO":q(a,d,"TEXTURE_COORDS_UV_ORCO");q(a,"TEXCOORD",1);break;case "NORMAL":q(a,d,"TEXTURE_COORDS_NORMAL"); | |
q(a,"NORMAL_TEXCOORD",1);break;default:q(a,d,0)}}function n(a,b){var d=b.game_settings,c=d.alpha_blend;switch(c){case "ALPHA_SORT":a.Ua=!0;a.Ah=fa.hz;a.Fa=!0;a.Mi=!1;break;case "ALPHA":a.Ua=!0;a.Ah=fa.zg;a.Fa=!0;a.Mi=!1;break;case "CLIP":a.Ua=!1;a.Ah=fa.zg;a.Fa=!0;a.Mi=!0;break;case "ADD":a.Ua=!0;a.Ah=fa.zg;a.Fa=!1;a.Mi=!1;break;case "OPAQUE":a.Ua=!1;a.Ah=fa.zg;a.Fa=!0;a.Mi=!1;break;default:throw Error("Unknown alpha blend mode: "+c);}a.Bb=d.use_backface_culling}function A(a,b){var d=a.texture,c= | |
d.k,d=d.image;c&&b&&d&&Y.Ao(c,b,d.Vd,d.filepath);return c}function L(a,b){for(var d=[],c=b.length,l=0;l<c;l++){var q=b[l];1==q[a]&&q.texture&&q.texture.k&&d.push(q)}return d}function K(a,b){var d=b.raytrace_transparency;a.nj[0]=d.fresnel;a.nj[1]=1-d.fresnel_factor/5;d=b.raytrace_mirror;a.Jr=d.reflect_factor;a.nj[2]=d.fresnel;a.nj[3]=1-d.fresnel_factor/5}function G(a,b){var d,c=0;switch(b.specular_shader){case "PHONG":case "COOKTORR":d=b.specular_hardness;break;case "WARDISO":d=b.specular_slope;break; | |
case "TOON":d=b.specular_toon_size;c=b.specular_toon_smooth;break;case "BLINN":d=b.specular_ior;c=b.specular_hardness;break;default:ra.error("unsupported specular shader: "+b.specular_shader+' (material "'+b.name+'")'),d=b.specular_hardness}a.Ul[0]=b.specular_intensity;a.Ul[1]=d;a.Ul[2]=c}function E(a,b){switch(b.diffuse_shader){case "LAMBERT":a.ae[0]=0;a.ae[1]=0;break;case "OREN_NAYAR":a.ae[0]=b.roughness;a.ae[1]=0;break;case "FRESNEL":a.ae[0]=b.diffuse_fresnel;a.ae[1]=b.diffuse_fresnel_factor;break; | |
case "MINNAERT":a.ae[0]=b.darkness;a.ae[1]=0;break;case "TOON":a.ae[0]=b.diffuse_toon_size;a.ae[1]=b.diffuse_toon_smooth;break;default:ra.error("unsupported diffuse shader: "+b.diffuse_shader+' (material "'+b.name+'")'),a.ae[0]=0,a.ae[1]=0}}function B(a,b,d){if(!b.use_nodes||b.b4w_do_not_render)return!1;var c;switch(d){case "MAIN":ca(a,"main.glslv","main.glslf");c=!1;break;case "GLOW":ca(a,"main.glslv","main.glslf");c=!0;break;case "SHADOW":ca(a,"shadow.glslv","shadow.glslf");c=!1;break;case "COLOR_ID":ca(a, | |
"color_id.glslv","color_id.glslf"),c=!1}var e=b.node_tree;d=za.LK(e,b.uuid,!1,b.name,d);if(!d)return ra.error('Failed to create node graph for material "'+b.name+'", disable nodes'),I(a,b),!0;a.Cn=!0;q(a,"NODES",1);q(a,"DOUBLE_SIDED_LIGHTING",b.b4w_double_sided_lighting?1:0);l(a,"a_position");b.use_orco_tex_coord&&l(a,"a_orco_tex_coord");n(a,b);a.Mj=b.offset_z;var r=b.game_settings.alpha_blend;c?(q(a,"ALPHA",1),q(a,"ALPHA_CLIP",0)):(q(a,"ALPHA","OPAQUE"===r?0:1),q(a,"ALPHA_CLIP","CLIP"===r?1:0)); | |
a.zh=b.b4w_render_above_all&&"OPAQUE"!=r&&"CLIP"!=r;X.set(b.diffuse_color[0],b.diffuse_color[1],b.diffuse_color[2],b.alpha,a.jf);a.Pk=b.emit;a.vk=b.ambient;K(a,b);b.b4w_wettable?q(a,"WETTABLE",1):q(a,"WETTABLE",0);var f=[],w=[],D=!1;U.ia(d,function(d,c){switch(c.type){case "UVMAP":case "TEX_COORD_UV":case "GEOMETRY_UV":case "UV_MERGED":var e=c.data.name,r=c.data.value;a.hk||(a.hk={});a.hk[r]=e;break;case "GEOMETRY_VC":case "GEOMETRY_VC1":case "GEOMETRY_VC2":case "GEOMETRY_VC3":e=c.data.name;a.wc[e]= | |
{oj:!0,src:[{name:c.data.value}]};r=0;if("GEOMETRY_VC"==c.type)r=7;else for(var g=0;g<c.Na.length;g++){var x="RGB".indexOf(c.Na[g].identifier);-1<x&&(r|=1<<2-x)}a.wc[e].src[0].Se=r;break;case "TEX_COORD_NO":case "GEOMETRY_NO":l(a,"a_normal");break;case "MATERIAL_BEGIN":l(a,"a_normal");D=!0;break;case "TEXTURE_COLOR":case "TEXTURE_ENVIRONMENT":e=c.data.name;r=c.data.value;if(!r.k){ra.warn('Wrong texture "'+c.data.value.name+'" in material "'+b.name+'".');I(a,b);break}!1!==r.k.sp&&(r.k.sp="TEXTURE_ENVIRONMENT"!= | |
c.type?!0:!1);Z(a,r.k,e);break;case "TEXTURE_NORMAL":case "B4W_PARALLAX":q(a,"CALC_TBN_SPACE",1);l(a,"a_normal");l(a,"a_tangent");a.wr=!0;e=c.data.name;r=c.data.value;r.k.sp=!1;Z(a,r.k,e);break;case "LAMP":c.data&&(a.nl=c.data);break;case "B4W_REFRACTION":a.Ua?a.fo=!0:(a.fo=!0,ra.warn('Material "'+b.name+'" is not blend. Disabling refractions.'));break;case "VALTORGB":f.push(c);break;case "CURVE_VEC":case "CURVE_RGB":w.push(c);break;case "PARTICLE_INFO":"PARTICLES"==a.type&&c.data&&(a.mw=c.data)}}); | |
var g=0,x=r=null,k=f.length+w.length;if(f.length)for(r=Y.UK(f,Y.lH),c=0;c<f.length;c++)f[c].Wa=[["NODE_TEX_ROW",aa.K((g+.5)/k)]],g++;if(w.length)for(x=Y.wL(w,Y.uy),c=0;c<w.length;c++){w[c].Wa=[["NODE_TEX_ROW",aa.K((g+.5)/k)]];g++;var h=w[c].data.value;"CURVE_RGB"==h.type?(C(h,0,0)&&w[c].Wa.push(["READ_R",1]),C(h,1,0)&&w[c].Wa.push(["READ_G",1]),C(h,2,0)&&w[c].Wa.push(["READ_B",1]),C(h,3,0)&&w[c].Wa.push(["READ_A",1])):"CURVE_VEC"==h.type&&(C(h,0,-1)&&w[c].Wa.push(["READ_R",1]),C(h,1,-1)&&w[c].Wa.push(["READ_G", | |
1]),C(h,2,-1)&&w[c].Wa.push(["READ_B",1]))}c=null;r&&x?(c=new Uint8Array(r.length+x.length),c.set(r),c.set(x,r.length)):c=r?r:x;c&&H(a,c,"u_nodes_texture",Y.uy);D||(a.ve=!0);d=a.Rb.Jj=za.Qp(d);y(e,a,b.name);e=a.zl;r=a.yl;for(c=0;c<d.length;c++)switch(x=d[c],x.id){case "VALUE":if(g=x.vr[0])for(k=0;k<e.length;k+=2)if(e[k]==g){x.Wa.push(["VALUE_IND",e[k+1]]);break}break;case "RGB":if(g=x.vr[0])for(k=0;k<r.length;k+=2)if(r[k]==g){x.Wa.push(["RGB_IND",r[k+1]]);break}}q(a,"NUM_VALUES",a.Kj.length);q(a, | |
"NUM_RGBS",a.he.length);return!0}function y(a,b,d){var c=[],l=[],q=[],e=[],r=[],f=[];Q(a,d,a.animation_data,c,l,q,e,r,f);b.Kj=c;b.zl=l;b.TD=q;b.he=e;b.yl=r;b.UD=f}function Q(a,c,l,q,e,r,f,w,D){for(var g=0;g<a.nodes.length;g++){var x=a.nodes[g];if("VALUE"==x.type){var k=d(c,x.name);q.push(x.outputs[0].default_value);e.push(k,e.length/2)}else"RGB"==x.type?(k=d(c,x.name),x=x.outputs[0].default_value.slice(0,3),f.push(x[0],x[1],x[2]),w.push(k,w.length/2)):"GROUP"==x.type&&(k=x.node_group.node_tree,Q(k, | |
d(c,x.name),k.animation_data,q,e,r,f,w,D))}if(l)for((a=l.action)&&a.k.type==Aa.sy&&b(a,c,r,e,D,w),l=l.nla_tracks,q=0;q<l.length;q++)for(f=l[q].strips,g=0;g<l[q].strips.length;g++)(a=f[g].action)&&a.k.type==Aa.sy&&b(a,c,r,e,D,w)}function b(a,b,c,l,q,e){var r=a.k.P,f;for(f in r){var w=d(b,f.match(/"(.*?)"/)[1]),r=x(l,w);null!=r?(w=d(a.name,f),c.push(w,r)):(r=x(e,w),null!=r&&(w=d(a.name,f),q.push(w,r)))}}function d(a,b){return a+"%join%"+b}function x(a,b){for(var d=0;d<a.length;d+=2)if(a[d]==b)return a[d+ | |
1];return null}function C(a,b,d){a=a.curve_mapping.curves_data[b];return 2==a.length&&a[0][0]<d+.01&&a[0][1]<d+.01&&.99<a[1][0]&&.99<a[1][1]?!1:!0}function H(a,b,d,c){var l={texture:Y.xB("NODE_TEX",null)};b=A(l,{width:c,height:b.length/(4*c),data:b});Z(a,b,d)}function I(a,b){switch(a.type){case "SHADOW":ca(a,"shadow.glslv","shadow.glslf");break;case "COLOR_ID":ca(a,"color_id.glslv","color_id.glslf");break;default:ca(a,"main.glslv","main_stack.glslf")}q(a,"SHADELESS",1);l(a,"a_position");l(a,"a_normal"); | |
X.set(1,0,1,1,a.jf);if(b){var d=b.game_settings.alpha_blend;q(a,"ALPHA","OPAQUE"===d?0:1);q(a,"ALPHA_CLIP","CLIP"===d?1:0);q(a,"VERTEX_COLOR",0);a.Mj=b.offset_z;n(a,b)}return!0}function O(a,b){if("PHYSICS"!==a.type){"DYNAMIC"==b.type?(b.Rq?q(a,"AU_QUALIFIER","attribute"):q(a,"AU_QUALIFIER","uniform"),q(a,"STATIC_BATCH",0)):(q(a,"AU_QUALIFIER","attribute"),q(a,"STATIC_BATCH",1));"WIREFRAME"==a.type&&(ja.pC()?q(a,"WIREFRAME_QUALITY",1):q(a,"WIREFRAME_QUALITY",0),a.dj?(q(a,"DEBUG_SPHERE",1),a.QA?q(a, | |
"DEBUG_SPHERE_DYNAMIC",1):q(a,"DEBUG_SPHERE_DYNAMIC",0)):q(a,"DEBUG_SPHERE",0),q(a,"ALPHA",1));b.Ef&&(a.Ef=b.Ef);b.xe?(""!==b.$g?(a.wc.a_bending_col_main={oj:!0,src:[{name:b.$g,Se:4}]},l(a,"a_bending_col_main"),""!==b.Wc.tD&&""!==b.Wc.sD&&""!==b.Wc.hE?(a.wc.a_bending_col_detail={oj:!0,src:[{name:b.Wc.tD,Se:4},{name:b.Wc.sD,Se:2},{name:b.Wc.hE,Se:1}]},l(a,"a_bending_col_detail"),l(a,"a_normal"),q(a,"DETAIL_BEND",1)):q(a,"DETAIL_BEND",0),q(a,"MAIN_BEND_COL",1)):q(a,"MAIN_BEND_COL",0),q(a,"WIND_BEND", | |
1)):q(a,"WIND_BEND",0);b.Gp?q(a,"BEND_CENTER_ONLY",1):q(a,"BEND_CENTER_ONLY",0);q(a,"BILLBOARD_PRES_GLOB_ORIENTATION",b.Gt|0);b.ff?q(a,"BILLBOARD",1):q(a,"BILLBOARD",0);b.ff&&b.Rq?q(a,"HAIR_BILLBOARD",1):q(a,"HAIR_BILLBOARD",0);b.Dm?q(a,"BILLBOARD_SPHERICAL",1):q(a,"BILLBOARD_SPHERICAL",0);switch(b.Em){case "RANDOM":q(a,"BILLBOARD_RANDOM",1);q(a,"BILLBOARD_JITTERED",0);break;case "JITTERED":q(a,"BILLBOARD_RANDOM",0);q(a,"BILLBOARD_JITTERED",1);break;default:q(a,"BILLBOARD_RANDOM",0),q(a,"BILLBOARD_JITTERED", | |
0)}b.Bc&&va.tp?q(a,"DYNAMIC_GRASS",1):q(a,"DYNAMIC_GRASS",0);a.Bc=b.Bc;"PARTICLES"!=a.type&&(a.Xf=b.Xf);a.pe=b.pe;a.Kd=b.Kd;a.Ld=b.Ld&&!a.ve&&!(a.Ua&&va.Fu);a.kd=b.kd;a.Zc=b.Zc;a.Gd=b.Gd;b.kl?(l(a,"a_influence"),q(a,"SKINNED",1),va.pt?(q(a,"DISABLE_TANGENT_SKINNING",1),q(a,"FRAMES_BLENDING",0)):(q(a,"DISABLE_TANGENT_SKINNING",0),b.rn?q(a,"FRAMES_BLENDING",1):q(a,"FRAMES_BLENDING",0)),q(a,"MAX_BONES",b.ah)):(q(a,"SKINNED",0),q(a,"FRAMES_BLENDING",0),q(a,"DISABLE_TANGENT_SKINNING",0));b.Qc?(q(a,"VERTEX_ANIM", | |
1),va.OG?q(a,"VERTEX_ANIM_MIX_NORMALS_FACTOR",.5):q(a,"VERTEX_ANIM_MIX_NORMALS_FACTOR","u_va_frame_factor")):q(a,"VERTEX_ANIM",0);if(b.kl&&b.Qc)throw"Skinning and vertex animation are mutually exlusive";b.eq?q(a,"DISABLE_FOG",1):q(a,"DISABLE_FOG",0)}}function M(a,b,d){if(b.length){for(var c=la.vq(b,va.Md&&d.b4w_enable_ssao),l=a.Rb,q=0,e=0;e<a.Rb.Jj.length;e++){var r=a.Rb.Jj[e];if("LIGHTING_LAMP"==r.id){var f=b[q++%b.length],w=f.hc;"AREA"==w.type&&(f=b[q++%b.length],w=f.hc);var D=la.bb(f,d);if("SPOT"== | |
w.type||"POINT"==w.type)var x=Math.cos(w.Wl/2);if("SPOT"==w.type)var g=w.qs*(1-x);D=D.Cj;f=c.indexOf(f);r.Wa=[["LAMP_TYPE",w.type],["LAMP_IND",D],["LAMP_LIGHT_FACT_IND",Math.floor(D/2)],["LAMP_FAC_CHANNELS",0==D%2?"rg":"ba"],["LAMP_SPOT_SIZE",aa.K(x||.01)],["LAMP_SPOT_BLEND",aa.K(g||.01)],["LAMP_LIGHT_DIST",aa.K(w.distance)],["LAMP_SHADOW_MAP_IND",f]]}}if(a.nl){d=0;for(var k in a.nl)d++;a.Gv=new Float32Array(3*d);a.Ev=new Float32Array(3*d);a.Dv=new Float32Array(3*d);a.Fv=new Float32Array(4*d);aa.R(l, | |
"NUM_LAMP_LIGHTS",d);for(e=0;e<b.length;e++)F(a,b[e])}}}function F(a,b){if(b.zi in a.nl){var d=a.nl[b.zi],c=sa.m(b.g.i);a.Gv.set(c,3*d);a.Ev.set(b.hc.direction,3*d);a.Dv.set(b.hc.Tm,3*d);var c=Ea,l=b.hc;c[0]=-1;c[1]=-1;c[2]=-1;c[3]=l.gk?1:0;switch(l.type){case "POINT":c[2]=l.distance;break;case "SPOT":c[2]=l.distance;var q=c[0]=Math.cos(l.Wl/2);c[1]=l.qs*(1-q)}a.Fv.set(c,4*d)}}function l(a,b){var d=a.Um;-1==d.indexOf(b)&&d.push(b)}function q(a,b,d){aa.R(a.Rb,b,d)}function D(a,b){if("PHYSICS"==a.type)0< | |
b.Ea.length&&fa.tR(b,b.H[0]),a.re=b;else{var d=a.Ah,c=a.Rh;a.EC&&"PARTICLES"!=a.type&&(b=fa.oM(b));a.XG&&(b=S.YM(a.YG,a.ZG,a.WG));d=fa.vR(b,d,c,a.wc);a.pa=d;a.Xf||d.Kq||a.Ef||(d.vj=null,d.md=null);d=b.H.length;a.hw=b.ma*d;a:switch(a.Rh){case fa.um:case fa.Vo:case fa.Uo:c=!0;break a;default:c=!1}c?fa.hO(b)?a.Nn=b.Ta.length/3*d:a.Nn=b.ma/3*d:a.Nn=0}}function r(a,b,d,c,l,q,e,r,f,D,x,g){var k=a.ya,C=[],n=r.b4w_dynamic_grass;if(!D&&n)return C;for(var W="INSTANCE"==r.b4w_wind_bend_inheritance,ia="INSTANCE"== | |
r.b4w_shadow_inheritance,M="INSTANCE"==r.b4w_reflection_inheritance,H=[],p=[],m=0;m<l.length;m++){var I=l[m].ya.g,F=N.Om(b);F.ff=r.b4w_hair_billboard;F.Em=r.b4w_hair_billboard_type;F.Dm="SPHERICAL"==r.b4w_hair_billboard_geometry;F.Bc=n;F.Rq=!0;W?(F.xe=I.xe,F.No=I.No,F.yh=I.yh,F.Jg=I.Jg,F.$g=I.$g,F.Ig=I.Ig,F.Dg=I.Dg,F.ug=I.ug,F.Wc=I.Wc,F.Gp=!1):(F.xe=k.g.xe,F.No=k.g.No,F.yh=k.g.yh,F.Jg=k.g.Jg,F.$g=k.g.$g,F.Ig=k.g.Ig,F.Dg=k.g.Dg,F.ug=k.g.ug,F.Wc=k.g.Wc,F.Gp=!0);ia?(F.pe=I.pe,F.Kd=I.Kd,F.Ld=I.Ld):(F.pe= | |
k.g.pe,F.Kd=k.g.Kd,F.Ld=k.g.Ld);M?(F.kd=I.kd,F.Zc=I.Zc,F.Gd=I.Gd,F.Fe=I.Fe,F.je=I.je,F.ig=I.ig):(F.kd=k.g.kd,F.Zc=k.g.Zc,F.Gd=k.g.Gd,F.Fe=k.g.Fe,F.je=k.g.je,F.ig=k.g.ig);H.push(F);var v=e[m];v||(v=new Float32Array);g&&N.Lq(f.seed,x);var y=new Float32Array(3),Z=new Float32Array([0,0,0,1]),J=[],ba=Fa.iA(va.Ov)&&!r.b4w_initial_rand_rotation&&!r.b4w_hair_billboard,A=4;ba&&(A=8);for(var Da=0;Da<v.length;Da+=A){y[0]=v[Da];y[1]=v[Da+1];y[2]=v[Da+2];var t=v[Da+3]*sa.qc(I.i);if(r.b4w_initial_rand_rotation){switch(r.b4w_rotation_type){case "XYZ":var B= | |
new Float32Array([N.Xe(x),N.Xe(x),N.Xe(x)]);qa.normalize(B,B);break;case "Z":B=new Float32Array([0,1,0]);break;default:throw"Unsupported random rotation type: "+r.b4w_rotation_type;}ea.setAxisAngle(B,r.b4w_rand_rotation_strength*(2*Math.PI*N.Xe(x)-Math.PI),Z)}else if(ba&&(Z.set(v.subarray(Da+4,Da+8)),N.zw(Z,Z),!r.use_whole_group))if(r.use_rotation_dupli){var ka=sa.v(I.i);ea.multiply(Z,ka,Z)}else ea.multiply(Z,Ia,Z);var Q=sa.yf(y,t,Z,sa.create());J.push(Q)}p.push(J)}for(var ta={},m=0;m<l.length;m++){var R= | |
l[m],z=q[m],F=H[m],yb={};F.xe&&(yb.au_wind_bending_amp=[F.ug],yb.au_wind_bending_freq=[F.yh],yb.au_detail_bending_freq=[F.Jg],yb.au_detail_bending_amp=[F.Ig],yb.au_branch_bending_amp=[F.Dg],F.ug=0,F.yh=0,F.Jg=0,F.Ig=0,F.Dg=0);var Pa=V(F),J=p[m];if(J.length)for(var na=R.data,S=na.materials,E=Array(S.length),Da=0;Da<S.length;Da++)if(!fa.MC(na,Da))for(var L=0;L<z.length;L++){var da=z[L],u=h(da),pa=S[Da];"COLOR_ID"==da&&(u.Tt=!(R.b4w_do_not_render||pa.b4w_do_not_render));"MAIN"==da&&(E[Da]=u);if(w(u, | |
pa)){"SHADOW"==da&&E[Da]&&(u.ve=E[Da].ve);u.Rh=fa.um;O(u,F);u.Bl=r.uuid;"JITTERED"==r.b4w_hair_billboard_type&&(u.lD=r.b4w_hair_billboard_jitter_amp,u.mD=r.b4w_hair_billboard_jitter_freq);n&&(u.BC=r.b4w_dynamic_grass_scale_threshold);W||(delete u.wc.a_bending_col_main,delete u.wc.a_bending_col_detail);P(u,Pa);var G=fa.hB(na,Da,u.Um,b.Dk,u.wc,u.hk),ha=fa.RO(G,yb,J),ca=ha,K=J;ca.U.au_center_pos=new Float32Array(3*ca.ma);for(var X=K.length,U=ca.ma/X,ja=0;ja<X;ja++)for(var Ba=K[ja],la=3*U*ja,za=0;za< | |
U;za++)ca.U.au_center_pos[la+3*za]=Ba[0],ca.U.au_center_pos[la+3*za+1]=Ba[1],ca.U.au_center_pos[la+3*za+2]=Ba[2];ha=ca;if(F.xe&&F.Gp){var Ea=ha,Y=k.g.i;Ea.U.a_emitter_center=new Float32Array(3*Ea.ma);var ga=qa.fromValues(0,0,0);sa.bc(ga,Y,ga);for(var aa=0;aa<Ea.ma;aa++)Ea.U.a_emitter_center[3*aa]=ga[0],Ea.U.a_emitter_center[3*aa+1]=ga[1],Ea.U.a_emitter_center[3*aa+2]=ga[2];ha=Ea}var oa=r.b4w_vcol_from_name,xa=r.b4w_vcol_to_name,Aa=u,nb=d,Ob=!W,sc=na,Ub=[];if(""!==oa&&""!==xa){var Ab,Bb=xa,Vb=Aa.wc, | |
Gc=[],oc=void 0;for(oc in Vb)for(var tb=Vb[oc].src,ob=0,Ta=0;Ta<tb.length;Ta++){var cb=tb[Ta].Se;Bb==tb[Ta].name&&Gc.push(oc,cb,ob);ob+=N.Xj(cb)}Ab=Gc;if(0<Ab.length)for(var Ga=0;Ga<Ab.length;Ga+=3)Ub.push({ln:oa,iq:7,xr:Ab[Ga],yr:Ab[Ga+1],fq:Ab[Ga+2]});else fa.IN(Aa.Um,"a_color")&&xa==sc.active_vcol_name&&Ub.push({ln:oa,iq:7,xr:"a_color",yr:7,fq:0})}Ob&&("a_bending_col_main"in nb&&Ub.push({ln:"a_bending_col_main",iq:4,xr:"a_bending_col_main",yr:4,fq:0}),"a_bending_col_detail"in nb&&Ub.push({ln:"a_bending_col_detail", | |
iq:7,xr:"a_bending_col_detail",yr:7,fq:0}));for(var Cb=ha,fb=J,Db=c,pb=Ub,Kb=u.wc,dc=!1,qb=0;qb<pb.length;qb++){var vc=pb[qb].ln,Fb=Db.U[vc];if(Fb&&0<Fb.length){dc=!0;break}}if(dc){var ec,Va=k.g.zc,Xa=Db.H[0].a_position,Ua=fb,Ca=ta,Pb=new Float32Array(3),ib=new Float32Array(3),rb=new Uint32Array(Ua.length);if(!("verts_indices"in Ca)){Ca.Fg=new Float32Array(3);Ca.Bg=new Float32Array(3);Ca.by=new Uint32Array(Xa.length/3);Ca.On=new Uint32Array(Xa.length/3);Ca.Fg[0]=(Va.max_x-Va.min_x)/20;Ca.Fg[1]=(Va.max_y- | |
Va.min_y)/20;Ca.Fg[2]=(Va.max_z-Va.min_z)/20;Ca.Bg[0]=Va.min_x;Ca.Bg[1]=Va.min_y;Ca.Bg[2]=Va.min_z;for(var Ka=0;Ka<Xa.length/3;Ka++){var wc=N.trunc((Xa[3*Ka]-Ca.Bg[0])/Ca.Fg[0]),gb=N.trunc((Xa[3*Ka+1]-Ca.Bg[1])/Ca.Fg[1]),Ja=N.trunc((Xa[3*Ka+2]-Ca.Bg[2])/Ca.Fg[2]),wc=N.J(wc,0,19),gb=N.J(gb,0,19),Ja=N.J(Ja,0,19);Ca.by[Ka]=Ka;Ca.On[Ka]=Ja*Math.pow(20,2)+20*gb+wc}fa.KF(Ca.On,Ca.by,fa.ht,!0);Ca.ik=new Uint32Array(Math.pow(20,3));for(Ka=0;Ka<Ca.On.length;Ka++)Ca.ik[Ca.On[Ka]]++;delete Ca.On;for(Ka=1;Ka< | |
Ca.ik.length;Ka++)Ca.ik[Ka]+=Ca.ik[Ka-1]}for(var ub=0;ub<Ua.length;ub++){Pb[0]=Ua[ub][0];Pb[1]=Ua[ub][1];Pb[2]=Ua[ub][2];for(var pc=1E10,Ya=-1,Gb=N.trunc((Pb[0]-Ca.Bg[0])/Ca.Fg[0]),Lb=N.trunc((Pb[1]-Ca.Bg[1])/Ca.Fg[1]),ab=N.trunc((Pb[2]-Ca.Bg[2])/Ca.Fg[2]),Gb=N.J(Gb,0,19),Lb=N.J(Lb,0,19),ab=N.J(ab,0,19),vb=ab*Math.pow(20,2)+20*Lb+Gb,wb=Ca.ik[vb],Ra=0==vb?0:Ca.ik[vb-1];Ra<wb;Ra++){var jb=Ca.by[Ra];ib[0]=Xa[3*jb];ib[1]=Xa[3*jb+1];ib[2]=Xa[3*jb+2];qa.sub(ib,Pb,ib);var Qb=qa.sqrLen(ib);Qb<=pc&&(pc=Qb, | |
Ya=jb)}if(-1==Ya)for(Ra=0;Ra<Xa.length/3;Ra++)ib[0]=Xa[3*Ra],ib[1]=Xa[3*Ra+1],ib[2]=Xa[3*Ra+2],qa.sub(ib,Pb,ib),Qb=qa.sqrLen(ib),Qb<=pc&&(pc=Qb,Ya=Ra);rb[ub]=Ya}ec=rb;for(var Hc=Cb.ma/fb.length,qb=0;qb<pb.length;qb++){var db=pb[qb].xr,Wb=pb[qb].yr,vc=pb[qb].ln,fc=pb[qb].iq,Fb=Db.U[vc];switch(db){case "a_bending_col_main":var Xb=1;break;case "a_bending_col_detail":Xb=3;break;case "a_color":Xb=3;break;default:for(var Yb=Xb=0;Yb<Kb[db].src.length;Yb++)Xb+=N.Xj(Kb[db].src[Yb].Se)}if(Fb&&0<Fb.length){var ad= | |
N.Xj(fc),Wa=N.Xj(Wb),Na=fc&Wb,Mb=N.SE(Na);Na!=Wb&&ra.error("Wrong color extraction from "+vc+" to "+db+".");if("a_bending_col_main"==db||"a_bending_col_detail"==db)Cb.U[db]=new Float32Array(Cb.ma*Wa);for(Yb=0;Yb<fb.length;Yb++){var gc=ec[Yb],hc=gc*ad,ic=Yb*Hc*Xb;if(-1!=gc)for(var Sb=0;Sb<Hc;Sb++)for(var Zb=Sb*Xb,jc=0;jc<Mb.length;jc++)Mb[jc]&&(Cb.U[db][ic+Zb+(pb[qb].fq+N.ko(Wb,jc))]=Fb[hc+N.ko(fc,jc)])}}else Cb.U[db]=new Float32Array(0)}}ha=Cb;C.push({I:u,re:ha,Ad:[pa.name],g:F,me:[a]})}}}return C} | |
function w(a,b){var d=!0;"NODES_GLOW"==a.type&&(d=za.gA(b));return d=d&&f(a,b)}function P(a,b){for(var d=null,c=null,l=0;l<a.ba.length;l++){var q=a.ba[l].Yd;q&&(d||(d={}),d[l]=q,a.ba[l].Yd=null);if(q=a.ba[l].ua)c||(c={}),c[l]=q,a.ba[l].ua=null}a.id=0;a.RP=b;a.id=N.Uz(a,b);if(d)for(var e in d)a.ba[e].Yd=d[e];if(c)for(e in c)a.ba[e].ua=c[e]}function V(a){var b=a.Ce;a.Ce=null;var d=N.Uz(a,0);a.Ce=b;return d}function R(a,b,d,c,l){var q=h("WIREFRAME");ca(q,"wireframe.glslv","wireframe.glslf");q.wireframe_mode= | |
0;q.dj=!0;q.Fa=!0;q.Bl=d;l&&(q.QA=!0);O(q,b);b=V(b);P(q,b);c?(c=l?a.N:[0,0,0],b=S.$u(1,c),d=[qa.length(a.Qf),qa.length(a.Rf),qa.length(a.Sf)],fa.WE(b,d,c),l||(sa.Jd(a.N,Da),sa.lg(a.quat,Da),sa.ld(1,Da),fa.Cx(b,Da))):b=S.$u(a.ib,a.N);fa.us(b,1,!0);b.U.a_polyindex=fa.Qu(b);D(q,b);return q}function ca(a,b,d){a.Rb.qm=b;a.Rb.Uk=d;aa.mQ(a.Rb)}function Z(a,b,d){1==a.ba.length&&0==a.Pc.length&&a.Pc.push("default0");d=d||"default"+String(a.ba.length);-1==a.Pc.indexOf(d)&&(a.ba.push(b),a.Pc.push(d));a.uc&& | |
oa.Hz(a)}function da(a){if(!a.Rb)throw"No shaders info for batch "+a.name;a.uc=aa.hN(a.Rb);oa.JJ(a.uc);oa.FJ(a);oa.Hz(a)}function ba(a,b,d){a=a.D[0].W;for(var c=0;c<a.length;c++)if(a[c].type==d&&!a[c].$f&&-1!=a[c].sf.indexOf(b))return a[c];return null}function J(a,b,d){a=a.D[0].W;for(var c=0;c<a.length;c++)if(a[c].type==d&&a[c].$f&&-1!=a[c].sf.indexOf(b))return a[c];return null}function pa(a,b){a.jf.set(b.jf);a.dn=b.dn;a.uo.set(b.uo);a.ps=b.ps;a.Ul.set(b.Ul);a.Pk=b.Pk;a.vk=b.vk;a.cn=b.cn;a.Am=b.Am; | |
a.Jr=b.Jr;a.nj.set(b.nj);a.ur=b.ur;a.es.set(b.es);a.fs=b.fs;a.js.set(b.js);a.ks=b.ks;a.mq=b.mq;a.Rs=b.Rs}function W(a,b){for(var d=a.zl,c=0;c<d.length;c+=2)if(d[c]==b)return d[c+1];return null}function na(a,b){for(var d=a.yl,c=0;c<d.length;c+=2)if(d[c]==b)return d[c+1];return null}var ka=m("__boundings");m("__camera");var ha=m("__config"),ra=m("__print"),ja=m("__extensions"),fa=m("__geometry"),U=m("__graph");m("__lights");var za=m("__nodemat"),la=m("__obj_util"),ga=m("__particles"),S=m("__primitives"), | |
ea=m("__quat"),Fa=m("__reformer"),oa=m("__renderer"),xa=m("__scenegraph"),aa=m("__shaders"),Y=m("__textures"),sa=m("__tsr"),N=m("__util"),Aa=m("__animation"),qa=m("__vec3"),X=m("__vec4"),va=ha.u,Ba=["MAIN"],Ia=new Float32Array([0,-Math.sqrt(.5),0,Math.sqrt(.5)]);new Float32Array(3);var Ea=new Float32Array(4),Da=sa.create(),ta=new Float32Array(24);a.gT=ia;var ia="u_colormap0 u_colormap1 u_stencil0 u_specmap0 u_normalmap0 u_mirrormap".split(" ");a.HY=h;a.XM=function(a,b,d,l){for(var q=[],e=[],r=0;r< | |
b.length;r++){var f=b[r],w=f.ya;w.In||(la.Aa(w)?q.push(f):e.push(f))}for(var r=[],r=r.concat(u(q,a.k.xb)),w=r=r.concat(g(e,a.k.xb,a.b4w_batch_grid_size)),q=[],e=[],x={},r=0;r<w.length;r++){var k=w[r].I,C=w[r].g,h=null;if(k.id in x){for(var P=x[k.id],n=e[P].I,W=e[P].g,ia=null,H=null,f=0;f<k.ba.length;f++){var p=k.ba[f].Yd;p&&(ia||(ia={}),ia[f]=p,k.ba[f].Yd=null);if(p=k.ba[f].ua)H||(H={}),H[f]=p,k.ba[f].ua=null}N.WF(k,n)&&N.WF(C,W)&&(h=e[P]);if(ia)for(f in ia)k.ba[f].Yd=ia[f];if(H)for(f in H)k.ba[f].ua= | |
H[f];if(!h){do k.id++;while(x[k.id])}}h||(h={I:k,g:w[r].g,me:[],Dx:[],Ad:[]},x[k.id]=e.length,e.push(h));h.me=h.me.concat(w[r].me);w[r].re&&w[r].re.ma&&h.Dx.push(w[r].re);if(h.Ad.length)for(f=0;f<w[r].Ad.length;f++)k=w[r].Ad[f],-1==h.Ad.indexOf(k)&&h.Ad.push(k);else h.Ad=w[r].Ad;fa.KF(h.Ad,h.Dx,fa.MI,!1)}for(r=0;r<e.length;r++){w=e[r].Dx;if(0==w.length)f=N.oc(N.km("%empty"));else if(1==w.length)f=w[0];else{x=[];for(f=0;f<w.length;f++)fa.iO(w[f])||x.push(f);if(x.length<w.length)for(f=0;f<x.length;f++)fa.us(w[x[f]]); | |
f=fa.uR(w)}q.push({I:e[r].I,g:e[r].g,re:f,Ad:e[r].Ad,me:e[r].me})}for(e=0;e<q.length;e++)if(w=q[e].I,w.sf=q[e].Ad,D(w,q[e].re),M(w,d,a),"STATIC"==q[e].g.type&&"COLOR_ID"!=w.type){if(r=N.km("%meta%"+w.type+"%"+w.sf.join("%")+"%"),x=la.Jk(r,"MESH"),x.g=q[e].g,la.yk(x,a),la.xp(x,a,w),l.push(x),"MAIN"==w.type)for(f=0;f<q[e].me.length;f++)r=q[e].me[f],r=r.ya,r.KD.push(x)}else for(x=[],f=0;f<q[e].me.length;f++)r=q[e].me[f],r=r.ya,-1==x.indexOf(r.name)&&(la.xp(r,a,w),x.push(r.name));if(va.wireframe_debug){for(e= | |
0;e<q.length;e++)if(d=q[e].g,"DYNAMIC"==d.type&&(r=q[e].me[0].ya,-1<Ba.indexOf(q[e].I.type))){f=la.bb(r,a);w=f.W;x=!1;for(f=0;f<w.length;f++)w[f].dj&&(x=!0);x||(d=R(d.Cg,d,r.name,!0,!0),la.xp(r,a,d))}for(e=0;e<l.length;e++)r=l[e],d=r.g,f=la.bb(r,a),w=f.W,-1<Ba.indexOf(w[0].type)&&(d=R(d.Cg,d,r.name,!0,!1),la.xp(r,a,d))}for(e=0;e<b.length;e++)for(f=la.bb(b[e].ya,a),w=f.W,f=0;f<w.length;f++)c(w[f]);for(e=0;e<l.length;e++)for(f=la.bb(l[e],a),w=f.W,f=0;f<w.length;f++)c(w[f])};a.ZM=function(a,b){var d= | |
a.k.jy,e=h("MAIN");ca(e,"special_skydome.glslv","special_skydome.glslf");if(b.procedural_skydome)q(e,"PROCEDURAL_SKYDOME",1),e.uE=!0;else{var r=d.tx;if(r){q(e,"WO_SKYTEX",1);var f=A(d.IF,null);Z(e,f,"u_sky");r.invert&&q(e,"MTEX_NEGATIVE",1);r.KS&&q(e,"MTEX_RGBTOINT",1);q(e,"BLENDTYPE",r.SJ);r.FS&&q(e,"WOMAP_BLEND",1);r.GS&&q(e,"WOMAP_HORIZ",1);r.IS&&q(e,"WOMAP_ZENUP",1);r.HS&&q(e,"WOMAP_ZENDOWN",1)}d.LS&&q(e,"WO_SKYBLEND",1);d.MS&&q(e,"WO_SKYPAPER",1);d.NS&&q(e,"WO_SKYREAL",1)}b.kd&&(e.kd=!0,b.Zc&& | |
(e.Zc=!0));e.Mj=99999;l(e,"a_position");d=S.TM();D(e,d);c(e);d=N.km("%meta_sky%");d=la.Jk(d,"MESH");la.yk(d,a);r=la.bb(d,a);d.g=la.bj("STATIC");d.g.gj=!0;d.g.zc=ka.Qd();d.g.De=ka.nk();d.g.Jb=ka.Qd();d.g.Ac=ka.nk();r.W.push(e);return d};a.BA=function(a,b,d){d=la.bb(a,d).W;var c=[];xa.Pb(b,"SHADOW_CAST");var l=xa.Pb(b,"MAIN_PLANE_REFLECT"),q=xa.Pb(b,"MAIN_CUBE_REFLECT"),r=xa.Pb(b,"OUTLINE_MASK");b=xa.Pb(b,"COLOR_PICKING");for(var f=0;f<d.length;f++){var w=d[f],x=null;"SHADOW"==w.type&&"RECEIVE"==w.ub&& | |
w.pe&&(x=e(w),x.ub="CAST");"MAIN"!=w.type&&"PARTICLES"!=w.type||!l&&!q||w.Ua||!w.kd||(x=e(w),x.ub="REFLECT",x.La=w.La);"COLOR_ID"==w.type&&w.Tt&&r&&a.g.Zb&&(b&&a.g.ii?(x=e(w),x.ub="OUTLINE"):w.ub="OUTLINE");x&&(x.$f=!0,P(x,a.g.id),c.push(x))}d.push.apply(d,c)};a.BQ=t;a.aT=function(a,b,d){if(b)b=d*(b.max_y-b.min_y);else throw"No bounding box for mesh";if(0==b)return 0;a=b*Math.tan(N.lb(a));return.5*(Math.sqrt(2*Math.sqrt(4*a+1)+2)/2-1)/b};a.NJ=function(a){return{max_x:a.max_x,min_x:a.min_x,max_y:a.max_y, | |
min_y:a.min_y,max_z:a.max_z,min_z:a.min_z}};a.fN=A;a.sJ=H;a.UR=I;a.TR=M;a.yQ=F;a.Gz=function(a,b){q(a,"CSM_SECTION0",0);q(a,"CSM_SECTION1",0);q(a,"CSM_SECTION2",0);q(a,"CSM_SECTION3",0);q(a,"NUM_CAST_LAMPS",0);if(b){q(a,"NUM_CAST_LAMPS",b.rf.length);va.fr&&q(a,"MAC_OS_SHADOW_HACK",1);for(var d=0;d<b.csm_num;d++)q(a,"CSM_SECTION"+String(d),1);q(a,"SHADOW_TEX_RES",aa.K(b.csm_resolution));q(a,"CSM_FADE_LAST_CASCADE",b.fade_last_cascade?1:0);q(a,"CSM_BLEND_BETWEEN_CASCADES",b.blend_between_cascades?1: | |
0)}else q(a,"SHADOW_TEX_RES",0),q(a,"CSM_FADE_LAST_CASCADE",0),q(a,"CSM_BLEND_BETWEEN_CASCADES",0)};a.Id=q;a.ev=function(a,b){return aa.lN(a.Rb,b)};a.RR=D;a.SR=P;a.eK=V;a.WV=R;a.zk=Z;a.WP=function(a,b,d){d=a.Pc.indexOf(d);-1<d&&(a.ba[d]=b)};a.oL=function(a,b){var d=h("MAIN");d.Ua=!0;X.set(b[0],b[1],b[2],.5,d.jf);d.Rh=fa.Vo;D(d,a);ca(d,"main.glslv","main_stack.glslf");q(d,"SHADELESS",1);da(d);return d};a.Hc=da;a.WM=function(a,b){for(var d=0;d<b.length;d++){var l=b[d].ya,q=h("LINE");ca(q,"line.glslv", | |
"line.glslf");q.Ua=!0;var e=S.VM();D(q,e);c(q);la.yk(l,a);la.bb(l,a).W.push(q);da(q)}};a.pK=function(a){return a.uc.Vn.length?a.uc.pw.u_cube_fog?!0:!1:!1};a.XK=function(){var a=h("DEPTH_PACK");a.Bb=!0;a.Fa=!1;var b=S.fc();D(a,b);ca(a,"postprocessing/postprocessing.glslv","postprocessing/depth_pack.glslf");da(a);return a};a.pu=function(a){var b=h("POSTPROCESSING");ca(b,"postprocessing/postprocessing.glslv","postprocessing/postprocessing.glslf");switch(a){case "NONE":q(b,"POST_EFFECT","POST_EFFECT_NONE"); | |
break;case "GRAYSCALE":q(b,"POST_EFFECT","POST_EFFECT_GRAYSCALE");break;case "X_BLUR":q(b,"POST_EFFECT","POST_EFFECT_X_BLUR");break;case "Y_BLUR":q(b,"POST_EFFECT","POST_EFFECT_Y_BLUR");break;case "X_GLOW_BLUR":q(b,"POST_EFFECT","POST_EFFECT_X_GLOW_BLUR");break;case "Y_GLOW_BLUR":q(b,"POST_EFFECT","POST_EFFECT_Y_GLOW_BLUR");break;case "X_EXTEND":q(b,"POST_EFFECT","POST_EFFECT_X_EXTEND");break;case "Y_EXTEND":q(b,"POST_EFFECT","POST_EFFECT_Y_EXTEND");break;case "FLIP_CUBEMAP_COORDS":q(b,"POST_EFFECT", | |
"FLIP_CUBEMAP_COORDS");break;default:throw"Wrong postprocessing effect: "+a;}b.Bb=!0;b.Fa=!1;a=S.fc();D(b,a);da(b);return b};a.rL=function(a){var b=h("SSAO");b.Fa=!1;b.Bb=!0;var d=S.fc();D(b,d);ca(b,"postprocessing/postprocessing.glslv","postprocessing/ssao.glslf");q(b,"SSAO_QUALITY","SSAO_QUALITY_"+a.QF);q(b,"SSAO_HEMISPHERE",a.ssao_hemisphere?1:0);a={texture:Y.xB("SSAO_TEXTURE",a)};d={width:4,height:4,data:new Uint8Array([150,123,254,0,127,3,97,0,164,246,99,0,155,177,14,0,54,83,221,0,2,142,143, | |
0,32,57,79,0,49,160,32,0,57,232,115,0,178,216,203,0,70,196,218,0,241,164,82,0,225,58,85,0,233,88,189,0,144,25,203,0,117,73,12,0])};a=A(a,d);Z(b,a,"u_ssao_special_tex");da(b);return b};a.sL=function(a){var b=h("SSAO_BLUR");b.Fa=!1;b.Bb=!0;var d=S.fc();D(b,d);ca(b,"postprocessing/postprocessing.glslv","postprocessing/ssao_blur.glslf");q(b,"SSAO_BLUR_DEPTH",a.ssao_blur_depth?1:0);da(b);return b};a.YK=function(){var a=h("DOF");a.Fa=!1;a.Bb=!0;var b=S.fc();D(a,b);ca(a,"postprocessing/postprocessing.glslv", | |
"postprocessing/dof.glslf");q(a,"DEPTH_RGBA",1);da(a);return a};a.gL=function(){var a=h("OUTLINE");a.Fa=!1;a.Bb=!0;var b=S.fc();D(a,b);ca(a,"postprocessing/postprocessing.glslv","postprocessing/outline.glslf");da(a);return a};a.$K=function(){var a=h("GLOW_COMBINE");a.Fa=!1;a.Bb=!0;var b=S.fc();D(a,b);ca(a,"postprocessing/postprocessing.glslv","postprocessing/glow.glslf");da(a);return a};a.aL=function(a,b,d){var c=h("GOD_RAYS");c.Fa=!1;c.Bb=!0;var l=S.OM();D(c,l);ca(c,"postprocessing/god_rays.glslv", | |
"postprocessing/god_rays.glslf");q(c,"DEPTH_RGBA",a?1:0);q(c,"WATER_EFFECTS",b?1:0);q(c,"STEPS_PER_PASS",aa.K(d,1));da(c);return c};a.bL=function(){var a=h("GOD_RAYS_COM");a.Fa=!1;a.Bb=!0;var b=S.fc();D(a,b);ca(a,"postprocessing/postprocessing.glslv","postprocessing/god_rays_combine.glslf");q(a,"SAFARI_CANVAS_ALPHA_HACK",va.VE?1:0);da(a);return a};a.jL=function(){var a=h("SKY");a.Fa=!1;a.Bb=!0;var b=S.PM();D(a,b);ca(a,"procedural_skydome.glslv","procedural_skydome.glslf");q(a,"WATER_EFFECTS",1);da(a); | |
return a};a.PK=function(a){var b=h("ANTIALIASING");b.Fa=!1;b.Bb=!0;var d=S.fc();D(b,d);ca(b,"postprocessing/postprocessing.glslv","postprocessing/antialiasing.glslf");va.yE?(q(b,"AA_METHOD","AA_METHOD_FXAA_QUALITY"),q(b,"AA_QUALITY",a.NM)):q(b,"AA_METHOD","AA_METHOD_FXAA_LIGHT");da(b);return b};a.pL=function(a){var b=h("SMAA"),d=S.fc();D(b,d);ca(b,"postprocessing/smaa.glslv","postprocessing/smaa.glslf");q(b,"AA_METHOD","AA_METHOD_SMAA_HIGH");q(b,"SMAA_PASS",a);q(b,"SMAA_PREDICATION",0);q(b,"SMAA_REPROJECTION", | |
0);da(b);b.Fa=!1;b.Bb=!0;return b};a.VK=function(){var a=h("COMPOSITING");a.Fa=!1;a.Bb=!0;var b=S.fc();D(a,b);ca(a,"postprocessing/postprocessing.glslv","postprocessing/compositing.glslf");da(a);return a};a.fL=function(){var a=h("MOTION_BLUR");a.Bb=!0;a.Fa=!1;var b=S.fc();D(a,b);ca(a,"postprocessing/postprocessing.glslv","postprocessing/motion_blur.glslf");da(a);return a};a.tL=function(a){var b=h("STEREO");b.Bb=!0;b.Fa=!1;var d=S.fc();D(b,d);ca(b,"postprocessing/postprocessing.glslv","postprocessing/stereo.glslf"); | |
q(b,"ANAGLYPH","ANAGLYPH"===a?1:0);q(b,"DISABLE_DISTORTION_CORRECTION",0);da(b);return b};a.cL=function(){var a=h("LUMINANCE");a.Fa=!1;a.Bb=!0;var b=S.fc();D(a,b);ca(a,"postprocessing/postprocessing.glslv","postprocessing/luminance.glslf");da(a);return a};a.QK=function(){var a=h("LUMINANCE");a.Fa=!1;a.Bb=!0;var b=S.fc();D(a,b);ca(a,"postprocessing/postprocessing.glslv","postprocessing/luminance_av.glslf");da(a);return a};a.dL=function(){var a=h("LUMINANCE_X_BLUR");a.Fa=!1;a.Bb=!0;var b=S.fc();D(a, | |
b);ca(a,"postprocessing/luminance_trunced.glslv","postprocessing/luminance_trunced.glslf");da(a);return a};a.RK=function(){var a=h("POSTPROCESSING");a.Bb=!0;a.Fa=!1;var b=S.fc();D(a,b);ca(a,"postprocessing/postprocessing.glslv","postprocessing/bloom_blur.glslf");da(a);return a};a.SK=function(){var a=h("BLOOM");a.Fa=!1;a.Bb=!0;var b=S.fc();D(a,b);ca(a,"postprocessing/postprocessing.glslv","postprocessing/bloom_combine.glslf");da(a);return a};a.xL=function(){var a=h("VELOCITY");a.Fa=!1;a.Bb=!0;var b= | |
S.fc();D(a,b);ca(a,"postprocessing/postprocessing.glslv","postprocessing/velocity.glslf");da(a);return a};a.OK=function(){var a=h("ANCHOR_VISIBILITY");a.Fa=!0;a.Bb=!0;a.Rh=fa.vy;ca(a,"anchors.glslv","anchors.glslf");var b=S.vB(1);D(a,b);q(a,"ANCHOR_NUM",1);da(a);a.Hl=new Float32Array([0,0,0]);return a};a.hL=function(){var a=h("PERFORMANCE");a.Fa=!1;a.Bb=!0;var b=S.fc();D(a,b);ca(a,"postprocessing/postprocessing.glslv","postprocessing/performance.glslf");q(a,"POST_EFFECT","POST_EFFECT_X_BLUR");da(a); | |
return a};a.QR=function(a,b){var d=b.length/3;if(d!=a.Hl.length/3){var c=S.vB(d);D(a,c);q(a,"ANCHOR_NUM",d);da(a)}a.Hl=b};a.jX=function(a){if(!a.D.length)return null;a=a.D[0];return a.W.length?a.W[0]:null};a.GW=ba;a.HW=J;a.f_=pa;a.wV=function(a,b){for(var d=a.D[0].W,c=0;c<d.length;c++)if(d[c].type==b)return!0;return!1};a.JK=function(a){for(var b=a.ba,d=0;d<b.length;d++)Y.KL(b[d].Ya);fa.lA(a.pa)};a.UN=function(a,b,d,c){for(var l=["MAIN","SHADOW","COLOR_ID"],q=!1,e=0;e<l.length;e++){var r=l[e],f=ba(a, | |
b,r),w=ba(d,c,r);if(f&&w){var q=!0,x=J(d,c,r);"MAIN"==r&&(pa(w,f),x&&pa(x,f));for(r=0;r<w.Pc.length;r++){var D=w.Pc[r];if(-1!==ia.indexOf(D)){var g=f.Pc.indexOf(D);-1!==g&&(w.ba[r]=f.ba[g],x&&(D=x.Pc.indexOf(D),-1!==D&&(x.ba[D]=f.ba[g])))}}}}q||ra.error("Wrong objects for inheriting material!")};a.FQ=function(a,b,d){var c=b[0],l=ba(a,c,"MAIN");if(null===l)ra.error('Material "'+c+'" was not found in the object "'+a.name+'".');else if(b=b.join("%join%"),l=W(l,b),null!==l)for(b=0;b<a.D.length;b++)for(var q= | |
a.D[b].W,e=0;e<q.length;e++){var r=q[e];-1!=r.sf.indexOf(c)&&r.Kj&&(r.Kj[l]=d)}else ra.error('Value node "'+b+'" was not found in the object "'+a.name+'".')};a.EQ=function(a,b,d,c,l){var q=b[0],e=b.join("%join%");b=na(ba(a,q,"MAIN"),e);if(null!=b)for(e=0;e<a.D.length;e++)for(var r=a.D[e].W,f=0;f<r.length;f++){var w=r[f];-1!=w.sf.indexOf(q)&&w.he&&(w.he[3*b]=d,w.he[3*b+1]=c,w.he[3*b+2]=l)}else ra.error('RGB node "'+e+'" was not found in the object "'+a.name+'".')};a.AX=function(a,b){var d=b.join("%join%"), | |
c=ba(a,b[0],"MAIN"),l=W(c,d);if(null!=l)return c.Kj[l];ra.error('Value node "'+d+'" was not found in the object "'+a.name+'".');return null};a.zX=function(a,b,d){var c=b.join("%join%");b=ba(a,b[0],"MAIN");var l=na(b,c);if(null!=l)return d[0]=b.he[3*l],d[1]=b.he[3*l+1],d[2]=b.he[3*l+2],d;ra.error('RGB node "'+c+'" was not found in the object "'+a.name+'".');return null}};b4w.module.__boundings=function(a,m){function h(a,b){for(var d=a[0],c=a[1],e=a[2],f=a[0],g=a[1],k=a[2],h=3;h<a.length;h+=3)var n=a[h],l=a[h+1],q=a[h+2],d=Math.max(d,n),c=Math.max(c,l),e=Math.max(e,q),f=Math.min(f,n),g=Math.min(g,l),k=Math.min(k,q);b.max_x=d;b.max_y=c;b.max_z=e;b.min_x=f;b.min_y=g;b.min_z=k;return b}function c(a,b){b||(b=new Float32Array(24));var d=a.max_x,c=a.max_y,e=a.max_z,f=a.min_x,g=a.min_y,k=a.min_z;b[0]=f;b[1]=g;b[2]=k;b[3]=d;b[4]=g;b[5]=k;b[6]=d;b[7]=c;b[8]=k;b[9]=f;b[10]= | |
c;b[11]=k;b[12]=f;b[13]=g;b[14]=e;b[15]=d;b[16]=g;b[17]=e;b[18]=d;b[19]=c;b[20]=e;b[21]=f;b[22]=c;b[23]=e;return b}function e(){return{Qf:new Float32Array(3),Rf:new Float32Array(3),Sf:new Float32Array(3),quat:new Float32Array([0,0,0,1]),N:new Float32Array([0,0,0])}}function u(a,b,d,c,e){return{Qf:new Float32Array(a),Rf:new Float32Array(b),Sf:new Float32Array(d),quat:new Float32Array(e),N:new Float32Array([c[0],c[1],c[2]])}}function g(a,b,d){p.add(b,d,a.N);p.scale(a.N,.5,a.N);a.ib=p.distance(a.N,b); | |
return a}var z=m("__tsr"),t=m("__util"),p=m("__vec3"),f=m("__math"),v=m("__mat3"),k=m("__quat"),n=new Float32Array(24),A=new Float32Array(3),L=new Float32Array(3),K=new Float32Array(3),G=new Float32Array(3),E=new Float32Array(9),B=new Float32Array(9),y=new Float32Array(9);new Float32Array(9);a.Sp=function(a,b){b.min_x=a.min_x;b.max_x=a.max_x;b.min_y=a.min_y;b.max_y=a.max_y;b.min_z=a.min_z;b.max_z=a.max_z};a.qV=function(){return{max_x:1E12,min_x:-1E12,max_y:1E12,min_y:-1E12,max_z:1E12,min_z:-1E12}}; | |
a.Qd=function(a){a||(a={});a.max_x=0;a.min_x=0;a.max_y=0;a.min_y=0;a.max_z=0;a.min_z=0;return a};a.dB=function(a,b){var d=a.max_y,c=a.max_z,e=a.min_x,f=a.min_y,g=a.min_z;a.max_x=Math.max(b.max_x,a.max_x);a.max_y=Math.max(b.max_y,d);a.max_z=Math.max(b.max_z,c);a.min_x=Math.min(b.min_x,e);a.min_y=Math.min(b.min_y,f);a.min_z=Math.min(b.min_z,g)};a.OJ=h;a.Kt=function(e,b,d){d||(d=a.Qd());e=c(e,n);z.ui(e,b,e);return h(e,d)};a.gB=c;a.D_=function(c,b,d){d||(d=a.Qd());var e=b.min_x,f=b.max_x,g=b.min_y,k= | |
b.max_y,h=b.min_z;b=b.max_z;if(e>=c.max_x||f<=c.min_x||g>=c.max_y||k<=c.min_y||h>=c.max_z||b<=c.min_z)return d.min_x=-.1,d.max_x=.1,d.min_y=-.1,d.max_y=.1,d.min_z=-.2,d.max_z=-.1,d;d.min_x=Math.max(c.min_x,e);d.max_x=Math.min(c.max_x,f);d.min_y=Math.max(c.min_y,g);d.max_y=Math.min(c.max_y,k);d.min_z=Math.max(c.min_z,h);d.max_z=Math.min(c.max_z,b);return d};a.S_=function(c,b,d){d||(d=a.Qd());var e=c.max_x-c.min_x,f=c.max_y-c.min_y,g=c.max_z-c.min_z;d.min_x=c.min_x-.5*(b-1)*e;d.max_x=c.max_x+.5*(b- | |
1)*e;d.min_y=c.min_y-.5*(b-1)*f;d.max_y=c.max_y+.5*(b-1)*f;d.min_z=c.min_z-.5*(b-1)*g;d.max_z=c.max_z+.5*(b-1)*g;return d};a.Mt=function(c,b,d){d||(d=a.nk());z.bc(c.N,b,d.N);d.ib=c.ib*z.qc(b);return d};a.Lt=function(a,b,d){d||(d=e());z.bc(a.N,b,d.N);p.copy(a.Qf,d.Qf);p.copy(a.Rf,d.Rf);p.copy(a.Sf,d.Sf);z.vc(d.Qf,b,d.Qf);z.vc(d.Rf,b,d.Rf);z.vc(d.Sf,b,d.Sf);return d};a.Vp=function(a,b){return{ib:a,N:new Float32Array(b)}};a.nk=function(){return{N:new Float32Array([0,0,0]),ib:0}};a.eH=e;a.Up=u;a.QJ=function(){return{N:new Float32Array([0, | |
0,0]),ib:1E12}};a.kM=function(a,b){var d=p.subtract(b.N,a.N,p.create());0==p.length(d)&&p.set(1,0,0,d);var c=p.normalize(d,p.create()),d=p.scale(c,a.ib,p.create());p.add(d,a.N,d);var e=p.scale(c,-a.ib,p.create());p.add(e,a.N,e);var f=p.scale(c,b.ib,p.create());p.add(f,b.N,f);var g=p.scale(c,-b.ib,p.create());p.add(g,b.N,g);d=[d,e,f,g];c=p.normalize(c,p.create());e=d[0];f=d[0];for(g=1;g<d.length;g++){var k=p.dot(d[g],c);k<p.dot(e,c)&&(e=d[g]);k>p.dot(f,c)&&(f=d[g])}c=[e,f];d=c[0];c=c[1];a.N=p.scale(p.add(d, | |
c,p.create()),.5,p.create());a.ib=p.length(p.subtract(c,d,p.create()))/2};a.TK=function(a){var b=f.fK(a,G),d=f.aK(a,b,B),d=f.vM(d,E);p.copy(a,A);p.transformMat3(A,d,A);for(var c=A[0],e=c,g=A[1],h=g,n=A[2],M=n,m=0,l=0,q=0,D=0,r=0,w=0,P=3;P<a.length;P+=3){A[0]=a[P];A[1]=a[P+1];A[2]=a[P+2];p.transformMat3(A,d,A);var V=A[0],t=A[1],z=A[2];V>c&&(c=V,m=P);V<e&&(e=V,l=P);t>g&&(g=t,q=P);t<h&&(h=t,D=P);z>n&&(n=z,r=P);z<M&&(M=z,w=P)}t=g-h;z=n-M;V=Math.max(c-e,1E-9);t=Math.max(t,1E-9);z=Math.max(z,1E-9);P=Math.max(V, | |
t,z);P!=V&&(P==t?(m=q,l=D):(m=r,l=w));D=v.identity(B);D[0]=2E-5<V?1/V:0;D[4]=2E-5<t?1/t:0;D[8]=2E-5<z?1/z:0;v.transpose(d,y);A[0]=a[m];A[1]=a[m+1];A[2]=a[m+2];p.transformMat3(A,y,A);p.transformMat3(A,D,A);p.transformMat3(A,d,A);L[0]=a[l];L[1]=a[l+1];L[2]=a[l+2];p.transformMat3(L,y,L);p.transformMat3(L,D,L);p.transformMat3(L,d,L);p.add(A,L,K);p.scale(K,.5,K);p.transformMat3(b,y,b);p.transformMat3(b,D,b);p.transformMat3(b,d,b);if(0==c+e||0==n+M)K[1]=b[1];if(0==g+h||0==n+M)K[0]=b[0];if(0==c+e||0==g+ | |
h)K[2]=b[2];p.subtract(A,K,A);b=p.length(A);for(P=0;P<a.length;P+=3)P!=l&&P!=m&&(A[0]=a[P],A[1]=a[P+1],A[2]=a[P+2],p.transformMat3(A,y,A),p.transformMat3(A,D,A),p.transformMat3(A,d,A),p.subtract(A,K,L),c=p.length(L),c>b&&(p.scale(L,b/c,L),p.subtract(K,L,L),p.add(L,A,K),p.scale(K,.5,K),p.subtract(A,K,A),b=p.length(A)));D=v.identity(B);D[0]=V;D[4]=t;D[8]=z;p.transformMat3(K,y,K);p.transformMat3(K,D,K);p.transformMat3(K,d,K);a=[d[0],d[3],d[6]];P=[d[1],d[4],d[7]];c=[d[2],d[5],d[8]];p.scale(a,V*b,a);p.scale(P, | |
t*b,P);p.scale(c,z*b,c);V=[0,0,0,1];k.fromMat3(d,V);return u(a,P,c,K,V)};a.WR=function(a){var b=t.Ma(a.Gh),d=z.rj(a.i,G);p.subtract(b.N,d,b.N);a.Cg=b};a.xA=function(a,b){var d=b.max_y,c=b.min_y,e=Math.max(0,d-c-2*a);return{ib:a,height:e,N:new Float32Array([0,(d+c)/2,0])}};a.zA=function(a,b){var d=b.max_y,c=b.min_y,e=Math.max(0,d-c);return{ib:a,height:e,N:new Float32Array([0,(d+c)/2,0])}};a.yA=function(a,b){var d=b.max_y,c=b.min_y,e=Math.max(0,d-c);return{ib:a,height:e,N:new Float32Array([0,(d+c)/ | |
2,0])}};a.xV=function(a,b){return a.min_x>b.max_x||a.max_x<b.min_x?!1:a.min_y>b.max_y||a.max_y<b.min_y?!1:a.min_z>b.max_z||a.max_z<b.min_z?!1:!0};a.MP=function(a){for(var b=0,d=0,c=0,e=0,f=0,g=0,k=0,h=0,n=0;n<a.submeshes.length;n++){var l=a.submeshes[n];if(l.position.length){b=e=l.position[0];d=f=l.position[1];c=g=l.position[2];break}}for(n=0;n<a.submeshes.length;n++)for(var l=a.submeshes[n],l=l.position,q=0;q<l.length/3;q++)var D=l[3*q],r=l[3*q+1],w=l[3*q+2],b=Math.max(D,b),d=Math.max(r,d),c=Math.max(w, | |
c),e=Math.min(D,e),f=Math.min(r,f),g=Math.min(w,g),k=Math.max(Math.sqrt(D*D+r*r+w*w),k),h=Math.max(Math.sqrt(D*D+w*w),h);a.b4w_bounding_box.max_x=b;a.b4w_bounding_box.min_x=e;a.b4w_bounding_box.max_y=d;a.b4w_bounding_box.min_y=f;a.b4w_bounding_box.max_z=c;a.b4w_bounding_box.min_z=g;a.b4w_bounding_box_source.max_x=b;a.b4w_bounding_box_source.min_x=e;a.b4w_bounding_box_source.max_y=d;a.b4w_bounding_box_source.min_y=f;a.b4w_bounding_box_source.max_z=c;a.b4w_bounding_box_source.min_z=g;a.b4w_bounding_sphere_radius= | |
k;a.b4w_bounding_cylinder_radius=h};a.qN=function(c){var b=c.subarray(0,3),d=c.subarray(6,9),e=c.subarray(12,15),f=c.subarray(18,21);c=p.subtract(d,b,A);p.normalize(c,c);var k=t.vN(b,d,e,L),k=p.cross(k,c,k);p.normalize(k,k);var h=p.create(),n=p.create();p.subtract(d,b,K);n[0]=p.dot(K,c);n[1]=p.dot(K,k);d=p.create();p.subtract(e,b,K);d[0]=p.dot(K,c);d[1]=p.dot(K,k);e=p.create();p.subtract(f,b,K);e[0]=p.dot(K,c);e[1]=p.dot(K,k);f=a.nk();e=[h,n,d,e];h=g(f,e[0],e[1]);for(f=2;f<e.length;f++)if(p.distance(h.N, | |
e[f])>h.ib){for(var M=h,h=e,n=e[f],d=f-1,M=g(M,n,h[0]),m=1;m<=d;m++)if(p.distance(M.N,h[m])>M.ib){for(var l=M,M=h,q=n,D=h[m],r=m-1,l=g(l,q,D),w=0;w<=r;w++)if(p.distance(l.N,M[w])>l.ib){var P=q,V=D,v=M[w],y=p.subtract(V,v,K),y=p.squaredLength(y),Z=p.subtract(P,v,K),B=p.squaredLength(Z),Z=p.subtract(P,V,K),ba=p.squaredLength(Z),Z=y*(B+ba-y),J=B*(ba+y-B),y=ba*(y+B-ba),B=Z+J+y;p.copy(P,l.N);p.scale(l.N,Z/B,l.N);p.scaleAndAdd(l.N,V,J/B,l.N);p.scaleAndAdd(l.N,v,y/B,l.N);l.ib=p.distance(l.N,P)}M=l}h=M}f= | |
h;c=p.scale(c,f.N[0],K);p.scaleAndAdd(c,k,f.N[1],c);p.add(c,b,f.N);return f}};b4w.module.__camera=function(a,m){function h(a,d,c,l,e){la.ac(a,d);c&&G(a,d,c);Q(a,l);b(a,e)}function c(a,d,c,l,e,q,r,f){var w=a.g;la.ac(a,d);w.pivot.set(c);G(a,d,c);Q(a,l);b(a,e);H(a,q);I(a,r);w.use_panning=f}function e(a,b,c,l,e,q,r,f){var w=a.g;la.ac(a,b);w.sb.set(c);G(a,b,c);C(a,l);d(a,e);O(a,q);M(a,r);w.nn=f}function u(a,b,d){var c=a.g,l=ga.m(c.i),e=ga.v(c.i),c=X;c.set(S.Db);c[3]=0;a=v(a,xa)[1];e=S.hb(e,S.xc,Y);ra.pF(Ea,l);ra.cx(Ea,e);if(!S.Mv(c,-b,Ea,d)||Math.abs(a)<oa)fa.warn("Active hover camera view vector and the supporting plane are parallel to each other. Hover pivot will be set based on the camera position."), | |
d[0]=l[0],d[1]=0,d[2]=l[2];return d}function g(b){b=b.g;if(b.S[0].type==a.Ud)switch(b.gb){case a.Ra:var d=ga.m(b.i);b.el=ea.dist(d,b.pivot);b.fl=b.S[0].top;break;case a.kc:d=ga.m(b.i),b.el=ea.dist(d,b.sb),b.fl=b.S[0].top}}function z(){return{left:new Float32Array([0,0,0,0]),right:new Float32Array([0,0,0,0]),top:new Float32Array([0,0,0,0]),bottom:new Float32Array([0,0,0,0]),near:new Float32Array([0,0,0,0]),far:new Float32Array([0,0,0,0])}}function t(b){switch(b){case "STATIC":return a.od;case "TARGET":return a.Ra; | |
case "EYE":return a.Tb;case "HOVER":return a.kc;default:throw"Unknown move style";}}function p(b){var d={type:b,name:"",E_:1,width:0,height:0,Le:null,Wu:null,Vb:null,Ge:null,Za:0,sd:0,near:0,far:0,left:0,right:0,top:0,bottom:0,ud:Fa.create(),i:new Float32Array(9),jb:new Float32Array(16),Ab:new Float32Array(16),Gf:new Float32Array(16),VG:new Float32Array(16),IP:new Float32Array(16),og:new Float32Array(16),Hf:ga.Xp(),IE:ga.Xp(),nx:ga.Xp(),dof_distance:0,dof_front:0,dof_rear:0,dof_power:0,be:null,dof_on:!1, | |
CD:new Float32Array(3),Wk:z(),dm:0,Ye:0,tc:null,Ym:null,ru:null,LA:new Float32Array(4),zr:new Float32Array(4)};d.ud[0]=d.ud[2]=45;d.ud[1]=d.ud[3]=55;if(b==a.mc)return d;switch(b){case a.Sc:n(d,40,.1,1E3);break;case a.Ud:n(d,2.5,.1,1E3);break;case a.yg:break;case a.Ch:break;case a.Ji:break;case a.Ub:case a.cc:case a.Sd:case a.Td:throw"Stereo camera may only be created from perspective one";default:throw"Unknown camera type";}return d}function f(b,d,c){if(b.type!=a.Ub&&b.type!=a.cc&&b.type!=a.Sd&&b.type!= | |
a.Td)throw"set_stereo_params(): wrong camera type";if(b.type==a.Ub||b.type==a.cc)b.dm=d;b.Ye=c;V(b,b.Za);if(za.wa()&&(d=za.q(),b=d.k.Oc))for(d=za.Yk(d).g.S,c=0;c<d.length;c++)da(d[c],b)}function v(a,b){var d=ga.v(a.g.i);return k(d,b)}function k(a,b){var d=S.hb(a,S.Db,Y),c=S.hb(a,S.Rd,sa),l=-Math.asin(d[1]/ea.length(d)),d=Math.abs(l)>Math.PI/4?ea.scale(c,-S.sign(l),N):ea.scale(d,-S.sign(c[1]),N),e=Math.atan(Math.abs(d[0]/d[2]));0<c[1]&&(l=S.sign(l)*Math.PI-l);c=e;0>d[2]&&(c=Math.PI-c);0>d[0]&&(c=2* | |
Math.PI-c);b[0]=c;b[1]=l;return b}function n(b,d,c,l,e){switch(b.type){case a.Sc:case a.Ub:case a.cc:b.sd=d;b.Za=1;break;case a.Ud:b.top=d;b.Za=1;break;case a.yg:delete b.sd;b.sd=d;b.Za=e/d;break;case a.Ch:b.top=d;b.Za=e/d;break;case a.Sd:case a.Td:break;default:fa.error("set_frustum(): Unsupported camera type: "+b.type)}b.near=c;b.far=l}function A(b,d){var c=ga.m(d.g.i),l=ga.v(d.g.i),c=ha.fromRotationTranslation(l,c,Ba);ha.rotateX(c,-Math.PI/2,c);ha.invert(c,b.jb);if(za.wa())var e=za.q(),e=za.da(e, | |
"STEREO");if(b.type==a.Ub||e&&e.enable_hmd_stereo&&b.type==a.Sd)b.jb[12]+=b.Ye/2;else if(b.type==a.cc||e&&e.enable_hmd_stereo&&b.type==a.Td)b.jb[12]-=b.Ye/2;if(b.tc){ga.lf(b.jb,b.IE);var e=b.tc[0],c=b.tc[1],l=b.tc[2],q=b.tc[3],r=Ba;r[0]=1-2*e*e;r[1]=-2*e*c;r[2]=-2*e*l;r[3]=0;r[4]=-2*e*c;r[5]=1-2*c*c;r[6]=-2*c*l;r[7]=0;r[8]=-2*e*l;r[9]=-2*c*l;r[10]=1-2*l*l;r[11]=0;r[12]=-2*e*q;r[13]=-2*c*q;r[14]=-2*l*q;r[15]=1;ha.multiply(b.jb,r,b.jb);V(b,b.Za,!0);e=X;c=Ba;ha.invert(b.jb,c);ha.transpose(c,c);Fa.transformMat4(b.tc, | |
c,e);c=va;c[0]=(S.sign(e[0])+b.Ab[8])/b.Ab[0];c[1]=(S.sign(e[1])+b.Ab[9])/b.Ab[5];c[2]=-1;c[3]=(1+b.Ab[10])/b.Ab[14];Fa.scale(e,2/(e[0]*c[0]+e[1]*c[1]+e[2]*c[2]+e[3]*c[3]),e);b.Ab[2]=e[0];b.Ab[6]=e[1];b.Ab[10]=e[2]+1;b.Ab[14]=e[3]}ga.lf(b.jb,b.Hf);ca(b);R(b);ga.copy(d.g.i,b.i)}function L(b,d,c,l){ha.lookAt(d,c,l,b.jb);c=za.q();c=za.da(c,"STEREO");za.wa()&&(c=za.q(),c=za.da(c,"STEREO"));if(b.type==a.Ub||c&&c.enable_hmd_stereo&&b.type==a.Sd)b.jb[12]+=b.Ye/2;else if(b.type==a.cc||c&&c.enable_hmd_stereo&& | |
b.type==a.Td)b.jb[12]-=b.Ye/2;ga.lf(b.jb,b.Hf);ca(b);R(b);ga.Jd(d,b.i)}function K(a,b,d){d=ea.subtract(d,b,Y);ea.length(d)&&(ea.normalize(d,d),d=S.UE(S.xc,d,Aa),la.mg(a,d));la.ac(a,b)}function G(a,b,d){var c=a.g,l=y(a);K(a,b,d);l?(b=ea.copy(c.Ff,Y),ea.negate(b,b),na.Nh(a,b,!0)):na.Nh(a,c.Ff,!0)}function E(a){var b=a.g,d=b.S;if(!d)throw"Wrong object";for(var c=b.mx,l=0;l<c.length;l++){var e=c[l];ea.copy(ga.m(b.i),e.CD)}for(l=0;l<d.length;l++)if(e=d[l],A(e,a),S.jq(e.Gf,e.Wk),e.be&&e.dof_on){var c=ga.m(b.i), | |
q=la.Oe(e.be,Y),c=ea.dist(c,q);e.dof_distance=c}}function B(b){var d=b.g;d.gb==a.Ra&&(d.vs=y(b))}function y(a){a=ga.v(a.g.i);return 0<S.hb(a,S.Rd,Y)[1]}function Q(b,d){var c=b.g;if(d){c.rb=c.rb||{};c.rb.left=d.left;c.rb.right=d.right;c.rb.ar=d.left;c.rb.Mr=d.right;c.rb.camera_space=Boolean(d.camera_space);var l=b.g;!(c=l.rb)||l.gb!=a.Tb&&l.gb!=a.Ra||(l=v(b,xa),c.camera_space?(c.left+=l[0],c.right+=l[0]):(c.ar-=l[0],c.Mr-=l[0]),c.left=S.Ae(c.left),c.right=S.Ae(c.right),c.ar=S.Ae(c.ar),c.Mr=S.Ae(c.Mr))}else c.rb= | |
null}function b(a,b){var d=a.g;b?(d.la=d.la||{},d.la.down=b.down,d.la.up=b.up,d.la.Nk=b.down,d.la.lm=b.up,d.la.camera_space=Boolean(b.camera_space),x(a)):d.la=null}function d(a,b){var d=a.g;if(!b){var c=v(a,xa);b={down:c[1],up:c[1]}}d.la=d.la||{};d.la.down=b.down;d.la.up=b.up;x(a);d.Xa&&d.la&&P(a)}function x(b){var d=b.g,c=d.la;if(c)switch(d.gb){case a.Tb:case a.Ra:b=v(b,xa);c.camera_space?(c.up+=b[1],c.down+=b[1]):(c.lm-=b[1],c.Nk-=b[1]);c.up=S.ef(c.up,-Math.PI,Math.PI);c.down=S.ef(c.down,-Math.PI, | |
Math.PI);c.lm=S.ef(c.lm,-Math.PI,Math.PI);c.Nk=S.ef(c.Nk,-Math.PI,Math.PI);break;case a.kc:c.up=S.ef(c.up,-Math.PI,Math.PI),c.down=S.ef(c.down,-Math.PI,Math.PI),c.up=S.J(c.up,-Math.PI/2,0),c.down=S.J(c.down,-Math.PI/2,0)}}function C(a,b){var d=a.g;if(!b){var c=la.Al(a,d.sb);b={min:c,max:c}}d.Xa=d.Xa||{};d.Xa.min=b.min;d.Xa.max=b.max;d.Xa&&d.la&&P(a)}function H(a,b){var d=a.g;b?(d.Xa=d.Xa||{},d.Xa.min=b.min,d.Xa.max=b.max):d.Xa=null}function I(a,b){var d=a.g;b?(d.Ve=d.Ve||{},d.Ve.min_y=b.min_y,d.Ve.max_y= | |
b.max_y):d.Ve=null}function O(a,b){var d=a.g;b?(d.Dc=d.Dc||{},d.Dc.min=b.min,d.Dc.max=b.max):d.Dc=null}function M(a,b){var d=a.g;b?(d.Ec=d.Ec||{},d.Ec.min=b.min,d.Ec.max=b.max):d.Ec=null}function F(b){var d=b.g;if(ja.ea(b)){var c=d.S;if(c[0].type===a.Ud){switch(d.gb){case a.Ra:var l=ga.m(d.i),l=ea.dist(l,d.pivot),d=l/d.el*d.fl;break;case a.kc:l=ga.m(d.i);l=ea.distance(l,d.sb);d=l/d.el*d.fl;break;default:d=c[0].top}for(l=0;l<c.length;l++){var e=c[l];e.top=d;V(e,e.Za)}E(b)}}}function l(b){var d=b.g, | |
c=d.gb;if(c===a.Ra||c===a.Tb){if(d.rb){var l=d.rb.left,e=d.rb.right,f=v(b,xa);(f=c==a.Ra?S.Ui(f[0],l,e):S.Ui(f[0],e,l))&&(c==a.Ra?D(b,f,0):q(b,f,0))}d.la&&(l=d.la.down,e=d.la.up,f=v(b,xa),(f=c==a.Ra?S.Ui(f[1],e,l):S.Ui(f[1],l,e))&&(c==a.Ra?D(b,0,f):q(b,0,f)));if(c===a.Ra&&d.Xa){var f=b.g,l=ga.m(f.i),e=ea.subtract(l,f.pivot,Y),w=ea.length(e);w>f.Xa.max?(ea.scale(e,f.Xa.max/w,e),ea.add(f.pivot,e,l)):w<f.Xa.min&&(w=ga.v(f.i),w=S.hb(w,S.xc,sa),ea.scale(w,100*f.Xa.min,w),ea.add(e,w,e),ea.scale(e,-f.Xa.min/ | |
ea.length(e),e),ea.add(f.pivot,e,l))}}c===a.Ra&&d.Ve&&(d=b.g,f=d.pivot[1],l=S.J(d.pivot[1],d.Ve.min_y,d.Ve.max_y),l!=f&&(f=ea.set(0,l-f,0,Y),ea.add(d.pivot,f,d.pivot),d=ga.m(d.i),ea.add(d,f,d)));c===a.kc&&(c=b.g,c.Dc&&(f=S.J(c.sb[0],c.Dc.min,c.Dc.max)-c.sb[0],c.sb[0]+=f,d=ga.m(c.i),d[0]+=f),c.Ec&&(f=S.J(c.sb[2],c.Ec.min,c.Ec.max)-c.sb[2],c.sb[2]+=f,d=ga.m(c.i),d[2]+=f),c=b.g,d=v(b,xa)[1],(c=S.Ui(d,c.la.up,c.la.down))&&r(b,0,c))}function q(a,b,d,c,l){var e=a.g,q=b,r=d;if(c||l)a=v(a,aa),c&&(q=b-a[0]), | |
l&&(r=d-a[1]);if(q||r)b=U.identity(Aa),q&&(q=U.setAxisAngle(e.Ff,q,qa),U.multiply(b,q,b)),e=ga.v(e.i),r&&(q=S.hb(e,S.ye,Y),r=U.setAxisAngle(q,r,qa),U.normalize(r,r),U.multiply(b,r,b)),U.multiply(b,e,e)}function D(a,b,d,c,l){var e=a.g,q=b,r=d;if(c||l){var f=v(a,aa);c&&(q=b-f[0]);l&&(r=d-f[1])}w(a,a.g.pivot,q,r);a=v(a,aa);a=S.ef(a[1],-Math.PI,Math.PI);e.vs=Math.abs(a)>Math.PI/2}function r(a,b,d,c,l){var e=a.g,q=b,r=d;if(c||l){var f=v(a,aa);c&&(q=b-f[0]);l&&(r=d-f[1])}e.nn||(q=0);w(a,e.sb,q,r);r&&P(a)} | |
function w(a,b,d,c){var l=a.g;if(d||c){a=U.identity(Aa);d&&(d=U.setAxisAngle(S.Db,d,qa),U.multiply(a,d,a));d=ga.v(l.i);if(c){var e=S.hb(d,S.ye,Y);c=U.setAxisAngle(e,c,qa);U.normalize(c,c);U.multiply(a,c,a)}c=ga.m(l.i);S.bQ(c,b,a,c);U.multiply(a,d,d)}}function P(a){var b=a.g,d=v(a,xa)[1],c=a.g;a=c.la;c=c.Xa;a.down-a.up?(d=(a.down-d)/(a.down-a.up),d=Math.max(d,0)):d=0;d=d*(c.max-c.min)+c.min;a=ga.m(b.i);c=ga.v(b.i);c=S.hb(c,S.xc,Y);ea.normalize(c,c);ea.scale(c,d,c);ea.subtract(b.sb,c,a)}function V(b, | |
d,c){switch(b.type){case a.Sc:if(!d)throw"No aspect ratio";b.Za=d;case a.yg:ha.perspective(S.lb(b.sd),b.Za,b.near,b.far,b.Ab);break;case a.Ud:if(!d)throw"No aspect ratio";b.Za=d;case a.Ch:d=b.top*b.Za;ha.ortho(-d,d,-b.top,b.top,b.near,b.far,b.Ab);break;case a.Ji:ha.ortho(b.left,b.right,b.bottom,b.top,b.near,b.far,b.Ab);break;case a.Ub:case a.cc:if(!d)throw"No aspect ratio";b.Za=d;var l=Math.tan(b.sd*Math.PI/360);d=b.near*l;var e=b.Za*b.dm*l;b.type==a.Ub?(l=e-b.Ye/2,e+=b.Ye/2):(l=e+b.Ye/2,e-=b.Ye/ | |
2);l=-(b.near/b.dm*l);e*=b.near/b.dm;ha.frustum(l,e,-d,d,b.near,b.far,b.Ab);b.left=l;b.right=e;break;case a.Sd:case a.Td:if(za.wa())if(l=za.q(),(l=za.da(l,"STEREO"))&&l.enable_hmd_stereo){d=Math.tan(S.lb(b.ud[0])/2);var l=Math.tan(S.lb(b.ud[1])/2),e=Math.tan(S.lb(b.ud[2])/2),q=Math.tan(S.lb(b.ud[3])/2);b.top=b.near*d;b.right=b.near*l;b.bottom=-b.near*e;b.left=-b.near*q;ha.frustum(b.left,b.right,b.bottom,b.top,b.near,b.far,b.Ab)}else d||(d=b.Za),ha.perspective(S.lb(b.sd),d,b.near,b.far,b.Ab);break; | |
case a.mc:return;default:throw"Wrong camera type: "+b.type;}c||(ca(b),R(b))}function R(a){ha.copy(a.jb,a.og);a.og[12]=0;a.og[13]=0;a.og[14]=0;a.og[15]=1;ha.multiply(a.Ab,a.og,a.og);ha.invert(a.og,a.og)}function ca(a){ha.copy(a.jb,a.Gf);ha.multiply(a.Ab,a.Gf,a.Gf);ha.invert(a.Gf,a.VG)}function Z(b,d,c,l,e){l||(l=new Float32Array(24));d||(d=b.near);c||(c=b.far);var q,r,f,w,g,D,k,x;switch(b.type){case a.mc:throw"Extraction from NONE camera is not possible";case a.Sc:case a.yg:q=d*Math.tan(b.sd*Math.PI/ | |
360);w=-q;r=q*b.Za;f=-r;g=c/d*q;x=-g;D=g*b.Za;k=-D;break;case a.Ud:case a.Ch:f=b.top*b.Za;q=g=b.top;r=D=f;w=x=-b.top;f=k=-f;break;case a.Ji:q=g=b.top;r=D=b.right;w=x=b.bottom;f=k=b.left;break;case a.Ub:case a.cc:g=d/b.near;q=d*Math.tan(b.sd*Math.PI/360);w=-q;r=b.right*g;f=b.left*g;k=c/d;g=q*k;x=-g;D=r*k;k*=f;break;case a.Sd:case a.Td:g=d/b.near;q=b.top*g;w=b.bottom*g;r=b.right*g;f=b.left*g;k=c/d;g=q*k;x=w*k;D=r*k;k*=f;break;default:throw"Wrong camera type: "+b.type;}l[0]=f;l[1]=w;l[2]=-d;l[3]=r;l[4]= | |
w;l[5]=-d;l[6]=r;l[7]=q;l[8]=-d;l[9]=f;l[10]=q;l[11]=-d;l[12]=k;l[13]=x;l[14]=-c;l[15]=k;l[16]=g;l[17]=-c;l[18]=D;l[19]=g;l[20]=-c;l[21]=D;l[22]=x;l[23]=-c;e&&(d=Ba,ha.invert(b.jb,d),S.Il(l,d,l,0));return l}function da(a,b){if(b.enable_csm){var d=b.csm_num;if(!a.Ym){var c=b.csm_num;a.Ym=Array(c);for(var l=0;l<c;l++)a.Ym[l]=new Float32Array(3);a.ru=new Float32Array(c)}for(c=0;c<d;c++){var l=0==c?a.near:ba(b,a,c-1),e=ba(b,a,c),l=Z(a,l,e,Ia),l=W.qN(l);a.Ym[c].set(l.N);a.ru[c]=l.ib;a.LA[c]=ea.length(l.N); | |
a.zr[c]=J(b.first_cascade_blur_radius,b.last_cascade_blur_radius,d,c)}}else a.zr[0]=b.first_cascade_blur_radius}function ba(a,b,d){var c=a.csm_num,l=S.J(a.csm_first_cascade_border,b.near,b.far);a=S.J(a.csm_last_cascade_border,b.near,b.far);return S.J(J(l,a,c,d),b.near,b.far)}function J(a,b,d,c){switch(c){case 0:break;case d-1:a=b;break;default:a=0==a?0:a*Math.pow(b/a,c/(d-1))}return a}function pa(a,b){b||(b=new Float32Array(3));var d=ga.m(a.g.i);ea.copy(d,b);return b}var W=m("__boundings");m("__config"); | |
var na=m("__constraints"),ka=m("__container");m("__mat3");var ha=m("__mat4"),ra=m("__math"),ja=m("__obj_util"),fa=m("__print"),U=m("__quat"),za=m("__scenes"),la=m("__transform"),ga=m("__tsr"),S=m("__util"),ea=m("__vec3"),Fa=m("__vec4");m("__physics");a.mc=10;a.Sc=20;a.Ud=30;a.yg=40;a.Ch=50;a.Ji=60;a.Ub=70;a.cc=80;a.Sd=90;a.Td=100;a.od=0;a.Ra=2;a.Tb=3;a.kc=4;var oa=S.lb(.5),xa=new Float32Array(2),aa=new Float32Array(2),Y=new Float32Array(3),sa=new Float32Array(3),N=new Float32Array(3),Aa=new Float32Array(4), | |
qa=new Float32Array(4),X=new Float32Array(4),va=new Float32Array(4),Ba=new Float32Array(16),Ia=new Float32Array(24),Ea=new Float32Array(6);a.hK=function(b,d){var q=d.g,r=b.data;switch(r.type){case "PERSP":var f=p(a.Sc);if(r.angle_y)var w=S.Fd(r.angle_y);n(f,w,r.clip_start,r.clip_end);break;case "ORTHO":f=p(a.Ud),n(f,r.ortho_scale/2,r.clip_start,r.clip_end)}f.name=d.name;q.OR=!1;q.gb=t(r.b4w_move_style);q.dof_distance=r.dof_distance;w=r.dof_object;q.be=w?w.ya:null;q.dof_front=r.b4w_dof_front;q.dof_rear= | |
r.b4w_dof_rear;q.dof_power=r.b4w_dof_power;q.S=[f];q.mx=[];q.Io=r.b4w_trans_velocity;q.Ho=r.b4w_rot_velocity;q.Jo=r.b4w_zoom_velocity;var f=d.g.gb,w=b.data,D=null;f!=a.Ra&&f!=a.Tb||!w.b4w_use_horizontal_clamping||(D={left:w.b4w_rotation_left_limit,right:w.b4w_rotation_right_limit,camera_space:"LOCAL"==w.b4w_horizontal_clamping_type},f==a.Tb&&(D.left*=-1,D.right*=-1));var f=D,w=d.g.gb,D=b.data,k=null;w!=a.Ra&&w!=a.Tb||!D.b4w_use_vertical_clamping?w==a.kc&&D.b4w_use_zooming&&(D.b4w_hover_angle_min<= | |
D.b4w_hover_angle_max?(k={down:D.b4w_hover_angle_min,up:D.b4w_hover_angle_max},k.down*=-1,k.up*=-1):fa.error("Wrong angle limits for the HOVER camera. Disabling angle limits.")):(k={down:D.b4w_rotation_down_limit,up:D.b4w_rotation_up_limit,camera_space:"LOCAL"==D.b4w_vertical_clamping_type},w==a.Ra&&(k.down*=-1,k.up*=-1));var w=k,D=d.g.gb,k=b.data,x=null;D==a.Ra&&k.b4w_use_target_distance_limits&&k.b4w_distance_min<=k.b4w_distance_max?x={min:k.b4w_distance_min,max:k.b4w_distance_max}:D===a.kc&&k.b4w_use_zooming&& | |
(k.b4w_distance_min<=k.b4w_distance_max?x={min:k.b4w_distance_min,max:k.b4w_distance_max}:fa.error("Wrong distance limits for the HOVER camera. Disabling distance limits."));D=x;k=b.data;x=null;d.g.gb==a.kc&&k.b4w_use_horizontal_clamping&&k.b4w_horizontal_translation_min<=k.b4w_horizontal_translation_max&&(x={min:k.b4w_horizontal_translation_min,max:k.b4w_horizontal_translation_max});var k=x,P=b.data,x=null;d.g.gb==a.kc&&P.b4w_use_vertical_clamping&&P.b4w_vertical_translation_min<=P.b4w_vertical_translation_max&& | |
(x={min:P.b4w_vertical_translation_min,max:P.b4w_vertical_translation_max},P=-x.min,x.min=-x.max,x.max=P);var P=b.data,C=null;d.g.gb==a.Ra&&P.b4w_use_pivot_limits&&(C={min_y:P.b4w_pivot_z_min,max_y:P.b4w_pivot_z_max});P=C;switch(q.gb){case a.Tb:q=ga.m(d.g.i);h(d,q,null,f,w);break;case a.Ra:q=ga.m(d.g.i);c(d,q,r.b4w_target,f,w,D,P,r.b4w_use_panning);break;case a.kc:q=ga.m(d.g.i),f=u(d,b.data.b4w_hover_zero_level,sa),e(d,q,f,D,w,k,x,r.b4w_enable_hover_hor_rotation)}l(d);g(d)};a.UQ=h;a.WQ=c;a.VQ=e;a.Dn= | |
g;a.ZK=z;a.eP=t;a.ec=p;a.vV=function(a,b){switch(b){case "COLOR":case "CUBEMAP":return Boolean(a.Vb);case "DEPTH":return Boolean(a.Ge);case "SCREEN":return!Boolean(a.Vb)&&!Boolean(a.Ge);default:throw"Wrong attachment type: "+b;}};a.Tr=function(a,b,d){switch(b){case "COLOR":case "CUBEMAP":a.Vb=d;break;case "DEPTH":a.Ge=d;break;case "SCREEN":a.Vb=null;a.Ge=null;break;default:throw"Wrong attachment type: "+b;}};a.UW=function(a,b){switch(b){case "COLOR":case "CUBEMAP":return a.Vb;case "DEPTH":return a.Ge; | |
case "SCREEN":return null;default:throw"Wrong attachment type: "+b;}};a.gr=function(b,d){if(b.type!=a.Sc||d!=a.Ub&&d!=a.cc&&d!=a.Sd&&d!=a.Td)throw"make_stereo(): wrong camera type";b.type=d;f(b,6,.065)};a.KQ=f;a.Qg=v;a.GB=k;a.qq=function(a,b){v(a,b);b[0]=S.Ae(b[0]+Math.PI);b[1]*=-1;return b};a.Wr=n;a.vQ=function(b,d,c,l,e,q,r){switch(b.type){case a.Ji:b.left=d;b.right=c;b.bottom=l;b.top=e;b.near=q;b.far=r;break;default:fa.error("set_frustum_asymmetric(): Unsupported camera type: "+b.type)}};a.Ne= | |
function(a){return a.g.gb};a.QQ=A;a.y_=L;a.kx=function(a,b,d){var c=Y;c[0]=0;c[1]=-1;c[2]=0;ea.transformQuat(c,d,c);c[0]+=b[0];c[1]+=b[1];c[2]+=b[2];var l=sa;l[0]=0;l[1]=0;l[2]=-1;ea.transformQuat(l,d,l);L(a,b,c,l)};a.Zr=K;a.CQ=G;a.dS=E;a.cS=function(b){var d=b.g;l(b);F(b);switch(d.gb){case a.Ra:var c=ga.m(d.i),e=ga.v(d.i);na.cQ(c,e,d.pivot);for(var e=d.S,q=0;q<e.length;q++){var r=e[q];r.type!=a.Ub&&r.type!=a.cc||f(r,ea.dist(c,d.pivot),r.Ye)}na.Nh(b,d.Ff);break;case a.Tb:b.vb||na.Nh(b,d.Ff)}B(b)}; | |
a.Wx=B;a.lF=Q;a.yF=b;a.Gq=d;a.Fq=C;a.nQ=H;a.HQ=I;a.xQ=O;a.PQ=M;a.mS=F;a.lo=q;a.Nr=D;a.mo=r;a.PY=function(b){switch(b.type){case a.Sc:case a.Ud:case a.Ub:case a.cc:return!0;default:return!1}};a.yB=function(b){b=b.g.S[0];switch(b.type){case a.Sc:case a.yg:case a.Ub:case a.cc:return S.lb(b.sd);default:return fa.error("get_angular_diameter(): Unsupported camera type: "+b.type),0}};a.ki=V;a.Pt=R;a.Vz=ca;a.nM=Z;a.GJ=function(a){a=a.g;var b=W.Qd();b.min_x=-1;b.max_x=1;b.min_y=-1;b.max_y=1;b.min_z=-1;b.max_z= | |
1;a.zc=b;var d=W.Vp(1,[0,0,0]);a.De=d;a.Bt=W.xA(1,b);a.Dt=W.zA(1,b);a.Ct=W.yA(1,b)};a.Bj=function(b){return ja.ea(b)&&b.g&&b.g.gb==a.od};a.ja=function(b){return ja.ea(b)&&b.g&&b.g.gb==a.Ra};a.eb=function(b){return ja.ea(b)&&b.g&&b.g.gb==a.Tb};a.Ba=function(b){return ja.ea(b)&&b.g&&b.g.gb==a.kc};a.Uq=function(b){return ja.ea(b)&&b.g&&b.g.S[0].type==a.Ud};a.Vx=da;a.AL=ba;a.xw=function(b,d,c){b=b.g.S[0];switch(b.type){case a.Sc:case a.yg:case a.Ud:case a.Ch:case a.Ub:case a.cc:case a.Sd:case a.Td:var l= | |
X;l.set(d);l[3]=1;Fa.transformMat4(l,b.Gf,l);d=-l[1]/l[3];c[0]=(l[0]/l[3]+1)/2*b.width;c[1]=(d+1)/2*b.height;ka.VS(c[0],c[1],c,b);2<c.length&&(c[2]=(l[2]/Math.abs(l[3])+1)/2);return c;default:return fa.error("Non-compatible camera"),c}};a.nN=function(a){return a.g.S[0]};a.Zk=function(b,d){switch(b.type){case a.Sc:case a.yg:case a.Ub:case a.cc:var c=Math.tan(S.lb(b.sd)/2);switch(d){case "LEFT":return-c*b.Za;case "RIGHT":return c*b.Za;case "TOP":return c;case "BOTTOM":return-c}break;case a.Ud:case a.Ch:switch(d){case "LEFT":return-b.top* | |
b.Za;case "RIGHT":return b.top*b.Za;case "TOP":return b.top;case "BOTTOM":return-b.top}break;case a.Ji:switch(d){case "LEFT":return b.left;case "RIGHT":return b.right;case "TOP":return b.top;case "BOTTOM":return b.bottom}break;case a.Sd:case a.Td:switch(d){case "LEFT":return Math.tan(S.lb(b.ud[3])/2);case "RIGHT":return Math.tan(S.lb(b.ud[1])/2);case "TOP":return Math.tan(S.lb(b.ud[0])/2);case "BOTTOM":return Math.tan(S.lb(b.ud[2])/2)}break;default:S.ha("Unknown camera type")}};a.kO=function(b){switch(b.type){case a.Ud:case a.Ch:case a.Ji:return!0; | |
default:return!1}};a.oN=function(b,d){switch(b.type){case a.Sc:case a.yg:case a.Ub:case a.cc:var c=S.lb(b.sd);return d?c*b.Za:c;default:return 0}};a.qo=function(a,b,d){a=a.g;ga.Jd(b,a.i);ea.copy(d,a.pivot)};a.Yr=function(a,b){var d=a.g,c=ea.subtract(b,d.sb,Y),l=ga.m(d.i),c=ea.add(c,l,c);la.ac(a,c);ea.copy(b,d.sb)};a.LQ=function(a,b){var d=a.g,c=ea.subtract(b,d.pivot,Y),l=ga.m(d.i),c=ea.add(c,l,c);la.ac(a,c);ea.copy(b,d.pivot)};a.PB=pa;a.bx=function(b,d){b.g.gb=d;b.g.rb=null;b.g.la=null;b.g.Xa=null; | |
b.g.Dc=null;b.g.Ec=null;g(b);switch(d){case a.kc:var c=ga.m(b.g.i),l=u(b,0,sa);e(b,c,l,null,null,null,null,b.g.nn);break;case a.Ra:c=pa(b,Y),l=ga.v(b.g.i),l=S.hb(l,S.xc,sa),l=ea.scaleAndAdd(c,l,10,l),ea.copy(l,b.g.pivot)}};a.Ts=function(a){a=a.g;a.gb=0;ea.set(0,0,0,a.pivot);ea.set(0,0,0,a.sb);a.vs=!1;a.use_panning=!1;a.rb=null;a.la=null;a.Xa=null;a.Dc=null;a.Ec=null;a.Ve=null;a.nn=!0};a.Xw=function(a,b){for(var d=a.g.S,c=0;c<d.length;c++){var l=d[c];70!=l.type&&80!=l.type&&90!=l.type&&100!=l.type|| | |
f(l,l.dm,b)}};a.ax=function(a,b,d){a=a.g.S;for(var c=0;c<a.length;c++){var l=a[c];if(90==l.type||100==l.type)90==l.type&&Fa.copy(b,l.ud),100==l.type&&Fa.copy(d,l.ud),l.tc||V(l),ca(l),R(l)}}};b4w.module.__constraints=function(a,m){function h(a){var b={};b.type=a;return b}function c(a,b){a.vb&&a.vb.ka&&e(a.vb.ka,a);if(b.ka){var d=b.ka;if(-1==d.gf.indexOf(a))d.gf.push(a);else throw"Descendant object override is forbidden";}a.vb=b}function e(a,b){var d=a.gf.indexOf(b);if(-1!=d)a.gf.splice(d,1);else throw"No descendant object";}function u(a,b,c){switch(b.type){case 1:var l=A.v(a.g.i),e=b.ka.g.i;c=A.v(b.ka.g.i);b.$c?(n.copy(b.$c,l),n.multiply(c,l,l)):n.copy(c,l);var g=A.bc(b.offset,e,B);A.Jd(g, | |
a.g.i);g=A.qc(b.ka.g.i);A.ld(b.no*g,a.g.i);break;case 9:g=A.m(a.g.i);l=A.v(a.g.i);e=b.ka.g.i;c=A.v(b.ka.g.i);n.multiply(n.invert(b.Rj,b.Rj),l,l);n.multiply(c,l,l);A.bc(b.offset,e,g);n.copy(c,b.Rj);break;case 10:g=A.m(a.g.i);l=A.v(a.g.i);e=b.ka.g.i;c=A.v(b.ka.g.i);n.multiply(n.invert(b.Rj,b.Rj),l,l);n.multiply(c,l,l);A.bc(b.offset,e,g);n.copy(c,b.Rj);g=A.v(a.g.i);l=A.v(b.ka.g.i);l=n.multiply(l,b.$c,d);l=f.GB(l,G);g=f.GB(g,E);f.lo(a,L.Ui(g[0],l[0]+b.HK,l[0]+b.GK),L.Ui(g[1],l[1]+b.FK,l[1]+b.IK));break; | |
case 13:var g=A.m(a.g.i),l=A.v(a.g.i),e=b.ka.g.i,r=A.m(e),w=b.dR,k=B,h=d;A.bc(b.offset,e,k);L.Tl(k,g,c,w,g);e=B;K.sub(r,g,e);K.normalize(e,e);var m=l,g=x,r=g.subarray(0,3),k=g.subarray(3,6),y=g.subarray(6,9);K.copy(e,k);K.negate(k,k);K.normalize(k,k);Boolean(.999999<Math.abs(K.dot(e,L.Db)))?(e=v.fromQuat(n.normalize(m,h),C),K.copy(e.subarray(0,3),r)):K.cross(L.Db,k,r);K.normalize(r,r);K.cross(r,k,y);K.normalize(y,y);n.fromMat3(g,h);n.normalize(h,h);L.JF(h,l,c,.16*w,l);break;case 2:l=A.v(a.g.i);c= | |
H;p.pq(b.ka,b.Si,!0,c);A.multiply(b.ka.g.i,c,c);l[0]=c[4];l[1]=c[5];l[2]=c[6];l[3]=c[7];b.$c&&(n.copy(b.$c,l),n.multiply(l,b.$c,l));A.ld(b.no*c[3],a.g.i);g=A.m(a.g.i);A.bc(b.offset,c,g);break;case 3:g=A.m(a.g.i);l=A.v(a.g.i);c=A.m(b.ka.g.i);z(g,l,c);break;case 4:g=A.m(a.g.i);l=A.v(a.g.i);c=b.target;z(g,l,c);break;case 5:g=A.m(a.g.i);l=A.v(a.g.i);c=A.m(b.ka.g.i);z(g,l,c);l=K.dist(g,c);if(l=l>b.dist_max?l-b.dist_max:l<b.fn?l-b.fn:0)K.sub(c,g,B),K.normalize(B,B),K.scale(B,l,B),K.add(g,B,g);break;case 6:g= | |
A.m(a.g.i);l=A.v(a.g.i);c=b.target;z(g,l,c);l=K.dist(g,c);if(l=l>b.dist_max?l-b.dist_max:l<b.fn?l-b.fn:0)K.sub(c,g,B),K.normalize(B,B),K.scale(B,l,B),K.add(g,B,g);break;case 7:e=b.ka.g.i;g=A.m(a.g.i);A.bc(b.offset,e,g);break;case 8:r=A.m(b.ka.g.i);g=A.m(a.g.i);K.add(r,b.offset,g);break;case 14:l=A.v(a.g.i);e=b.ka.g.i;c=A.v(b.ka.g.i);b.$c?(n.copy(b.$c,l),n.multiply(c,l,l)):n.copy(c,l);g=A.m(a.g.i);A.bc(b.offset,e,g);break;case 11:A.multiply(b.ka.g.i,b.Gs,a.g.i);break;case 12:g=b.Gs;c=H;p.pq(b.ka,b.Si, | |
!0,c);A.multiply(b.ka.g.i,c,c);A.multiply(c,g,a.g.i);break;case 15:l=b.ka,c=f.nN(l),g=A.m(a.g.i),e=f.Zk(c,"LEFT"),r=f.Zk(c,"RIGHT"),w=f.Zk(c,"TOP"),h=f.Zk(c,"BOTTOM"),k="heights"==b.hor_units?w-h:r-e,b.uD?(e=f.Zk(c,"LEFT"),g[0]=e+k*b.Iv):(r=f.Zk(c,"RIGHT"),g[0]=r-k*b.Iv),e="heights"==b.vert_units?w-h:r-e,g[2]=b.iG?-(w-e*b.Px):-(h+e*b.Px),f.kO(c)?g[1]=-b.distance:(g[1]=-1,K.normalize(g,g),K.scale(g,b.distance/Math.abs(g[1]),g)),A.vc(g,l.g.i,g),c=A.m(l.g.i),K.add(c,g,g),g=A.v(a.g.i),l=A.v(l.g.i),b.$c? | |
(n.copy(b.$c,g),n.multiply(l,g,g)):n.copy(l,g)}"CAMERA"==a.g.type&&(g=L.Db,10==b.type&&(c=A.v(b.ka.g.i),g=K.transformQuat(g,c,I)),f.Wx(a),t(a,g))}function g(a,b){switch(b.type){case 1:var d=b.target.g.i,c=H;A.invert(a.g.i,c);A.multiply(c,d,c);p.lQ(a,b.Si,c)}a.aw=!0}function z(a,d,c){var l=B;L.hb(d,L.xc,l);K.normalize(l,l);var e=y;K.subtract(c,a,e);K.normalize(e,e);a=L.UE(l,e,b);n.multiply(a,d,d);n.normalize(d,d)}function t(a,b,c){var l=a.g,e=A.v(l.i),g=L.hb(e,L.Db,B);K.normalize(g,g);if(.999999<Math.abs(K.dot(b, | |
g)))g=n.identity(d);else{var r=K.cross(b,g,y);K.normalize(r,r);l.gb==f.Ra?l.vs&&K.negate(r,r):(l=L.hb(e,L.Rd,Q),0<K.dot(l,b)&&K.negate(r,r));l=L.hb(e,L.ye,Q);K.normalize(l,l);var w=L.J(K.dot(l,r),-1,1),g=-.999999>=w?n.setAxisAngle(g,Math.acos(w),d):n.rotationTo(l,r,d);n.normalize(g,g)}n.multiply(g,e,e);c&&(c=L.hb(e,L.Bh,B),0>K.dot(b,c)&&n.rotateY(e,Math.PI,e));f.Wx(a)}var p=m("__armature"),f=m("__camera"),v=m("__mat3"),k=m("__print"),n=m("__quat"),A=m("__tsr"),L=m("__util"),K=m("__vec3");a.tT=1;a.sT= | |
2;a.xT=3;a.yT=4;a.nT=5;a.oT=6;a.uT=7;a.mT=8;a.rT=9;a.qT=10;a.kT=11;a.lT=12;a.pT=13;a.vT=14;a.wT=15;a.hT=1;var G=new Float32Array(2),E=new Float32Array(2),B=new Float32Array(3),y=new Float32Array(3),Q=new Float32Array(3),b=new Float32Array(4),d=new Float32Array(4),x=new Float32Array(9),C=new Float32Array(9),H=A.create(),I=new Float32Array(3);a.xz=function(a,b,d,l,e){var f=h(1);f.ka=b;f.offset=new Float32Array(d);f.$c=l?new Float32Array(l):null;f.no=e;c(a,f);u(a,f,0)};a.mJ=function(a,b,d,l,e,f){var r= | |
h(2);r.ka=b;r.Si=d;r.offset=new Float32Array(l);r.$c=e?new Float32Array(e):null;r.no=f;c(a,r);u(a,r,0)};a.lJ=function(a,b,d,l){var e=h(9),f=A.v(a.g.i),r=A.v(b.g.i);e.ka=b;e.offset=new Float32Array(d);e.Rj=new Float32Array(r);l&&(n.copy(l,f),n.multiply(r,f,f));c(a,e);u(a,e,0)};a.kJ=function(a,b,d,l,e,f,r,w){var g=h(10),k=A.v(a.g.i),x=A.v(b.g.i);g.ka=b;g.offset=new Float32Array(d);g.Rj=new Float32Array(x);g.GK=L.Ae(e);g.HK=L.Ae(f);g.IK=L.ef(r,-Math.PI,Math.PI);g.FK=L.ef(w,-Math.PI,Math.PI);l?(g.$c= | |
new Float32Array(l),n.copy(l,k),n.multiply(x,k,k)):g.$c=n.create();c(a,g);u(a,g,0)};a.jJ=function(a,b,d,l){var e=h(13);e.ka=b;e.offset=new Float32Array(d);e.dR=l;c(a,e);u(a,e,0)};a.qJ=function(a,b,d,l){var e=h(14);e.ka=b;e.offset=new Float32Array(d);e.no=1;e.$c=l?new Float32Array(l):null;c(a,e);u(a,e,0)};a.HZ=e;a.tJ=function(a,b){var d=h(3);d.ka=b;c(a,d);u(a,d,0)};a.uJ=function(a,b){var d=h(4);d.target=new Float32Array(b);c(a,d);u(a,d,0)};a.fJ=function(a,b,d,l){var e=h(5);e.ka=b;e.fn=d;e.dist_max= | |
l;c(a,e);u(a,e,0)};a.gJ=function(a,b,d,l){var e=h(6);e.target=new Float32Array(b);e.fn=d;e.dist_max=l;c(a,e);u(a,e,0)};a.pJ=function(a,b){var d=h(7);d.ka=b;d.offset=new Float32Array([0,.5,0]);c(a,d);u(a,d,0)};a.eJ=function(a,b,d){var l=h(8);l.ka=b;l.offset=new Float32Array(d);c(a,l);u(a,l,0)};a.cJ=function(a,b,d){var l=h(11);l.ka=b;l.Gs=new Float32Array(d);c(a,l);u(a,l,0)};a.dJ=function(a,b,d,l){var e=h(12);e.ka=b;e.Si=d;e.Gs=new Float32Array(l);c(a,e);u(a,e,0)};a.vt=function(a,b,d){var l=h(15);l.ka= | |
b;if(L.qf(d.left))l.uD=!0,l.Iv=d.left;else if(L.qf(d.right))l.uD=!1,l.Iv=d.right;else{k.error("append_stiff_viewport: Wrong positioning params");return}if(L.qf(d.top))l.iG=!0,l.Px=d.top;else if(L.qf(d.bottom))l.iG=!1,l.Px=d.bottom;else{k.error("append_stiff_viewport: Wrong positioning params");return}L.qf(d.distance)?(l.distance=d.distance,l.$c=L.qf(d.rotation)?new Float32Array(d.rotation):null,l.hor_units=L.qf(d.hor_units)?d.hor_units:"widths",l.vert_units=L.qf(d.vert_units)?d.vert_units:"heights", | |
c(a,l),u(a,l,0)):k.error("append_stiff_viewport: Wrong positioning params")};a.eS=function(a,b){a.vb&&u(a,a.vb,b)};a.nJ=function(a,b,d,c,e){var f=h(1);f.Si=d;f.target=b;f.offset=new Float32Array(c);f.$c=e?new Float32Array(e):null;f.no=1;b=f.target;d=f.Si;c=a.g.Ce[d];e=b.fu;for(var r=0;r<e;r++){var w=e[r];if(w[0]==a&&w[1]==d){e.splice(r,1);break}}b.fu.push([a,d]);c.vb=f;g(a,f)};a.XR=function(a,b){var d=a.g.Ce[b];d.vb&&g(a,d.vb)};a.cQ=z;a.Nh=t;a.uK=function(a){return a.vb?!0:!1};a.remove=function(a){a.vb.ka&& | |
e(a.vb.ka,a);a.vb=null};a.XX=function(a){return a.vb?a.vb.type:null};a.Pe=function(a){a=a.vb;return!a||11!=a.type&&12!=a.type?!1:!0};a.sq=function(a){if((a=a.vb)&&11==a.type)return a.ka.g.i;if(a&&12==a.type){var b=H;p.pq(a.ka,a.Si,!0,b);A.multiply(a.ka.g.i,b,b);return b}return null};a.Me=function(a){a=a.vb;return!a||11!=a.type&&12!=a.type?null:a.Gs}};b4w.module.__armature=function(a,m){function h(a){a=a.g;for(var c=a.ls,e=a.JD,f=0;f<c.length;f++){for(var g=c[f],k=e[f],h=0;h<k.length;h+=2)for(var n=k[h],b=k[h+1],d=0;4>d;d++)g.Ed[n+d]=a.Ed[b+d],g.ke[n+d]=a.ke[b+d],g.Od[n+d]=a.Od[b+d],g.ue[n+d]=a.ue[b+d];g.Ke=a.Ke}}function c(a,e,g,k){var h=a.sG,n=a.wi,m=a.Fs,v=a.mE;v?(v=v.Fs,e?u.multiply(v,h,m):(e=f,u.invert(v,e),u.multiply(e,m,h))):e?u.copy(h,m):u.copy(m,h);h=p;u.invert(n,h);u.multiply(m,h,h);n=a.Ih;g[4*n]=h[0];g[4*n+1]=h[1];g[4*n+2]=h[2];g[4* | |
n+3]=h[3];k[4*n]=h[4];k[4*n+1]=h[5];k[4*n+2]=h[6];k[4*n+3]=h[7];a=a.WA;for(n=0;n<a.length;n++)m=a[n],m.vb||c(m,!0,g,k)}var e=m("__util"),u=m("__tsr"),g=m("__quat"),z=m("__mat4"),t=m("__vec3"),p=u.create(),f=u.create(),v=new Float32Array(4),k=new Float32Array(4),n=new Float32Array(4);a.yi=function(a,c){for(var f=a.data.bones,g=a.pose.bones,k={},h=0;h<g.length;h++){var n=g[h],m=n.bone,b=m.name,d=k[b]={Ih:0,PG:-1,mE:null,WA:[],Mp:[],vb:null,Tx:u.create(),sG:u.create(),wi:u.create(),Fs:u.create(),Ds:u.create(), | |
Ux:u.create(),Es:!1,cG:new Float32Array(3)},b=new Float32Array(m.matrix_local),x=new Float32Array(16);z.invert(b,x);var n=new Float32Array(n.matrix_basis),C=d.cG;t.subtract(m.tail_local,m.head_local,C);e.QS(C,x,C);u.lf(b,d.wi);u.lf(n,d.Ds);u.copy(d.wi,d.Fs)}for(h=0;h<f.length;h++){b=f[h].name;n=e.Fc("name",b,g);d=k[b];m=n.parent_recursive;d.Mp.push(d);for(x=0;x<m.length;x++)n=m[x],n=n.name,n=k[n],d.Mp.push(n);m.length?(n=m[0],n=n.name,n=k[n],d.mE=n,u.invert(n.wi,p),u.multiply(p,d.wi,d.Tx),n.WA.push(d)): | |
u.copy(d.wi,d.Tx);d.Ih=h;d.name=b;u.multiply(d.Tx,d.Ds,d.sG)}c.g.Ce=k};a.pq=function(a,c,e,h){var m=a.g,t=m.Ke;c=m.Ce[c];var y=c.Ih;a=c.wi;var z=m.Od,b=m.ue,d=m.Ed,m=m.ke,x=z[4*y+1],C=z[4*y+2],H=z[4*y+3],I=b[4*y+1],O=b[4*y+2],M=b[4*y+3];v[0]=(1-t)*z[4*y]+t*b[4*y];v[1]=(1-t)*x+t*I;v[2]=(1-t)*C+t*O;v[3]=(1-t)*H+t*M;k[0]=d[4*y];k[1]=d[4*y+1];k[2]=d[4*y+2];k[3]=d[4*y+3];n[0]=m[4*y];n[1]=m[4*y+1];n[2]=m[4*y+2];n[3]=m[4*y+3];g.slerp(k,n,t,k);t=p;u.ix(v,t);u.lg(k,t);e?(e=f,u.translate(a,c.cG,e),u.multiply(t, | |
e,t)):u.multiply(t,a,t);u.copy(t,h)};a.lQ=function(a,e,f){var g=a.g;e=g.Ce[e];var k=g.Od,n=g.Ed;u.copy(f,e.Fs);c(e,!1,k,n);g.Ke=0;h(a)};a.sS=h;a.YR=c;a.qK=function(a,c){return c in a.g.Ce}};b4w.module.__container=function(a,m){var h,c,e,u,g;function z(a,b){h=a;c=b}function t(){var a=y.getBoundingClientRect();z(a.left,a.top)}function p(){return B.allow_hidpi&&2<=window.devicePixelRatio?!0:!1}var f=m("__anchors"),v=m("__config"),k=m("__data"),n=m("__hud");m("__objects");var A=m("__print"),L=m("__scenes"),K=m("__time"),G=m("__transform"),E=m("__util"),B=v.u,y=null,Q=null,b=null,d=!1;u=e=0;g=1;h=c=0;var x=null;a.$s=320;a.Zs=240;a.oe=function(a){x=a};a.rq=function(){return y};a.HB=function(){return Q}; | |
a.Yc=function(){return b};a.wd=function(a,d){a&&a.parentNode?(y=a,Q=d,b=a.parentNode):E.ha("canvas container is not available")};a.Nq=function(a,d){d=d||"LAST";switch(d){case "FIRST":b.insertBefore(a,b.firstElementChild);break;case "JUST_BEFORE_CANVAS":b.insertBefore(a,y);break;case "JUST_AFTER_CANVAS":y.nextElementSibling?b.insertBefore(a,y.nextElementSibling):b.appendChild(a,y);break;case "LAST":b.appendChild(a,y);break;default:A.error(d+" invalid stack order")}};a.vC=function(){return e};a.uC= | |
function(){return u};a.ZE=z;a.uG=t;a.XQ=function(a,b,d){e=a;u=b;g=d;t()};a.Uu=function(){d=!0};a.Np=function(a,b,e){e||(e=new Float32Array(2));var f=e;d&&(t(),d=!1);f[0]=a-h;a=e;d&&(t(),d=!1);a[1]=b-c;return e};a.Im=function(a,b,d,c){d||(d=new Float32Array(2));d[0]=a*g;d[1]=b*g;c&&(a=c.width/e,d[0]*=a,d[1]*=a);return d};a.VS=function(a,b,d,c){d||(d=new Float32Array(2));d[0]=a/g;d[1]=b/g;c&&(a=c.width/e,d[0]/=a,d[1]/=a)};a.WC=function(d){return d&&d.parentNode?d.parentNode==b?!0:a.WC(d.parentNode): | |
!1};a.gO=p;a.xM=function(a){var b=document.getElementsByTagName("script");a=E.Mn(a);for(var d=0;d<b.length;d++)if(b[d].src==a)return b[d];return null};a.resize=function(d,c,e){if(!d||!c){d=a.$s;c=a.Zs;var g=b;g.style.width=a.$s+"px";g.style.height=a.Zs+"px"}var g=y,h=Q;!1!==e&&(g.style.width=d+"px",g.style.height=c+"px",h&&(h.style.width=d+"px",h.style.height=c+"px"));h&&(h.width=d,h.height=c,n.zo());e=Math.floor(d*B.canvas_resolution_factor);c=Math.floor(c*B.canvas_resolution_factor);p()&&(e*=window.devicePixelRatio, | |
c*=window.devicePixelRatio);k.of()&&(h=L.q().k,e=Math.floor(e*h.Hd),c=Math.floor(c*h.Hd));g.width=e;g.height=c;if(e>x.drawingBufferWidth||c>x.drawingBufferHeight)A.warn("Canvas size exceeds platform limits, downscaling"),h=Math.min(x.drawingBufferWidth/e,x.drawingBufferHeight/c),e*=h,c*=h,g.width=e,g.height=c;L.BF(e,c,e/d);L.wa()&&G.o(L.q().Ki);k.iS(g.width,g.height);k.of()&&(f.update(),L.update(K.qj(),0),f.FG())}};b4w.module.__anchors=function(a,m){function h(){d=!0;n.Yc().addEventListener("mouseup",function(){function a(){return"visible"==e.style.visibility&&!w&&!g}if(!Q){var d=b;if(d)if("hidden"==d.style.visibility)c(),b=null;else if(1==d.style.opacity){var e=d.querySelector("div"),l=e.querySelector("span"),q=l.innerHTML;d.style.visibility="hidden";e.style.visibility="visible";var f=Math.min(parseInt(e.style.width)||200,z(q)-24),r=t(q,f),w=!1,g=!1,q=d.offsetWidth-24,d=d.offsetHeight-16;r==d&&(e.style.height= | |
r+"px");f!=q?E.Of(q,f,200,function(b){b==f&&(w=!1,a&&(l.style.visibility="visible"));e.style.width=b+"px"}):w=!1;r!=d?E.Of(d,r,200,function(b){b==r&&(g=!1,a&&(l.style.visibility="visible"));e.style.height=b+"px"}):g=!1}}})}function c(){b.querySelector("div").style.visibility="hidden";b.querySelector("div").querySelector("span").style.visibility="hidden";b.style.visibility="visible"}function e(a){a.style.cssText+="color: #fff;font-family: Arial;font-size: 12px;font-weight: bold;line-height: 15px;"} | |
function u(a){a.style.cssText+="background-color: #000;border-radius: 20px 20px 20px 0px;bottom: 0;box-shadow: 0px 0px 10px rgb(180, 180, 200);-webkit-box-shadow: 0px 0px 10px rgb(180, 180, 200);font-size: 12px;left: 0;line-height: 15px;opacity: 1.0;overflow: hidden;padding: 8px 12px;position: absolute;z-index: 2;"}function g(a,d,f){var l=document.createElement("div"),q=document.createElement("span"); | |
f&&(l.style.width=f+"px");u(l);e(q);q.innerHTML=a;l.style.visibility="hidden";q.style.visibility="hidden";l.appendChild(q);d.appendChild(l);d.addEventListener("mousedown",function(){d==b||1!=d.style.opacity||Q||(b&&"hidden"==b.style.visibility&&c(),b=d)})}function z(a){var b=document.createElement("div"),d=document.createElement("span");d.innerHTML=a;e(d);u(b);b.appendChild(d);document.body.appendChild(b);a=b.offsetWidth+1;document.body.removeChild(b);return a}function t(a,b){var d=document.createElement("div"), | |
c=document.createElement("span");c.innerHTML=a;e(c);u(d);d.style.width=b+"px";d.style.display="inline-block";d.appendChild(c);document.body.appendChild(d);c=d.offsetHeight-16;document.body.removeChild(d);return c}function p(){for(var a=0,b=0;b<y.length;b++)y[b].Kk&&a++;x=new Float32Array(3*a)}function f(a,b){return b.depth-a.depth}var v=m("__batch"),k=m("__camera"),n=m("__container"),A=m("__objects"),L=m("__print"),K=m("__renderer"),G=m("__scenes"),E=m("__time"),B=m("__tsr");m("__util");m("__config"); | |
var y=[],Q=!1,b=null,d=!1,x=new Float32Array(0),C=new Uint8Array(16),H=new Float32Array(2),I=new Float32Array(3);a.append=function(a){var b;a:{for(b=0;b<y.length;b++)if(y[b].va==a){b=!0;break a}b=!1}if(!b){b=a.anchor.Kk&&Boolean(G.da(G.al(),"ANCHOR_VISIBILITY"));b={type:a.anchor.type,va:a,x:0,y:0,depth:0,Pi:"out",Kk:b,element:null,ul:null,aJ:a.anchor.ZO,wp:0,tt:0,hq:a.anchor.hq};switch(b.type){case "ANNOTATION":var c=b.aJ,l=document.createElement("div"),q=document.createElement("span"),f="",r=a.name, | |
w=n.Yc();a=A.yn(a);l.style.cssText+="background-color: #000;border-radius: 20px 20px 20px 0px;box-shadow: 0px 0px 10px rgb(180, 180, 200);-webkit-box-shadow: 0px 0px 10px rgb(180, 180, 200);font-size: 12px;line-height: 15px;opacity: 1.0;padding: 8px 12px;position: absolute;";l.style.visibility="hidden";w.appendChild(l);a&&(f=a.description||f,r=a.title||r);q.innerHTML=r;q.style.cssText+="-webkit-touch-callout: none;-webkit-user-select: none;-khtml-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;cursor: default;"; | |
e(q);l.appendChild(q);f&&g(f,l,c);b.element=l;b.wp=b.element.offsetHeight;b.tt=b.element.offsetWidth;break;case "ELEMENT":b.element=document.getElementById(a.anchor.hq),b.element?(b.wp=b.element.offsetHeight,b.tt=b.element.offsetWidth):(L.warn("Anchor HTML element was not found, making it generic"),b.type="GENERIC")}y.push(b);p();d||h()}};a.remove=function(a){for(var b=0;b<y.length;b++){var d=y[b];if(d.va==a){"ANNOTATION"==d.type&&(a=d,n.Yc().removeChild(a.element));y.splice(b,1);p();break}}};a.update= | |
function(){for(var a=0,b=y.length;b--;){var d=y[b];if(d.Kk){var c=B.m(d.va.g.i);x.set(c,3*a++)}var e;e=d;var c=I,g=G.Yk(G.al());e=B.m(e.va.g.i);e=c=k.xw(g,e,c);c=e[0];g=e[1];e=e[2];if(c!=d.x||g!=d.y||e!=d.depth){switch(d.type){case "ANNOTATION":var r=d.element;r.style.left=Math.floor(c)+"px";r.style.top=Math.floor(g-d.wp)+"px";break;case "ELEMENT":var r=d.element,w=r.getBoundingClientRect();r.style.cssText+="left:"+Math.floor(c-w.width/2)+"px;top:"+Math.floor(g-w.height/2)+"px;"}d.x=c;d.y=g;d.depth= | |
e;d.ul&&d.ul(c,g,d.Pi,d.va,r)}}y.sort(f);for(b=0;b<y.length;b++)d=y[b],"GENERIC"!=d.type&&(d.element.style.zIndex=b);0<a&&(a=G.da(G.al(),"ANCHOR_VISIBILITY").A[0].I,v.QR(a,x))};a.FG=function(){for(var a=n.Yc(),b=y.length;b--;){var d=y[b],c=d.va,e=d.x,f=d.y,r=d.depth,r=0>e||0>f||0>r||1<r||G.Av(c)||e>=a.clientWidth||f>=a.clientHeight?"out":"visible";if(d.Kk&&"out"!=r){var r=d,w=G.da(G.al(),"ANCHOR_VISIBILITY").j,g=n.Im(r.x,r.y,H,w);K.Cw(w.Le,g[0],w.height-g[1],2,2,C);r=1020==C[0]+C[4]+C[8]+C[12]?"visible": | |
"out"==r.Pi||0==C[0]+C[4]+C[8]+C[12]?"covered":r.Pi}if(r!=d.Pi){switch(d.type){case "ANNOTATION":case "ELEMENT":var k=d.element;if(!k)break;"out"==r?(k.style.visibility="hidden",k.children.length&&(k.children[0].style.visibility="hidden"),"ANNOTATION"==d.type&&1<k.children.length&&(w=k.children[1],w.style.visibility="hidden",w.children.length&&(w.children[0].style.visibility="hidden"))):"visible"==r?(k.style.visibility="visible",k.children.length&&(k.children[0].style.visibility="visible"),k.style.opacity= | |
1):(k.style.visibility="visible",k.style.opacity=.1,k.children.length&&(k.children[0].style.visibility="visible"),"ANNOTATION"==d.type&&1<k.children.length&&(w=k.children[1],w.style.visibility="hidden",w.children.length&&(w.children[0].style.visibility="hidden")))}d.Pi=r;d.ul&&d.ul(e,f,d.Pi,c,k)}}};a.kV=function(a,b){for(var d=0;d<y.length;d++)y[d].va==a&&(y[d].ul=b)};a.eW=function(a){for(var b=0;b<y.length;b++)y[b].va==a&&(y[b].ul=null)};a.fa=function(){for(var a=0;a<y.length;a++){var b=y[a];"ANNOTATION"== | |
b.type&&n.Yc().removeChild(b.element)}y.length=0};a.ZN=function(a){for(var b=0;b<y.length;b++)if(y[b].va==a)return!0;return!1};a.eX=function(a){for(var b=0;b<y.length;b++)if(y[b].va==a)return y[b].hq;return!1};a.pause=function(){Q=!0};a.wf=function(){Q=!1};a.vP=function(a,b){for(var d=-1,c=0;c<y.length;c++){var e;if(e="visible"==y[c].Pi){var f=y[c];e=Math.round(f.tt);var r=Math.round(f.wp),w=f.x,f=f.y;e=a>=w&&a<=w+e&&b<f&&b>=f-r?!0:!1}if(e)if(0>d)var g=y[c].depth,d=c;else y[c].depth<g&&(d=c,g=y[c].depth)}return 0> | |
d?null:y[d].va}};b4w.module.__objects=function(a,m){function h(a){var b=a.D;a=a.g;for(var d=0;d<b.length;d++){var c=b[d].Ia;c.k.outline&&a.ih&&I.YP(c)}}function c(a){a.g.ih=0;a=ba.indexOf(a);-1!=a&&ba.splice(a,1)}function e(a){if(a.Rk)for(var b=a.D,d=0;d<b.length;d++)I.fS(b[d].Ia,a)}function u(a,b){for(var d=a.D,c=b.D,l=0;l<d.length;l++){for(var e=!1,r=0;r<c.length;r++)if(d[l].Ia==c[r].Ia){e=!0;break}e||g(b,d[l].Ia)&&Q.yk(b,d[l].Ia)}}function g(a,b){return!b.mz&&"SPEAKER"==a.type||!b.VI&&("LAMP"==a.type||"CAMERA"== | |
a.type)?!1:!0}function z(a,d){if(a.dg_parent&&a.dg_parent.mt||a.parent&&a.parent.mt)return!0;switch(a.type){case "MESH":var c=a.b4w_do_not_batch,l=a.b4w_collision,e=a.b4w_vehicle,r=a.b4w_floating,q=a.b4w_character,f=b.KN(a),w=y.Sz(a),g=0<a.data.b4w_shape_keys.length,x=a.b4w_dynamic_geometry;if(!(c=k.Tz(a,d)||c||l||e||g||r))a:{c=a.data;for(l=0;l<c.materials.length;l++)if("LENS_FLARES"===c.materials[l].name){c=!0;break a}c=!1}return c||f||q||w||x;case "EMPTY":return q=y.Sz(a),f=a.b4w_do_not_batch,w= | |
Boolean(a.b4w_anchor),k.Tz(a,d)||q||f||w;default:return!0}}function t(a,b){var d=a.animation_data,c=a.data?a.data.animation_data:null;d&&d.action&&(d=d.action,(d.k.type==k.jH||d.k.type==k.gH&&"ARMATURE"==b.type||d.k.type==k.iH&&"LAMP"==b.type||d.k.type==k.hH&&"WORLD"==b.type)&&b.df.push(d));c&&c.action&&("SPEAKER"==b.type||"LAMP"==b.type)&&b.df.push(c.action);"MESH"==b.type&&b.df.push.apply(b.df,k.gN(a))}function p(a,b,d){b=R[b]||[];for(var c=[],l=0;l<b.length;l++){var e=b[l];if(e.g.rd==d||-1==d)for(var r= | |
e.D,q=0;q<r.length;q++)r[q].Ia==a&&c.push(e)}return c}function f(a,b,d,c){for(var l=null,e=0;e<b.length;e++){var r=b[e];if((d?r.Nj:r.name)==a&&(r.g.rd==c||-1==c)&&(l=r,!Q.Rg(l)))break}return l}function v(a){R.ALL.push(a);R[a.type]||(R[a.type]=[]);R[a.type].push(a);var b=a.g.je;if(null!=b)for(var d=0;d<da.length;d++){var c=da[d];c.g.je==b&&c.eo.push(a)}}var k=m("__animation"),n=m("__batch"),A=m("__boundings"),L=m("__camera"),K=m("__config"),G=m("__constraints"),E=m("__geometry"),B=m("__lights"),y= | |
m("__nla"),Q=m("__obj_util"),b=m("__particles"),d=m("__physics"),x=m("__print"),C=m("__primitives"),H=m("__quat"),I=m("__scenes"),O=m("__sfx"),M=m("__transform"),F=m("__textures"),l=m("__tsr"),q=m("__util"),D=m("__vec3"),r=m("__armature"),w=m("__anchors"),P=K.u,V=K.Zb,R={ALL:[]},ca=0,Z=0,da=[],ba=[],J=new Float32Array(3),pa=new Float32Array(4);a.bt=0;a.at=1;a.Jc=2;a.yc=-1;a.update=function(a){for(var b=R.ARMATURE,d=0;d<ba.length;d++){var l=ba[d],e=l,r=a,q=0,f=e.fE;0==f.ws&&(f.ws=r);r-=f.ws;if(f.Ew&& | |
r/f.ie>=f.Ew)c(e);else{r%=f.ie;if(r<f.kw)switch(f=r/(f.kw/5),r=Math.floor(f),r){case 0:q=(f-r)/2;break;case 1:q=(f-r)/2+.5;break;case 2:q=1;break;case 3:q=1-(f-r)/2;break;case 4:q=.5-(f-r)/2}e.g.ih=q}l.g.ih&&h(l)}if(b)for(d=0;d<b.length;d++)a=b[d],a.aw&&(M.o(a),a.aw=!1)};a.oF=function(a,b){a.g.ih=b;h(a)};a.Ak=function(a,b,d,c){var l=a.fE;l.ws=0;l.kw=b;l.ie=d;l.Ew=c;-1==ba.indexOf(a)&&ba.push(a)};a.Nm=c;a.yi=function(a,b){b.zi=a.uuid;b.Ti=!0;t(a,b);a.mt=b.Aa=z(a,b);a.WI=!0;b.xd=a.b4w_vehicle;b.Re= | |
a.b4w_character;b.Aj=a.b4w_floating;b.fk=a.b4w_collision;b.kb=a.b4w_collision_id;b.Tp=a.b4w_correct_bounding_offset;var d=a.game;b.vf={Ar:d.physics_type,Fo:d.use_ghost,IG:d.use_sleep,cg:d.mass,MG:d.velocity_min,LG:d.velocity_max,wu:d.damping,Nw:d.rotation_damping,HO:d.lock_location_x,IO:d.lock_location_y,JO:d.lock_location_z,KO:d.lock_rotation_x,LO:d.lock_rotation_y,MO:d.lock_rotation_z,Rm:d.collision_margin,Pm:d.collision_group,Sm:d.collision_mask,Xx:d.use_collision_bounds,Op:d.collision_bounds_type, | |
Do:d.use_collision_compound};if(d=a.b4w_vehicle_settings)b.Pd={name:d.name,Cd:d.part,yR:d.suspension_rest_length,Fx:d.suspension_compression,Hx:d.suspension_stiffness,Gx:d.suspension_damping,iy:d.wheel_friction,Lw:d.roll_influence,Tv:d.max_suspension_travel_cm,qn:d.force_max,Gm:d.brake_max,am:d.steering_max,ql:d.max_speed_angle,bn:d.delta_tach_angle,vo:d.speed_ratio,xo:d.steering_ratio,Fn:d.inverse_control,lj:d.floating_factor,lk:d.water_lin_damp,mk:d.water_rot_damp,$F:d.synchronize_position};if(d= | |
a.b4w_floating_settings)b.Sk={name:d.name,Cd:d.part,lj:d.floating_factor,lk:d.water_lin_damp,mk:d.water_rot_damp,$F:d.synchronize_position};if(d=a.b4w_character_settings)b.dA={YS:d.walk_speed,dQ:d.run_speed,qR:d.step_height,oO:d.jump_strength,$S:d.waterline};for(d=0;d<a.constraints.length;d++){var c=a.constraints[d];"RIGID_BODY_JOINT"==c.type&&b.qw.push({target:c.target.ya,xP:c.pivot_type,yP:c.pivot_x,zP:c.pivot_y,AP:c.pivot_z,Qf:c.axis_x,Rf:c.axis_y,Sf:c.axis_z,CS:c.use_limit_x,DS:c.use_limit_y, | |
ES:c.use_limit_z,xS:c.use_angular_limit_x,yS:c.use_angular_limit_y,zS:c.use_angular_limit_z,yO:c.limit_max_x,zO:c.limit_max_y,AO:c.limit_max_z,BO:c.limit_min_x,CO:c.limit_min_y,DO:c.limit_min_z,sO:c.limit_angle_max_x,tO:c.limit_angle_max_y,uO:c.limit_angle_max_z,vO:c.limit_angle_min_x,wO:c.limit_angle_min_y,xO:c.limit_angle_min_z})}d=b.g=Q.bj("MESH"===b.type?b.Aa?"DYNAMIC":"STATIC":b.type);a.parent?(b.parent=a.parent.ya,"BONE"==a.parent_type&&"ARMATURE"==a.parent.type&&(b.Tn=a.parent_bone),a.pinverse_tsr&& | |
(b.Br=l.create(),l.copy(a.pinverse_tsr,b.Br))):a.dg_parent&&(b.parent=a.dg_parent.ya,b.fi=!0);var c=a.location,e=a.scale[0];q.zw(a.rotation_quaternion,pa);M.ac(b,c);M.mg(b,pa);M.ld(b,e);b.Eo=a.b4w_use_default_animation;b.Bm=k.qt(a.b4w_anim_behavior);a.b4w_object_tags&&(b.ir={title:a.b4w_object_tags.title,description:a.b4w_object_tags.description,uV:a.b4w_object_tags.category});a.b4w_viewport_alignment&&(b.Qs={YI:a.b4w_viewport_alignment.alignment,distance:a.b4w_viewport_alignment.distance});switch(a.type){case "ARMATURE":r.yi(a, | |
b);c=d.Ce;e=k.cK(c);a.b4w_animation_mixing?(d.Ed=new Float32Array(e.Oa),d.ke=new Float32Array(e.Oa),d.Od=new Float32Array(e.trans),d.ue=new Float32Array(e.trans)):(d.Ed=e.Oa,d.ke=e.Oa,d.Od=e.trans,d.ue=e.trans);for(var f in c){var w=c[f];1==w.Mp.length&&r.YR(w,!0,e.trans,e.Oa)}d.tw=e;d.Ke=0;d.Ni=a.b4w_animation_mixing;break;case "MESH":d.Lk=a.b4w_do_not_render;d.Bk=n.NJ(a.data.b4w_bounding_box);d.ii=V.outlining_overview_mode||a.b4w_selectable;d.sr=a.b4w_selectable;d.Zb=V.outlining_overview_mode|| | |
a.b4w_outlining;d.rr=a.b4w_outlining;d.gE=V.outlining_overview_mode||a.b4w_outline_on_select;d.ff=a.b4w_billboard;d.Gt=a.b4w_pres_glob_orientation;d.Em="BASIC";d.Dm="SPHERICAL"==a.b4w_billboard_geometry;f=d.Cl;f.Dl=a.b4w_outline_settings.outline_duration;f.El=a.b4w_outline_settings.outline_period;f.Fl=a.b4w_outline_settings.outline_relapses;d.ii&&(d.Pp=q.sB(ca),ca++);for(f=0;f<a.data.b4w_vertex_anim.length;f++)c=a.data.b4w_vertex_anim[f],b.Qc.push({name:c.name,ga:c.frame_start,Da:c.frame_end,nV:c.averaging, | |
oV:c.averaging_interval,ZI:c.allow_nla});b.g.Qc=b.Qc.length?!0:!1;if("MESH"!=a.type)throw"Wrong object type: "+a.name;f=b.g;if(a.data.b4w_shape_keys.length)for(f.Ef=!0,c=0;c<a.data.b4w_shape_keys.length;c++)e={},e.value=a.data.b4w_shape_keys[c].value,e.name=a.data.b4w_shape_keys[c].name,f.li.push(e);else f.Ef=!1;d.pe=a.b4w_shadow_cast;d.Ld=a.b4w_shadow_receive;d.Kd=a.b4w_shadow_cast_only&&d.pe;d.kd=a.b4w_reflexible;d.Zc=a.b4w_reflexible_only&&d.kd;d.Gd=a.b4w_reflective;d.ig=a.b4w_reflection_type; | |
d.Eg=a.b4w_caustics;d.xe=a.b4w_wind_bending;d.No=a.b4w_wind_bending_angle;f=n.aT(a.b4w_wind_bending_angle,d.Bk,a.scale[0]);d.ug=f;d.yh=a.b4w_wind_bending_freq;d.Jg=a.b4w_detail_bending_freq;d.Ig=a.b4w_detail_bending_amp;d.Dg=a.b4w_branch_bending_amp;d.uj=!1;d.$g=a.b4w_main_bend_stiffness_col;f=a.b4w_detail_bend_colors;d.Wc={};d.Wc.tD=f.leaves_stiffness_col;d.Wc.sD=f.leaves_phase_col;d.Wc.hE=f.overall_stiffness_col;d.gj=a.b4w_do_not_cull;d.eq=a.b4w_disable_fogging;d.Xf=a.b4w_dynamic_geometry;if("MESH"!== | |
a.type)throw"Wrong object";f=a.data.materials[0];d.sn=f.physics.friction;d.kn=f.physics.elasticity;d.Ln=0;d.Zh=1E6;d.Fj=a.b4w_lod_transition;d.$q=!0;break;case "LINE":d.gj=!0;d.zc=A.Qd();d.De=A.nk();d.Cg=A.eH();d.Jb=A.Qd();d.Ac=A.nk();d.Gh=A.eH();break;case "CAMERA":L.hK(a,b);L.GJ(b);break;case "LAMP":B.pO(a,b);break;case "SPEAKER":b.M=O.nL();d=!1;for(f=0;f<b.D.length;f++)if(b.D[f].Ia.b4w_enable_audio){d=!0;break}d&&O.yi(a,b);break;case "EMPTY":d.zc=A.Qd(),f=A.nk(),d.De=f,a.field&&(b.Rk={type:a.field.type, | |
VF:a.field.strength}),a.b4w_anchor&&(b.anchor={type:a.b4w_anchor.type,Kk:a.b4w_anchor.detect_visibility,hq:a.b4w_anchor.element_id,ZO:a.b4w_anchor.max_width})}v(b)};a.vS=function(a,b){b.zi=a.uuid;b.Ti=!0;t(a,b);a.mt=b.Aa=z(a,b);a.WI=!0;b.g=Q.bj(b.type);b.Eo=a.b4w_use_default_animation;b.Bm=k.qt(a.b4w_anim_behavior);v(b)};a.kS=function(a,b){var c=b.g;if(b.parent){!b.fi&&b.vf.Do&&b.parent.vf.Do&&(b.fk=!1);for(var e=!1,r=0;r<b.D.length;r++)if(b.D[r].Ia.Hb){e=!0;break}if(r=e)r=b.vf,r=b.xd||b.Aj||d.Re(b)|| | |
b.fk&&!r.Fo&&0<r.cg&&("DYNAMIC"==r.Ar||"RIGID_BODY"==r.Ar);if(r)r=b.fi?l.copy(c.i,l.create()):c.i,l.multiply(b.parent.g.i,r,c.i),M.ac(b,l.m(c.i)),M.ld(b,l.qc(c.i)),M.mg(b,l.v(c.i));else if(b.fi||!b.Tn)if(r=l.copy(c.i,l.create()),b.Qs&&"CAMERA"==b.parent.type){r={distance:b.Qs.distance,rotation:l.v(r)};switch(b.Qs.YI){case "TOP_LEFT":r.top=0;r.left=0;break;case "TOP":r.top=0;r.left=.5;break;case "TOP_RIGHT":r.top=0;r.right=0;break;case "LEFT":r.top=.5;r.left=0;break;case "CENTER":r.top=.5;r.left=.5; | |
break;case "RIGHT":r.top=.5;r.right=0;break;case "BOTTOM_LEFT":r.bottom=0;r.left=0;break;case "BOTTOM":r.bottom=0;r.left=.5;break;case "BOTTOM_RIGHT":r.bottom=0,r.right=0}G.vt(b,b.parent,r)}else G.cJ(b,b.parent,r);else r=l.copy(c.i,l.create()),G.dJ(b,b.parent,b.Tn,r)}if("ARMATURE"==b.type)for(e=a.pose.bones,r=0;r<e.length;r++){var f=e[r],w=f.constraints;if(w)for(var g=0;g<w.length;g++){var h=w[g];"COPY_TRANSFORMS"!=h.type||h.subtarget||h.mute||G.nJ(b,h.target.ya,f.name,q.Zy,q.Ry)}}if("MESH"==b.type)var D= | |
k.EB(a);if(D){w=D.ya;r=w.g.tw;e=b.g;f=a.data;b.Bp=w;f=f.vertex_groups;if(f.length){var w=w.g.Ce,g=0,h={},n;for(n in w){var P=q.Fc("name",n,f);P&&(h[n]={PG:P.index,Ih:w[n].Ih,Au:g++})}e.Dk=h;n=g;f=k.XB();e.ah=n;n>2*f?(e.kl=!1,x.error('too many bones for "'+a.name+'" / '+e.ah+" bones (max "+f+" with blending, "+2*f+" without blending). Skinning will be disabled.")):e.kl=!0}n=k.pM(r.trans,r.Oa,c.Dk);D.b4w_animation_mixing?(c.Ed=new Float32Array(n.Oa),c.ke=new Float32Array(n.Oa),c.Od=new Float32Array(n.trans), | |
c.ue=new Float32Array(n.trans)):(c.Ed=n.Oa,c.ke=n.Oa,c.Od=n.trans,c.ue=n.trans);c.yt=new Float32Array(4);c.xt=H.create();c.tw=n;c.Ke=0}if(c.Gd)if(c=b.g,"CUBE"==c.ig)c.Fe=Z++;else if("PLANE"==c.ig){a:{D=a.constraints;for(n=0;n<D.length;n++)if(r=D[n],"LOCKED_TRACK"==r.type&&"REFLECTION PLANE"==r.name){if(r.target.ya){D=r.target.ya;break a}x.warn('Reflection plane target "'+r.target.name+'" for object: "'+b.name+"\" is not present on the scene. Using object's Z-axis.")}D=null}D||(D=q.km("%reflection%"), | |
D=Q.Jk(D,"EMPTY"),n=Q.bj("EMPTY"),D.g=n,u(b,D),G.xz(D,b,[0,0,0],null,1),v(D));n=null;for(r=0;r<da.length;r++)if(da[r]==D){n=r;break}null==n&&(n=da.length,da.push(D));D.g.je=n;c.je=n;D.eo.push(b)}};a.xG=e;a.UV=u;a.tK=g;a.lS=function(a){for(var b=0;b<a.length;b++){var d=a[b];!d.g||"DYNAMIC"!=d.g.type&&"CAMERA"!=d.g.type||M.o(d);d.Eo&&k.cE(d)&&(k.Ap(d),d.T.length&&k.play(d,null,k.pk))}};a.yn=function(a){return q.Ma(a.ir)};a.fa=function(){Z=ca=0;da.length=0;ba.length=0;R={ALL:[]}};a.copy=function(a,b, | |
d){var c=b,l=Q.Rg(a);b=l?Q.tB(l.name,b):b;if(f(b,R.ALL,!1,-1)){for(var l=1,e;;){e="."+(3>String(l).length?("000"+String(l)).slice(-3):String(l));if(!f(b+e,R.ALL,!1,-1))break;l++}x.error('Object "'+b+'" already exists. Name was replaced by "'+b+e+'".');c+=e;b+=e}c=Q.Jk(b,a.type,c);c.Ti=a.Ti;c.Aa=a.Aa;c.In=a.In;c.Eo=a.Eo;c.g=Q.Hk(a.g);c.ir=Q.Hk(a.ir);u(a,c);c.uk=Q.gu(a.uk);c.parent=Q.gu(a.parent);c.fi=a.fi;c.Tn=a.Tn;!a.p||a.xd||a.Re||a.Aj||(c.fk=a.fk,c.p=null);c.kb=a.kb;c.Tp=a.Tp;c.vf=Q.Hk(a.vf);b= | |
[];for(l=0;l<a.D.length;l++){var r=c.D[l];e=a.D[l].W;if(d){for(var r=r.W,w=0;w<e.length;w++)if(!e[w].$f){var g=Q.Hk(e[w]);r.push(g);b.push(e[w].pa)}for(w=0;w<e.length;w++)if(e[w].$f){g=Q.Hk(e[w]);r.push(g);for(var k=0;k<b.length;k++)b[k]==e[w].pa&&(g.pa=r[k].pa)}for(w=0;w<r.length;w++)r[w].pa&&E.yG(r[w].pa),r[w].Bl=c.zi,n.SR(r[w],n.eK(c.g));F.$Q(r)}else r.W=Q.gu(e)}Q.Ow(c,!1);v(c);c.g.XC=!0;c.g.Pp=q.sB(ca);ca++;return c};a.ZR=function(a){for(var b=a.g,d=a.D[0].W,c,l,e,r,q,f,w=0;w<d.length;w++)if("MAIN"== | |
d[w].type){var g=d[w].pa.md,k=d[w].pa.jd.a_position.offset;c=r=g[k];l=q=g[k+1];e=f=g[k+2];break}for(w=0;w<d.length;w++)if(g=d[w],"MAIN"==g.type)for(var g=g.pa.md,x=d[w].pa.jd,k=x.a_position.offset,x=x.a_position.length+k,h=k;h<x;h+=3){var k=g[h],D=g[h+1],m=g[h+2];c=Math.max(k,c);l=Math.max(D,l);e=Math.max(m,e);r=Math.min(k,r);q=Math.min(D,q);f=Math.min(m,f)}var p={max_x:parseFloat(c.toFixed(3)),max_y:parseFloat(l.toFixed(3)),max_z:parseFloat(e.toFixed(3)),min_x:parseFloat(r.toFixed(3)),min_y:parseFloat(q.toFixed(3)), | |
min_z:parseFloat(f.toFixed(3))},H=c-r,V=l-q,v=e-f;r=.5*(c+r);var Z=.5*(l+q),J=.5*(e+f),I=r,ba=J;q=Math.max(H,Math.max(V,v))/2;f=Math.max(H,v)/2;var y=[r/(H?H:1),Z/(V?V:1),J/(v?v:1)],t=.5;if(b.ff)k=Math.max(Math.abs(p.max_x),Math.abs(p.min_x)),D=Math.max(Math.abs(p.max_y),Math.abs(p.min_y)),m=Math.max(Math.abs(p.max_z),Math.abs(p.min_z)),q=Math.sqrt(k*k+D*D+m*m),f=Math.sqrt(k*k+D*D),p.max_x=p.max_y=p.max_z=q,p.min_x=p.min_y=p.min_z=-q,r=new Float32Array([0,0,0]),v=new Float32Array([q,q,q]),V=new Float32Array([0, | |
0,0]);else{for(w=0;w<d.length;w++)if(g=d[w],"MAIN"==g.type)for(g=g.pa.md,x=d[w].pa.jd,k=x.a_position.offset,x=x.a_position.length+k,h=k;h<x;h+=3){var k=g[h],D=g[h+1],m=g[h+2],F=Math.sqrt((r-k)*(r-k)+(Z-D)*(Z-D)+(J-m)*(J-m));if(F>q){var B=r-q*(k-r)/F,O=Z-q*(D-Z)/F,F=J-q*(m-J)/F;r=(B+k)/2;Z=(O+D)/2;J=(F+m)/2;q=Math.sqrt((r-k)*(r-k)+(Z-D)*(Z-D)+(J-m)*(J-m))}O=Math.sqrt((I-k)*(I-k)+(ba-m)*(ba-m));O>f&&(B=I-f*(k-I)/O,F=ba-f*(m-ba)/O,I=(B+k)/2,ba=(F+m)/2,f=Math.sqrt((I-k)*(I-k)+(ba-m)*(ba-m)));k/=H?H:1; | |
D/=V?V:1;m/=v?v:1;F=Math.sqrt((y[0]-k)*(y[0]-k)+(y[1]-D)*(y[1]-D)+(y[2]-m)*(y[2]-m));F>t&&(B=y[0]-t*(k-y[0])/F,O=y[1]-t*(D-y[1])/F,F=y[2]-t*(m-y[2])/F,y[0]=(B+k)/2,y[1]=(O+D)/2,y[2]=(F+m)/2,t=Math.sqrt((y[0]-k)*(y[0]-k)+(y[1]-D)*(y[1]-D)+(y[2]-m)*(y[2]-m)))}w=H?H*y[0]:c;l=V?V*y[1]:l;e=v?v*y[2]:e;H*=t;V*=t;v*=t;r=new Float32Array([r,Z,J]);v=new Float32Array([H,V,v]);V=new Float32Array([w,l,e]);f=parseFloat(f.toFixed(3))}b.zc=p;n.BQ(b,f,f,p);p=A.Vp(q,r);b.De=p;p=A.Up([v[0],0,0],[0,v[1],0],[0,0,v[2]], | |
V,[0,0,0,1]);b.Cg=p;M.o(a);if(P.wireframe_debug)for(w=0;w<d.length;w++)if("WIREFRAME"===d[w].type&&d[w].dj){a=C.$u(1,p.N);E.WE(a,[p.Qf[0],p.Rf[1],p.Sf[2]],p.N);E.us(a,1,!0);a.U.a_polyindex=E.Qu(a);n.RR(d[w],a);break}};a.wb=p;a.wN=function(a,b){for(var d=R.ALL||[],c=[],l=0;l<d.length;l++){var e=d[l];if((e.g.rd==b||-1==b)&&e.Ti)for(var r=e.D,q=0;q<r.length;q++)r[q].Ia==a&&c.push(e)}return c};a.oq=function(a){var b=R.ALL;if(-1==a)return b;for(var d=[],c=0;c<b.length;c++){var l=b[c];l.g.rd==a&&d.push(l)}return d}; | |
a.fR=function(a){var b=p(a,"LAMP",-1);if(b.length==a.k.mZ){for(var d=[],c=0;c<b.length;c++){var l=b[c],l=Q.bb(l,a);d[l.Cj]=c}for(c=0;c<d.length-1;c++)for(l=c+1;l<d.length;l++){var e=b[d[c]].hc,r=b[d[l]].hc;if(r.mm&&r.gk&&(!e.mm||!e.gk)||!e.mm&&(r.mm||!e.gk&&r.gk))e=d[c],d[c]=d[l],d[l]=e}for(c=0;c<d.length;c++)l=b[d[c]],Q.bb(l,a).Cj=c,I.zG(b[d[c]],a)}};a.p0=function(a){for(var b=p(a,"LAMP",-1),d=p(a,"MESH",-1),c=0;c<d.length;c++)for(var l=Q.bb(d[c],a).W,e=0;e<l.length;e++){var r=l[e];"MAIN"==r.type&& | |
(n.TR(r,b,a),n.Hc(r))}};a.kC=function(){for(var a=[],b=R.MESH,d=0;d<b.length;d++){var c=b[d];c.g.ii&&c.Ti&&a.push(c)}return a};a.MX=function(){for(var a=[],b=R.MESH,d=0;d<b.length;d++){var c=b[d];c.g.Zb&&c.Ti&&a.push(c)}return a};a.gc=function(b,d,c,l){var e=null,r=R.ALL;switch(b){case a.bt:e=f(d,r,!0,c);break;case a.at:a:{for(b=0;b<r.length;b++)if(e=r[b],e.Nj==c&&(e.g.rd==l||-1==l)){var q=Q.Rg(e);if(q&&q.Nj==d)break a}e=null}break;case a.Jc:a:{for(l=0;l<r.length;l++){b=r[l];for(var e=d.length-1, | |
q=b,w=!0;0<=e&&w;)w=q&&q.Nj==d[e]&&(q.g.rd==c||-1==c),q&&(q=Q.Rg(q)),e--;if(w&&!q){e=b;break a}}e=null}}return e};a.yq=function(a,b){return f("%meta_world%"+a,R.WORLD,!0,b)};a.Wn=function(b,d){var c=I.al();if(!c)return x.error("No active scene"),null;var l=w.vP(b,d);if(l)return l;l=I.wP(c,b,d);if(!l)return null;for(var c=p(c,"MESH",-1),e=0;e<c.length;e++){var r=c[e].g,q=r.Pp;if(q&&3>Math.abs(255*q[0]-l[0])&&3>Math.abs(255*q[1]-l[1])&&3>Math.abs(255*q[2]-l[2]))return r.Zb&&r.gE&&(V.outlining_overview_mode? | |
a.Ak(c[e],V.Dl,V.El,V.Fl):(l=r.Cl,a.Ak(c[e],l.Dl,l.El,l.Fl))),c[e]}return null};a.AF=function(a,b){for(var d=p(a,"EMPTY",-1),c=0;c<d.length;c++){var l=d[c];if(l.Rk&&"WIND"===l.Rk.type)var r=l}if(!r)return x.error("There is no wind on the scene"),0;"number"==typeof b.wind_dir&&(d=q.lb(b.wind_dir),D.set(Math.sin(d),0,Math.cos(d),J),q.QL(J,q.Db,pa),M.mg(r,pa));"number"==typeof b.wind_strength&&(r.Rk.VF=b.wind_strength);e(r)};a.ho=function(a){G.uK(a)&&G.remove(a);var b=R.ALL,d=R[a.type],c=b.indexOf(a); | |
a=d.indexOf(a);-1!=c&&b.splice(c,1);-1!=a&&d.splice(a,1)};a.mP=v;a.nP=function(a){return R[a.type]&&-1<R[a.type].indexOf(a)}};b4w.module.__geometry=function(a,m){function h(a,b){for(var d=1;d<a.Ea.length;d++){for(var c=a.Ea[d].ed,e=c.a_position,f=c.a_normal,g=b.a_position,k=b.a_normal,x=e.length,h=a.Ea[d].Mq,n=0;n<x;n++)g[n]+=h*e[n],k[n]+=h*f[n];c=c.a_tangent;e=b.a_tangent;f=c.length;for(n=0;n<f;n++)e[n]+=h*c[n]}}function c(a){return 65536<a.ma?b.NB()?!1:!0:!1}function e(a){return 0<a.Ta.length?!0:!1}function u(a,b,c){if(!e(a))return a;c||d.log('%cDEBUG max vertices exceeded for indexed submesh "'+a.name+'": '+a.ma*(b|| | |
1)+", will use drawArrays","color: #aa0");b=a.Ta;c=a.ma;var r=a.U,f=a.H,k;for(k in r){var x=r[k],h=L(x,c);r[k]=g(b,x,h)}for(r=0;r<f.length;r++){var n=f[r];for(k in n)x=n[k],h=L(x,c),n[k]=g(b,x,h)}for(r=0;r<a.Ea.length;r++){k=a.Ea[r].ed;for(var C in k)x=k[C],h=L(x,c),k[C]=g(b,x,h)}a.ma=b.length;a.Ta=new Uint16Array(0);return a}function g(a,b,d){if(0==b.length)return new Float32Array(0);for(var c=new Float32Array(a.length*d),e=0;e<a.length;e++)for(var f=a[e],g=0;g<d;g++)c[d*e+g]=b[d*f+g];return c}function z(a, | |
b){var d=a.md,c=a.jd[b];if(c)return d.subarray(c.offset,c.offset+c.length);throw"extract_array() failed; invalid name: "+b;}function t(b,d){var c,e;switch(d){case a.um:case a.Vo:c=F.TRIANGLES;e=F.STATIC_DRAW;break;case a.vy:c=F.POINTS;e=F.STATIC_DRAW;break;case a.Uo:c=F.TRIANGLES;e=F.DYNAMIC_DRAW;break;case a.mH:c=F.POINTS;e=F.DYNAMIC_DRAW;break;case a.nH:c=F.LINES;e=F.STATIC_DRAW;break;default:throw"Wrong draw_mode";}b.mode=c;b.Co=e}function p(a){a.vj?(a.Vg||(a.Vg=F.createBuffer()),F.bindBuffer(F.ELEMENT_ARRAY_BUFFER, | |
a.Vg),F.bufferData(F.ELEMENT_ARRAY_BUFFER,a.vj,a.Co),a.aq=a.vj.byteLength):a.aq=0;a.Ai||(a.Ai=F.createBuffer());F.bindBuffer(F.ARRAY_BUFFER,a.Ai);F.bufferData(F.ARRAY_BUFFER,a.md,a.Co);a.RA=a.md.byteLength}function f(a){for(var b=C.oc("JOIN_"+a.length+"_SUBMESHES"),d=0,c=0;c<a.length;c++)d+=a[c].Ta.length;b.Ta=new Uint32Array(d);var e=d=0,f=0;if(0<a[0].Ea.length)for(var g=0;g<a[0].Ea.length;g++){for(c=0;c<a.length;c++)d+=a[c].Ea[g].ed.a_position.length,e+=a[c].Ea[g].ed.a_normal.length,f+=a[c].Ea[g].ed.a_tangent.length; | |
c={a_position:new Float32Array(d),a_normal:new Float32Array(e),a_tangent:new Float32Array(f)};b.Ea.push({Mq:a[0].Ea[g].Mq,ed:c})}for(c=d=0;c<a.length;c++)d+=a[c].ma;b.ma=d;var e=a[0],k;for(k in e.U){for(c=d=0;c<a.length;c++)d+=a[c].U[k].length;b.U[k]=new Float32Array(d)}for(k in e.H[0]){for(c=d=0;c<a.length;c++)d+=a[c].H[0][k].length;for(c=0;c<e.H.length;c++)b.H[c]=b.H[c]||{},b.H[c][k]=new Float32Array(d)}for(k=e=d=0;k<a.length;k++){for(var f=a[k],x=f.Ta,g=f.ma,h=f.U,c=0;c<x.length;c++)b.Ta[d+c]= | |
x[c]+e;var d=d+x.length,n;for(n in h){var x=h[n],m=e*L(x,g);b.U[n].set(x,m)}for(c=0;c<f.H.length;c++){var h=f.H[c],p=b.H[c];for(n in h)x=h[n],m=e*L(x,g),p[n].set(x,m)}e+=g}if(0<b.Ea.length)for(k=0;k<b.Ea.length;k++)for(n=b.Ea[k].ed,c=f=e=d=0;c<a.length;c++)g=a[c].Ea[k].ed,n.a_position.set(g.a_position,d),n.a_normal.set(g.a_normal,e),n.a_tangent.set(g.a_tangent,f),d+=g.a_position.length,e+=g.a_normal.length,f+=g.a_tangent.length;return b}function v(a,b,c,e,f,g){var x=a.submeshes[b],h=x.base_length, | |
m=a.materials[b],p=C.oc("SUBMESH_"+a.name+"_"+m.name);p.ma=h;var H=!1;if(n(c,"a_texcoord")){var v=null,y=a.materials[b];b=a.submeshes[b];if(y.texture_slots.length)switch(y=y.texture_slots[0],y.texture_coords){case "UV":y=a.uv_textures.indexOf(y.uv_layer);0==y?v=new Float32Array(b.texcoord):1==y&&(v=new Float32Array(b.texcoord2));break;case "ORCO":for(var I=a.b4w_bounding_box_source,v=new Float32Array(2*b.base_length),y=(I.max_x+I.min_x)/2,W=(I.max_z+I.min_z)/2,M=I.max_x-I.min_x,I=I.max_z-I.min_z, | |
t=0,F=0;F<b.position.length;F+=3)v[t++]=(b.position[F]-y)/M+.5,v[t++]=(W-b.position[F+2])/I+.5}null===v&&(v=new Float32Array(2*b.base_length));b=v}else b=new Float32Array(0);if(n(c,"a_orco_tex_coord")){v=a.b4w_bounding_box_source;y=new Float32Array(3*x.base_length);W=v.max_x-v.min_x;M=v.max_y-v.min_y;I=v.max_z-v.min_z;for(F=t=0;F<x.position.length;F+=3)0==W?y[t++]=.5:y[t++]=C.J(parseFloat(((x.position[F]-v.min_x)/W).toFixed(5)),0,1),0==I?y[t++]=.5:y[t++]=C.J(parseFloat(((v.max_z-x.position[F+2])/ | |
I).toFixed(5)),0,1),0==M?y[t++]=.5:y[t++]=C.J(parseFloat(((x.position[F+1]-v.min_y)/M).toFixed(5)),0,1);v=y}else v=new Float32Array(0);var O,y=x.group;if(n(c,"a_influence")&&e){W=new Float32Array(4*h);M=y.length/h;I=new Float32Array(M);for(t=0;t<M;t++)for(O in I[t]=-1,e)if(F=e[O],F.PG===t){I[t]=F.Au;break}var z=3<M?M:4;e=new Float32Array(z);O=new Uint32Array(z);for(var t=new Float32Array(4),F=new Float32Array(z),z=new Uint32Array(z),L=new Float32Array(4),E=0;E<h;E++)e.set(F),O.set(z),t.set(L),W.set(A(y, | |
M,E,h,I,e,O,t),4*E)}else W=new Float32Array(0);O=W;e=f?C.Ma(f):{};e.a_color={oj:!0};e.a_color.src=n(c,"a_color")&&a.active_vcol_name?[{name:a.active_vcol_name,Se:7}]:[];f={a_texcoord:b,a_influence:O,a_orco_tex_coord:v};O=x.vertex_colors;b=x.color;v=a.name;y=[];for(W=0;W<O.length;W++)y.push(O[W].name);for(var G in e)if(W=e[G].src,W.length){for(I=M=0;I<W.length;I++)M+=C.Xj(W[I].Se);f[G]=new Float32Array(M*h);for(I=t=0;I<W.length;I++){var K=W[I].name,F=W[I].Se,z=C.SE(F),Q=y.indexOf(K);-1==Q&&C.ha('vertex color "'+ | |
K+'" for mesh "'+v+'" not found.');L=O[Q].mask;E=C.Xj(L);(F&L)!==F&&d.error("Wrong color extraction from "+K+" to "+G+".");for(var S=K=0;S<Q;S++)K+=C.Xj(O[S].mask);Q=K*h;for(K=0;K<h;K++)for(S=0;3>S;S++)z[S]&&(f[G][K*M+(t+C.ko(F,S))]=b[Q+K*E+C.ko(L,S)]);t+=E}}else f[G]=new Float32Array(0);G=a.uv_textures;e=x.texcoord;O=x.texcoord2;if(g)for(var ea in g){b=G.indexOf(ea);if(0==b)var Fa=new Float32Array(e);else 1==b&&(Fa=new Float32Array(O));f[g[ea]]=Fa}p.U=f;p.Ta=new Uint32Array(x.indices);g=x.position.length/ | |
h/3;Fa=(ea=n(c,"a_normal")&&x.normal.length?!0:!1)&&n(c,"a_tangent")&&x.tangent.length?!0:!1;G=m.texture_slots[0];G=ea&&m.texture_slots.length&&n(c,"a_tangent")&&"ORCO"==G.texture_coords&&G.use_map_normal?!0:!1;0<a.b4w_shape_keys.length&&(H=!0);for(f=0;f<g;f++){m=k(x,c,h,ea,Fa,G,f,a.name);if(H)if(e={},e.name=a.b4w_shape_keys[f].name,p.Ea.push(e),0!=f){e.ed=m;e.Mq=a.b4w_shape_keys[f].value;continue}else e.ed=k(x,c,h,ea,Fa,G,f,a.name),e.Mq=1;p.H.push(m)}if(1<g&&!H){a=p.H[0];var m={},oa;for(oa in a)m[oa]= | |
new Float32Array(a[oa]);p.H.push(m)}n(c,"a_polyindex")&&(u(p,1,!0),p.U.a_polyindex=B(p));return p}function k(a,b,c,e,f,g,k,x){var h={},m=new Float32Array(3*c),p=new Float32Array(e?3*c:0),v=new Float32Array(f||g?4*c:0),y=k*c*3;m.set(a.position.subarray(y,y+3*c),0);e&&(y=k*c*3,p.set(a.normal.subarray(y,y+3*c),0));if(f)y=k*c*4,v.set(a.tangent.subarray(y,y+4*c),0);else if(g)for(a=v,d.warn('Not precise tangents calculation for normalmap using GENERATED texture coordinates in mesh: "'+x+'". Please add a UV-map.'), | |
x=0;x<c;x++)b=I,e=O,b[0]=p[3*x],b[1]=p[3*x+1],b[2]=p[3*x+2],H.cross(b,C.Rd,e),0==H.length(e)&&H.cross(b,C.ye,e),H.normalize(e,e),a[4*x]=e[0],a[4*x+1]=e[1],a[4*x+2]=e[2],a[4*x+3]=1;else if(e&&n(b,"a_tangent"))for(v=new Float32Array(4*c),c=0;c<v.length;c++)v[c]=1;h.a_position=m;h.a_normal=p;h.a_tangent=v;return h}function n(a,b){return-1<a.indexOf(b)?!0:!1}function A(b,d,c,e,f,g,k,x){for(var h=!0,n=0;n<d;n++){var C=b[n*e+c];if(-1!==C){var m=f[n];-1!==m&&(g[n]=C,k[n]=m,h=!1)}}if(h)return x;K(g,k,a.ht, | |
!1);for(n=b=0;4>n;n++)b+=g[n];if(.01>b)return x;for(n=0;4>n;n++)g[n]/=b;if(.01>Math.abs(g[0]-1))x[0]=k[0]+1;else for(n=0;4>n;n++)x[n]=k[n]+g[n];return x}function L(a,b){if(0==b)return 0;var d=a.length,c=d/b;if(c!=Math.floor(c))throw"Array size mismatch during geometry calculation: array length="+d+", base length="+b;return c}function K(b,d,c,e){for(var f=b.length,g=f,k=!1,x=e?-1:1;1<g||k;){1<g&&(g=Math.floor(g/1.247330950103979));for(var k=!1,h=0;g+h<f;h++)if(c==a.ht?0>x*(b[h]-b[h+g]):b[h]<b[h+g]&& | |
e)k=b[h],b[h]=b[h+g],b[h+g]=k,k=d[h],d[h]=d[h+g],d[h+g]=k,k=!0}}function G(a,b,d){var c=[],e=[];H.subtract(b,a,c);H.subtract(d,a,e);H.normalize(c,c);H.normalize(e,e);return Math.acos(H.dot(c,e))}function E(a,b,d){b||(b=[]);d=d?a.H[0].a_normal:a.H[0].a_position;if(e(a)){a=a.Ta;for(var c=a.length/3,f=0;f<c;f++){var g=new Float32Array(9),k=a[3*f];g[0]=d[3*k];g[1]=d[3*k+1];g[2]=d[3*k+2];k=a[3*f+1];g[3]=d[3*k];g[4]=d[3*k+1];g[5]=d[3*k+2];k=a[3*f+2];g[6]=d[3*k];g[7]=d[3*k+1];g[8]=d[3*k+2];b[f]=g}}else for(f= | |
0;f<d.length;f++)g=new Float32Array(9),g[0]=d[9*f],g[1]=d[9*f+1],g[2]=d[9*f+2],g[3]=d[9*f+3],g[4]=d[9*f+4],g[5]=d[9*f+5],g[6]=d[9*f+6],g[7]=d[9*f+7],g[8]=d[9*f+8],b[f]=g;return b}function B(a){for(var b=new Float32Array(a.ma),d=0;d<a.ma;d++)b[d]=d%3;return b}function y(a,b,d){var c=H.dist(a,b);a=H.dist(a,d);b=H.dist(b,d);d=(c+a+b)/2;return d*(d-c)*(d-a)*(d-b)}function Q(a,b,d,c,e){d-=b;for(var f=0;f<d;f+=c)f%c==e&&vec3.normalize(a.subarray(f+b-e,f+b+1),a.subarray(f+b-e,f+b+1))}var b=m("__extensions"), | |
d=m("__print"),x=m("__tsr"),C=m("__util"),H=m("__vec3"),I=new Float32Array(3),O=new Float32Array(3),M=new Float32Array(3);a.zg=10;a.hz=20;a.NU=30;a.Vo=10;a.vy=20;a.Uo=30;a.mH=40;a.nH=50;a.ht=0;a.MI=1;a.um=a.Vo;var F=null;a.oe=function(a){F=a};a.cW=function(a){var b=_buffers[a];F.deleteBuffer(b.Vg);F.deleteBuffer(b.Ai);delete _buffers[a]};a.vR=function(b,d,f,r){c(b)&&u(b);var w=b.Ta,g=b.ma,k=b.H,x={},n;for(n in b.U)n in r&&!r[n].oj||(x[n]=b.U[n]);r={vj:null,md:null,sv:0,count:0,jd:{},mode:0,Co:0,aq:0, | |
RA:0,Ai:null,Vg:null,Kq:null,Ea:null};0<b.Ea.length&&h(b,k[0]);if(w.length)if(n=w.length,65536>=g)var C=new Uint16Array(w),m=F.UNSIGNED_SHORT;else C=new Uint32Array(w),m=F.UNSIGNED_INT;else n=g,C=null;var H=0,v=k.length,y;for(y in k[0])var I=k[0][y],H=H+I.length*v;for(y in x)I=x[y],H+=I.length;y=new Float32Array(H);var H=0,v={},M;for(M in x){var A=x[M];if(I=A.length)y.set(A,H),v[M]={lV:M,gh:L(A,g),offset:H,frames:1,length:I},H+=I}x=k.length;for(M in k[0])if(A=k[0][M],I=A.length,A=L(A,g),I){v[M]={gh:A, | |
offset:H,frames:x,length:I};1<x&&(v[M+"_next"]={gh:A,offset:H+I,frames:x,length:I});for(var B=0;B<x;B++)A=k[B][M],y.set(A,H),H+=I}r.count=n;r.vj=C;r.md=y;r.sv=m;r.jd=v;t(r,f);p(r);d!=a.zg&&e(b)&&(r.Kq={aP:new Float32Array(w.length),bP:new Float32Array(w.length),SL:new Float32Array(w.length/3),type:d});r.Ea=b.Ea;return r};a.tR=h;a.iO=c;a.hO=e;a.us=u;a.bS=function(a,b,d){t(a,b);a.count=d.length;a.vj=d;a.sv=d instanceof Uint16Array?F.UNSIGNED_SHORT:F.UNSIGNED_INT};a.aS=function(a,b){var d=a.md,c=a.jd, | |
e=c.a_p_data;e?(3!=e.gh&&C.ha('invalid num_comp for "a_p_data"'),d.set(b,e.offset)):(d=d.length,e=new Float32Array(d+b.length),e.set(a.md),e.set(b,d),a.md=e,c.a_p_data={gh:3,offset:d});p(a)};a.wW=z;a.fZ=function(a){a.Co=F.STATIC_DRAW};a.SO=function(a){a.Co=F.DYNAMIC_DRAW};a.yG=p;a.lA=function(a){a.Vg&&F.deleteBuffer(a.Vg);a.Ai&&F.deleteBuffer(a.Ai)};a.MC=function(a,b){return a.submeshes[b].base_length?!1:!0};a.Cx=function(a,b){for(var d=0;d<a.H.length;d++){var c=a.H[d].a_position;x.ui(c,b,c,0);c= | |
a.H[d].a_normal;0<c.length&&x.Bs(c,b,c,0);c=a.H[d].a_tangent;0<c.length&&x.Cs(c,b,c,0)}(d=a.U.au_center_pos)&&d.length&&x.ui(d,b,d,0);return a};a.sR=function(a,b){var d=a.U.au_center_pos;if(d&&d.length){var c=new Float32Array(d);x.ui(c,b,c,0);for(var e=0;e<a.H.length;e++)for(var f=0;f<c.length;f++)a.H[e].a_position[f]+=c[f]-d[f];d.set(c)}else throw'Attribute "au_center_pos" is missing in particle submesh';};a.rR=function(a,b){var d=a.ma,c;for(c in b){var e=b[c].length;a.U[c]=new Float32Array(e*d); | |
for(var f=0;f<d;f++)for(var g=0;g<e;g++)a.U[c][f*e+g]=b[c][g]}};a.uR=f;a.RO=function(a,d,c){if(!a.ma)return C.oc("EMPTY");var e=c.length;65536<a.ma*e&&!b.NB()&&u(a,e);var f=a.Ta,g=a.ma,k=a.U;a=a.H;for(var h in d){var n=d[h].length,m=n*g;k[h]=new Float32Array(m);for(var p=0;p<g;p++)for(m=0;m<n;m++)k[h][p*n+m]=d[h][m]}d=C.oc("CLONE_"+e+"_SUBMESHES");d.ma=g*e;d.Ta=new Uint32Array(f.length*e);for(p=0;p<e;p++)for(n=f.length*p,h=g*p,m=0;m<f.length;m++)d.Ta[n+m]=f[m]+h;for(var H in k)for(f=k[H],m=f.length* | |
e,n=L(f,g),d.U[H]=new Float32Array(m),p=0;p<e;p++)h=g*n*p,d.U[H].set(f,h);for(H in a[0])for(p=0;p<a.length;p++)for(f=a[p][H],m=f.length*e,n=L(f,g),d.H[p]=d.H[p]||{},d.H[p][H]=new Float32Array(m),m=0;m<e;m++)switch(k=c[m],h=g*n*m,H){case "a_position":x.ui(f,k,d.H[p][H],h);break;case "a_normal":x.Bs(f,k,d.H[p][H],h);break;case "a_tangent":x.Cs(f,k,d.H[p][H],h);break;default:throw"Wrong attribute name: "+H;}return d};a.hB=v;a.oM=function(a){var b=a.ma,d=a.H[0].a_position,c=new Float32Array(12*b),e=new Float32Array(8* | |
b);a=new Uint32Array(4*a.Ta.length);for(var f=new Float32Array(4*b),g=0;g<b;g++){c[12*g]=d[3*g];c[12*g+1]=d[3*g+1];c[12*g+2]=d[3*g+2];c[12*g+3]=d[3*g];c[12*g+4]=d[3*g+1];c[12*g+5]=d[3*g+2];c[12*g+6]=d[3*g];c[12*g+7]=d[3*g+1];c[12*g+8]=d[3*g+2];c[12*g+9]=d[3*g];c[12*g+10]=d[3*g+1];c[12*g+11]=d[3*g+2];e[8*g]=-.5;e[8*g+1]=-.5;e[8*g+2]=-.5;e[8*g+3]=.5;e[8*g+4]=.5;e[8*g+5]=.5;e[8*g+6]=.5;e[8*g+7]=-.5;a[6*g]=4*g+2;a[6*g+1]=4*g+1;a[6*g+2]=4*g;a[6*g+3]=4*g+2;a[6*g+4]=4*g;a[6*g+5]=4*g+3;var k=Math.random(); | |
f[4*g]=k;f[4*g+1]=k;f[4*g+2]=k;f[4*g+3]=k}d=C.oc("HALO");d.H=[];d.H[0]={};d.ma=4*b;d.H[0].a_position=c;d.U.a_halo_bb_vertex=e;d.U.a_random_vals=f;d.Ta=a;return d};a.IN=n;a.iB=function(a,b,d){for(var c=[],e=0;e<a.submeshes.length;e++){var g=v(a,e,b,null,d,null);g.ma&&c.push(g)}return 0==c.length?C.oc("EMPTY"):1==c.length?c[0]:f(c)};a.$R=function(a,b,d){for(var c=a.vj,e=z(a,"a_position"),f=a.Kq,g=f.aP,k=f.bP,f=f.SL,h=c,n=h.length/3,m=0;m<n;m++){var C=h[3*m],p=h[3*m+1],H=h[3*m+2],v=e[3*C+1],y=e[3*C+ | |
2],I=e[3*p+1],M=e[3*p+2],t=e[3*H+1],A=e[3*H+2];g[3*m]=(e[3*C]+e[3*p]+e[3*H])/3;g[3*m+1]=(v+I+t)/3;g[3*m+2]=(y+M+A)/3}x.ui(g,b,k);b=k.length/3;for(e=0;e<b;e++)g=k[3*e]-d[0],h=k[3*e+1]-d[1],n=k[3*e+2]-d[2],f[e]=g*g+h*h+n*n;d=c;c=f.length;if(!(2>c))for(k=c,e=!1;1<k||e;)for(1<k&&(k=Math.floor(k/1.247330950103979)),e=!1,b=0;k+b<c;b++)0>f[b]-f[b+k]&&(e=f[b],f[b]=f[b+k],f[b+k]=e,e=d,g=b,h=b+k,n=e[3*g],m=e[3*g+1],C=e[3*g+2],e[3*g]=e[3*h],e[3*g+1]=e[3*h+1],e[3*g+2]=e[3*h+2],e[3*h]=n,e[3*h+1]=m,e[3*h+2]=C, | |
e=!0);c=d;F.bindBuffer(F.ELEMENT_ARRAY_BUFFER,a.Vg);F.bufferData(F.ELEMENT_ARRAY_BUFFER,c,F.DYNAMIC_DRAW)};a.KF=K;a.bK=function(a,b,d){for(var c=b.length/3,e=a.length/3,f=[],g=Array(3),k=Array(3),x=Array(3),h=0;h<e;h++){for(var n=a[3*h],m=a[3*h+1],C=a[3*h+2],p=0;3>p;p++)g[p]=b[3*n+p],k[p]=b[3*m+p],x[p]=b[3*C+p];if(d)var p=G(g,k,x),v=G(k,x,g),y=Math.PI-p-v;else y=v=p=1;var I=f,M;M=g;var t=x,A=[],F=[],B=[];H.subtract(k,M,A);H.subtract(t,M,F);H.cross(A,F,B);H.normalize(B,B);M=B;for(t=0;3>t;t++)A=3*m+ | |
t,F=3*C+t,I[3*n+t]=p*M[t],I[A]=v*M[t],I[F]=y*M[t]}if(d)for(var O in d)for(h=d[O],a=0;3>a;a++){b=3*h[0]+a;for(e=1;e<h.length;e++)g=3*h[e]+a,f[b]+=f[g];for(e=1;e<h.length;e++)g=3*h[e]+a,f[g]=f[b]}for(h=0;h<c;h++){d=h;O=f;a=new Float32Array(3);for(b=0;3>b;b++)e=3*d+b,a[b]=O[e];H.normalize(a,a);for(b=0;3>b;b++)e=3*d+b,O[e]=a[b]}return f};a.dK=function(a,b,d){for(var c={},e=b.length/3,f=0;f<e;f++){var g=String(b[3*f])+String(b[3*f+1])+String(b[3*f+2]);c[g]=[]}e=a.length;for(f=0;f<e;f++)b=a[f],g=String(d[3* | |
b])+String(d[3*b+1])+String(d[3*b+2]),g in c&&c[g].push(b);return c};a.av=function(a,b,d,c){var e=E(a,null,!1);if(d)var f=E(a,null,!0);var g=e.length,k=new Float32Array(g),x=I,h=O;for(a=0;a<g;a++){var n=e[a];x.set(n.subarray(0,3));h.set(n.subarray(3,6));M.set(n.subarray(6));k[a]=Math.sqrt(y(x,h,M))}x=new Float32Array(g);x[0]=k[0];for(a=1;a<g;a++)x[a]=x[a-1]+k[a];g=x[k.length-1];k=[];for(a=0;a<b;a++){var h=g*C.Xe(c),h=C.Hp(x,h,0,x.length-1),n=d?f[h]:e[h],h=a,m=n,p=c,n=void 0,n=new Float32Array(3), | |
H=m[0],v=m[1],t=m[2],A=m[3],F=m[4],B=m[5],z=m[6],L=m[7],u=m[8],m=C.Xe(p),p=C.Xe(p);1<m+p&&(m=1-m,p=1-p);var G=1-m-p,v=G*v+m*F+p*L,t=G*t+m*B+p*u;n[0]=G*H+m*A+p*z;n[1]=v;n[2]=t;k[h]=n}return k};a.xW=E;a.Qu=B;a.i0=y;a.WE=function(a,b,d){a=a.H[0].a_position;for(var c=0;c<a.length;c+=3)a[c]=(a[c]-d[0])*b[0]+d[0],a[c+1]=(a[c+1]-d[1])*b[1]+d[1],a[c+2]=(a[c+2]-d[2])*b[2]+d[2]};a.AJ=function(a,b,d){var c=a.D[0].W;a=a.g.li;for(var e=1;e<a.length;e++)a[e].name==b&&(a[e].value=d);for(e=0;e<c.length;e++)if(!c[e].$f&& | |
c[e].Ef&&!c[e].dj){d=c[e].pa.jd;b=c[e].pa.md;F.bindBuffer(F.ARRAY_BUFFER,c[e].pa.Ai);var f=d.a_position,g=c[e],k=b,x=a;if(f){for(var h=f.offset,f=f.length+h,n=g.pa.Ea[0].ed.a_position,m=h;m<f;m++)k[m]=n[m-h];for(m=1;m<g.pa.Ea.length;m++){var n=g.pa.Ea[m].ed.a_position,p=x[m].value;if(p)for(var C=h;C<f;C++)k[C]+=p*n[C-h]}F.bufferSubData(F.ARRAY_BUFFER,4*h,k.subarray(h))}f=d.a_normal;g=c[e];k=b;x=a;if(f){h=f.offset;f=f.length+h;n=g.pa.Ea[0].ed.a_normal;for(m=h;m<f;m++)k[m]=n[m-h];for(m=1;m<g.pa.Ea.length;m++)if(n= | |
g.pa.Ea[m].ed.a_normal,p=x[m].value)for(C=h;C<f;C++)k[C]+=p*n[C-h];Q(k,h,f,3,2);F.bufferSubData(F.ARRAY_BUFFER,4*h,k.subarray(h))}x=d.a_tangent;d=c[e];g=a;if(x){k=x.offset;x=x.length+k;f=d.pa.Ea[0].ed.a_tangent;for(h=k;h<x;h++)b[h]=f[h-k];for(h=1;h<d.pa.Ea.length;h++)if(f=d.pa.Ea[h].ed.a_tangent,m=g[h].value)for(n=k;n<x;n++)b[n]+=m*f[n-k];Q(b,k,x,4,3);F.bufferSubData(F.ARRAY_BUFFER,4*k,b.subarray(k))}}};a.BK=function(a){return a.g.Ef};a.UX=function(a){var b=[];if(a.g)for(var d=1;d<a.g.li.length;d++)b.push(a.g.li[d].name); | |
return b};a.TX=function(a,b){if(a.g)for(var d=1;d<a.g.li.length;d++)if(b==a.g.li[d].name)return a.g.li[d].value;return 0};a.MN=function(a,b){var d=a.g.li;if(d)for(var c=1;c<d.length;c++)if(d[c].name==b)return!0;return!1};a.mY=function(a){return a&&a.g&&a.g.Xf?!0:!1};a.jW=function(b,d,c){var e=b.pa;if(e){for(var f=c?d.length/3/2:d.length/3-1,g=new Float32Array(12*f),k=new Float32Array(12*f),x=new Uint16Array(6*f),h=0;h<f;h++){if(c)var n=6*h,m=6*h+3;else n=3*h,m=3*(h+1);var C=d[n],H=d[n+1],n=d[n+2], | |
v=d[m],y=d[m+1],m=d[m+2],I=v-C,M=y-H,t=m-n;g[12*h]=C;g[12*h+1]=H;g[12*h+2]=n;k[12*h]=I;k[12*h+1]=M;k[12*h+2]=t;g[12*h+3]=v;g[12*h+4]=y;g[12*h+5]=m;k[12*h+3]=-I;k[12*h+4]=-M;k[12*h+5]=-t;g[12*h+6]=C;g[12*h+7]=H;g[12*h+8]=n;k[12*h+6]=-I;k[12*h+7]=-M;k[12*h+8]=-t;g[12*h+9]=v;g[12*h+10]=y;g[12*h+11]=m;k[12*h+9]=I;k[12*h+10]=M;k[12*h+11]=t;x[6*h]=4*h;x[6*h+1]=4*h+1;x[6*h+2]=4*h+2;x[6*h+3]=4*h;x[6*h+4]=4*h+3;x[6*h+5]=4*h+1}c=0;for(var A in e.jd)d=e.jd[A],c+=g.length/3*d.gh;e.md=new Float32Array(c);c=e.md; | |
a.bS(e,b.Rh,x);b=0;for(A in e.jd)switch(d=e.jd[A],A){case "a_position":c.set(g,b);d.offset=b;d.length=g.length;b+=d.length;break;case "a_direction":c.set(k,b);d.offset=b;d.length=k.length;b+=d.length;break;default:d.offset=b,d.length=g.length/3*d.gh,x=new Float32Array(d.length),c.set(x,b),b+=d.length}p(e)}}};b4w.module.__extensions=function(a,m){function h(a){if(a in z)return z[a];var c=g.getExtension(a)||null;z[a]=c;e.log("%cGET EXTENSION","color: #"+(c?"0a0":"a00"),a);return c}var c=m("__config"),e=m("__print"),u=c.u,g=null,z={};a.oe=function(a){g=a};a.hC=function(){return h("WEBGL_compressed_texture_s3tc")||h("WEBKIT_WEBGL_compressed_texture_s3tc")||h("MOZ_WEBGL_compressed_texture_s3tc")};a.kN=function(){return u.nd?{}:h("WEBGL_depth_texture")||h("WEBKIT_WEBGL_depth_texture")||h("MOZ_WEBGL_depth_texture")}; | |
a.dN=function(){return h("EXT_texture_filter_anisotropic")||h("WEBKIT_EXT_texture_filter_anisotropic")||h("MOZ_EXT_texture_filter_anisotropic")};a.fv=function(){return h("WEBGL_debug_shaders")};a.fC=function(){return h("WEBGL_debug_renderer_info")};a.NB=function(){return u.nd?{}:h("OES_element_index_uint")};a.pC=function(){return u.nd?null:h("OES_standard_derivatives")};a.tq=function(){return h("EXT_disjoint_timer_query")};a.fa=function(){z={}}};b4w.module.__lights=function(a,m){function h(a){u.scale(a.color,a.Kg,a.Tm)}m("__print");var c=m("__tsr"),e=m("__util"),u=m("__vec3"),g=new Float32Array(3);new Float32Array(3);a.pO=function(a,m){var p=a.data,f=m.hc={name:"",type:p.type,rE:new Float32Array(3),direction:new Float32Array(3),color:new Float32Array(3),Tm:new Float32Array(3),IL:0,Wl:0,qs:0,wB:!1,SD:!1,XL:!1,mm:!0,gk:!0,Kg:1,distance:25,EW:"INVERSE_SQUARE"};f.name=m.name;f.mm=p.use_diffuse;f.gk=p.use_specular;var v=c.v(m.g.i),v=e.hb(v,e.Db, | |
g);u.normalize(v,v);f.direction.set(v);f.color[0]=p.color[0];f.color[1]=p.color[1];f.color[2]=p.color[2];f.Kg=f.IL=p.energy;h(f);f.distance=p.distance;if("POINT"===f.type||"SPOT"===f.type)f.distance=p.distance;"SPOT"===f.type?(f.qs=p.spot_blend,f.Wl=p.spot_size):"POINT"===f.type&&(f.Wl=Math.PI/2);f.wB=p.b4w_generate_shadows;f.XL=p.b4w_dynamic_intensity};a.zQ=function(a,c){a.color[0]=c[0];a.color[1]=c[1];a.color[2]=c[2];h(a)};a.d_=function(a,c){a.qs=c};a.c_=function(a,c){a.distance=c};a.e_=function(a, | |
c){a.Wl=c};a.AQ=function(a,c){a.Kg=c;h(a)};a.hS=function(a){if("LAMP"!=a.type)throw"Wrong light object";var g=a.hc;if(g){a=c.v(a.g.i);e.hb(a,e.Db,g.direction);u.normalize(g.direction,g.direction);if("SUN"==g.type){a=Math.acos(u.dot(g.rE,e.it));var h=Math.acos(u.dot(g.direction,e.it));g.SD=Math.floor(a/.025)!=Math.floor(h/.025)?!0:!1}u.copy(g.direction,g.rE)}}};b4w.module.__nla=function(a,m){function h(){return{type:"CLIP",ga:0,Da:0,oh:!1,paused:!1,Be:"",Cm:"",Tc:0,Dh:0,Li:0,fB:0,eB:0,HG:!1,scale:1,repeat:1,qz:0}}function c(a,d){if(a.animation_data){var e=a.animation_data.nla_tracks;if(e)for(var f=0;f<e.length;f++)d.push(e[f])}e=a.nodes;for(f=0;f<e.length;f++){var g=e[f];g.node_group&&(g=g.node_group.node_tree)&&c(g,d)}}function e(a,d){var c=Math.round(a)-d.ga;d.ek&&(c%=d.Vk,0>c&&(c+=d.Vk));return d.pb+c}function u(a,d){var c=(d-Q)*E.pc()+a.pb;c>a.ga?(c-= | |
a.ga,a.Kc&&(c%=a.Da-a.ga+1),c+=a.ga):c=a.ga;return c}function g(a,d){a=B.J(a,d.ga,d.Da);var c=a==d.Da?d.qz:d.Dh+(a-d.ga)%((d.Li-d.Dh)*d.scale)/d.scale;d.HG&&(c=d.Li-c+d.Dh);return c}function z(a,d){for(var c=[],e=0;e<a.length;e++){var f=a[e].strips;if(f)for(var g=0;g<f.length;g++){var k=f[g],n=h();n.type=k.type;n.ga=k.frame_start;n.Da=k.frame_end;n.Tc=d;n.Dh=k.action_frame_start;n.Li=k.action_frame_end;n.HG=k.use_reverse;n.scale=k.scale;n.repeat=k.repeat;k.action&&(n.Be=k.action.name,n.Cm=k.action.uuid); | |
c.push(n)}}return c}function t(a){return("SPEAKER"==a.type||"LAMP"==a.type)&&a.data.animation_data&&a.data.animation_data.nla_tracks.length?!0:!1}function p(a){if("MESH"!=a.type||!a.data)return!1;a=a.data.materials;if(!a)return!1;for(var d=0;d<a.length;d++){var c=a[d],e=c.node_tree;if(c=c.use_nodes&&e)a:{if(e.animation_data&&(c=e.animation_data.nla_tracks)&&c.length){c=!0;break a}e=e.nodes;for(c=0;c<e.length;c++);c=!1}if(c)return!0}return!1}function f(a,d){var c=L.q();if(c.V){var e=u(c.V,d);c.V.pb-= | |
e-a;c.V.Tk=!0}}var v=m("__animation");m("__camera");m("__controls");m("__config");m("__lights");m("__loader");var k=m("__objects"),n=m("__obj_util"),A=m("__print"),L=m("__scenes"),K=m("__sfx"),G=m("__textures"),E=m("__time"),B=m("__util"),y=[],Q=-1;a.yi=function(a,d){var e;e=null;for(var f=d.D.length-1;0<=f;f--){var g=d.D[f];if(g.Ia.b4w_use_nla&&(e=g,g.Ia.mz))break}if(e){e.bE=!0;var k=0;if((f=a.animation_data)&&f.nla_tracks.length){var m=f.nla_tracks;if(n.yj(d)||n.ea(d)||n.Lc(d)||n.Gn(d)||n.Sq(d)|| | |
n.ll(d)||n.Cv(d))m=z(m,k),m.length&&(d.Te=d.Te.concat(m),k++)}t(a)&&(m=a.data.animation_data.nla_tracks,m=z(m,k),m.length&&(d.Te=d.Te.concat(m),k++));if(n.Lc(d))for(g=a.data.materials,f=0;f<g.length;f++){var p=g[f];if(p.use_nodes&&p.node_tree&&(m=[],c(p.node_tree,m),m=z(m,k),m.length)){for(var p=k,y=m,l=v.bN(),q=[],D=0,r=0;r<y.length;r++){var w=y[r];""!=w.Cm?w=B.Fc("uuid",w.Cm,l):(w=w.Be,w=B.Fc("name",w,l)||B.Fc("name",w+"_B4W_BAKED",l));if(w){var w=w.fcurves,P=[],A;for(A in w)P.push(A);q.push(P)}}for(r= | |
0;r<q.length;r++){l=!1;for(w=0;w<r;w++)if(B.DJ(q[r],q[w])){y[r].Tc=y[w].Tc;l=!0;break}l||(y[r].Tc=k+D++)}k=p+D;d.Te=d.Te.concat(m)}}if(!n.Cv(d)){for(f=0;f<a.particle_systems.length;f++)g=a.particle_systems[f],A=g.settings,"EMITTER"==A.type&&A.b4w_allow_nla&&(A=h(),A.type="CLIP",A.ga=e.Ia.frame_start,A.Da=e.Ia.frame_end+1,A.Be=g.name,A.Tc=k,A.Dh=A.ga,A.Li=A.Da,d.Te.push(A),k++);g=k+1;for(f=0;f<d.Qc.length;f++)m=d.Qc[f],m.ZI&&(k=g,A=h(),A.type="CLIP",A.ga=e.Ia.frame_start,A.Da=e.Ia.frame_end+1,A.Be= | |
m.name,A.Tc=k,A.Dh=A.ga,A.Li=A.Da,d.Te.push(A))}}};a.pS=function(a,d,c){a.V||(a.V={ga:a.frame_start,Da:a.frame_end,pb:0,Kn:-1,Zn:a.frame_end,$n:a.frame_start,nm:null,Kc:d,mb:[],ba:[],fQ:a.name,Yh:!1,Tk:!1,Kw:!0},y.push(a.V));d=a.V;for(var e=k.wN(a,c),f=0;f<e.length;f++){var g=e[f];if(g.Te.length){for(var n=0;n<g.D.length;n++){var m=g.D[n];m.Ia==a&&m.bE&&d.mb.push(g)}for(var n=g.Te,m=d,p=g.name,l=0;l<n.length;l++){var q=n[l];m.ga>q.Da||m.Da<q.ga?(A.warn("NLA: Strip is out of scene range: "+(p+" ["+ | |
q.ga+":"+q.Da+"]")),n.splice(l,1),l--):q.Be||"CLIP"!=q.type||(A.warn('NLA: no action in strip for object "'+p+'".'),n.splice(l,1),l--)}g=g.Te;n=d;for(m=0;m<g.length;m++){for(var p=g[m],l=n.ga,q=n.Da+1,D=0;D<g.length;D++){var r=g[D];p.Tc==r.Tc&&(r.Da<=p.ga&&(l=p.ga),r.ga>=p.Da&&(q=Math.min(q,r.ga)))}p.fB=l;p.eB=q;p.qz=0===p.repeat%1?p.Li:p.Dh+p.repeat%1*(p.Li-p.Dh)}}}a=a.k.rm;for(f=0;f<a.length;f++)e=a[f].k,e.Ls&&(e.ua||e.Nc)&&e.wh==c&&(g=h(),g.type="VIDEO",e.ek?(g.ga=0,g.Da=d.Da):(g.ga=B.J(e.ga,0, | |
d.Da),g.Da=B.J(e.ga+e.Vk,0,d.Da)),g.Be=a[f].name,d.ba.push(e))};a.start=function(){Q=0};a.yN=function(){return Q};a.pX=function(a){return a.V?a.V.pb:null};a.a_=function(a,d){return a.V?(a.V.pb=d,!0):!1};a.update=function(a,d){if(!(0>Q)){0==Q&&(Q=a);for(var c=0;c<y.length;c++){var k=y[c];k.Yh&&(k.pb-=E.pc()*d);var h=u(k,a);if((!k.Yh||k.Tk)&&h>=k.Zn)if(k.Kc){var h=k,n=a;h.nm&&h.nm();f(h.$n,n);h.Kw=!0;h=u(h,n)}else{var n=k,m=h;n.Yh=!0;n.pb-=m-n.Zn;n.nm&&n.nm()}if(!k.Yh||k.Tk){for(var n=k,m=h,p=0;p<n.mb.length;p++){for(var A= | |
n.mb[p],l=A.Te,q=0;q<l.length;q++){var D=l[q];"SOUND"==D.type&&m<n.Kn-1E-6&&(D.oh=!1)}for(q=0;q<l.length;q++)switch(D=l[q],D.type){case "CLIP":if(D.fB<=m&&m<D.eB&&!D.oh){var r=A,w=D;""!=w.Cm?v.wJ(r,w.Cm,w.Tc):v.apply(r,w.Be,w.Tc);v.po(r,v.Us,w.Tc);var P=g(w.ga,w);v.Ol(r,P,w.Tc);for(r=0;r<l.length;r++)l[r]!=D&&l[r].Tc==D.Tc&&(l[r].oh=!1);D.oh=!0}D.oh&&(r=A,w=g(m,D),1E-6<Math.abs(w-v.KB(r,D.Tc))&&v.Ol(r,w,D.Tc));break;case "SOUND":(m<n.Kn-1E-6||n.Kn<D.ga)&&D.ga<=m&&m<D.Da&&!D.oh&&(r=A,P=D,w=(P.ga-m)/ | |
E.pc(),P=(P.Da-P.ga)/E.pc(),K.play(r,w,P),D.oh=!0),n.Kn<D.Da&&D.Da<=m&&D.oh&&(D.oh=!1)}}n=a;m=k;p=h;for(A=0;A<m.ba.length;A++)if(l=m.ba[A],l.ua||l.Nc){q=G.QG(l);D=l;r=B.J(e(p,D),D.pb,D.pb+G.RG(D)-1);D.Nc&&(r=G.TS(D,r),r==D.Sw&&r--);D=r;r=G.SG(l);P=w=!1;if(m.Tk||m.Kw)P=!0;if(!m.Yh){var t;t=e(p,l);t=l.pb<=t&&t<=l.pb+G.RG(l);var z=G.TG(l);l.ek&&D==r&&(P=!0);z||q==D||(P=!0);t&&!z?G.qE(l.name,l.wh):t&&z?w=!0:!t&&z&&(l.ua&&q<D?w=!0:G.ow(l.name,l.wh))}P?(G.tQ(l.name,D,l.wh),l.Nc&&(l.Nl=G.Rr(l,n))):w&&G.UG(l)&& | |
(l.ua?G.EG(l):(q=G.Rr(l,n),q!=l.Nl&&(l.Zj=D,G.DG(l)),l.Nl=q))}k.Kn=h}k.Tk=!1;k.Kw=!1}}};a.fa=function(){y.length=0;Q=-1};a.Sz=function(a){var d=a.animation_data;return d&&d.nla_tracks.length||t(a)||p(a)?!0:!1};a.Ol=f;a.xn=function(a){var d=L.q();return d.V?u(d.V,a):-1};a.TF=function(){var a=L.q();a.V&&(a.V.Yh=!0);for(var a=a.V.ba,d=0;d<a.length;d++){var c=a[d];G.ow(c.name,c.wh)}};a.DP=function(){var a=L.q();a.V&&(a.V.Yh=!1,a.V.nm=null)};a.qX=function(){var a=L.q();return a.V?a.V.ga:-1};a.UB=function(){var a= | |
L.q();return a.V?a.V.Da:-1};a.Wg=function(){var a=L.q();return a.V?!a.V.Yh:!1};a.CV=function(){var a=L.q();return a.V?a.b4w_use_nla:!1};a.BV=function(){var a=L.q();return a.V?0<a.b4w_logic_nodes.length:!1};a.p_=function(a,d){var c=L.q();if(c.V)c.V.$n=a,c.V.Zn=d;else return!1};a.dx=function(a){var d=L.q();d.V&&(d.V.Zn=a)};a.IQ=function(a){var d=L.q();d.V&&(d.V.$n=a)};a.LZ=function(){var a=L.q();if(a.V)a=a.V,a.$n=a.ga,a.Zn=a.Da;else return!1};a.WZ=function(a){var d=L.q();if(d.V)d.V.Kc=a;else return!1}; | |
a.JV=function(){var a=L.q();a.V&&(a.V.nm=null)};a.mF=function(a){var d=L.q().V;d&&(d.pb=-(a-Q)*E.pc()+d.$n,d.Tk=!0)};a.UB=function(){var a=L.q().V;return a?a.Da:null}};b4w.module.__controls=function(a,m){function h(a,b){b||(b=k.Yc());return{type:a,value:0,ra:null,element:b,Ca:!1,key:0,kb:"",Uf:!1,cu:null,bu:function(){},au:null,pA:function(){},qi:null,from:new Float32Array(3),to:new Float32Array(3),VC:!1,Iq:!1,ao:0,HE:function(){},axis:"",se:0,jm:new Float32Array(3),Gr:new Float32Array(4),threshold:0,zE:new Float32Array(4),Ep:0,Dp:0,TE:0,Fp:0,ie:0,repeat:!1,Kz:!1,callback:function(){}}}function c(a){a||(a=k.Yc());for(var c=0;c<O.length;c++)if(a==O[c].element)return O[c]; | |
var e={element:a,il:!1,Xq:!0,Xv:0,Yv:0,sl:0,tl:0,Af:new Float32Array(2),Nd:new Float32Array(2),Bf:new Float32Array(2),te:new Float32Array(2),As:0,Rx:0,nG:0,TL:{},Ss:0,Qw:null,DC:G.create(),Eq:0,Dq:0,Cq:0,nv:0,mv:0,Bq:-1E3,XY:null,lh:{},eE:function(a){G.copy(a,e.DC)},dE:function(a){a=Q.copy(a,l);e.Cq=a[0];e.Dq=a[1];e.Eq=a[2];-1E3==e.Bq&&(e.Bq=a[0],e.mv=a[1],e.nv=a[2])},QD:function(a){e.Ss+=a*b.cP},MD:function(a){var b=n.za(n.Ic,e.element),b=n.tj(b,n.Hi,M);e.Xv=b[0];e.Yv=b[1];e.sl=b[0];e.tl=b[1];e.il= | |
!0;e.which=a},OD:function(){var a=n.za(n.Ic,e.element),a=n.tj(a,n.Hi,M),a=k.Np(a[0],a[1],M);e.Qw=A.Wn(a[0],a[1])},lG:function(a){1==a.length&&(a=k.Np(a[0].clientX,a[0].clientY,M),e.Qw=A.Wn(a[0],a[1]))},PD:function(){e.il=!1},ND:function(a){if(!d.Hq||e.il)e.sl=a[0],e.tl=a[1]},oD:function(a){for(var b=0;b<H.length;b++){var d=H[b];20==d.type&&a==d.key&&g(d,1)}},pD:function(a){for(var b=0;b<H.length;b++){var d=H[b];20==d.type&&0==a&&16==d.key&&g(d,0);20==d.type&&a==d.key&&g(d,0)}},mG:function(a){e.Xq= | |
!1;if(1==a.length)e.Af[0]=a[0].clientX,e.Af[1]=-1,e.Bf[0]=a[0].clientY,e.Bf[1]=-1;else if(1<a.length){e.As=e.Rx=f(a);e.Af[0]=a[0].clientX;e.Af[1]=a[1].clientX;e.Bf[0]=a[0].clientY;e.Bf[1]=a[1].clientY;var b=a[0];a=a[1];e.nG=Math.atan2(b.clientY-a.clientY,b.clientX-a.clientX)}e.Nd.set(e.Af);e.te.set(e.Bf)},kG:function(a){1===a.length?(e.Nd[0]=a[0].clientX,e.Nd[1]=-1,e.te[0]=a[0].clientY,e.te[1]=-1):1<a.length&&(e.Nd[0]=a[0].clientX,e.Nd[1]=a[1].clientX,e.te[0]=a[0].clientY,e.te[1]=a[1].clientY,e.As= | |
f(a))},jG:function(a){0==a.length&&(e.Xq=!0)}};O.push(e);return e}function e(a,b){if(b in a.lh&&0<a.lh[b])a.lh[b]+=1;else switch(a.lh[b]=1,b){case "orientation_quat":var d=n.za(n.bf);n.bd(d,n.Xo,a.eE);break;case "orientation_angles":d=n.za(n.bf);n.bd(d,n.Wo,a.dE);break;case "mouse_wheel":d=n.za(n.Ic,a.element);n.bd(d,n.bp,a.QD);break;case "mouse_down_which":d=n.za(n.Ic,a.element);n.bd(d,n.vm,a.MD);break;case "mouse_select":d=n.za(n.Ic,a.element);n.bd(d,n.vm,a.OD);break;case "touch_select":d=n.za(n.cf, | |
a.element);n.bd(d,n.wm,a.lG);break;case "mouse_up_which":d=n.za(n.Ic,a.element);n.bd(d,n.ap,a.PD);break;case "mouse_location":d=n.za(n.Ic,a.element);n.bd(d,n.Hi,a.ND);break;case "keyboard_downed_keys":d=n.za(n.tm,a.element);n.bd(d,n.Zo,a.oD);n.bd(d,n.$o,a.pD);break;case "touch_start":d=n.za(n.cf,a.element);n.bd(d,n.wm,a.mG);break;case "touch_move":d=n.za(n.cf,a.element);n.bd(d,n.hp,a.kG);break;case "touch_end":d=n.za(n.cf,a.element),n.bd(d,n.gp,a.jG)}}function u(a,b){if(!(!b in a.lh)&&0<a.lh[b]&& | |
(--a.lh[b],!a.lh[b]))switch(b){case "orientation_quat":var d=n.za(n.bf);n.cd(d,"orientation_quat",a.eE);break;case "orientation_angles":d=n.za(n.bf);n.cd(d,"orientation_angles",a.dE);break;case "mouse_wheel":d=n.za(n.Ic,a.element);n.cd(d,"mouse_wheel",a.QD);break;case "mouse_down_which":d=n.za(n.Ic,a.element);n.cd(d,"mouse_down_which",a.MD);break;case "mouse_select":d=n.za(n.Ic,a.element);n.cd(d,"mouse_down_which",a.OD);break;case "touch_select":d=n.za(n.cf,a.element);n.cd(d,"touch_start",a.lG);break; | |
case "mouse_up_which":d=n.za(n.Ic,a.element);n.cd(d,"mouse_up_which",a.PD);break;case "mouse_location":d=n.za(n.Ic,a.element);n.cd(d,"mouse_location",a.ND);break;case "keyboard_downed_keys":d=n.za(n.tm,a.element);n.cd(d,"keyboard_down",a.oD);n.cd(d,"keyboard_up",a.pD);break;case "touch_start":d=n.za(n.cf,a.element);n.cd(d,"touch_start",a.mG);break;case "touch_move":d=n.za(n.cf,a.element);n.cd(d,"touch_move",a.kG);break;case "touch_end":d=n.za(n.cf,a.element),n.cd(d,"touch_end",a.jG)}}function g(a, | |
b){a.value=Number(b)}function z(a){for(var b=a.ji,d=a.jQ,c=0;c<b.length;c++)d[c]=b[c].value;return a.NO(d)}function t(a,b){a=a||C;var d=a.xf;if(d){var c=a.Yj;if(b){var e=d[b];if(e){for(var l=e.ji,f=0;f<l.length;f++){var g=l[f],k;k=H.indexOf(g);k=-1<k?I[k]:[];1==k.length?(p(g),g=H.indexOf(g),-1<g?(H.splice(g,1),I.splice(g,1)):y.ha("Sensors cache is corrupted")):1<k.length&&k.splice(k.indexOf(e,1))}delete d[b];f=c.indexOf(e);-1<f?c.splice(f,1):y.ha("Incorrect manifolds array");Object.getOwnPropertyNames(d).length|| | |
(d=x.indexOf(a),-1<d?x.splice(d,1):L.error("Wrong object"))}}else{c=[];for(b in d)c.push(b);for(f=0;f<c.length;f++)t(a,c[f])}q=!0}}function p(a){switch(a.type){case 90:K.Fw(a.cu,a.kb,a.bu);a.Ca=!0;break;case 100:K.Zt(a.au);a.Ca=!0;break;case 110:K.Gw(a.ao);a.Ca=!0;break;case 140:a.Ca=!0;break;case 20:var b=c(a.element);u(b,"keyboard_downed_keys");a.Ca=!0;break;case 30:b=c(a.element);u(b,"mouse_wheel");a.Ca=!0;break;case 40:b=c(a.element);u(b,"mouse_down_which");u(b,"mouse_up_which");u(b,"mouse_location"); | |
a.Ca=!0;break;case 50:b=c(a.element);u(b,"mouse_down_which");u(b,"mouse_up_which");a.Ca=!0;break;case 60:b=c(a.element);u(b,"touch_start");u(b,"touch_move");u(b,"touch_end");a.Ca=!0;break;case 70:b=c(a.element);u(b,"touch_start");u(b,"touch_move");a.Ca=!0;break;case 75:b=c(a.element);u(b,"touch_start");u(b,"touch_move");a.Ca=!0;break;case 80:b=c(a.element);u(b,"touch_start");u(b,"touch_end");a.Ca=!0;break;case 170:b=c(a.element);u(b,"mouse_select");u(b,"touch_select");u(b,"touch_start");u(b,"touch_end"); | |
u(b,"mouse_down_which");u(b,"mouse_up_which");a.Ca=!0;break;case 180:case 190:b=c(a.element);u(b,"orientation_angles");a.Ca=!0;break;case 200:b=c(a.element);u(b,"orientation_quat");a.Ca=!0;break;case 210:a.Ca=!0}}function f(a){var b=a[0],d=a[1];a=b.clientX-d.clientX;b=b.clientY-d.clientY;return Math.sqrt(a*a+b*b)}var v=m("__config"),k=m("__container"),n=m("__input"),A=m("__objects"),L=m("__print"),K=m("__physics"),G=m("__quat"),E=m("__time"),B=m("__tsr"),y=m("__util"),Q=m("__vec3"),b=v.controls,d= | |
v.u,x=[],C={},H=[],I=[],O=[],M=new Float32Array(2),F=new Float32Array(2),l=Q.create();G.create();var q=!1,D=0;a.vg=10;a.Qa=20;a.To=30;a.ze=40;a.Jf=50;a.Ys=60;a.fp=0;a.ep=1;a.dp=2;a.et=3;a.update=function(b,e){for(var l=0;l<H.length;l++){var f=H[l],k=b,h=e;if(h)switch(f.type){case 120:var m=f.qi,p=B.m(m.g.i),m=B.v(m.g.i),v=Q.dist(f.jm,p),A=f.zE;G.invert(f.Gr,A);G.multiply(m,A,A);G.normalize(A,A);A=Math.abs(2*Math.acos(A[3]));v/=h;f.Ep=y.Gc(v,f.Ep,h,.3);f.ra[0]=v;v=A/h;f.Dp=y.Gc(v,f.Dp,h,.3);f.ra[1]= | |
v;f.Ep>=f.threshold||f.Dp>=f.TE?g(f,1):g(f,0);Q.copy(p,f.jm);G.copy(m,f.Gr);f.se=k;break;case 130:m=f.qi;p=B.m(m.g.i);m=Math.abs(p[1]-f.jm[1])/h;f.Fp=y.Gc(m,f.Fp,h,.3);f.ra=m;f.Fp>=f.threshold?g(f,1):g(f,0);Q.copy(p,f.jm);f.se=k;break;case 140:!f.Ca&&0<=f.ie&&k-f.se>=f.ie&&(g(f,1),f.repeat?f.se=k:f.ie=-f.ie);break;case 150:f.se||(f.se=k);g(f,k-f.se);f.se=k;break;case 160:g(f,k);break;case 180:h=c(f.element);f.ra[0]=h.Eq-h.nv;f.ra[1]=h.Dq-h.mv;f.ra[2]=h.Cq-h.Bq;h.nv=h.Eq;h.mv=h.Dq;h.Bq=h.Cq;break; | |
case 190:h=c(f.element);f.ra[0]=h.Eq;f.ra[1]=h.Dq;f.ra[2]=h.Cq;break;case 200:h=c(f.element);G.copy(h.DC,f.ra);break;case 210:k=n.za(n.Rc);n.tj(k,n.Yo,f.ra);break;case 220:g(f,f.callback());break;case 30:h=c(f.element);g(f,h.Ss);break;case 40:h=c(f.element);if(!d.Hq||h.il)switch(k=h.sl-h.Xv,p=h.tl-h.Yv,f.axis){case "X":g(f,k);f.ra=h.sl;break;case "Y":g(f,p);f.ra=h.tl;break;case "XY":m=Math.sqrt(k*k+p*p),g(f,m),f.ra[0]=h.sl,f.ra[1]=h.tl}break;case 50:h=c(f.element);g(f,h.il);f.ra=h.which;break;case 170:h= | |
c(f.element);f.Kz&&!h.il&&h.Xq||h.Qw!=f.qi?g(f,0):g(f,1);break;case 60:h=c(f.element);-1==h.Nd[1]&&-1==h.te[1]?(k=h.Nd[0]-h.Af[0],p=h.te[0]-h.Bf[0],m=Math.sqrt(k*k+p*p),-1!=h.Af[1]&&-1!=h.Bf[1]&&(v=h.Nd[0]-h.Af[1],h=h.te[0]-h.Bf[1],A=Math.sqrt(v*v+h*h),A<m&&(k=v,p=h,m=A)),f.ra=a.fp):(p=M,p[0]=(h.Nd[0]+h.Nd[1])/2,p[1]=(h.te[0]+h.te[1])/2,m=F,m[0]=(h.Af[0]+h.Af[1])/2,m[1]=(h.Bf[0]+h.Bf[1])/2,k=p[0]-m[0],p=p[1]-m[1],m=Math.sqrt(k*k+p*p),f.ra=a.dp);switch(f.axis){case "X":g(f,k);break;case "Y":g(f,p); | |
break;case "XY":g(f,m)}break;case 70:h=c(f.element);k=h.As-h.Rx;f.ra=a.ep;g(f,k);break;case 75:h=c(f.element);-1!=h.Nd[1]&&(k=Math.atan2(h.te[0]-h.te[1],h.Nd[0]-h.Nd[1]),f.ra=a.et,g(f,k-h.nG));break;case 80:h=c(f.element),h.Xq?g(f,0):g(f,1)}}for(l=0;l<x.length;l++)for(h=x[l],f=h.Yj,k=0;k<f.length;k++)if(p=f[k],p.vG!=D){p.vG=D;A=p;m=0;switch(A.type){case a.vg:m=(v=z(A))?1:0;break;case a.Qa:m=A.Zg;(v=z(A))?(m=1,A.Zg=1):1==m?(m=-1,A.Zg=-1):m=0;break;case a.To:m=A.Zg;(v=z(A))&&-1==m?(m=1,A.Zg=1):v||1!= | |
m?m=0:(m=-1,A.Zg=-1);break;case a.ze:m=A.Zg;(v=z(A))&&-1==m?(m=1,A.Zg=1):v||1!=m?m=0:(m=0,A.Zg=-1);break;case a.Jf:v=z(A);A.rD!=v?(m=1,A.rD=v):m=0;break;case a.Ys:for(var v=A.ji,A=A.rO,I=0;I<v.length;I++){var t=v[I].value;m||t==A[I]||(m=1);A[I]=t}break;default:y.ha("Wrong sensor manifold type: "+A.type)}if(m&&(v=h==C?null:h,q=!1,p.callback(v,p.id,m,p.gK),q)){l=-1;break}}for(l=0;l<x.length;l++)for(h=x[l],f=h.Yj,k=0;k<f.length;k++)for(p=f[k],h=p.ji,p=0;p<h.length;p++)switch(m=h[p],m.type){case 30:g(m, | |
0);break;case 40:g(m,0);break;case 60:g(m,0);break;case 70:g(m,0);break;case 75:g(m,0);break;case 80:g(m,0);break;case 140:g(m,0)}for(l=0;l<O.length;l++)f=O[l],f.Ss=0,f.Xv=f.sl,f.Yv=f.tl,f.TL[0]=!1,f.Af.set(f.Nd),f.Bf.set(f.te),f.Rx=f.As;D++};a.Wp=function(a){var b=h(10);g(b,a);return b};a.Wb=function(a){var b=h(20,document);b.key=a;b.Ca=!0;return b};a.ku=function(a,b,d){if(!a||!K.Z(a))return L.error("Wrong collision object"),null;var c=h(90);c.cu=a;c.kb=b;c.Uf=d;c.ra={coll_obj:null,coll_pos:d?new Float32Array(3): | |
null,coll_norm:d?new Float32Array(3):null,coll_dist:0};c.bu=function(a,b,d,e,l){g(c,a);a=c.ra;a.coll_obj=b;c.Uf&&(a.coll_pos.set(d),a.coll_norm.set(e),a.coll_dist=l)};c.Ca=!0;return c};a.AA=function(a){if(!a||!a.p)return L.error("Wrong collision impulse object"),null;var b=h(100);b.au=a;b.pA=function(a){g(b,a)};b.Ca=!0;return b};a.FA=function(a,b,d,c,e,l,f){var q=h(110);q.qi=a;q.from=b;q.to=d;q.kb=c;q.VC=e;q.Uf=l;q.Iq=f;q.ra={hit_fract:0,obj_hit:null,hit_time:0,hit_pos:new Float32Array(3),hit_norm:new Float32Array(3), | |
ao:0};q.HE=function(a,b,d,c,e,l){q.VC?g(q,-1==b?0:1):g(q,b);q.ra.hit_fract=b;q.ra.obj_hit=d;q.ra.hit_time=c;q.Uf&&(q.ra.hit_pos.set(e),q.ra.hit_norm.set(l))};q.Ca=!0;return q};a.aj=function(a){a=h(50,a);a.Ca=!0;return a};a.ou=function(a){a=h(30,a);a.Ca=!0;return a};a.Hg=function(a,b){var d=h(40,b);d.axis=a||"XY";d.ra="XY"==d.axis?new Float32Array(2):0;d.Ca=!0;return d};a.Xm=function(a,b){var d=h(60,b);d.axis=a||"XY";d.ra=0;d.Ca=!0;return d};a.Zp=function(a){a=h(70,a);a.ra=0;a.Ca=!0;return a};a.JA= | |
function(a){a=h(75,a);a.ra=0;a.Ca=!0;return a};a.IA=function(a){a=h(80,a);a.ra=0;a.Ca=!0;return a};a.EA=function(a,b,d){if(!a)return L.error("Wrong collision object"),null;var c=h(120);c.qi=a;var e=B.m(a.g.i);a=B.v(a.g.i);c.zE=new Float32Array(4);c.jm=new Float32Array(e);c.Gr=new Float32Array(a);c.Ep=0;c.Dp=0;c.threshold=b||.1;c.TE=d||.1;c.se=0;c.ra=new Float32Array([0,0]);return c};a.KA=function(a,b){if(!a)return L.error("Wrong collision object"),null;var d=h(130);d.qi=a;var c=B.m(a.g.i),e=B.v(a.g.i); | |
d.jm=new Float32Array(c);d.Gr=new Float32Array(e);d.Fp=0;d.threshold=b||1;d.se=0;d.ra=0;return d};a.HA=function(a,b){var d=h(140);d.ie=a;d.repeat=b;d.Ca=!0;return d};a.OE=function(a,b,d,c){a=a||C;a=a.xf;if(!a||!a[b])return L.error("reset_timer_sensor(): wrong object"),null;b=a[b].ji[d];if(!b)return L.error("reset_timer_sensor(): sensor not found"),null;b.se=E.qj();b.ie=c};a.$i=function(){var a=h(150);a.se=0;return a};a.DA=function(){var a=h(180,window);a.ra=new Float32Array(3);n.za(n.bf)?g(a,1):g(a, | |
0);a.Ca=!0;return a};a.CA=function(){var a=h(190,window);a.ra=new Float32Array(3);n.za(n.bf)?g(a,1):g(a,0);a.Ca=!0;return a};a.lu=function(){var a=h(200,window);a.ra=G.create();n.za(n.bf)?g(a,1):g(a,0);a.Ca=!0;return a};a.mu=function(){var a=h(210,window);a.ra=G.create();n.za(n.Rc)?g(a,1):g(a,0);a.Ca=!0;return a};a.GA=function(){return h(160)};a.Yp=function(a,b){var d=h(170);d.qi=a;d.Kz=b;d.Ca=!0;return d};a.ju=function(a,b){var d=h(220);d.callback=a;g(d,b);return d};a.iQ=g;a.fd=function(a,b,d){a= | |
a||C;a=a.xf;if(!a||!a[b])return L.error("get_sensor_value(): wrong object"),null;b=a[b].ji[d];return b?b.value:(L.error("get_sensor_value(): sensor not found"),null)};a.nf=function(a,b,d){a=a||C;a=a.xf;if(!a||!a[b])return L.error("get_sensor_payload(): wrong object"),null;b=a[b].ji[d];return b?b.ra:(L.error("get_sensor_payload(): sensor not found"),null)};a.fa=function(){x=[];C={};for(var a=0;a<H.length;a++)p(H[a]);H.length=0;I.length=0};a.Ek=function(a,b){a=a||C;if(!a.xf)return!1;if(b&&a.xf[b])return!0; | |
if(!b)for(var d in a.xf)return!0;return!1};a.X=function(a,b,d,l,f,g,k){a=a||C;a.Yj=a.Yj||[];a.xf=a.xf||{};var h=a.xf,n=a.Yj;h[b]&&t(a,b);d={id:b,type:d,ji:l.slice(0),NO:f,jQ:Array(l.length),callback:g,gK:k,Zg:-1,rD:0,rO:Array(l.length),vG:-1};h[b]=d;n.push(d);-1==x.indexOf(a)&&x.push(a);l=d.ji;for(a=0;a<l.length;a++){h=b=l[a];if(h.Ca){switch(h.type){case 90:K.ut(h.cu,h.kb,h.bu,h.Uf);break;case 100:K.wt(h.au,h.pA);break;case 110:h.ao=K.zp(h.qi,h.from,h.to,h.kb,h.HE,!1,!1,h.Uf,h.Iq);h.ra.ao=h.ao;break; | |
case 140:h.se=E.qj();0>h.ie&&(h.ie=-h.ie);break;case 20:n=c(h.element);e(n,"keyboard_downed_keys");break;case 30:n=c(h.element);e(n,"mouse_wheel");break;case 40:n=c(h.element);e(n,"mouse_down_which");e(n,"mouse_up_which");e(n,"mouse_location");break;case 50:n=c(h.element);e(n,"mouse_down_which");e(n,"mouse_up_which");break;case 60:n=c(h.element);e(n,"touch_start");e(n,"touch_move");e(n,"touch_end");break;case 70:n=c(h.element);e(n,"touch_start");e(n,"touch_move");break;case 75:n=c(h.element);e(n, | |
"touch_start");e(n,"touch_move");break;case 80:n=c(h.element);e(n,"touch_start");e(n,"touch_end");break;case 170:n=c(h.element);e(n,"mouse_select");e(n,"touch_select");e(n,"touch_start");e(n,"touch_end");e(n,"mouse_down_which");e(n,"mouse_up_which");break;case 180:case 190:n=c(h.element);e(n,"orientation_angles");break;case 200:n=c(h.element),e(n,"orientation_quat")}h.Ca=!1}h=H.indexOf(b);-1==h?(H.push(b),I.push([d])):I[h].push(d)}q=!0};a.SA=function(a){for(var b=0;b<a.length;b++)if(!a[b])return a[b]; | |
return a[a.length-1]};a.TA=function(a){for(var b=0;b<a.length;b++)if(a[b])return a[b];return a[a.length-1]};a.mh=t;a.reset=function(){for(var a=0;a<x.length;a++){var b=x[a],d=b.xf,b=b.Yj,c;for(c in d)delete d[c];b.length=0}for(a=0;a<H.length;a++)p(H[a]);x.length=0;H.length=0;I.length=0};a.debug=function(){L.log(String(x.length)+" objects with manifolds",x);L.log(String(H.length)+" sensors",H);for(var a=[],b=[],d=0;d<H.length;d++){var c=H[d];90==c.type&&a.push(c);110==c.type&&b.push(c)}L.log(String(a.length)+ | |
" collision sensors",a);L.log(String(b.length)+" ray sensors",b)}};b4w.module.__input=function(a,m){function h(a){return(20!=a||navigator.getVRDevices||q.ag)&&(10!=a||q.ag&&window.DeviceOrientationEvent&&q.gyro_use)?!0:!1}function c(a,b){if(!h(a))return null;var d={type:a,kh:!1,Ue:[],uf:[],bh:[],dh:[],eh:[],fh:[],Xg:[],Yg:[],vh:[],uh:[],th:[],element:b,jh:!0,tb:[],kr:new Float32Array(2),dP:0,Lo:"",distortion_coefs:new Float32Array(2),chromatic_aberration_coefs:new Float32Array(4),sm:null,tg:null,Ng:new Float32Array(4),Og:new Float32Array(4),Wh:0,Fh:0,ph:0,NL:"", | |
Fi:0,Ug:0,Hh:0};d.Ng[0]=d.Ng[1]=d.Ng[2]=d.Ng[3]=45;d.Og[0]=d.Og[1]=d.Og[2]=d.Og[3]=45;30==a||40==a||50==a?(d.kh=Boolean(b),50==a?document.addEventListener("touchstart",function(){}):40==a&&(d.jh=!1)):10==a&&(d.kh=!0);return d}function e(a,b){10==a||20==a?b=window:b||(b=C.Yc());for(var d=0;d<da.length;d++)if(da[d].type==a&&da[d].element==b)return da[d];(d=c(a,b))&&da.push(d);return d}function u(a){var b="default",d;for(d in D)if(navigator.userAgent.match(D[d].Ou)){b=d;break}d=D[b];a.NL=b;a.Fi=d.Fi; | |
a.Ug=d.Ug;a.Hh=d.Hh;a.Lo="cardboard_2";g(a);b=r[a.Lo];a.Wh=b.Wh;a.Fh=b.Fh;a.ph=b.ph;var c=a.Fh-a.Hh,b=a.Ug-c;d=a.distortion_coefs;var c=M.Fd(Math.atan(z(d,c/a.ph))),e=M.Fd(Math.atan(z(d,b/a.ph))),l=M.Fd(Math.atan(z(d,b/a.ph))),b=M.Fd(Math.atan(z(d,b/a.ph)));a.Ng[0]=Math.min(e,60);a.Ng[1]=Math.min(l,60);a.Ng[2]=Math.min(c,60);a.Ng[3]=Math.min(b,60);a.Og[0]=Math.min(e,60);a.Og[1]=Math.min(b,60);a.Og[2]=Math.min(c,60);a.Og[3]=Math.min(l,60)}function g(a){var b=r[a.Lo];a.distortion_coefs[0]=b.distortion_coefs[0]; | |
a.distortion_coefs[1]=b.distortion_coefs[1];a.chromatic_aberration_coefs[0]=b.chromatic_aberration_coefs[0];a.chromatic_aberration_coefs[1]=b.chromatic_aberration_coefs[1];a.chromatic_aberration_coefs[2]=b.chromatic_aberration_coefs[2];a.chromatic_aberration_coefs[3]=b.chromatic_aberration_coefs[3]}function z(a,b){var d=b*b;return b*(1+a[0]*d+a[1]*d*d)}function t(a,b){a.Lo="default";var d=b.filter(function(a){return a instanceof HMDVRDevice}),c=null;d.length&&(c=d[0],-1!==c.deviceName.toLowerCase().indexOf("oculus")&& | |
(a.Lo="oculus"));d=null;c&&(d=b.filter(function(a){return-1!==a.deviceName.toLowerCase().indexOf("oculus")&&a.hardwareUnitId==c.hardwareUnitId&&a instanceof PositionSensorVRDevice}));a.sm=c;a.tg=d;g(a)}function p(a,b,d){switch(a.type){case 20:if(a.sm){if((b=a.sm.getEyeParameters(b))&&b.currentFieldOfView){var c=a.distortion_coefs;a=z(c,Math.tan(M.lb(b.currentFieldOfView.downDegrees)));a=M.Fd(Math.atan(a));var e=z(c,Math.tan(M.lb(b.currentFieldOfView.upDegrees))),e=M.Fd(Math.atan(e)),f=z(c,Math.tan(M.lb(b.currentFieldOfView.leftDegrees))), | |
f=M.Fd(Math.atan(f));b=z(c,Math.tan(M.lb(b.currentFieldOfView.rightDegrees)));b=M.Fd(Math.atan(b));d[0]=e;d[1]=b;d[2]=a;d[3]=f;break}}else l.copy("left"==b?a.Ng:a.Og,d);break;default:I.error("fov is undefined for device: ",a.type)}return d}function f(a,b){var d=a.indexOf(b);0<=d&&(a[d]=null)}function v(a){return null===a}function k(a,c,e,l){switch(c){case 120:e&&f(a.Ue,e);if(l||a.uf.every(v)&&a.Ue.every(v))a.Ue.length=0,a.uf.length=0,c=a.tb.indexOf(131),0<=c&&(a.tb.splice(c,1),a.element.removeEventListener("deviceorientation", | |
n,!1));break;case 130:e&&f(a.uf,e);if(l||a.uf.every(v)&&a.Ue.every(v))a.Ue.length=0,a.uf.length=0,c=a.tb.indexOf(131),0<=c&&(a.tb.splice(c,1),a.element.removeEventListener("deviceorientation",n,!1));break;case 40:e&&f(a.bh,e);if(l||a.bh.every(v))a.bh.length=0,c=a.tb.indexOf(c),0<=c&&(a.tb.splice(c,1),a.element.removeEventListener("mousedown",K,!1));break;case 30:e&&f(a.dh,e);if(l||a.dh.every(v))a.dh.length=0,c=a.tb.indexOf(c),0<=c&&(a.tb.splice(c,1),a.element.removeEventListener("mousemove",L,!1)); | |
break;case 50:e&&f(a.eh,e);if(l||a.eh.every(v)){a.eh.length=0;c=a.tb.indexOf(c);0<=c&&(a.tb.splice(c,1),a.element.removeEventListener("mouseout",G,!1),a.element.removeEventListener("mouseup",E,!1));break}break;case 60:e&&f(a.fh,e);if(l||a.fh.every(v))a.fh.length=0,c=a.tb.indexOf(c),0<=c&&(a.tb.splice(c,1),a.element.removeEventListener("wheel",B,!1));break;case 80:e&&f(a.Xg,e);if(l||a.Xg.every(v))a.Xg.length=0,c=a.tb.indexOf(c),0<=c&&(a.tb.splice(c,1),a.element.removeEventListener("keydown",y,!1)); | |
break;case 70:e&&f(a.Yg,e);if(l||a.Yg.every(v))a.Yg.length=0,c=a.tb.indexOf(c),0<=c&&(a.tb.splice(c,1),a.element.removeEventListener("keyup",Q,!1));break;case 90:e&&f(a.vh,e);if(l||a.vh.every(v))a.vh.length=0,c=a.tb.indexOf(c),0<=c&&(a.tb.splice(c,1),a.element.removeEventListener("touchstart",b,!1));break;case 100:e&&f(a.uh,e);if(l||a.uh.every(v))a.uh.length=0,c=a.tb.indexOf(c),0<=c&&(a.tb.splice(c,1),a.element.removeEventListener("touchmove",d,!1));break;case 110:if(e&&f(a.th,e),l||a.th.every(v))a.th.length= | |
0,c=a.tb.indexOf(c),0<=c&&(a.tb.splice(c,1),a.element.removeEventListener("touchend",x,!1))}}function n(a){var b=V;b[0]=M.lb(a.alpha);b[1]=M.lb(a.beta);b[2]=M.lb(a.gamma);a=e(10,a.currentTarget);for(var d=0;d<a.uf.length;d++){var c=a.uf[d];c&&(F.copy(b,ca),c(ca))}if(a.Ue.length){var l=w,l=M.jw(b,M.lt,w),b=M.lb(window.orientation),b=O.setAxisAngle(M.Rd,-b,P);O.multiply(l,b,l);b=O.setAxisAngle(M.ye,-Math.PI/2,P);O.multiply(b,l,l);b=O.setAxisAngle(M.ye,Math.PI/2,P);O.multiply(l,b,l);for(d=0;d<a.Ue.length;d++)if(c= | |
a.Ue[d])O.copy(l,Z),c(Z)}for(d=0;d<a.Ue.length;d++)a.Ue[d]||a.Ue.splice(d,1);for(d=0;d<a.uf.length;d++)a.uf[d]||a.uf.splice(d,1)}function A(a,b){switch(a.type){case 30:a.kr[0]=b.clientX,a.kr[1]=b.clientY,a.dP=b.which}}function L(a){var b=e(30,a.currentTarget);A(b,a);for(var d=0;d<b.dh.length;d++){var c=b.dh[d];c&&(R[0]=a.clientX,R[1]=a.clientY,c(R))}b.jh&&a.preventDefault();for(d=0;d<b.dh.length;d++)b.dh[d]||b.dh.splice(d,1)}function K(a){var b=e(30,a.currentTarget);A(b,a);for(var d=0;d<b.bh.length;d++){var c= | |
b.bh[d];c&&c(a.which)}b.jh&&a.preventDefault();for(d=0;d<b.bh.length;d++)b.bh[d]||b.bh.splice(d,1)}function G(a){C.WC(a.relatedTarget)||E(a)}function E(a){var b=e(30,a.currentTarget);A(b,a);for(var d=0;d<b.eh.length;d++){var c=b.eh[d];c&&c(a.which)}b.jh&&a.preventDefault();for(d=0;d<b.eh.length;d++)b.eh[d]||b.eh.splice(d,1)}function B(a){for(var b=e(30,a.currentTarget),d=0;d<b.fh.length;d++){var c=b.fh[d];c&&c(-a.deltaY)}b.jh&&a.preventDefault();for(d=0;d<b.fh.length;d++)b.fh[d]||b.fh.splice(d,1)} | |
function y(a){for(var b=e(40,a.currentTarget),d=0;d<b.Xg.length;d++){var c=b.Xg[d];c&&c(a.keyCode)}b.jh&&a.preventDefault();for(d=0;d<b.Xg.length;d++)b.Xg[d]||b.Xg.splice(d,1)}function Q(a){for(var b=e(40,a.currentTarget),d=0;d<b.Yg.length;d++){var c=b.Yg[d];c&&c(a.keyCode)}b.jh&&a.preventDefault();for(d=0;d<b.Yg.length;d++)b.Yg[d]||b.Yg.splice(d,1)}function b(a){for(var b=e(50,a.currentTarget),d=0;d<b.vh.length;d++){var c=b.vh[d];c&&c(a.targetTouches)}for(d=0;d<b.vh.length;d++)b.vh[d]||b.vh.splice(d, | |
1)}function d(a){for(var b=e(50,a.currentTarget),d=0;d<b.uh.length;d++){var c=b.uh[d];c&&c(a.targetTouches)}b.jh&&a.preventDefault();for(d=0;d<b.uh.length;d++)b.uh[d]||b.uh.splice(d,1)}function x(a){for(var b=e(50,a.currentTarget),d=0;d<b.th.length;d++){var c=b.th[d];c&&c(a.targetTouches)}for(d=0;d<b.th.length;d++)b.th[d]||b.th.splice(d,1)}var C=m("__container"),H=m("__config"),I=m("__print"),O=m("__quat"),M=m("__util"),F=m("__vec3"),l=m("__vec4"),q=H.u,D=H.OL,r=H.ON;a.bf=10;a.Rc=20;a.Ic=30;a.tm= | |
40;a.cf=50;a.Yo=10;a.dt=20;a.rH=21;a.sH=22;a.pH=23;a.Hi=30;a.vm=40;a.ap=50;a.bp=60;a.$o=70;a.Zo=80;a.wm=90;a.hp=100;a.gp=110;a.Xo=120;a.Wo=130;var w=O.create(),P=O.create(),V=F.create(),R=new Float32Array(2);F.create();var ca=F.create(),Z=O.create(),da=[];a.Jh=h;a.za=e;a.Dw=function(a){if(!a.kh)switch(a.type){case 20:navigator.getVRDevices?navigator.getVRDevices().then(function(b){t(a,b);b.length?a.kh=!0:I.Cc("WebVR devices are not found.")}):(u(a),a.kh=!0);break;default:I.error("register_device() is undefined for device: ", | |
a.type)}};a.Ix=function(a,b){a.jh=b};a.Lr=function(a){switch(a.type){case 20:if(a.kh&&a.tg)for(var b=0;b<a.tg.length;b++)a.tg[b].resetSensor();break;default:I.error("reset_device() is undefined for device: ",a.type)}};a.tj=function(a,b,d){switch(b){case 10:a:switch(a.type){case 20:F.copy(M.it,d);if(a.tg)for(b=0;b<a.tg.length;b++){var c=a.tg[b].getImmediateState();c.orientation&&(d[0]=c.orientation.x,d[1]=c.orientation.y,d[2]=c.orientation.z,d[3]=c.orientation.w)}O.normalize(d,d);a=O.setAxisAngle(M.ye, | |
Math.PI/2,w);O.multiply(d,a,d);break a;default:I.error("orientation_quat is undefined for device: ",a.type)}return d;case 20:a:switch(a.type){case 20:if(a.tg)for(b=0;b<a.tg.length;b++)c=a.tg.getImmediateState(),c.position&&(d[0]=c.position.x,d[1]=c.position.y,d[2]=c.position.z);break a;default:I.error("position is undefined for device: ",a.type)}return d;case 21:return p(a,"left",d);case 22:return p(a,"right",d);case 30:return d[0]=a.kr[0],d[1]=a.kr[1],d}};a.AN=function(a,b){switch(b){case 23:var d; | |
a:{switch(a.type){case 20:if(a.sm){d=a.sm.getEyeParameters("left");d=a.sm.getEyeParameters("right").eyeTranslation.x-d.eyeTranslation.x;break a}d=a.Wh;break a;default:I.error("eye_distance is undefined for device: ",a.type)}d=void 0}return d}};a.bd=function(a,c,e){if(a){switch(c){case 120:a.Ue.push(e);c=131;break;case 130:a.uf.push(e);c=131;break;case 40:a.bh.push(e);break;case 30:a.dh.push(e);break;case 50:a.eh.push(e);break;case 60:a.fh.push(e);break;case 80:a.Xg.push(e);break;case 70:a.Yg.push(e); | |
break;case 90:a.vh.push(e);break;case 100:a.uh.push(e);break;case 110:a.th.push(e)}if(-1==a.tb.indexOf(c)&&(a.tb.push(c),a.kh))switch(c){case 40:a.element.addEventListener("mousedown",K,!1);break;case 30:a.element.addEventListener("mousemove",L,!1);break;case 50:a.element!=window&&a.element.addEventListener("mouseout",E,!1);a.element.addEventListener("mouseup",E,!1);break;case 60:a.element.addEventListener("wheel",B,!1);break;case 80:a.element.addEventListener("keydown",y,!1);break;case 70:a.element.addEventListener("keyup", | |
Q,!1);break;case 90:a.element.addEventListener("touchstart",b,!1);break;case 100:a.element.addEventListener("touchmove",d,!1);break;case 110:a.element.addEventListener("touchend",x,!1);break;case 131:a.element.addEventListener("deviceorientation",n,!1)}}};a.cd=function(a,b,d){a&&k(a,b,d,!1)};a.fa=function(){for(var a=0;a<da.length;a++)for(var b=da[a],d=0;d<b.tb.length;d++)k(b,b.tb[d],null,!0);da.length=0}};b4w.module.__physics=function(a,m){function h(a,b){for(var d=a.gf,c=0;c<d.length;c++)d[c].vf.Do&&b.push(d[c]),h(d[c],b)}function c(a,b,d){for(var c=a.Hb.A,e=0;e<c.length;e++)for(var l=c[e].p,f=0;f<l.qd.length;f++){var q=l.qd[f];"ANY"!=q.kb&&d!=q.kb||y(q,a,b)}}function e(a,b,c){if(q.Oq(a))switch(b){case q.CH:var e=u(a);e.Hb.bH=!0;q.G(a,q.sI,Date.now()-performance.now(),ba.tf,ba.Ot?J.nB:0);break;case q.DH:r.Pv("URANIUM:",c.slice(1));break;case q.yH:r.error(c);break;case q.zH:l.kq.apply(this,c.slice(1)); | |
break;case q.IH:var f=g(c.F);if(f){a=c.trans;e=c.quat;b=c.bg;var k=c.Nf,f=f.p;f.$p=c.time;R.yf(a,1,e,f.uu);Z.copy(b,f.bg);Z.copy(k,f.Nf)}break;case q.FH:(a=g(c.Ut))&&R.yf(c.trans,1,c.quat,a.l.Yn[c.yw]);break;case q.AH:if(e=g(c[1]))a=c[4],e=e.Ie.Jp[c[2]],V.ac(e,c[3]),V.mg(e,a),V.o(e);break;case q.JH:if(f=g(c[1]))f.l.speed=c[2];break;case q.uH:e=u(a);z(e,c.Qi,c.Ri,c.result,null,null,0);break;case q.wH:e=u(a);z(e,c.Qi,c.Ri,c.result,c.Yi,c.coll_norm,c.coll_dist);break;case q.vH:if(f=g(c[1]))a=f.p,a.Xi&& | |
a.Xi(c[2]);break;case q.wy:case q.GH:e=u(a);if(a=e.Hb.gi[c.id])if(e=g(c.Ck),b==q.wy)b=a.callback,b(a.id,c.hit_fract,e,c.hit_time);else{b=c.hit_fract;var k=c.hit_time,f=c.hit_pos,h=a.callback;f?h(a.id,b,e,k,f,c.hit_norm):h(a.id,b,e,k)}break;case q.HH:d(id);break;case q.EH:a=na.indexOf(a);console.log("Physics #"+a+" Ping: OUT "+(c[2]-c[1]).toFixed(3)+" ms, IN "+(performance.now()-c[2]).toFixed(3)+" ms, ALL "+(performance.now()-c[1]).toFixed(3)+" ms");break;case q.BH:W=c[1];break;case q.xH:a=na.indexOf(a); | |
console.log("Worker: #"+String(a));console.log(c[1]);break;default:r.error("Wrong message: "+b)}}function u(a){for(var b=0;b<na.length;b++)if(na[b]==a)return ka[b]}function g(a){return ha[a]||null}function z(a,b,d,c,e,l,f){a=a.Hb.A;for(var q=0;q<a.length;q++)for(var r=a[q].p,k=0;k<r.qd.length;k++){for(var h=r.qd[k],w=h.ei,n=!1,x=0;x<w.length;x++){var m=w[x];if(m[0]===b&&m[1]===d){h.Qn[x]=c;n=!0;break}}n&&(w=t(h),e&&h.It!=b&&(n=e,x=l,m=f,n[0]+=x[0]*m,n[1]+=x[1]*m,n[2]+=x[2]*m,x[0]*=-1,x[1]*=-1,x[2]*= | |
-1),h.callback(w,w?h.It==b?g(d):g(b):null,e,l,f))}}function t(a){a=a.Qn;for(var b=!1,d=0;d<a.length;d++)b=b||a[d];return b}function p(){fa.body++;return fa.body}function f(a){var b=ja.indexOf(a);return-1==b?(ja.push(a),ja.length-1):b}function v(a,b){return{F:a,type:b,cg:0,Qq:!1,oi:!0,xd:!1,Re:!1,eO:!1,Rp:null,kb:"",Qm:0,RV:{},qd:[],Xi:null,$p:0,uu:new Float32Array([0,0,0,1,0,0,0,1]),bg:new Float32Array(3),Nf:new Float32Array(3),Lp:new Float32Array(3),Hm:new Float32Array(4)}}function k(a,b){switch(a){case "BOX":var d= | |
b.zc;break;case "CYLINDER":d=b.Dt;break;case "CONE":d=b.Ct;break;case "SPHERE":d=b.De;break;case "CAPSULE":d=b.Bt}return d}function n(a){if(!a)return null;var b={};"number"===typeof a.min_x&&(b.min_x=a.min_x);"number"===typeof a.min_y&&(b.min_y=a.min_y);"number"===typeof a.min_z&&(b.min_z=a.min_z);"number"===typeof a.max_x&&(b.max_x=a.max_x);"number"===typeof a.max_y&&(b.max_y=a.max_y);"number"===typeof a.max_z&&(b.max_z=a.max_z);"object"===typeof a.N&&(b.center=a.N);"number"===typeof a.ib&&(b.radius= | |
a.ib);"number"===typeof a.height&&(b.height=a.height);return b}function A(a,b,d,c,e){var l=R.m(a.g.i),f=R.invert(b.g.i,la),g=new Float32Array(3);R.bc(l,f,g);switch(b.l.type){case 10:b=b.Pd;a=a.g.zc;q.G(e,q.WH,d,g,b.yR,b.Lw,(a.max_y-a.min_y)/2,c);break;case 20:q.G(e,q.VH,d,g,a.U_)}}function L(a){return a.p&&a.p.Rp}function K(a,b,d,c,e,l,f,g,r,k){var h;fa.vb++;h=fa.vb.toString(16);var w=b.p.F;q.G(G(w),q.cI,h,a,g,w,d,c,e.p.F,l,f,r,k);b.p.Rp=h}function G(a){for(var b=0;b<ka.length;b++)for(var d=ka[b].Hb.A, | |
c=0;c<d.length;c++)if(d[c].p.F==a)return na[b];return null}function E(a){var b=a.p;if(b=b?0===b.cg?!0:!0===b.Qq?!0:!1===b.oi?!0:"RIGID_BODY"!==b.type&&"DYNAMIC"!==b.type?!0:!1:!1)var b=R.m(a.g.i),d=R.v(a.g.i),b=b[0]!=a.p.Lp[0]||b[1]!=a.p.Lp[1]||b[2]!=a.p.Lp[2]||d[0]!=a.p.Hm[0]||d[1]!=a.p.Hm[1]||d[2]!=a.p.Hm[2]||d[3]!=a.p.Hm[3];if(b){var b=a.p,c=a.g,d=R.m(c.i),c=R.v(c.i);Z.copy(d,b.Lp);w.copy(c,b.Hm);var e=q.YB(q.cp);e.F=b.F;e.trans=d;"DYNAMIC"==b.type?w.identity(e.quat):e.quat=c;q.G(G(b.F),q.cp)}a= | |
a.gf;for(b=0;b<a.length;b++)E(a[b])}function B(a,b,d,c,e){e=e||new Float32Array(3);a=R.v(a.g.i);e[0]=b;e[1]=d;e[2]=c;Z.transformQuat(e,a,e)}function y(a,b,d){var c=a.ei,e=a.Qn,l=a.It,f=[],g=a.kb;if(!f)throw"At least one destination required";for(var r=0;r<b.Hb.A.length;r++){var k=b.Hb.A[r];if("ANY"==g||k.p.kb==g)k=k.p.F,f&&-1==f.indexOf(k)&&f.push(k)}for(b=0;b<f.length;b++)g=f[b],l<g&&!Q(c,l,g)?(c.push([l,g]),e.push(!1)):l>g&&!Q(c,g,l)&&(c.push([g,l]),e.push(!1));q.G(d,q.UH,l);q.G(d,q.bI,c,a.Uf)} | |
function Q(a,b,d){for(var c=0;c<a.length;c++)if(a[c][0]==b&&a[c][1]==d)return!0;return!1}function b(a){a.p&&a.p.Xi&&(a=a.p,q.G(G(a.F),q.oI,a.F),a.Xi=null)}function d(a){var b=C(a),d=x(a).Hb;d.gi[a]&&(delete d.gi[a],d.Bw.splice(d.Bw.indexOf,1),q.G(b,q.xI,a))}function x(a){for(var b=0;b<ka.length;b++){var d=ka[b];if(d.Hb.gi[a])return d}return null}function C(a){for(var b=0;b<ka.length;b++)if(ka[b].Hb.gi[a])return na[b];return null}function H(a,b,d){if(b.bm){a=a.p.F;var c=b.Qk*b.qn,e=b.Fm*b.Gm,l=-b.$l* | |
b.am*2*Math.PI/b.xo;b.Fn&&(l*=-1);switch(b.type){case 10:q.G(d,q.KI,a,c,e,l);break;case 20:q.G(d,q.JI,a,c,e,l)}}}function I(a){return a.xd&&"CHASSIS"==a.Pd.Cd}function O(a){return a.xd&&"HULL"==a.Pd.Cd}function M(a){return a.Aj&&"MAIN_BODY"==a.Sk.Cd}var F=m("__config");m("__constraints");var l=m("__debug"),q=m("__ipc");m("__mat4");var D=m("__obj_util"),r=m("__print"),w=m("__quat");m("__renderer");var P=m("__scenes"),V=m("__transform"),R=m("__tsr"),ca=m("__util"),Z=m("__vec3"),da=m("__version"),ba= | |
F.p,J=F.u,pa=F.Pf,W=0,na=[],ka=[],ha={},ra=[],ja=["ANY"],fa={body:0,vb:0,GE:0},U=new Float32Array(3);new Float32Array(4);var za=new Float32Array(4);new Float32Array(16);var la=R.create(),ga=R.create();a.XN=function(a){a.Hb={bH:!1,A:[],gi:{},Bw:[]};var b=ba.Bo;pa.ww&&(b+=da.timestamp());r.log("%cLOAD PHYSICS","color: #0a0",ba.Go?"Using Separate Worker Thread,":"Using Same Thread,","Max FPS: "+ba.tf);r.log("%cPHYSICS PATH","color: #0a0",b);var d=q.yL(b,!ba.Go);q.KJ(d,e);na.push(d);ka.push(a);ba.ping&& | |
setInterval(function(){q.G(d,q.uI,performance.now())},1E3)};a.EK=function(a){return a.Hb?a.Hb.bH:!0};a.fa=function(){for(var a=0;a<na.length;a++)q.terminate(na[a]);na.length=0;ka.length=0;ha={};ra.length=0;ja.length=0;for(var b in fa)fa[b]=0};a.xk=function(a,b){if(!a.g)throw"No object render: "+a.name;var d;a:{for(var e=0;e<ka.length;e++)if(ka[e]==b){d=na[e];break a}d=void 0}var l=[];a.vf.Do&&h(a,l);var g=b.Hb.A;if(I(a)||O(a)||a.Re||M(a)||a.fk){var x,m=a,C=d,y=m.g,t=m.vf,P=t.Ar,F=p();if("CAMERA"== | |
m.type)var W=t.Xx?t.Op:"BOX",B=k(W,y),Z=y.sn,z=y.kn,Z=.5,z=0;else if("EMPTY"==m.type)W="EMPTY",B=null,z=Z=0;else{var W=t.Xx?t.Op:"BOX",B=k(W,y),u=R.qc(y.i);if(1!=u){var ia=B;switch(W){case "BOX":ia.min_x*=u;ia.max_x*=u;ia.min_y*=u;ia.max_y*=u;ia.min_z*=u;ia.max_z*=u;break;case "CYLINDER":case "CONE":case "CAPSULE":ia.height*=u;ia.ib*=u;break;case "SPHERE":ia.ib*=u}}Z=y.sn;z=y.kn}var T=R.m(y.i),E=R.v(y.i),G=t.Fo,J=t.IG,Q=t.cg,V=t.MG,da=t.LG,ba=t.wu,U=t.Nw,pa=m.kb,fa=f(pa),ja=t.Rm,Za=t.Pm,ya=t.Sm,$b= | |
y.De.ib,Ib=n(B),Kc=m.Tp,Tb;var kb=W;if(l.length){var rc=[],Cc={};Cc.quat=new Float32Array([0,0,0,1]);Cc.trans=new Float32Array(3);Cc.worker_bounding=Ib;Cc.bounding_type=kb;rc.push(Cc);var Lc=R.invert(y.i,la),ac=R.v(y.i);w.invert(ac,za);for(var Oa=0;Oa<l.length;Oa++){var lb={},Jb=l[Oa],xc=Jb.vf.Op,kc=new Float32Array(4),Dc=new Float32Array(3),Xc=R.m(Jb.g.i),Pc=R.v(Jb.g.i);R.bc(Xc,Lc,Dc);w.multiply(za,Pc,kc);lb.trans=Dc;lb.quat=kc;lb.bounding_type=xc;lb.worker_bounding=n(k(xc,Jb.g));rc.push(lb)}Tb= | |
rc}else Tb=[];q.G(C,q.ZH,F,T,E,P,G,J,Q,V,da,ba,U,fa,ja,Za,ya,W,Ib,$b,Z,z,Tb,Kc);ha[F]=m;ra.push(m);var bc=v(F,"BOUNDING");bc.type=P;bc.cg=Q;bc.Qq=G;bc.kb=pa;bc.Qm=fa;x=bc;a.p=x;var jd={I:null,p:x};g.push(jd);c(b,d,x.kb)}else for(var Yc=D.bb(a,b).W,mb=0;mb<Yc.length;mb++){var cc=Yc[mb],Eb;if(Eb="PHYSICS"==cc.type){var yb;a:{for(var Pa=b.Hb.A,vd=0;vd<Pa.length;vd++){var Ad=Pa[vd].I;if(Ad&&Ad.id==cc.id){yb=!0;break a}}yb=!1}Eb=!yb}if(Eb)if(cc.re.ma)if(cc.kk&&b.k.jc){var Qa=cc,yc=b,lc=d,La=yc.k.jc;q.G(lc, | |
q.hI,La.Di);if(Qa.ZS){var bb={};bb.dst_noise_scale0=Qa.dst_noise_scale0;bb.dst_noise_scale1=Qa.dst_noise_scale1;bb.dst_noise_freq0=Qa.dst_noise_freq0;bb.dst_noise_freq1=Qa.dst_noise_freq1;bb.dir_min_shore_fac=Qa.dir_min_shore_fac;bb.dir_freq=Qa.dir_freq;bb.dir_noise_scale=Qa.dir_noise_scale;bb.dir_noise_freq=Qa.dir_noise_freq;bb.dir_min_noise_fac=Qa.dir_min_noise_fac;bb.dst_min_fac=Qa.dst_min_fac;bb.waves_hor_fac=Qa.waves_hor_fac;var zc=La.waves_height,Zc=La.waves_length;La.ni?q.G(lc,q.Ny,bb,La.Rl[0], | |
La.Rl[1],La.Ql[0],La.Ql[1],La.Sv,zc,Zc,La.qx,yc.k.px):q.G(lc,q.Ny,bb,0,0,0,0,0,zc,Zc,0,null)}}else{var zb;if(cc.Fo){var Ec=a,mc=cc,od=d,Rb=p(),pd=mc.re,qd=pd.H[0].a_position,rd=pd.Ta||null,kd=mc.kb,nc=f(kd),$a=mc.Rm,$c=mc.Pm,Fc=mc.Sm,Mc=R.m(Ec.g.i);q.G(od,q.eI,Rb,qd,rd,Mc,nc,$a,$c,Fc);var eb=v(Rb,"STATIC_MESH");eb.Qq=!0;eb.kb=kd;eb.Qm=nc;zb=eb}else{var nb=a,Ob=cc,sc=d,Ub=p(),Ab=Ob.re,Bb=Ab.H[0].a_position,Vb=Ab.Ta||null,Gc=R.m(nb.g.i),oc=Ob.sn,tb=Ob.kn,ob=Ob.kb,Ta=f(ob);q.G(sc,q.gI,Ub,Bb,Vb,Gc,oc, | |
tb,Ta,Ob.Rm,Ob.Pm,Ob.Sm);var cb=v(Ub,"STATIC_MESH");cb.kb=ob;cb.Qm=Ta;zb=cb}x=zb;a.p=x;jd={I:cc,p:x};g.push(jd);c(b,d,x.kb)}else r.error("Object "+a.name+" has collision material with no assigned vertices")}if(I(a)||O(a)){var Ga=a,Cb=d,fb=Ga.p.F;I(Ga)?(Ga.l.type=10,q.G(Cb,q.$H,fb,Ga.l.Fx,Ga.l.Hx,Ga.l.Gx,Ga.l.iy,Ga.l.Tv)):O(Ga)&&(Ga.l.type=20,q.G(Cb,q.YH,fb,Ga.l.lj,Ga.l.lk,Ga.l.mk));if(Ga.l.Uj){var Db=Ga.l.Uj;switch(Ga.l.type){case 10:A(Db[1],Ga,fb,!0,Cb);A(Db[0],Ga,fb,!0,Cb);A(Db[3],Ga,fb,!1,Cb); | |
A(Db[2],Ga,fb,!1,Cb);break;case 20:for(var pb=0;pb<Db.length;pb++)A(Db[pb],Ga,fb,!1,Cb)}}H(a,a.l,d)}else if(a.Re){var Kb=d,dc=a.g,qb=a.p,vc=dc.zc.max_y-dc.zc.min_y,Fb=qb.F,ec=a.dA,Va=ec.YS,Xa=ec.dQ,Ua=ec.qR,Ca=ec.oO,Pb=ec.$S,ib=ca.PL(a);q.G(Kb,q.aI,Fb,ib,vc,Va,Xa,Ua,Ca,Pb);qb.Re=!0}else if(M(a)){var rb=a,Ka=d,wc=rb.p.F;q.G(Ka,q.dI,wc,rb.Ie.lj,rb.Ie.lk,rb.Ie.mk);if(rb.Ie.Jp)for(var gb=rb.Ie.Jp,Ja=0;Ja<gb.length;Ja++){var ub=gb[Ja],pc=R.m(ub.g.i),Ya=R.invert(rb.g.i,la),Gb=new Float32Array(3);R.bc(pc, | |
Ya,Gb);q.G(Ka,q.XH,wc,Gb,ub.VJ)}rb.p.eO=!0}for(mb=0;mb<ra.length;mb++)if(a=ra[mb],a.p){var Lb=a;if(!L(Lb))for(var ab=0;ab<Lb.qw.length;ab++){var vb=Lb.qw[ab],wb=vb.target,Ra=vb.xP;if(wb.p){var jb=new Float32Array([vb.yP,vb.zP,vb.AP]),Qb,Hc=new Float32Array([vb.Qf,vb.Rf,vb.Sf]);Qb=ca.Sh(Hc,new Float32Array(4));var db=R.identity(la),db=R.Jd(jb,db),db=R.lg(Qb,db),Wb=R.multiply(Lb.g.i,db,la),fc=R.invert(wb.g.i,ga),Xb=R.multiply(fc,Wb,fc),Yb=R.m(Xb),ad=R.v(Xb),Wa=vb,Na={};Na.use_limit_x=Wa.CS;Na.use_limit_y= | |
Wa.DS;Na.use_limit_z=Wa.ES;Na.use_angular_limit_x=Wa.xS;Na.use_angular_limit_y=Wa.yS;Na.use_angular_limit_z=Wa.zS;Na.limit_max_x=Wa.yO;Na.limit_min_x=Wa.BO;Na.limit_max_y=Wa.zO;Na.limit_min_y=Wa.CO;Na.limit_max_z=Wa.AO;Na.limit_min_z=Wa.DO;Na.limit_angle_max_x=Wa.sO;Na.limit_angle_min_x=Wa.vO;Na.limit_angle_max_y=Wa.tO;Na.limit_angle_min_y=Wa.wO;Na.limit_angle_max_z=Wa.uO;Na.limit_angle_min_z=Wa.xO;K(Ra,Lb,jb,Qb,wb,Yb,ad,Na,null,null)}}}};a.wM=g;a.update=function(a,b){for(var d=0;d<na.length;d++){var c= | |
na[d],e=a;c&&q.ZC(c)&&q.G(c,q.LI,e,b);for(var l=0;l<ra.length;l++){var f=ra[l],g=f.p;if(g.oi&&g.$p){var r=q.ZC(c)?e-g.$p:performance.now()/1E3-g.$p,r=Math.min(r,10/ba.tf),r=r-1/ba.tf;J.iP&&(r=0);var k=la;R.YN(g.uu,r,g.bg,g.Nf,la);V.ng(f,k);V.o(f);E(f);if(f.l)for(var g=f,r=g.l.Uj,k=g.g.i,h=la,n=0;n<r.length;n++){var x=r[n];R.multiply(k,g.l.Yn[n],h);V.ng(x,h);V.o(x)}f.l&&f.l.bm&&(h=f,r=h.l,g=r.bm)&&(n=h.l.RF,R.multiply(h.g.i,h.l.SF,g.g.i),k=U,R.vc(n,h.g.i,k),h=za,w.setAxisAngle(k,-r.$l*r.am*2*Math.PI, | |
h),r=R.v(g.g.i),w.multiply(h,r,r),V.o(g));f.l&&f.l.yx&&(h=f,r=h.l,g=r.yx)&&(n=h.l.NF,R.multiply(h.g.i,h.l.OF,g.g.i),k=U,R.vc(n,h.g.i,k),h=za,n=Math.abs(r.speed)*r.vo,n>r.ql&&(n=r.ql),w.setAxisAngle(k,-n,h),r=R.v(g.g.i),w.multiply(h,r,r),w.normalize(r,r),V.o(g));f.l&&f.l.Jx&&(k=f,g=k.l,f=g.Jx)&&(h=k.l.aG,R.multiply(k.g.i,k.l.bG,f.g.i),r=U,R.vc(h,k.g.i,r),k=za,w.setAxisAngle(r,-Math.abs(g.Qk)*g.bn,k),g=R.v(f.g.i),w.multiply(k,g,g),w.normalize(g,g),V.o(f))}}q.EP(c);c=ka[d];(e=c.k.jc)&&0<e.waves_height&& | |
(c=P.da(c,"MAIN_OPAQUE"),e=Z.length(c.xh),q.G(na[d],q.II,c.time*e))}};a.aN=function(){return ka[0]};a.pause=function(){for(var a=0;a<na.length;a++)q.G(na[a],q.tI)};a.wf=function(){for(var a=0;a<na.length;a++)q.G(na[a],q.yI)};a.cB=function(a){a=a.p;if(!a)throw"No object physics";if(!a.oi){var b=a.F,d=G(b);a.oi=!0;q.G(d,q.rI,b)}};a.Hu=function(a){a=a.p;if(!a)throw"No object physics";if(a.oi){var b=a.F,d=G(b);a.oi=!1;q.G(d,q.qI,b)}};a.Or=function(a){return Boolean(a.Hb)};a.Z=function(a){return Boolean(a.p)}; | |
a.LC=function(a){return(a=a.p)&&a.oi&&("RIGID_BODY"==a.type||"DYNAMIC"==a.type)&&0<a.cg&&0==a.Qq?!0:!1};a.qv=function(a){return(a=a.p)&&a.oi?!0:!1};a.kF=function(a,b){var d=a.p.F;q.G(G(d),q.HI,d,b)};a.JN=L;a.yz=K;a.mA=function(a){a=a.p;q.G(G(body_a),q.wI,a.Rp);a.Rp=null};a.xE=function(b,d,c,e,l,f){d=R.yf(d,1,c,la);l=R.yf(l,1,f,ga);R.invert(d,d);R.multiply(l,d,d);V.sj(e,l);R.multiply(l,d,d);V.ng(b,d);V.o(b);e=R.m(b.g.i);l=R.v(b.g.i);a.bs(b,e,l)};a.bs=function(a,b,d){var c=a.p,e=R.m(a.g.i);a=R.v(a.g.i); | |
R.yf(e,1,a,c.uu);e=q.YB(q.cp);e.F=c.F;e.trans=b;e.quat=d;q.G(G(c.F),q.cp)};a.r=E;a.Ez=function(a,b,d,c){B(a,b,d,c,U);a=a.p.F;b=Math.abs(0);d=Math.abs(0);c=Math.abs(0);var e=Math.abs(U[0]),l=Math.abs(U[1]),f=Math.abs(U[2]);U[0]=e?U[0]/e*Math.max(e,b):0;U[1]=l?U[1]/l*Math.max(l,d):0;U[2]=f?U[2]/f*Math.max(f,c):0;q.G(G(a),q.Py,a,U[0],U[1],U[2])};a.Fz=function(a,b,d,c){a=a.p.F;q.G(G(a),q.Py,a,b,d,c)};a.zz=function(a,b,d,c){B(a,b,d,c,U);a=a.p.F;q.G(G(a),q.iI,a,U[0],U[1],U[2])};a.Dz=function(a,b,d,c){B(a, | |
b,d,c,U);a=a.p.F;q.G(G(a),q.kI,a,U[0],U[1],U[2])};a.Uw=function(a,b,d){a=a.p.F;q.G(G(a),q.BI,a,b,d)};a.Ur=function(a,b){var d=a.p.F;q.G(G(d),q.CI,d,b)};a.dF=function(a,b){var d=a.p.F;q.G(G(d),q.GI,d,b)};a.cF=function(a,b){var d=a.p.F;q.G(G(d),q.EI,d,b)};a.$E=function(a,b){var d=a.p.F;q.G(G(d),q.zI,d,b)};a.bA=function(a){a=a.p.F;q.G(G(a),q.mI,a)};a.cA=function(a,b,d){a=a.p.F;q.G(G(a),q.nI,a,b,d)};a.Vr=function(a,b,d){a=a.p.F;q.G(G(a),q.DI,a,b,d)};a.aF=function(a,b){var d=a.p.F;q.G(G(d),q.AI,d,b)}; | |
a.bF=function(a,b){var d=a.p.F;q.G(G(d),q.FI,d,b)};a.ut=function(a,b,d,c){var e=a.p,l=e.F;b=b||"ANY";for(var f=0;f<e.qd.length;f++)if(a=e.qd[f],a.kb==b&&a.callback==d)return;a={It:l,Uf:c||!1,kb:b,callback:d,ei:[],Qn:[]};e.qd.push(a);b=G(l);y(a,u(b),b)};a.Fw=function(a,b,d){a=a.p;for(var c=G(a.F),e=u(c),l=0;l<a.qd.length;l++){var f=a.qd[l];if(f.kb==b&&f.callback==d){if(t(f)){var g=Z.set(0,0,0,U);f.callback(!1,null,g,g,0)}a.qd.splice(l,1);l--;for(var g=c,f=f.ei,r=e.Hb.A,k=0;k<r.length;k++)for(var h= | |
r[k].p,n=0;n<h.qd.length;n++)for(var w=h.qd[n],x=0;x<w.ei.length;x++)for(var m=w.ei[x],p=0;p<f.length;p++){var C=f[p];m[0]==C[0]&&m[1]==C[1]&&(f.splice(p,1),p--)}f.length&&q.G(g,q.Oy,f)}}};a.wt=function(a,d){a.p&&a.p.Xi&&b(a);var c=a.p;q.G(G(c.F),q.jI,c.F);c.Xi=d};a.Zt=b;a.zp=function(a,b,d,c,e,l,g,r,k){var h;fa.GE++;h=fa.GE;c=c||"ANY";a={id:h,F:a?a.p.F:0,from:new Float32Array(b),to:new Float32Array(d),kb:c,Qm:f(c),Mz:l,ZJ:g,Uf:r,Iq:k,callback:e};b=G(a.F)||na[0];d=u(b).Hb;h=a.id;d.gi[h]=a;d.Bw.push(a); | |
q.G(b,q.fI,a.id,a.F,a.from,a.to,a.Qm,a.Mz,a.ZJ,a.Uf,a.Iq);return h};a.Gw=d;a.$z=function(a,b,d){var c=C(a),e=x(a).Hb.gi[a];e&&!e.Mz&&(e.from.set(b),e.to.set(d),q.G(c,q.lI,a,b,d))};a.gD=function(a){return x(a).Hb.gi[a]?!0:!1};a.pm=function(a,b){var d=a.l;d.Qk=b;H(a,d,G(a.p.F))};a.om=function(a,b){var d=a.l;d.$l=b;H(a,d,G(a.p.F))};a.ay=function(a,b){var d=a.l;d.Fm=b;H(a,d,G(a.p.F))};a.yd=I;a.zd=O;a.cO=function(a){if(!a.xd)return!1;a=a.Pd.Cd;return"WHEEL_FRONT_LEFT"==a||"WHEEL_FRONT_RIGHT"==a||"WHEEL_BACK_LEFT"== | |
a||"WHEEL_BACK_RIGHT"==a?!0:!1};a.aO=function(a){return a.xd?"BOB"==a.Pd.Cd?!0:!1:!1};a.fO=function(a){return a.Aj?"BOB"==a.Sk.Cd?!0:!1:!1};a.iD=function(a){return a.xd&&"STEERING_WHEEL"==a.Pd.Cd?!0:!1};a.hD=function(a){return a.xd&&"SPEEDOMETER"==a.Pd.Cd?!0:!1};a.jD=function(a){return a.xd&&"TACHOMETER"==a.Pd.Cd?!0:!1};a.tC=function(a){return a.l.speed};a.bT=function(a){switch(a){case "WHEEL_FRONT_LEFT":return 0;case "WHEEL_FRONT_RIGHT":return 1;case "WHEEL_BACK_LEFT":return 2;case "WHEEL_BACK_RIGHT":return 3}}; | |
a.Re=function(a){return a.Re};a.QY=M;a.pN=function(){return W};a.GL=function(){for(var a=0;a<na.length;a++)q.G(na[a],q.pI)};a.ho=function(a){if("BOUNDING"==a.p.type){var d=ra.indexOf(a);-1==d&&r.error("Object "+a.name+" doesn't have bounding physics");delete ha[c];ra.splice(d,1)}for(var c=a.p.F,d=G(c),e=u(d),l=c,f=e.Hb.A,g=[],k=0;k<f.length;k++)for(var h=f[k].p,n=0;n<h.qd.length;n++)for(var w=h.qd[n],x=0;x<w.ei.length;x++){var m=w.ei[x],p=w.Qn[x];if(m[0]==l||m[1]==l)w.ei.splice(x,1),w.Qn.splice(x, | |
1),x--,p&&!t(w)&&(p=Z.set(0,0,0,U),w.callback(!1,null,p,p,0)),g.push(m)}g.length&&q.G(d,q.Oy,g);a.p&&a.p.Xi&&b(a);a=e.Hb.A;for(e=0;e<a.length;e++)a[e].p.F==c&&(a.splice(e,1),e--);q.G(d,q.vI,c)}};b4w.module.__debug=function(a,m){function h(a){a=a.split("\n");for(var d=0;d<a.length;d++)a[d]=d+1+" "+a[d];return a=a.join("\n")}function c(a){for(var d=g.tq(),c=a.bq,e=0;e<c.length;e++){var k=c[e],h=d.$M(k,d.JU),n=A.getParameter(d.BT);h&&!n&&(k=d.$M(k,d.KU)/1E6,a.Ph=a.Ph?f.Gc(k,a.Ph,1,10):k,c.splice(e,1),e--)}}function e(a,d){typeof a!=typeof d&&f.ha("Structure assertion failed: incompatible types");if(null!==a&&null!==d&&"object"==typeof a){for(var c in a)c in d||f.ha("Structure assertion failed: missing key in the first object: "+ | |
c);for(c in d)c in a||f.ha("Structure assertion failed: missing key in the second object: "+c),typeof a[c]!=typeof d[c]&&f.ha("Structure assertion failed: incompatible types for key "+c)}}var u=m("__config"),g=m("__extensions"),z=m("__print"),t=m("__textures"),p=m("__time"),f=m("__util"),v=m("__graph");m("__scenes");m("__renderer");var k=u.u,n={},A=null,L=!1,K={},G=[],E=-1,B=null,y=!1;a.op=0;a.kt=1;a.pp=2;a.jt=3;a.np=4;a.oe=function(a){var d="INVALID_ENUM INVALID_VALUE INVALID_OPERATION OUT_OF_MEMORY INVALID_FRAMEBUFFER_OPERATION CONTEXT_LOST_WEBGL".split(" "), | |
c;for(c in d){var e=d[c];e in a&&(n[a[e]]=e)}A=a};a.Vt=function(a){if(L){var d=A.getError();d!=A.NO_ERROR&&(d in n?f.ha("GL Error: "+d+", gl."+n[d]+" ("+a+")"):f.ha("Unknown GL error: "+d+" ("+a+")"))}};a.rK=function(){if(L)switch(A.checkFramebufferStatus(A.FRAMEBUFFER)){case A.FRAMEBUFFER_COMPLETE:break;case A.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:z.error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_ATTACHMENT");break;case A.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:z.error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT"); | |
break;case A.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:z.error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_DIMENSIONS");break;case A.FRAMEBUFFER_UNSUPPORTED:z.error("Incomplete framebuffer: FRAMEBUFFER_UNSUPPORTED");break;default:z.error("FRAMEBUFFER CHECK FAILED")}};a.vK=function(){if(-1!=E)return E;A.bindFramebuffer(A.FRAMEBUFFER,A.createFramebuffer());var a=t.Wm("DEBUG",t.rk);t.resize(a,1,1);A.framebufferTexture2D(A.FRAMEBUFFER,A.DEPTH_ATTACHMENT,a.Sb,a.Ya,0);A.checkFramebufferStatus(A.FRAMEBUFFER)!= | |
A.FRAMEBUFFER_COMPLETE?(E=!0,z.warn("depth-only issue was found")):E=!1;A.bindFramebuffer(A.FRAMEBUFFER,null);return E};a.yK=function(a,d,c){if(L&&!A.getShaderParameter(a,A.COMPILE_STATUS)){var e=k.uz&&g.fv();e&&(c=e.getTranslatedShaderSource(a));c=h(c);z.error("shader compilation failed:\n"+c+"\n"+A.getShaderInfoLog(a)+" ("+d+")");throw"Engine failed: see above for error messages";}};a.zK=function(a,d,c,e,f,n){if(L&&!A.getProgramParameter(a,A.LINK_STATUS)){var m=k.uz&&g.fv();m&&(f=m.getTranslatedShaderSource(c), | |
n=m.getTranslatedShaderSource(e));f=h(f);n=h(n);z.error("shader linking failed:\n"+f+"\n\n\n"+n+"\n"+A.getProgramInfoLog(a)+" ("+d+")");throw"Engine failed: see above for error messages";}};a.Vw=function(a){L=a};a.Hw=function(a){if(k.show_hud_debug_info||"PERFORMANCE"==a.type){var d=g.tq();if(d){var c=d.VV();a.bq.push(c);d.pV(d.SI,c)}else a.bq.push(performance.now())}};a.Iw=function(a){if(k.show_hud_debug_info||"PERFORMANCE"==a.type){var d=g.tq();d?(d.qW(d.SI),c(a)):(d=performance.now()-a.bq.pop(), | |
a.Ph=a.Ph?f.Gc(d,a.Ph,1,10):d)}};a.JP=c;a.vW=function(a){K[a]=a in K?K[a]+1:1};a.update=function(){for(var a in K)z.log(a,K[a]),K[a]=0};a.kq=function(){for(var a=[performance.now()],d=0;d<arguments.length;d++){var c=arguments[d];if(f.pf(c))for(var e=0;e<c.length;e++)a.push(c[e]);else a.push(arguments[d])}G.push(a)};a.RD=function(){for(var a=1,d=0;d<G.length;d++){var c=G[d];c[1]==arguments[0]&&a++}c=[a];for(d=0;d<arguments.length;d++)if(a=arguments[d],f.pf(a))for(var e=0;e<a.length;e++)c.push(a[e]); | |
else c.push(arguments[d]);G.push(c)};var Q=["color: #3366FF","color: #CC33FF","color: #FF3366","color: #33FF66","color: #FFCC33"];a.tE=function(a){a||(a=1);for(var d=0,c={},e=Math.max(0,performance.now()-1E3*a),f=0;f<G.length;f++){var g=G[f];a=g[0];if(!(a<e)){var k=String(g[1]);c[k]||(c[k]=Q[d++%Q.length]);a=["%c"+(a/1E3).toFixed(6),c[k],k];for(k=2;k<g.length;k++)a.push(g[k]);z.log.apply(this,a)}}G.splice(0)};a.sw=function(a){a||(a=1);for(var d={},c=Math.max(0,performance.now()-1E3*a),e=0;e<G.length;e++){var f= | |
G[e];a=f[0];if(!(a<c))for(var g=2;g<f.length;g++){var k=String(f[1]);3<f.length&&(k+="_"+String(g-2));d[k]||(d[k]=k+"\n");d[k]+=String(a)+" "+f[g]+"\n"}}a="";for(k in d)a+=d[k]+"\n\n";z.log(a);G.splice(0)};a.yV=function(a){function d(a){return-1<c.indexOf(a)?!0:!1}var c=navigator.userAgent.toLowerCase();switch(a.toLowerCase()){case "chrome":return d("mozilla")&&d("applewebkit")&&d("chrome");case "firefox":return d("mozilla")&&d("gecko")&&d("firefox");case "msie":return d("mozilla")&&d("trident")&& | |
d("msie");case "opera":return d("opera")&&d("presto");case "safari":return d("mozilla")&&d("applewebkit")&&d("safari")&&!d("chrome");default:return!1}};a.fA=function(a){if(f.pf(a)){for(var d=0;d<a.length;d++)if(!isFinite(a[d]))return!1;return Boolean(a.length)}return isFinite(a)?!0:!1};a.gV=function(a,d){a.constructor!=d&&f.ha("Type assertion failed: value <"+a+"> has type <"+a.constructor+">, required <"+d+">")};a.iV=e;a.jV=function(a){y?e(a,B):y=!0;B=a};a.jB=function(a,d,c,e,g){(a=a||null)||f.ha("Stage load callback is undefined"); | |
d=d||5E3;c=c||0;e=e||100;100<e&&f.ha("Max percentage must be less than 100");0>c&&f.ha("Min percentage must be greater than 0");c>e&&f.ha("Max percentage must be greater than min percentage");var k=p.Of(c,e,d,function(d){d=d.toFixed();a(d);100==d&&(p.Lh(k),g&&g())})};a.kZ=function(a){return v.EL(a,function(a,b){return b.type},function(d,c,e){d=v.Pa(a,d);c=v.Pa(a,c);return d.Na[e[0]].identifier+"\n==>\n"+c.O[e[1]].identifier})}};b4w.module.__textures=function(a,m){function h(){return{name:"",type:0,source:"",vx:"",width:0,height:0,eu:1,sp:!0,bk:1024,mn:!1,Yd:null,Sb:0,Ya:null,we:null,Jn:!1,wh:-1,ua:null,vl:0,Pg:0,ga:0,pb:0,Vk:0,eg:!1,nh:1,Nc:null,Sw:0,Rw:0,Zj:-1,Tw:!1,Nl:-1,Ps:!1,AS:!1,ek:!1,Ls:!1,repeat:!0}}function c(b,d,c,f){var q=b.type,g=new Uint8Array([204,204,204,255]),r=h();switch(q){case "DATA_TEX2D":case "IMAGE":var k=J.createTexture(),n=J.TEXTURE_2D;J.bindTexture(n,k);J.texImage2D(n,0,J.RGBA,1,1,0,J.RGBA,J.UNSIGNED_BYTE, | |
g);b.image&&"MOVIE"==b.image.source&&(r.Jn=!0,r.ga=b.frame_start,r.pb=b.frame_offset,r.Vk=b.frame_duration,r.AS=b.use_auto_refresh,r.ek=b.use_cyclic,r.vl=b.movie_length,r.Ls=b.b4w_nla_video,0!=r.pb&&M.warn('Frame offset for texture "'+b.name+'" has a nonzero value. Can lead to undefined behaviour for mobile devices.'));break;case "NONE":k=J.createTexture();n=J.TEXTURE_2D;J.bindTexture(n,k);if("NONE"==b.b4w_source_type)return null;if("SCENE"==b.b4w_source_type)if(b.b4w_source_id&&(c=l.Fc("name",b.b4w_source_id, | |
c)))r.bk=b.b4w_source_size,c.Mf=c.Mf||[],c.Mf.push(b),J.texImage2D(n,0,J.RGBA,1,1,0,J.RGBA,J.UNSIGNED_BYTE,g);else return null;break;case "ENVIRONMENT_MAP":k=J.createTexture();n=J.TEXTURE_CUBE_MAP;J.bindTexture(n,k);c="POSITIVE_X NEGATIVE_X POSITIVE_Y NEGATIVE_Y POSITIVE_Z NEGATIVE_Z".split(" ");for(var w=0;6>w;w++)J.texImage2D(J["TEXTURE_CUBE_MAP_"+c[w]],0,J.RGBA,1,1,0,J.RGBA,J.UNSIGNED_BYTE,g);break;case "BLEND":return null;case "NODE_TEX":k=J.createTexture();n=J.TEXTURE_2D;J.bindTexture(n,k);J.texImage2D(n, | |
0,J.RGBA,1,1,0,J.RGBA,J.UNSIGNED_BYTE,g);break;default:return M.error('texture "'+b.name+'" has unsupported type "'+q+'"'),null}"NONE"==q&&(!b.b4w_enable_canvas_mipmapping||"CANVAS"!=b.b4w_source_type)||"DATA_TEX2D"==q||"IMAGE"==q&&"MOVIE"==b.image.source||"NODE_TEX"==q?J.texParameteri(n,J.TEXTURE_MIN_FILTER,J.LINEAR):J.texParameteri(n,J.TEXTURE_MIN_FILTER,pa[P.im]);J.texParameteri(n,J.TEXTURE_MAG_FILTER,J.LINEAR);g=n;c=b.b4w_anisotropic_filtering;"DEFAULT"===c&&(c=d);"OFF"!==c&&P.vp&&(d=O.dN())&& | |
(c=parseFloat(c.split("x")[0]),J.texParameterf(g,d.TEXTURE_MAX_ANISOTROPY_EXT,c));"REPEAT"!=b.extension||b.b4w_shore_dist_map?(r.repeat=!1,J.texParameteri(n,J.TEXTURE_WRAP_S,J.CLAMP_TO_EDGE),J.texParameteri(n,J.TEXTURE_WRAP_T,J.CLAMP_TO_EDGE)):(J.texParameteri(n,J.TEXTURE_WRAP_S,J.REPEAT),J.texParameteri(n,J.TEXTURE_WRAP_T,J.REPEAT));r.type=a.Ii;r.width=1;r.height=1;r.Ya=k;r.Sb=n;"CANVAS"==b.b4w_source_type&&"NONE"==q?(q=b.b4w_source_id,k=b.b4w_source_size,r.mn=b.b4w_enable_canvas_mipmapping,r.vx= | |
q,r.source="CANVAS",n=document.createElement("canvas"),n.width=k,n.height=k,r.Yd=n.getContext("2d"),f in da||(da[f]={}),da[f][q]=r,e(r)):"SCENE"==b.b4w_source_type&&"NONE"==q?(r.vx=b.b4w_source_id,r.source="SCENE"):(r.source=q,J.generateMipmap(n),J.bindTexture(n,null));r.name=b.name;return b.k=r}function e(a){if("CANVAS"!=a.source)throw"Wrong texture";var b=a.Sb;J.bindTexture(b,a.Ya);var d=k(a),c=n(a),e=A(a),l=a.Yd.canvas;J.pixelStorei(J.UNPACK_FLIP_Y_WEBGL,!0);J.texImage2D(b,0,c,d,e,l);J.pixelStorei(J.UNPACK_FLIP_Y_WEBGL, | |
!1);a.mn&&J.generateMipmap(b);J.bindTexture(b,null);a.width=l.width;a.height=l.height}function u(a){var b=a.Sb;J.bindTexture(b,a.Ya);J.pixelStorei(J.UNPACK_FLIP_Y_WEBGL,!0);4!=a.ua.length?a.eg?t(a,a.ua,a.width*a.nh,a.height*a.nh,!1):J.texImage2D(b,0,J.RGBA,J.RGBA,J.UNSIGNED_BYTE,a.ua):J.texImage2D(b,0,J.RGBA,1,1,0,J.RGBA,J.UNSIGNED_BYTE,a.ua);J.bindTexture(b,null)}function g(a){var b=a.Sb;J.bindTexture(b,a.Ya);J.pixelStorei(J.UNPACK_FLIP_Y_WEBGL,!0);a.eg?t(a,a.Nc[a.Zj],a.width*a.nh,a.height*a.nh, | |
!1):J.texImage2D(b,0,J.RGBA,J.RGBA,J.UNSIGNED_BYTE,a.Nc[a.Zj]);J.bindTexture(b,null)}function z(){R||(R=document.createElement("canvas"));return R}function t(a,b,d,c,e){e||(p(J.TEXTURE_2D),J.texImage2D(J.TEXTURE_2D,0,J.RGBA,J.RGBA,J.UNSIGNED_BYTE,b));J.bindTexture(J.TEXTURE_2D,null);q.VL(a,d,c,Z,ca)}function p(a){Z||(Z=J.createFramebuffer());J.bindTexture(a,null);ca||(ca=J.createTexture());J.bindTexture(a,ca);J.texParameteri(a,J.TEXTURE_WRAP_S,J.CLAMP_TO_EDGE);J.texParameteri(a,J.TEXTURE_WRAP_T,J.CLAMP_TO_EDGE); | |
J.texParameteri(a,J.TEXTURE_MAG_FILTER,J.LINEAR);J.texParameteri(a,J.TEXTURE_MIN_FILTER,J.LINEAR)}function f(a){a.ua.uZ=function(){u(a)}}function v(a){return l.Mm(a)?l.J(Math.pow(2,parseInt(a).toString(2).length),2,P.Lb):a}function k(b){switch(b.type){case a.Ii:b=J.RGBA;break;case a.mp:b=J.RGB;break;case a.xm:b=J.RGBA;break;case a.ym:b=J.RGB;break;case a.rk:b=J.DEPTH_COMPONENT;break;default:throw"Wrong texture type";}return b}function n(b){switch(b.type){case a.Ii:b=P.nd?J.RGBA8:J.RGBA;break;case a.mp:b= | |
P.nd?J.RGB8:J.RGB;break;case a.xm:b=P.nd?J.RGBA8:J.RGBA;break;case a.ym:b=P.nd?J.RGB8:J.RGB;break;case a.rk:b=P.nd?J.DEPTH_COMPONENT24:J.DEPTH_COMPONENT;break;default:throw"Wrong texture type";}return b}function A(b){switch(b.type){case a.Ii:b=J.UNSIGNED_BYTE;break;case a.mp:b=J.UNSIGNED_BYTE;break;case a.xm:b=J.FLOAT;break;case a.ym:b=J.FLOAT;break;case a.rk:b=J.UNSIGNED_INT;break;default:throw"Wrong texture type";}return b}function L(a){return a&&a.name&&a.we?!0:!1}function K(a,b){if(b in ba&&a in | |
ba[b]){var d=ba[b][a];d.ua?d.ua.play():d.Nc&&(d.Tw=!0);return!0}return!1}function G(a,b){if(b in ba&&a in ba[b]){var d=ba[b][a];d.ua?d.ua.pause():d.Nc&&(d.Tw=!1);return!0}return!1}function E(a,b){if(b in ba&&a in ba[b]){var d=ba[b][a];d.ua?d.ua.currentTime=d.pb/d.Pg:d.Nc&&(d.Zj=y(d,d.pb),g(d));return!0}return!1}function B(a){return a.ua?!a.ua.paused:a.Nc?a.Tw:!1}function y(a,b){return Math.round(b*a.Sw/a.vl)}function Q(a,d){if(D.Aa(a))return b(a,d);for(var c=a.KD,e=0;e<c.length;e++){var l=b(c[e], | |
d);if(l)return l}return null}function b(a,b){for(var d=null,c=a.D,e=0;e<c.length;e++)for(var l=c[e].W,f=0;f<l.length;f++)for(var q=l[f],g=0;g<q.ba.length;g++)if(q.ba[g].name==b){d=q.ba[g];break}return d}function d(a,b,d){var c=a.elements;a=a.interpolation;for(var e=0;e<b;e++){var l=e/(b-1),f=x(c,l,!0),q=C(c,l,!0);if(f&&q)if("CONSTANT"==a)d.push.apply(d,f.color);else{var g=d,k=f,h=q;k==h?g.push.apply(g,k.color):(g.push(r.dr(h.color[0],h.position,k.color[0],k.position,l)),g.push(r.dr(h.color[1],h.position, | |
k.color[1],k.position,l)),g.push(r.dr(h.color[2],h.position,k.color[2],k.position,l)),g.push(r.dr(h.color[3],h.position,k.color[3],k.position,l)))}q&&!f&&d.push.apply(d,q.color);f&&!q&&d.push.apply(d,f.color)}}function x(a,b,d){for(var c=null,e=0;e<a.length;e++){var l=d?b-a[e].position:b-a[e][1][0];0<=l&&(c?l<=(d?b-c.position:b-a[e][1][0])&&(c=a[e]):c=a[e])}return c}function C(a,b,d){for(var c=null,e=0;e<a.length;e++){var l=d?a[e].position-b:a[e][1][0]-b;0<=l&&(c?l<=(d?c.position-b:c[1][0]-b)&&(c= | |
a[e]):c=a[e])}return c}var H=m("__config"),I=m("__dds"),O=m("__extensions"),M=m("__print"),F=m("__time"),l=m("__util"),q=m("__renderer"),D=m("__obj_util"),r=m("__curve"),w=m("__vec3"),P=H.u,V=H.M,R=null,ca=null,Z=null;a.xg=0;a.B=0;a.RI=0;a.OI=0;a.QI=0;a.NI=0;a.Ii=10;a.mp=20;a.xm=30;a.ym=40;a.rk=50;a.kp=60;a.ip=70;a.lp=80;a.jp=90;a.uy=128;a.lH=128;a.Qy=128;var da={},ba={},J=null,pa;a.oe=function(b){pa=[b.NEAREST_MIPMAP_NEAREST,b.NEAREST_MIPMAP_LINEAR,b.LINEAR_MIPMAP_NEAREST,b.LINEAR_MIPMAP_LINEAR]; | |
a.xg=b.NEAREST;a.B=b.LINEAR;a.RI=b.NEAREST_MIPMAP_NEAREST;a.OI=b.LINEAR_MIPMAP_NEAREST;a.QI=b.NEAREST_MIPMAP_LINEAR;a.NI=b.LINEAR_MIPMAP_LINEAR;J=b};a.YW=function(a,b){return b in da&&a in da[b]?da[b][a].Yd:null};a.q0=function(a,b){return b in da&&a in da[b]?(e(da[b][a]),!0):!1};a.Wm=function(b,d){var c=h();c.name=b;c.type=d;c.source="NONE";if(d==a.kp||d==a.ip||d==a.lp||d==a.jp)c.we=J.createRenderbuffer();else{var e=J.TEXTURE_2D,l=J.createTexture();J.bindTexture(e,l);J.texParameteri(e,J.TEXTURE_MAG_FILTER, | |
J.LINEAR);J.texParameteri(e,J.TEXTURE_MIN_FILTER,J.LINEAR);J.texParameteri(e,J.TEXTURE_WRAP_S,J.CLAMP_TO_EDGE);J.texParameteri(e,J.TEXTURE_WRAP_T,J.CLAMP_TO_EDGE);J.bindTexture(e,null);c.Sb=e;c.Ya=l}return c};a.WK=function(b){var d=J.createTexture(),c=J.TEXTURE_CUBE_MAP;J.bindTexture(c,d);J.texParameteri(c,J.TEXTURE_MAG_FILTER,J.LINEAR);J.texParameteri(c,J.TEXTURE_MIN_FILTER,J.LINEAR);J.texParameteri(c,J.TEXTURE_WRAP_S,J.CLAMP_TO_EDGE);J.texParameteri(c,J.TEXTURE_WRAP_T,J.CLAMP_TO_EDGE);for(var e= | |
"TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z".split(" "),l=0;6>l;l++)J.texImage2D(J[e[l]],0,J.RGBA,b,b,0,J.RGBA,J.UNSIGNED_BYTE,null);J.bindTexture(c,null);c=h();c.name="CUBEMAP";c.type=a.Ii;c.source="NONE";c.width=3*b;c.height=2*b;c.eu=1;c.Ya=d;c.Sb=J.TEXTURE_CUBE_MAP;return c};a.Yw=function(a,b,d){if(!L(a)){var c=a.Sb;J.bindTexture(c,a.Ya);b&&J.texParameteri(c,J.TEXTURE_MIN_FILTER, | |
b);d&&J.texParameteri(c,J.TEXTURE_MAG_FILTER,d);J.bindTexture(c,null)}};a.hX=function(b){if(L(b))return{min:a.xg,PO:a.xg};var d=b.Sb;J.bindTexture(d,b.Ya);b=J.getTexParameter(d,J.TEXTURE_MIN_FILTER);var c=J.getTexParameter(d,J.TEXTURE_MAG_FILTER);J.bindTexture(d,null);return{min:b,PO:c}};a.resize=function(b,d,c){d=Math.max(d,P.jn?2:1);c=Math.max(c,P.jn?2:1);if(b.width!=d||b.height!=c){switch(b.type){case a.kp:J.bindRenderbuffer(J.RENDERBUFFER,b.we);J.renderbufferStorage(J.RENDERBUFFER,J.RGB565,d, | |
c);J.bindRenderbuffer(J.RENDERBUFFER,null);break;case a.ip:J.bindRenderbuffer(J.RENDERBUFFER,b.we);J.renderbufferStorage(J.RENDERBUFFER,J.DEPTH_COMPONENT16,d,c);J.bindRenderbuffer(J.RENDERBUFFER,null);break;case a.lp:J.bindRenderbuffer(J.RENDERBUFFER,b.we);J.renderbufferStorageMultisample(J.RENDERBUFFER,P.gd,J.RGBA8,d,c);J.bindRenderbuffer(J.RENDERBUFFER,null);break;case a.jp:J.bindRenderbuffer(J.RENDERBUFFER,b.we);J.renderbufferStorageMultisample(J.RENDERBUFFER,P.gd,J.DEPTH_COMPONENT24,d,c);J.bindRenderbuffer(J.RENDERBUFFER, | |
null);break;default:var e=b.Sb;J.bindTexture(e,b.Ya);var l=k(b),f=n(b),q=A(b);J.texImage2D(e,0,f,d,c,0,l,q,null);J.bindTexture(e,null)}d>P.Lb||c>P.Lb?M.error('Slink texture "'+b.name+'" has unsupported size: '+d+"x"+c+". Max available: "+P.Lb+"x"+P.Lb+"."):(b.width=d,b.height=c)}};a.uL=c;a.EG=u;a.DG=g;a.Ao=function(a,b,d,c,e){var g=a.source,r=a.Ya,k=a.Sb,h=1,n=1;J.bindTexture(k,r);if(4==b.length){var w=!0;b=new Uint8Array([255*b[0],255*b[1],255*b[2],255*b[3]])}if("IMAGE"==g)if(w)J.texImage2D(k,0, | |
J.RGBA,1,1,0,J.RGBA,J.UNSIGNED_BYTE,b),a.width=1,a.height=1;else if(d){n=I.zC(b);w=l.Mm(n.width)||l.Mm(n.height);if(n.width>P.Lb||n.height>P.Lb){M.error('Texture "'+c+'" has unsupported size: '+n.width+"x"+n.height+". Max available: "+P.Lb+"x"+P.Lb+".");return}h=n.width;n=n.height;w&&(a.eg=!0,p(k),h=v(h*a.nh),n=v(n*a.nh));I.wS(J,O.hC(),b,!0);a.eg&&(t(a,null,h,n,!0),J.bindTexture(k,r),J.generateMipmap(k));a.width=h;a.height=n;a.eu=I.iN(b)}else{J.pixelStorei(J.UNPACK_FLIP_Y_WEBGL,!0);a.Jn?P.oo?(h=b[0].width, | |
n=b[0].height):(h=b.videoWidth,n=b.videoHeight):(h=b.width,n=b.height);a.width=h;a.height=n;if(h>P.Lb||h>P.Lb)M.warn('Texture "'+c+'" has unsupported size: '+h+"x"+n+". Max available: "+P.Lb+"x"+P.Lb+". Reduced image size will be used."),a.nh=Math.min(P.Lb/h,P.Lb/n),a.eg=!0;a.Jn&&(P.oo?(e in ba||(ba[e]={}),ba[e][a.name]=a,a.Nc=b,a.Sw=b.length,a.Pg=a.Rw*a.vl/b.length,b=b[0]):(e in ba||(ba[e]={}),ba[e][a.name]=a,a.ua=b,a.ua.loop=a.ek,a.Pg=b.duration?a.vl/b.duration:F.pc(),V.ZA||(b.playbackRate=F.pc()/ | |
a.Pg,V.kA&&2<b.playbackRate&&(b.playbackRate=2)),f(a)));h=v(a.width*a.nh);n=v(a.height*a.nh);a.eg?(c=z(),r=c.getContext("2d"),c.width=h,c.height=n,r.drawImage(b,0,0,a.width,a.height,0,0,h,n),J.texImage2D(k,0,J.RGBA,J.RGBA,J.UNSIGNED_BYTE,c)):l.Mm(a.width)||l.Mm(a.height)?(t(a,b,h,n,!1),a.eg=!0):J.texImage2D(k,0,J.RGBA,J.RGBA,J.UNSIGNED_BYTE,b);r=a.Ya;J.bindTexture(k,r);a.Jn||J.generateMipmap(k);J.bindTexture(k,null);a.width=h;a.height=n}else if("ENVIRONMENT_MAP"==g)if(n=[["POSITIVE_X",2,0],["NEGATIVE_X", | |
0,0],["POSITIVE_Y",1,1],["NEGATIVE_Y",0,1],["POSITIVE_Z",1,0],["NEGATIVE_Z",2,1]],w){for(h=0;6>h;h++)J.texImage2D(J["TEXTURE_CUBE_MAP_"+n[h][0]],0,J.RGBA,1,1,0,J.RGBA,J.UNSIGNED_BYTE,b);a.width=3;a.height=2}else{J.pixelStorei(J.UNPACK_FLIP_Y_WEBGL,!1);if(b.width%3||b.height%2){M.error('Cubemap texture "'+c+'" has unsupported size: '+b.width+"x"+b.height+". The width must be multiple of three and the height - multiple of two.");return}h=b.width/3;if(h>P.$h)M.warn('Cubemap texture "'+c+'" has unsupported size: '+ | |
b.width+"x"+b.height+". Max available: "+3*P.$h+"x"+2*P.$h+". Reduced image size will be used."),c=v(P.$h/h*h),a.eg=!0;else if(c=v(h),3*c>P.Lb||2*c>P.Lb)a.eg=!0;if(a.eg||P.QE)for(r=c,w=0;6>w;w++)d=n[w],e=z(),e.width=r,e.height=r,g=e.getContext("2d"),"POSITIVE_Y"==d[0]||"NEGATIVE_Y"==d[0]?(g.translate(0,r),g.scale(1,-1)):(g.translate(r,0),g.scale(-1,1)),g.drawImage(b,d[1]*h,d[2]*h,h,h,0,0,r,r),J.texImage2D(J["TEXTURE_CUBE_MAP_"+d[0]],0,J.RGBA,J.RGBA,J.UNSIGNED_BYTE,e);else{n=b;b=c;p(J.TEXTURE_2D); | |
J.texImage2D(J.TEXTURE_2D,0,J.RGBA,J.RGBA,J.UNSIGNED_BYTE,n);J.bindTexture(J.TEXTURE_2D,null);for(n=0;6>n;n++)J.texImage2D(J.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,J.RGBA,b,b,0,J.RGBA,J.UNSIGNED_BYTE,null);J.bindTexture(a.Sb,null);J.bindFramebuffer(J.FRAMEBUFFER,Z);for(n=0;6>n;n++)q.UL(a,J.TEXTURE_CUBE_MAP_POSITIVE_X+n,b,h,ca,n);J.bindFramebuffer(J.FRAMEBUFFER,null);J.bindTexture(a.Sb,a.Ya);J.texParameteri(a.Sb,J.TEXTURE_MIN_FILTER,pa[P.im]);J.texParameteri(a.Sb,J.TEXTURE_MAG_FILTER,J.LINEAR)}a.width=3* | |
c;a.height=2*c;J.generateMipmap(k)}else if("DATA_TEX2D"==g||"NODE_TEX"==g)J.texImage2D(k,0,J.RGBA,b.width,b.height,0,J.RGBA,J.UNSIGNED_BYTE,b.data),a.width=b.width,a.height=b.height;J.bindTexture(k,null)};a.KL=function(a){J.deleteTexture(a)};a.ml=function(a){return a&&a.name&&(a.Ya||a.we)?!0:!1};a.jl=L;a.OY=function(b){return b.type==a.xm||b.type==a.ym?!0:!1};a.zN=function(b){var d=0;switch(b.type){case a.Ii:case a.mp:d=4;break;case a.xm:case a.ym:d=16;break;case a.rk:d=3;break;case a.kp:case a.ip:d= | |
2;break;case a.lp:d=4*P.gd;break;case a.jp:d=3*P.gd}return d};a.xB=function(a,b){var d=null;switch(a){case "SSAO_TEXTURE":d={name:"special_ssao_texture",type:"DATA_TEX2D",extension:"REPEAT",b4w_anisotropic_filtering:"OFF"};c(d,null,b,0);d.image={filepath:null};break;case "NODE_TEX":d={name:void 0,type:"NODE_TEX",extension:"CLIP",b4w_anisotropic_filtering:"OFF"},c(d,null,b,0),d.image={filepath:null}}return d};a.fa=function(){if(!P.oo)for(var a in ba)for(var b in ba[a])ba[a][b].ua.pause(),ba[a][b].ua.src= | |
"",ba[a][b].ua.load();da={};ba={}};a.pause=function(){for(var a in ba)for(var b in ba[a]){var d=ba[a][b];B(d)&&(G(b,a),d.Ps=!0)}};a.reset=function(){for(var a in ba)for(var b in ba[a])E(b,a),ba[a][b].Ps=!1};a.play=function(a){for(var b in ba)for(var d in ba[b]){var c=ba[b][d];if(!a||c.Ps)K(d,b),c.Ps=!1}};a.x0=function(a,b){return b in ba&&a in ba[b]?ba[b][a].Ls:!1};a.qE=K;a.ow=G;a.PE=E;a.tQ=function(a,b,d){d in ba&&a in ba[d]&&(a=ba[d][a],a.ua?a.ua.currentTime=b/a.Pg:a.Nc&&(a.Zj=b,g(a)))};a.TG=B; | |
a.UG=function(a){return a.ua||a.Nc?a.ua?2<=a.ua.readyState:!0:0};a.QG=function(a){return a.ua||a.Nc?a.ua?Math.round(a.ua.currentTime*a.Pg):a.Zj:0};a.SG=function(a){return a.ua||a.Nc?a.ua?a.pb:y(a,a.pb):0};a.US=function(a){if(!a.ua&&!a.Nc)return 0;var b=Math.min(a.Vk,a.vl-a.pb);return a.ua?a.pb+b:y(a,a.pb+b)};a.Rr=function(a,b){return Math.round(b*a.Rw*(F.pc()/a.Pg))};a.RG=function(a){return Math.min(a.Vk,a.vl-a.pb)};a.TS=y;a.ZW=function(a,b){var d=Q(a,b);return d&&"CANVAS"==d.source?d.Yd:null};a.r0= | |
function(a,b){var d=Q(a,b);return d&&"CANVAS"==d.source?(e(d),!0):!1};a.$Q=function(a){for(var b={},d=0;d<a.length;d++){for(var c=a[d].ba,l=[],f=0;f<c.length;f++){var q=c[f];if("CANVAS"==q.source)if(q.name in b)q=b[q.name];else{var g=c[f],q=h();q.name=g.name;q.source="CANVAS";q.width=g.width;q.height=g.height;q.mn=g.mn;q.type=g.type;g=document.createElement("canvas");g.width=q.width;g.height=q.height;q.Yd=g.getContext("2d");q.Sb=J.TEXTURE_2D;q.Ya=J.createTexture();J.bindTexture(J.TEXTURE_2D,q.Ya); | |
q.mn?J.texParameteri(J.TEXTURE_2D,J.TEXTURE_MIN_FILTER,pa[P.im]):J.texParameteri(J.TEXTURE_2D,J.TEXTURE_MIN_FILTER,J.LINEAR);J.texParameteri(J.TEXTURE_2D,J.TEXTURE_MAG_FILTER,J.LINEAR);J.bindTexture(J.TEXTURE_2D,null);g=q;g.Yd.drawImage(c[f].Yd.canvas,0,0);e(g);b[q.name]=q}l.push(q)}a[d].ba=l}};a.UK=function(a,b){for(var c=[],e=0;e<a.length;e++)d(a[e].data.value.color_ramp,b,c);return new Uint8Array(c.map(function(a){return l.J(255*a,0,255)}))};a.$J=d;a.wL=function(a,b){for(var d=new Float32Array(3), | |
c=new Float32Array(3),e=[],f=0;f<a.length;f++){for(var q=a[f].data.value,g=[],k=q.curve_mapping.curves_data,h=q.curve_mapping.curve_extend,n=q.curve_mapping.curves_handle_types,q=0;q<k.length;q++){for(var m=h[q],p=k[q],D=[],v=n[q],H=0;H<p.length;H++)D.push([new Float32Array(3),new Float32Array(p[H].concat(0)),new Float32Array(3)]);r.Qt(D[0],null,D[1],v[0],v[0]);for(H=1;H<D.length-1;H++)r.Qt(D[H],D[H-1],D[H+1],v[H],v[H]);r.Qt(D[D.length-1],D[D.length-2],null,v[D.length-1],v[D.length-1]);if(2<D.length){if("AUTO"== | |
v[0]){w.subtract(D[0][2],D[0][1],d);H=w.length(d);w.copy(D[1][0],c);c[0]<D[0][1][0]&&(c[0]=D[0][1][0]);w.subtract(c,D[0][1],c);var y=w.length(c);1E-8<y&&(w.scale(c,H/y,c),w.add(D[0][1],c,D[0][2]),w.subtract(D[0][1],c,D[0][0]))}p=D.length-1;"AUTO"==v[0]&&(w.subtract(D[p][0],D[p][1],d),H=w.length(d),w.copy(D[p-1][2],c),c[0]>D[p][1][0]&&(c[0]=D[p][1][0]),w.subtract(c,D[p][1],c),y=w.length(c),1E-8<y&&(w.scale(c,H/y,c),w.add(D[p][1],c,D[p][0]),w.subtract(D[p][1],c,D[p][2])))}for(p=0;p<D.length-1;p++)r.NK(D[p][1], | |
D[p][2],D[p+1][0],D[p+1][1]);p=[];3>=k.length?(H=Math.round(-b/2),v=Math.round(b/2)):(H=0,v=b);for(;H<v;H++){var y=H/(v-1),A=x(D,y,!1),I=C(D,y,!1);A&&I?p.push(r.PJ(y,A[1],A[2],I[0],I[1])):I&&!A?"EXTRAPOLATED"==m?p.push(r.xD(y,I[1],I[2])):p.push(I[1][1]):A&&!I&&("EXTRAPOLATED"==m?p.push(r.xD(y,A[0],A[1])):p.push(A[1][1]))}g.push(p)}e.push(g)}d=[];for(H=0;H<e.length;H++)for(g=e[H],q=0;q<g[0].length;q++)3>=g.length?(c=l.J(127.5*(g[0][q]+1),0,255),f=l.J(127.5*(g[1][q]+1),0,255),k=l.J(127.5*(g[2][q]+1), | |
0,255),p=255):(c=l.J(255*g[0][q],0,255),f=l.J(255*g[1][q],0,255),k=l.J(255*g[2][q],0,255),p=l.J(255*g[3][q],0,255)),d.push(c,f,k,p);return new Uint8Array(d)}};b4w.module.__dds=function(a,m){function h(a,c,e,f){var g=new Uint16Array(4),h=new Uint16Array(e*f),m=0,p=0,t=0,y=p=m=0,z=0,b=0,d=0,x=e/4;f/=4;for(var C=0;C<f;C++)for(var H=0;H<x;H++)t=c+4*(C*x+H),g[0]=a[t],g[1]=a[t+1],m=g[0]&31,p=g[0]&2016,y=g[0]&63488,z=g[1]&31,b=g[1]&2016,d=g[1]&63488,g[2]=5*m+3*z>>3|5*p+3*b>>3&2016|5*y+3*d>>3&63488,g[3]=5*z+3*m>>3|5*b+3*p>>3&2016|5*d+3*y>>3&63488,m=a[t+2],p=4*C*e+4*H,h[p]=g[m&3],h[p+1]=g[m>>2&3],h[p+2]=g[m>>4&3],h[p+3]=g[m>>6&3],p+=e,h[p]=g[m>>8&3],h[p+1]=g[m>> | |
10&3],h[p+2]=g[m>>12&3],h[p+3]=g[m>>14],m=a[t+3],p+=e,h[p]=g[m&3],h[p+1]=g[m>>2&3],h[p+2]=g[m>>4&3],h[p+3]=g[m>>6&3],p+=e,h[p]=g[m>>8&3],h[p+1]=g[m>>10&3],h[p+2]=g[m>>12&3],h[p+3]=g[m>>14];return h}function c(a,c,e,m){var u=new Int32Array(e,0,31),K,G,E,B,y,Q;if(542327876!=u[0])return z.error("Invalid magic number in DDS header"),0;if(!u[20]&4)return z.error("Unsupported format, must contain a FourCC code"),0;K=u[21];switch(K){case t:G=8;E=c?c.COMPRESSED_RGB_S3TC_DXT1_EXT:null;break;case p:G=16;E= | |
c?c.COMPRESSED_RGBA_S3TC_DXT3_EXT:null;break;case f:G=16;E=c?c.COMPRESSED_RGBA_S3TC_DXT5_EXT:null;break;default:return z.error("Unsupported FourCC code:",g(K)),null}Q=1;u[2]&131072&&!1!==m&&(Q=Math.max(1,u[7]));B=u[4];y=u[3];u=u[1]+4;if(c)for(K=0;K<Q;++K)m=Math.max(4,B)/4*Math.max(4,y)/4*G,c=new Uint8Array(e,u,m),a.compressedTexImage2D(a.TEXTURE_2D,K,E,B,y,0,c),u+=m,B=Math.max(.5*B,1),y=Math.max(.5*y,1);else if(K==t)Math.max(4,B),Math.max(4,y),c=new Uint16Array(e),e=h(c,u/2,B,y),a.texImage2D(a.TEXTURE_2D, | |
0,a.RGB,B,y,0,a.RGB,a.UNSIGNED_SHORT_5_6_5,e),m&&a.generateMipmap(a.TEXTURE_2D);else return z.error("No manual decoder for",g(K),"and no native support"),0;return Q}function e(a,e,f,g,h,m){var p=new XMLHttpRequest;p.open("GET",f,!0);p.responseType="arraybuffer";p.onload=function(){if(200==p.status){a.bindTexture(a.TEXTURE_2D,g);var f=c(a,e,p.response,h);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,1<f?a.LINEAR_MIPMAP_LINEAR:a.LINEAR)}m&& | |
m(g)};p.send(null);return g}function u(a){return a.charCodeAt(0)+(a.charCodeAt(1)<<8)+(a.charCodeAt(2)<<16)+(a.charCodeAt(3)<<24)}function g(a){return String.fromCharCode(a&255,a>>8&255,a>>16&255,a>>24&255)}var z=m("__print"),t=u("DXT1"),p=u("DXT3"),f=u("DXT5");a.lW=h;a.wS=c;a.zC=function(a){a=new Int32Array(a,0,31);return{width:a[4],height:a[3]}};a.iN=function(a){var c=1;a=(new Int32Array(a,0,31))[21];switch(a){case t:c=6;break;case p:case f:c=4;break;default:z.error("Unsupported FourCC code:",g(a))}return c}; | |
a.cZ=e;a.bZ=function(a,c,f,g){var h=a.createTexture();e(a,c,f,h,!0,g);return h}};b4w.module.__time=function(a,m){function h(){return-1!==c.Oi.nq?c.Oi.nq:f}var c=m("__config");m("__print");m("__util");var e=0,u=0,g=[],z=0,t=0,p=[],f=-1;a.wF=function(a){e=a;u=performance.now();for(a=0;a<g.length;a++){var c=g[a];e>c.Mu&&(g.splice(a,1),a--,c.callback())}for(a=0;a<p.length;a++){var c=p[a],f=1-(c.Mu-e)/c.duration,f=Math.min(f,1);c.callback(c.from+f*(c.to-c.from));1==f&&(p.splice(a,1),a--)}};a.qj=function(){return e};a.as=function(a,c){var f;z++;f=z;g.push({id:f,callback:a,Mu:e+(performance.now()- | |
u+c)/1E3});return f};a.Fk=function(a){for(var c=0;c<g.length;c++)if(g[c].id==a){g.splice(c,1);break}};a.Lh=function(a){for(var c=p.length;c--;)if(p[c].id==a){p.splice(c,1);break}};a.Of=function(a,c,f,g){f/=1E3;var h;t++;h=t;p.push({id:h,callback:g,from:a,to:c,Mu:e+f,duration:f});g(a);return h};a.reset=function(){u=e=0;g.length=0;t=z=p.length=0};a.pc=h;a.uQ=function(a){f=a};a.xn=function(a){return a*h()}};b4w.module.__renderer=function(a,m){function h(a){for(var c=a.j,f=a.A,k=0;k<f.length;k++){var h=f[k];if(h.Xb){var n=a,m=c,p=h.gg,l=h.I,h=l.uc;B.useProgram(h.Kl);for(var q=l.pa,D=l.Cp,r=h.rG,w=r.length;w--;){var y=r[w];y.Yu(B,y.Ej,n,p,l,m)}if(h.nr&&!h.cw){h.Vn.length||g(h);r=h.Vn;for(w=r.length;w--;)y=r[w],y.Yu(B,y.Ej,n,p,l,m);h.nr=!1}m=l.qA;B.colorMask(m,m,m,m);B.depthMask(l.Fa);l.Bb?B.enable(B.CULL_FACE):B.disable(B.CULL_FACE);m=l.ba;for(l=0;l<m.length;l++)w=m[l],B.activeTexture(B.TEXTURE0+l),B.bindTexture(w.Sb, | |
w.Ya);if("SKY"==n.type){m=n;h=h.dk;l=m.j.Vb.Ya;w=m.Zm;for(y=0;6>y;y++)if(r=u(y),b.$t?(B.bindTexture(B.TEXTURE_CUBE_MAP,l),B.texImage2D(r,0,B.RGBA,1,1,0,B.RGBA,B.UNSIGNED_BYTE,E)):(B.uniformMatrix4fv(h.u_cube_view_matrix,!1,w[y]),B.framebufferTexture2D(B.FRAMEBUFFER,B.COLOR_ATTACHMENT0,r,l,0),e(q,D,p.$x)),m.lr&&3!=y){var r=m,v=y,A=Q;b.$t?A.set(E):(B.readPixels(191,191,1,1,B.RGBA,B.UNSIGNED_BYTE,A),255!=A[0]&&255!=A[1]&&255!=A[2]||B.readPixels(191,220,1,1,B.RGBA,B.UNSIGNED_BYTE,A));var t=A[0],Z=A[1], | |
A=A[2],t=t/255,Z=Z/255,A=A/255;2===v?(r.Zd[3]=t,r.Zd[7]=Z,r.Zd[11]=A):2>v?(r.Zd[4*v]=t,r.Zd[4*v+1]=Z,r.Zd[4*v+2]=A):(r.Zd[4*(v-2)]=t,r.Zd[4*(v-2)+1]=Z,r.Zd[4*(v-2)+2]=A)}n.an+=6}else e(q,D,p.$x),n.an++}}}function c(a){if(a){var c=(a.Sa?B.COLOR_BUFFER_BIT:0)|(a.Va?B.DEPTH_BUFFER_BIT:0);if(!c)return;switch(a.type){case "MAIN_GLOW":a=G;break;case "SHADOW_CAST":a=A;break;case "SHADOW_RECEIVE":a=L;break;case "COLOR_PICKING":case "COLOR_PICKING_XRAY":case "ANCHOR_VISIBILITY":a=K;break;case "OUTLINE_MASK":case "SMAA_BLENDING_WEIGHT_CALCULATION":case "SMAA_EDGE_DETECTION":a= | |
G;break;default:a=b.background_color}}else c=B.COLOR_BUFFER_BIT|B.DEPTH_BUFFER_BIT,a=b.background_color;B.colorMask(!0,!0,!0,!0);B.depthMask(!0);B.clearColor(a[0],a[1],a[2],a[3]);B.clear(c)}function e(a,b,c){B.bindBuffer(B.ARRAY_BUFFER,a.Ai);for(var e=0;e<b.length;e++){var f=b[e];B.enableVertexAttribArray(f.Ej);B.vertexAttribPointer(f.Ej,f.gh,B.FLOAT,!1,0,f.MJ+f.GM*c)}a.Vg?(B.bindBuffer(B.ELEMENT_ARRAY_BUFFER,a.Vg),B.drawElements(a.mode,a.count,a.sv,0)):B.drawArrays(a.mode,0,a.count);for(e=0;e<b.length;e++)f= | |
b[e],B.disableVertexAttribArray(f.Ej)}function u(a){switch(a){case 0:return B.TEXTURE_CUBE_MAP_POSITIVE_X;case 1:return B.TEXTURE_CUBE_MAP_NEGATIVE_X;case 2:return B.TEXTURE_CUBE_MAP_POSITIVE_Y;case 3:return B.TEXTURE_CUBE_MAP_NEGATIVE_Y;case 4:return B.TEXTURE_CUBE_MAP_POSITIVE_Z;case 5:return B.TEXTURE_CUBE_MAP_NEGATIVE_Z}}function g(a){var b=a.dk,c=[],e=[],f={},g;for(g in b){var h=!1;switch(g){case "u_proj_matrix":var n=function(a,b,d,c,e,f){a.uniformMatrix4fv(b,!1,f.Ab)},h=!0;break;case "u_view_matrix":n= | |
function(a,b,d,c,e,f){a.uniformMatrix4fv(b,!1,f.jb)};h=!0;break;case "u_view_tsr":case "u_view_tsr_frag":n=function(a,b,d,c,e,f){f.tc?a.uniformMatrix3fv(b,!1,f.IE):a.uniformMatrix3fv(b,!1,f.Hf)};h=!0;break;case "u_shadow_cast_billboard_view_tsr":n=function(a,b,d,c,e,f){a.uniformMatrix3fv(b,!1,f.nx)};h=!0;break;case "u_view_proj_prev":n=function(a,b,d,c,e,f){a.uniformMatrix4fv(b,!1,f.IP)};h=!0;break;case "u_view_proj_matrix":n=function(a,b,d,c,e,f){a.uniformMatrix4fv(b,!1,f.Gf)};h=!0;break;case "u_view_proj_inverse":n= | |
function(a,b,d,c,e,f){a.uniformMatrix4fv(b,!1,f.VG)};h=!0;break;case "u_sky_vp_inverse":n=function(a,b,d,c,e,f){a.uniformMatrix4fv(b,!1,f.og)};h=!0;break;case "u_camera_eye":case "u_camera_eye_frag":n=function(a,b,d,c,e,f){a.uniform3fv(b,k.rj(f.i,y))};h=!0;break;case "u_camera_quat":n=function(a,b,d,c,e,f){a.uniform4fv(b,k.v(f.i))};h=!0;break;case "u_view_max_depth":n=function(a,b,d,c,e,f){a.uniform1f(b,f.far)};h=!0;break;case "u_camera_range":n=function(a,b,d,c,e,f){a.uniform2f(b,f.near,f.far)}; | |
break;case "u_csm_center_dists":n=function(a,b,d,c,e,f){a.uniform4fv(b,f.LA)};break;case "u_cam_water_depth":n=function(a,b,d){a.uniform1f(b,d.St)};h=!0;break;case "u_waves_height":n=function(a,b,d){a.uniform1f(b,d.ey)};break;case "u_waves_length":n=function(a,b,d){a.uniform1f(b,d.fy)};break;case "u_fog_color_density":n=function(a,b,d){a.uniform4fv(b,d.dd)};break;case "u_fog_params":n=function(a,b,d){a.uniform4fv(b,d.Je)};break;case "u_underwater_fog_color_density":n=function(a,b,d){a.uniform4fv(b, | |
d.If)};break;case "u_bloom_key":n=function(a,b,d){a.uniform1f(b,d.bloom_key)};break;case "u_bloom_edge_lum":n=function(a,b,d){a.uniform1f(b,d.bloom_edge_lum)};break;case "u_time":n=function(a,b,d){a.uniform1f(b,d.time)};h=!0;break;case "u_wind":n=function(a,b,d){a.uniform3fv(b,d.xh)};h=!0;break;case "u_sky_tex_dvar":n=function(a,b,d){a.uniform1f(b,d.GF)};break;case "u_sky_tex_fac":n=function(a,b,d){a.uniform4fv(b,d.HF)};break;case "u_sky_tex_color":n=function(a,b,d){a.uniform3fv(b,d.FF)};break;case "u_horizon_color":n= | |
function(a,b,d){a.uniform3fv(b,d.Qe)};break;case "u_zenith_color":n=function(a,b,d){a.uniform3fv(b,d.af)};break;case "u_environment_energy":n=function(a,b,d){a.uniform1f(b,d.Lg)};break;case "u_sky_color":n=function(a,b,d){a.uniform3fv(b,d.Sl)};break;case "u_rayleigh_brightness":n=function(a,b,d){a.uniform1f(b,d.rayleigh_brightness)};break;case "u_mie_brightness":n=function(a,b,d){a.uniform1f(b,d.mie_brightness)};break;case "u_spot_brightness":n=function(a,b,d){a.uniform1f(b,d.spot_brightness)};break; | |
case "u_scatter_strength":n=function(a,b,d){a.uniform1f(b,d.scatter_strength)};break;case "u_rayleigh_strength":n=function(a,b,d){a.uniform1f(b,d.rayleigh_strength)};break;case "u_mie_strength":n=function(a,b,d){a.uniform1f(b,d.mie_strength)};break;case "u_rayleigh_collection_power":n=function(a,b,d){a.uniform1f(b,d.rayleigh_collection_power)};break;case "u_mie_collection_power":n=function(a,b,d){a.uniform1f(b,d.mie_collection_power)};break;case "u_mie_distribution":n=function(a,b,d){a.uniform1f(b, | |
d.mie_distribution)};break;case "u_light_positions":n=function(a,b,d){a.uniform3fv(b,d.cr)};break;case "u_light_directions":n=function(a,b,d){a.uniform3fv(b,d.Kv)};break;case "u_light_color_intensities":n=function(a,b,d){a.uniform3fv(b,d.br)};break;case "u_light_factors":n=function(a,b,d){a.uniform4fv(b,d.Lv)};break;case "u_sun_quaternion":n=function(a,b,d){a.uniform4fv(b,d.ZF)};break;case "u_sun_intensity":n=function(a,b,d){a.uniform3fv(b,d.YF)};break;case "u_sun_direction":n=function(a,b,d){a.uniform3fv(b, | |
d.Ex)};break;case "u_height":n=function(a,b,d,c,e,f){a.uniform1f(b,f.height)};h=!0;break;case "u_model_tsr":n=function(a,b,d,c){a.uniformMatrix3fv(b,!1,c.i)};h=!0;break;case "u_transb":n=function(a,b,d,c){a.uniform4fv(b,c.Od)};h=!0;break;case "u_transa":n=function(a,b,d,c){a.uniform4fv(b,c.ue)};h=!0;break;case "u_arm_rel_trans":n=function(a,b,d,c){a.uniform4fv(b,c.yt)};h=!0;break;case "u_arm_rel_quat":n=function(a,b,d,c){a.uniform4fv(b,c.xt)};h=!0;break;case "u_quat":n=function(a,b,d,c){d=k.v(c.i); | |
a.uniform4fv(b,d)};h=!0;break;case "u_quatsb":n=function(a,b,d,c){a.uniform4fv(b,c.Ed)};h=!0;break;case "u_quatsa":n=function(a,b,d,c){a.uniform4fv(b,c.ke)};h=!0;break;case "u_frame_factor":n=function(a,b,d,c){a.uniform1f(b,c.Ke)};h=!0;break;case "au_center_pos":n=function(){};h=!0;break;case "au_wind_bending_amp":n=function(a,b,d,c){a.uniform1f(b,c.ug)};h=!0;break;case "au_wind_bending_freq":n=function(a,b,d,c){a.uniform1f(b,c.yh)};h=!0;break;case "au_detail_bending_freq":n=function(a,b,d,c){a.uniform1f(b, | |
c.Jg)};h=!0;break;case "au_detail_bending_amp":n=function(a,b,d,c){a.uniform1f(b,c.Ig)};h=!0;break;case "au_branch_bending_amp":n=function(a,b,d,c){a.uniform1f(b,c.Dg)};h=!0;break;case "u_node_values":n=function(a,b,d,c,e){a.uniform1fv(b,e.Kj)};h=!0;break;case "u_node_rgbs":n=function(a,b,d,c,e){a.uniform3fv(b,e.he)};h=!0;break;case "u_diffuse_color":n=function(a,b,d,c,e){a.uniform4fv(b,e.jf)};h=!0;break;case "u_diffuse_intensity":n=function(a,b,d,c,e){a.uniform1f(b,e.dn)};h=!0;break;case "u_diffuse_params":n= | |
function(a,b,d,c,e){a.uniform2fv(b,e.ae)};h=!0;break;case "u_emit":n=function(a,b,d,c,e){a.uniform1f(b,e.Pk)};h=!0;break;case "u_ambient":n=function(a,b,d,c,e){a.uniform1f(b,e.vk)};h=!0;break;case "u_specular_color":n=function(a,b,d,c,e){a.uniform3fv(b,e.uo)};h=!0;break;case "u_specular_alpha":n=function(a,b,d,c,e){a.uniform1f(b,e.wx)};h=!0;break;case "u_specular_params":n=function(a,b,d,c,e){a.uniform3fv(b,e.Ul)};h=!0;break;case "u_reflect_factor":n=function(a,b,d,c,e){a.uniform1f(b,e.Jr)};h=!0; | |
break;case "u_mirror_factor":n=function(a,b,d,c,e){a.uniform1f(b,e.Vv)};h=!0;break;case "u_grass_map_dim":n=function(a,b,d,c,e){a.uniform3fv(b,e.td)};h=!0;break;case "u_grass_size":n=function(a,b,d,c,e){a.uniform1f(b,e.lv)};h=!0;break;case "u_scale_threshold":n=function(a,b,d,c,e){a.uniform1f(b,e.BC)};h=!0;break;case "u_cube_fog":n=function(a,b,d,c,e){a.uniformMatrix4fv(b,!1,e.Zd)};break;case "u_jitter_amp":n=function(a,b,d,c,e){a.uniform1f(b,e.lD)};h=!0;break;case "u_jitter_freq":n=function(a,b, | |
d,c,e){a.uniform1f(b,e.mD)};h=!0;break;case "u_wireframe_mode":n=function(a,b,d,c,e){a.uniform1i(b,e.wireframe_mode)};break;case "u_wireframe_edge_color":n=function(a,b,d,c,e){a.uniform3fv(b,e.wireframe_edge_color)};break;case "u_subpixel_jitter":n=function(a,b,d){a.uniform2fv(b,d.lO)};h=!0;break;case "u_subsample_indices":n=function(a,b,d){a.uniform4fv(b,d.mO)};h=!0;break;case "u_refr_bump":n=function(a,b,d,c,e){a.uniform1f(b,e.LE)};h=!0;break;case "u_line_width":n=function(a,b,d,c,e){a.uniform1f(b, | |
e.wD)};h=!0;break;case "u_lamp_light_positions":n=function(a,b,d,c,e){a.uniform3fv(b,e.Gv)};break;case "u_lamp_light_directions":n=function(a,b,d,c,e){a.uniform3fv(b,e.Ev)};break;case "u_lamp_light_color_intensities":n=function(a,b,d,c,e){a.uniform3fv(b,e.Dv)};break;case "u_lamp_light_factors":n=function(a,b,d,c,e){a.uniform4fv(b,e.Fv)};break;case "u_halo_size":n=function(a,b,d,c,e){a.uniform1f(b,e.IC)};h=!0;break;case "u_halo_hardness":n=function(a,b,d,c,e){a.uniform1f(b,e.FC)};h=!0;break;case "u_halo_rings_color":n= | |
function(a,b,d,c,e){a.uniform3fv(b,e.HC)};h=!0;break;case "u_halo_lines_color":n=function(a,b,d,c,e){a.uniform3fv(b,e.GC)};h=!0;break;case "u_halo_stars_blend":n=function(a,b,d,c,e){a.uniform1f(b,e.JC)};h=!0;break;case "u_halo_stars_height":n=function(a,b,d,c,e){a.uniform1f(b,e.KC)};h=!0;break;case "u_fresnel_params":n=function(a,b,d,c,e){a.uniform4fv(b,e.nj)};h=!0;break;case "u_texture_scale":n=function(a,b,d,c,e){a.uniform3fv(b,e.ti)};h=!0;break;case "u_parallax_scale":n=function(a,b,d,c,e){a.uniform1f(b, | |
e.ur)};h=!0;break;case "u_color_id":n=function(a,b,d,c){a.uniform3fv(b,c.Pp)};h=!0;break;case "u_line_points":n=function(a,b,d,c,e){a.uniform3fv(b,e.$Y)};h=!0;break;case "u_diffuse_color_factor":n=function(a,b,d,c,e){a.uniform1f(b,e.cn)};h=!0;break;case "u_alpha_factor":n=function(a,b,d,c,e){a.uniform1f(b,e.Am)};h=!0;break;case "u_specular_color_factor":n=function(a,b,d,c,e){a.uniform1f(b,e.ps)};h=!0;break;case "u_normal_factor":n=function(a,b,d,c,e){a.uniform1f(b,e.XD)};h=!0;break;case "u_normalmap0_scale":n= | |
function(a,b,d,c,e){a.uniform2fv(b,e.Lj[0])};h=!0;break;case "u_normalmap1_scale":n=function(a,b,d,c,e){a.uniform2fv(b,e.Lj[1])};h=!0;break;case "u_normalmap2_scale":n=function(a,b,d,c,e){a.uniform2fv(b,e.Lj[2])};h=!0;break;case "u_normalmap3_scale":n=function(a,b,d,c,e){a.uniform2fv(b,e.Lj[3])};h=!0;break;case "u_foam_factor":n=function(a,b,d,c,e){a.uniform1f(b,e.mq)};h=!0;break;case "u_foam_uv_freq":n=function(a,b,d,c,e){a.uniform2fv(b,e.mB)};h=!0;break;case "u_foam_mag":n=function(a,b,d,c,e){a.uniform2fv(b, | |
e.lB)};h=!0;break;case "u_foam_scale":n=function(a,b,d,c,e){a.uniform2fv(b,e.Su)};h=!0;break;case "u_water_norm_uv_velocity":n=function(a,b,d,c,e){a.uniform1f(b,e.Rs)};h=!0;break;case "u_shallow_water_col":n=function(a,b,d,c,e){a.uniform3fv(b,e.es)};h=!0;break;case "u_shore_water_col":n=function(a,b,d,c,e){a.uniform3fv(b,e.js)};h=!0;break;case "u_water_shallow_col_fac":n=function(a,b,d,c,e){a.uniform1f(b,e.fs)};h=!0;break;case "u_water_shore_col_fac":n=function(a,b,d,c,e){a.uniform1f(b,e.ks)};h=!0; | |
break;case "u_p_length":n=function(a,b,d,c,e){a.uniform1f(b,e.La.gG)};h=!0;break;case "u_p_cyclic":n=function(a,b,d,c,e){a.uniform1i(b,e.La.Kc)};h=!0;break;case "u_p_max_lifetime":n=function(a,b,d,c,e){a.uniform1f(b,e.La.vD)};h=!0;break;case "u_p_fade_in":n=function(a,b,d,c,e){a.uniform1f(b,e.La.kj)};h=!0;break;case "u_p_fade_out":n=function(a,b,d,c,e){a.uniform1f(b,e.La.ce)};h=!0;break;case "u_p_size":n=function(a,b,d,c,e){a.uniform1f(b,e.La.size)};h=!0;break;case "u_p_alpha_start":n=function(a, | |
b,d,c,e){a.uniform1f(b,e.La.wz)};h=!0;break;case "u_p_alpha_end":n=function(a,b,d,c,e){a.uniform1f(b,e.La.vz)};h=!0;break;case "u_p_nfactor":n=function(a,b,d,c,e){a.uniform1f(b,e.La.bw)};h=!0;break;case "u_p_gravity":n=function(a,b,d,c,e){a.uniform1f(b,e.La.CC)};h=!0;break;case "u_p_mass":n=function(a,b,d,c,e){a.uniform1f(b,e.La.cg)};h=!0;break;case "u_p_color_ramp":n=function(a,b,d,c,e){a.uniform4fv(b,e.La.rA)};h=!0;break;case "u_p_wind_fac":n=function(a,b,d,c,e){a.uniform1f(b,e.La.aH)};h=!0;break; | |
case "u_texel_size":n=function(a,b,d){a.uniform2fv(b,d.Nx)};h=!0;break;case "u_p_time":n=function(a,b,d,c,e){a.uniform1f(b,e.La.time)};h=!0;break;case "u_position":n=function(a,b,d,c,e){a.uniform3fv(b,e.Hl)};h=!0;break;case "u_va_frame_factor":n=function(a,b,d,c){a.uniform1f(b,c.JG)};h=!0;break;case "u_normal_offset":n=function(a,b,d){a.uniform1f(b,d.self_shadow_normal_offset)};break;case "u_pcf_blur_radii":n=function(a,b,d,c,e,f){a.uniform4fv(b,f.zr)};break;case "u_v_light_ts":n=function(a,b,d){a.uniform4fv(b, | |
d.Os)};h=!0;break;case "u_v_light_r":n=function(a,b,d){a.uniform4fv(b,d.Ns)};h=!0;break;case "u_v_light_tsr":n=function(a,b,d){a.uniformMatrix3fv(b,!1,d.Zx)};h=!0;break;case "u_p_light_matrix0":n=function(a,b,d){a.uniformMatrix4fv(b,!1,d.Qj[0])};h=!0;break;case "u_p_light_matrix1":n=function(a,b,d){a.uniformMatrix4fv(b,!1,d.Qj[1])};h=!0;break;case "u_p_light_matrix2":n=function(a,b,d){a.uniformMatrix4fv(b,!1,d.Qj[2])};h=!0;break;case "u_p_light_matrix3":n=function(a,b,d){a.uniformMatrix4fv(b,!1,d.Qj[3])}; | |
h=!0;break;case "u_motion_blur_exp":n=function(a,b,d){a.uniform1f(b,d.LD)};h=!0;break;case "u_motion_blur_decay_threshold":n=function(a,b,d){a.uniform1f(b,d.mb_decay_threshold)};h=!0;break;case "u_refl_plane":n=function(a,b,d,c){a.uniform4fv(b,c.tc)};h=!0;break;case "u_radial_blur_step":n=function(a,b,d){a.uniform1f(b,d.Ir)};break;case "u_god_rays_intensity":n=function(a,b,d){a.uniform1f(b,d.god_rays_intensity)};break;case "u_ssao_radius_increase":n=function(a,b,d){a.uniform1f(b,d.Zl)};break;case "u_ssao_blur_discard_value":n= | |
function(a,b,d){a.uniform1f(b,d.ssao_blur_discard_value)};h=!0;break;case "u_ssao_influence":n=function(a,b,d){a.uniform1f(b,d.Yl)};break;case "u_ssao_dist_factor":n=function(a,b,d){a.uniform1f(b,d.Xl)};break;case "u_dof_dist":n=function(a,b,d,c,e,f){f.dof_on?a.uniform1f(b,f.dof_distance):a.uniform1f(b,0)};h=!0;break;case "u_dof_front":n=function(a,b,d,c,e,f){a.uniform1f(b,f.dof_front)};h=!0;break;case "u_dof_rear":n=function(a,b,d,c,e,f){a.uniform1f(b,f.dof_rear)};h=!0;break;case "u_outline_intensity":n= | |
function(a,b,d,c){a.uniform1f(b,c.ih)};h=!0;break;case "u_outline_color":n=function(a,b,d){a.uniform3fv(b,d.hh)};break;case "u_draw_outline":n=function(a,b,d){a.uniform1f(b,d.Ju)};h=!0;break;case "u_glow_mask_small_coeff":n=function(a,b,d){a.uniform1f(b,d.small_glow_mask_coeff)};h=!0;break;case "u_glow_mask_large_coeff":n=function(a,b,d){a.uniform1f(b,d.large_glow_mask_coeff)};h=!0;break;case "u_brightness":n=function(a,b,d){a.uniform1f(b,d.brightness)};break;case "u_contrast":n=function(a,b,d){a.uniform1f(b, | |
d.contrast)};break;case "u_exposure":n=function(a,b,d){a.uniform1f(b,d.exposure)};break;case "u_saturation":n=function(a,b,d){a.uniform1f(b,d.saturation)};break;case "u_enable_hmd_stereo":n=function(a,b,d){a.uniform1i(b,d.enable_hmd_stereo)};break;case "u_distortion_params":n=function(a,b,d){a.uniform4fv(b,d.fj)};break;case "u_chromatic_aberration_coefs":n=function(a,b,d){a.uniform4fv(b,d.chromatic_aberration_coefs)};break;default:n=null}n&&(n={name:g,Yu:n,Ej:b[g]},h?c.push(n):(e.push(n),f[g]=n))}a.rG= | |
c;e.length?(a.Vn=e,a.pw=f):a.cw=!0}var z=m("__batch"),t=m("__camera"),p=m("__config"),f=m("__debug"),v=m("__textures"),k=m("__tsr"),n=m("__util"),A=[1,1,1,1],L=[1,1,1,1],K=[0,0,0,1],G=[0,0,0,0],E=new Uint8Array([91.8,142.8,.96*255,255]);new Float32Array([.25,-.25]);new Float32Array([-.25,.25]);new Float32Array([1,1,1,0]);new Float32Array([2,2,2,0]);var B=null,y=new Float32Array(3),Q=new Uint8Array(4);new Float32Array(9);new Float32Array(8);var b=p.u;a.oe=function(a){var c=b.background_color;a.clearColor(c[0], | |
c[1],c[2],c[3]);a.clearDepth(1);a.enable(a.DEPTH_TEST);a.depthFunc(a.LEQUAL);a.enable(a.CULL_FACE);a.frontFace(a.CCW);a.cullFace(a.BACK);a.enable(a.BLEND);a.blendFunc(a.ONE,a.ONE_MINUS_SRC_ALPHA);B=a};a.Ok=function(a){if(a.Xb)if("RESOLVE"==a.type){f.Hw(a);var e=a.j;B.bindFramebuffer(B.READ_FRAMEBUFFER,e.Wu);B.bindFramebuffer(B.DRAW_FRAMEBUFFER,e.Le);B.blitFramebuffer(0,0,e.width,e.height,0,0,e.width,e.height,B.COLOR_BUFFER_BIT|B.DEPTH_BUFFER_BIT,B.NEAREST);f.Iw(a);f.Vt("draw resolve")}else if("COPY"== | |
a.type)f.Hw(a),e=a.j,B.bindFramebuffer(B.FRAMEBUFFER,e.Wu),B.bindTexture(B.TEXTURE_2D,e.Vb.Ya),B.copyTexSubImage2D(B.TEXTURE_2D,0,0,0,0,0,e.width,e.height,0),f.Iw(a),f.Vt("draw copy");else{f.Hw(a);e=a.j;B.bindFramebuffer(B.FRAMEBUFFER,e.Le);if(a.zt){var g=e.Vb;B.framebufferTexture2D(B.FRAMEBUFFER,B.COLOR_ATTACHMENT0,g.Sb,g.Ya,0)}B.viewport(0,0,e.width,e.height);"MAIN_CUBE_REFLECT"!=a.type&&c(a);a.Ua?B.enable(B.BLEND):B.disable(B.BLEND);a.Vc?B.enable(B.DEPTH_TEST):B.disable(B.DEPTH_TEST);switch(a.type){case "SHADOW_CAST":B.enable(B.POLYGON_OFFSET_FILL); | |
B.polygonOffset(a.self_shadow_polygon_offset,a.self_shadow_polygon_offset);B.cullFace(B.BACK);break;case "MAIN_PLANE_REFLECT":B.disable(B.POLYGON_OFFSET_FILL);B.cullFace(B.FRONT);break;case "MAIN_GLOW":if(1<b.gd){B.enable(B.POLYGON_OFFSET_FILL);B.polygonOffset(-2,-2);break}default:B.disable(B.POLYGON_OFFSET_FILL),B.cullFace(B.BACK)}if("MAIN_CUBE_REFLECT"==a.type)for(var e=a.j,g=e.Vb.Ya,n=0;6>n;n++){var m=u(n);e.jb=a.Zm[n];k.lf(e.jb,e.Hf);t.Pt(e);B.framebufferTexture2D(B.FRAMEBUFFER,B.COLOR_ATTACHMENT0, | |
m,g,0);c(a);for(var m=a.A,p=0;p<m.length;p++)m[p].Xb=m[p].Iu[n];h(a)}else h(a);f.Iw(a);f.Vt("draw subscene: "+a.type);B.bindFramebuffer(B.FRAMEBUFFER,null)}};a.clear=function(a){B.bindFramebuffer(B.FRAMEBUFFER,a.j.Le);c(a)};a.FJ=function(a){var b=a.Cp;b.length=0;var c=a.pa;a=a.uc;c&&a||n.ha("Incomplete batch");c=c.jd;a=a.attributes;for(var e in a){var f=c[e];b.push({Ej:a[e],MJ:4*f.offset,GM:1<f.frames?4*f.length:0,gh:f.gh})}};a.JJ=g;a.Hz=function(a){var b=a.uc,c=a.ba;a=a.Pc;B.useProgram(b.Kl);for(var e= | |
0;e<c.length;e++)B.uniform1i(b.dk[a[e]],e)};a.Cw=function(a,b,c,e,f,g){e||(e=1);f||(f=1);g||(g=new Uint8Array(4*e*f));g.length!=4*e*f&&n.ha("read_pixels(): Wrong storage");B.bindFramebuffer(B.FRAMEBUFFER,a);B.readPixels(b,c,e,f,B.RGBA,B.UNSIGNED_BYTE,g);B.bindFramebuffer(B.FRAMEBUFFER,null);return g};a.VR=function(a){var b=a.uc;b.cw||(B.useProgram(b.Kl),b.Vn.length||g(b),b=b.pw.u_cube_fog,b.Yu(B,b.Ej,null,null,a,null))};a.UP=function(a,b){var c=B.createFramebuffer();B.bindFramebuffer(B.FRAMEBUFFER, | |
c);if(v.jl(a)){var e=a.we;B.framebufferRenderbuffer(B.FRAMEBUFFER,B.COLOR_ATTACHMENT0,B.RENDERBUFFER,e)}else if(v.ml(a)){var g=a,e=g.Ya,g=g.Sb==B.TEXTURE_CUBE_MAP?B.TEXTURE_CUBE_MAP_NEGATIVE_Z:g.Sb;B.framebufferTexture2D(B.FRAMEBUFFER,B.COLOR_ATTACHMENT0,g,e,0)}v.jl(b)?(e=b.we,B.framebufferRenderbuffer(B.FRAMEBUFFER,B.DEPTH_ATTACHMENT,B.RENDERBUFFER,e)):v.ml(b)&&(g=b,e=g.Ya,g=g.Sb,B.framebufferTexture2D(B.FRAMEBUFFER,B.DEPTH_ATTACHMENT,g,e,0));f.rK();B.bindFramebuffer(B.FRAMEBUFFER,null);return c}; | |
a.TP=function(a,b,c,e,f){null==a?(B.bindFramebuffer(B.FRAMEBUFFER,a),B.viewport(0,0,e,f),B.clear(B.COLOR_BUFFER_BIT|B.DEPTH_BUFFER_BIT)):(v.jl(b)?B.deleteRenderbuffer(b.we):v.ml(b)&&B.deleteTexture(b.Ya),v.jl(c)?B.deleteRenderbuffer(c.we):v.ml(c)&&B.deleteTexture(c.Ya),B.deleteFramebuffer(a))};a.FY=function(){};a.UL=function(a,b,c,f,g,h){a=a.Ya;B.viewport(0,0,c,c);B.framebufferTexture2D(B.FRAMEBUFFER,B.COLOR_ATTACHMENT0,b,a,0);b=z.pu("FLIP_CUBEMAP_COORDS");a=b.uc;B.activeTexture(B.TEXTURE0);B.bindTexture(B.TEXTURE_2D, | |
g);var k=g=0;c!=f&&(g=1/(6*f),k=1/(4*f));B.uniform1i(a.dk.u_tex_number,h);B.uniform2fv(a.dk.u_delta,[g,k]);B.useProgram(a.Kl);e(b.pa,b.Cp,0);B.bindTexture(B.TEXTURE_2D,null)};a.VL=function(a,b,c,f,g){B.bindFramebuffer(B.FRAMEBUFFER,f);f=a.Ya;a=a.Sb;B.bindTexture(a,f);B.viewport(0,0,b,c);B.texImage2D(a,0,B.RGBA,b,c,0,B.RGBA,B.UNSIGNED_BYTE,null);B.framebufferTexture2D(B.FRAMEBUFFER,B.COLOR_ATTACHMENT0,a,f,0);b=z.pu("NONE");c=b.uc;B.bindTexture(a,null);B.activeTexture(B.TEXTURE0);B.bindTexture(a,g); | |
B.useProgram(c.Kl);e(b.pa,b.Cp,0);B.bindFramebuffer(B.FRAMEBUFFER,null);B.bindTexture(a,null)};a.fa=function(){}};b4w.module.__curve=function(a,m){function h(a,c,e,g,h){var m=g.length;h||(h=new Float32Array(m));for(var t=m+a,z=new Float32Array(t),u=1;u<=t-1;u++)z[u-1]=c>=e[u-1]&&c<e[u+1-1]?1:0;for(var E=2;E<=a;E++)for(u=1;u<=t-E;u++)z[u-1]=(0!=z[u-1]?(c-e[u-1])*z[u-1]/(e[u+E-1-1]-e[u-1]):0)+(0!=z[u+1-1]?(e[u+E-1]-c)*z[u+1-1]/(e[u+E-1]-e[u+1-1]):0);c==e[t-1]&&(z[m-1]=1);a=0;for(u=1;u<=m;u++)a+=z[u-1]*g[u-1];for(u=1;u<=m;u++)h[u-1]=0!=a?z[u-1]*g[u-1]/a:0;return h}function c(a){a=a.Zq;return a[a.length-1]}function e(a){a= | |
a.NA;return a[a.length-1]}function u(a,c,e,h,n,m,t,z){var G=a+(c-a)/2,E=g(G,h,n,m,t)-e;z=z?z:.01;return Math.abs(E)<z?G:0<E?u(a,G,e,h,n,m,t,z):u(G,c,e,h,n,m,t,z)}function g(a,c,e,g,h){var m=1-a;return c*m*m*m+3*e*m*m*a+3*g*m*a*a+h*a*a*a}m("__print");var z=m("__util"),t=m("__vec3");a.qL=function(a){var c={},e=a.data;a=e.splines[0];if(!a||"NURBS"!=a.type||!a.use_endpoint_u)return null;var g=a.order_u;c.bi=g;a=a.points;var n=a.length/5,m=[],t=n+g,n=n+2;m[0]=0;for(var u=2;u<=t;u++)m[u-1]=u>g&&u<n?m[u- | |
2]+1:m[u-2];c.Zq=m;if("2D"==e.dimensions)c.Xh=!1;else if("3D"==e.dimensions)c.Xh=!0;else throw"Wrong curve dimensions";g=[];m=[];for(e=0;e<a.length;e+=5)g.push(a[e]),g.push(a[e+1]),g.push(a[e+2]),c.Xh&&g.push(a[e+3]),m.push(a[e+4]);c.iu=g;c.hy=m;a=[];for(var e=c.iu,g=c.Xh?4:3,m=c.hy,t=c.Zq,n=c.bi,u=e.length/g,z=u+n,E=0,B=t[z-1]/999,y=0;1E3>y;y++){5E-6>t[z-1]-E&&(E=t[z-1]);for(var Q=h(n,E,t,m),b=0;b<g;b++)for(var d=a[g*y+b]=0;d<u;d++)a[g*y+b]+=Q[d]*e[g*d+b];E+=B}g=c.Xh?4:3;m=new Float32Array(1E3); | |
m[0]=0;for(e=1;1E3>e;e+=1)t=a[(e-1)*g],n=a[(e-1)*g+1],u=a[(e-1)*g+2],z=a[e*g],E=a[e*g+1],B=a[e*g+2],m[e]=m[e-1]+Math.sqrt((z-t)*(z-t)+(E-n)*(E-n)+(B-u)*(B-u));c.NA=m;return c};a.nR=function(a,e,g){g||(g=[]);var k=e,n=Math.max(k,0);e=n=Math.min(k,c(a));var k=a.iu,n=a.Xh?4:3,m=a.hy,t=a.Zq,u=a.bi;a=k.length/n;var z=a+u;5E-6>t[z-1]-e&&(e=t[z-1]);z=new Float32Array(a);h(u,e,t,m,z);for(e=0;e<n;e++)for(m=g[e]=0;m<a;m++)g[e]+=z[m]*k[n*m+e]};a.kR=function(a,c,e){e||(e=[]);var g=a.iu,h=a.Xh?4:3,m=a.hy,t=a.Zq, | |
u=a.bi;a=g.length/h;var z=a+u;5E-6>t[z-1]-c&&(c=t[z-1]);var z=new Float32Array(a),E=c;c=z;var B=m.length;c||(c=new Float32Array(B));var y=new Float32Array(B),Q=new Float32Array(B),b=y,d=Q;b||(b=new Float32Array(B));d||(d=new Float32Array(B));for(var x=B+u,C=new Float32Array(x),H=new Float32Array(x),I=1;I<=x-1;I++)C[I-1]=E>=t[I-1]&&E<t[I+1-1]?1:0;E==t[x-1]&&(C[B-1]=1);for(var O=2;O<=u;O++)for(I=1;I<=x-O;I++){var M=0!=C[I-1]?C[I-1]/(t[I+O-1-1]-t[I-1]):0,F=0!=C[I+1-1]?-C[I+1-1]/(t[I+O-1]-t[I+1-1]):0, | |
l=0!=H[I-1]?(E-t[I-1])*H[I-1]/(t[I+O-1-1]-t[I-1]):0,q=0!=H[I+1-1]?(t[I+O-1]-E)*H[I+1-1]/(t[I+O-1]-t[I+1-1]):0;C[I-1]=(0!=C[I-1]?(E-t[I-1])*C[I-1]/(t[I+O-1-1]-t[I-1]):0)+(0!=C[I+1-1]?(t[I+O-1]-E)*C[I+1-1]/(t[I+O-1]-t[I+1-1]):0);H[I-1]=M+F+l+q}for(I=1;I<=B;I++)b[I-1]=C[I-1],d[I-1]=H[I-1];t=0;for(u=1;u<=B;u++)t+=y[u-1]*m[u-1];E=0;for(u=1;u<=B;u++)E+=Q[u-1]*m[u-1];for(u=1;u<=B;u++)c[u-1]=0!=t?Q[u-1]*m[u-1]/t+y[u-1]*m[u-1]*E/(t*t):0;for(m=0;m<h;m++)for(t=e[m]=0;t<a;t++)e[m]+=z[t]*g[h*t+m]};a.I_=c;a.mR= | |
e;a.lR=function(a,f){if(0>=f)return 0;var g=c(a);if(f>=e(a))return g;var h=a.NA,n=z.Hp(h,f,0,h.length-1);return g*(n+(f-h[n])/(h[n+1]-h[n]))/1E3};a.dr=function(a,c,e,g,h){return e+(h-g)*(a-e)/(c-g)};a.xD=function(a,c,e){var g=c[0];c=c[1];e=(e[1]-c)/(e[0]-g);return e*a+(c-e*g)};a.PJ=function(a,c,e,h,n){return g(u(0,1,a,c[0],e[0],h[0],n[0],.001),c[1],e[1],h[1],n[1])};a.Qt=function(a,c,e,g,h){var m=new Float32Array(3),u=new Float32Array(3),z=new Float32Array(3),G=new Float32Array(3),E=new Float32Array(3), | |
B=new Float32Array(3);t.copy(a[1],u);null==c?(t.copy(e[1],z),m[0]=2*u[0]-z[0],m[1]=2*u[1]-z[1]):t.copy(c[1],m);null==e?(t.copy(c[1],m),z[0]=2*u[0]-m[0],z[1]=2*u[1]-m[1]):t.copy(e[1],z);t.subtract(u,m,G);t.subtract(z,u,E);c=t.length(G);e=t.length(E);0==c&&(c=1);0==e&&(e=1);if("AUTO"==g||"AUTO"==h)B[0]=E[0]/e+G[0]/c,B[1]=E[1]/e+G[1]/c,m=2.5614*t.length(B),0!=m&&("AUTO"==g&&t.scaleAndAdd(u,B,-(c/m),a[0]),"AUTO"==h&&t.scaleAndAdd(u,B,e/m,a[2]));"VECTOR"==g&&t.scaleAndAdd(u,G,-1/3,a[0]);"VECTOR"==h&&t.scaleAndAdd(u, | |
E,1/3,a[2])};a.NK=function(a,c,e,g){var h=[],m=[],t,u,z;h[0]=a[0]-c[0];h[1]=a[1]-c[1];m[0]=g[0]-e[0];m[1]=g[1]-e[1];z=g[0]-a[0];t=Math.abs(h[0]);u=Math.abs(m[0]);0!=t+u&&t+u>z&&(t=z/(t+u),c[0]=a[0]-t*h[0],c[1]=a[1]-t*h[1],e[0]=g[0]-t*m[0],e[1]=g[1]-t*m[1])}};b4w.module.__graph=function(a,m){function h(a,b,d){d||(d=null);if(c(a,b))throw"Graph already has node with given ID";a.L.push(b,d)}function c(a,b){for(var d=a.L,c=0;c<d.length;c+=2)if(d[c]==b)return!0;return!1}function e(a,b,d,e){e||(e=null);if(c(a,b)&&c(a,d))a.qa.push(b,d,e);else throw"Wrong node IDs";}function u(a,b){if(!c(a,b))throw"Node not found";for(var d=a.L,e=0;e<d.length;e+=2)d[e]==b&&(d.splice(e,2),e-=2)}function g(a,b,d,c){if(!C(a,b,d))throw"Edge not found";a=a.qa;for(var e=0,f=0;f<a.length;f+= | |
3)if(a[f]==b&&a[f+1]==d){if(-1==c)a.splice(f,3);else{if(c==e){a.splice(f,3);break}e++}f-=3}}function z(a){a=a.L;for(var b=-1,d=0;d<a.length;d+=2)b=Math.max(b,a[d]);return++b}function t(a,b){for(var d=a.L,c=0;c<d.length;c+=2)if(d[c+1]==b)return d[c];return-1}function p(a){var d=[],c={};f(a,c);for(var e=a.L,g=0;g<e.length;g+=2)0==b(a,e[g])&&v(a,e[g],c,d);return{L:d,qa:a.qa.slice(0)}}function f(a,b){for(var d=a.L,c=0;c<d.length;c+=2)b[d[c]]=!1}function v(a,b,c,e){if(!c[b]){c[b]=!0;for(var f=0;f<Q(a, | |
b);f++)v(a,d(a,b,f),c,e);e.unshift(b,y(a,b))}}function k(a,c,e,f){if(!e[c]){e[c]=!0;if(10==f||30==f)for(var g=0;g<Q(a,c);g++){var h=d(a,c,g);k(a,h,e,f)}if(20==f||30==f)for(g=0;g<b(a,c);g++)h=x(a,c,g),k(a,h,e,f)}}function n(a){for(var b=a.qa,d=0;d<b.length;d+=3){var e=b[d+1];c(a,b[d])&&c(a,e)||(b.splice(d,3),d-=3)}}function A(a){for(var b=[],d=a.L,c=0;c<d.length;c+=2){var e=d[c];Q(a,e)||b.push(e)}return b}function L(a){var b=a.L;a=a.qa;for(var d=[],c=[],e=[],f=0;f<b.length;f++)e[b[2*f]]=f,d.push(f, | |
b[2*f+1]);for(f=0;f<a.length;f+=3)c.push(e[a[f]],e[a[f+1]],a[f+2]);return{L:d,qa:c}}function K(a,c,e){if(e.Wf==e.ai){for(var f=0,g=0;f<e.ai;f++)-1!=e.Gg[f]&&(a[g]=f,c[g]=e.Gg[f],g++);return!0}if(e.ai>e.xl||e.ri>e.si||e.fm>e.hm||e.em>e.gm)return!1;for(var g=f=-1,h=!1;!h&&G(e,F,f,g);)if(f=F[0],g=F[1],E(e,f,g)){var k;k=e;h={};h.tn=k.tn;h.un=k.un;h.dw=k.dw;h.gq=k.gq;h.ai=k.ai;h.xl=k.xl;h.bi=k.bi;h.Wf=h.qr=k.Wf;h.em=k.em;h.fm=k.fm;h.ri=k.ri;h.gm=k.gm;h.hm=k.hm;h.si=k.si;h.zm=-1;h.Gg=k.Gg;h.Zi=k.Zi;h.wj= | |
k.wj;h.xj=k.xj;h.Oj=k.Oj;h.Pj=k.Pj;h.gs=k.gs;k.gs[0]+=1;var h=k=h,n=f,m=g,p=h.tn,C=h.un,y=h.ai,H=h.xl,t=h.Gg,v=h.Zi,A=h.wj,I=h.xj,u=h.Oj,z=h.Pj;B(n<y);B(m<H);B(h.Wf<y);B(h.Wf<H);y=++h.Wf;h.zm=n;A[n]||(A[n]=y,h.em++,u[n]&&h.ri++);u[n]||(u[n]=y,h.fm++,A[n]&&h.ri++);I[m]||(I[m]=y,h.gm++,z[m]&&h.si++);z[m]||(z[m]=y,h.hm++,I[m]&&h.si++);t[n]=m;v[m]=n;for(t=0;t<b(p,n);t++)v=x(p,n,t),A[v]||(A[v]=y,h.em++,u[v]&&h.ri++);for(t=0;t<Q(p,n);t++)v=d(p,n,t),u[v]||(u[v]=y,h.fm++,A[v]&&h.ri++);for(t=0;t<b(C,m);t++)v= | |
x(C,m,t),I[v]||(I[v]=y,h.gm++,z[v]&&h.si++);for(t=0;t<Q(C,m);t++)v=d(C,m,t),z[v]||(z[v]=y,h.hm++,I[v]&&h.si++);h=K(a,c,k);B(1>=k.Wf-k.qr);B(-1!=k.zm);v=k.tn;n=k.un;m=k.Wf;p=k.zm;C=k.Gg;A=k.Zi;y=k.wj;I=k.xj;H=k.Oj;u=k.Pj;if(k.qr<m){y[p]==m&&(y[p]=0);for(z=0;z<b(v,p);z++)t=x(v,p,z),y[t]==m&&(y[t]=0);H[p]==m&&(H[p]=0);for(z=0;z<Q(v,p);z++)t=d(v,p,z),H[t]==m&&(H[t]=0);v=C[p];I[v]==m&&(I[v]=0);for(z=0;z<b(n,v);z++)t=x(n,v,z),I[t]==m&&(I[t]=0);u[v]==m&&(u[v]=0);for(z=0;z<Q(n,v);z++)t=d(n,v,z),u[t]==m&& | |
(u[t]=0);C[p]=-1;A[v]=-1;k.Wf=k.qr;k.zm=-1}}return h}function G(a,b,d,c){-1==d&&(d=0);-1==c?c=0:c++;var e=a.ri,f=a.si,g=a.fm,h=a.hm,k=a.em,n=a.gm,m=a.Wf,x=a.ai,p=a.xl,C=a.Gg,y=a.Zi,H=a.wj,t=a.xj,v=a.Oj,A=a.Pj;if(e>m&&f>m)for(;d<x&&(-1!=C[d]||0==v[d]||0==H[d]);)d++,c=0;else if(g>m&&h>m)for(;d<x&&(-1!=C[d]||0==v[d]);)d++,c=0;else if(k>m&&n>m)for(;d<x&&(-1!=C[d]||0==H[d]);)d++,c=0;else if(0==d&&0!=a.bi){for(H=0;H<x&&-1!=C[d=a.bi[H]];)H++;H==x&&(d=x)}else for(;d<x&&-1!=C[d];)d++,c=0;if(e>m&&f>m)for(;c< | |
p&&(-1!=y[c]||0==A[c]||0==t[c]);)c++;else if(g>m&&h>m)for(;c<p&&(-1!=y[c]||0==A[c]);)c++;else if(k>m&&n>m)for(;c<p&&(-1!=y[c]||0==t[c]);)c++;else for(;c<p&&-1!=y[c];)c++;return d<x&&c<p?(b[0]=d,b[1]=c,!0):!1}function E(a,c,e){var f=a.tn,g=a.un,h=a.xl,k=a.Gg,n=a.Zi,m=a.wj,p=a.xj,t=a.Oj,v=a.Pj;B(c<a.ai);B(e<h);B(-1==k[c]);B(-1==n[e]);if(!(0,a.dw)(y(f,c),y(g,e)))return!1;for(var A=h=0,I=0,u=0,z=0,M=0,O=0;O<Q(f,c);O++){var F=d(f,c,O);if(-1!=k[F]){var E=k[F];if(!C(g,e,E)||!H(a.gq,f,c,F,g,e,E))return!1}else m[F]&& | |
I++,t[F]&&h++,m[F]||t[F]||z++}for(O=0;O<b(f,c);O++)if(F=x(f,c,O),-1!=k[F]){if(E=k[F],!C(g,E,e)||!H(a.gq,f,F,c,g,E,e))return!1}else m[F]&&I++,t[F]&&h++,m[F]||t[F]||z++;for(O=0;O<Q(g,e);O++)if(E=d(g,e,O),-1!=n[E]){if(F=n[E],!C(f,c,F))return!1}else p[E]&&u++,v[E]&&A++,p[E]||v[E]||M++;for(O=0;O<b(g,e);O++)if(E=x(g,e,O),-1!=n[E]){if(F=n[E],!C(f,F,c))return!1}else p[E]&&u++,v[E]&&A++,p[E]||v[E]||M++;return I<=u&&h<=A&&z<=M}function B(a){if(!a)throw"Assertion failed";}function y(a,b){for(var d=a.L,c=0;c< | |
d.length;c+=2)if(d[c]==b)return d[c+1];return null}function Q(a,b){for(var d=a.qa,c=0,e=0;e<d.length;e+=3)d[e]==b&&c++;return c}function b(a,b){for(var d=a.qa,c=0,e=0;e<d.length;e+=3)d[e+1]==b&&c++;return c}function d(a,b,d){a=a.qa;for(var c=0,e=0;e<a.length;e+=3)if(a[e]==b){if(c==d)return a[e+1];c++}return-1}function x(a,b,d){a=a.qa;for(var c=0,e=0;e<a.length;e+=3)if(a[e+1]==b){if(c==d)return a[e];c++}return-1}function C(a,b,d){a=a.qa;for(var c=0;c<a.length;c+=3)if(a[c]==b&&a[c+1]==d)return!0;return!1} | |
function H(a,b,d,c,e,f,g){for(var h=I(b,d,c),k=I(e,f,g),n=0;n<h;n++){for(var m=!1,x=0;x<k;x++)if(a(O(b,d,c,n),O(e,f,g,x))){m=!0;break}if(!m)return!1}return!0}function I(a,b,d){var c=0;a=a.qa;for(var e=0;e<a.length;e+=3)a[e]==b&&a[e+1]==d&&c++;return c}function O(a,b,d,c){a=a.qa;for(var e=0,f=0;f<a.length;f+=3)if(a[f]==b&&a[f+1]==d){if(e==c)return a[f+2];e++}return null}m("__print");var M=m("__util"),F=[-1,-1];a.Fy=-1;a.AT=10;a.So=20;a.MU=30;a.create=function(){for(var a=arguments,b=[],d=[],c=0;c< | |
a.length;c++){var e=a[c];switch(e.length){case 2:b.push(e[0],e[1]);break;case 3:d.push(e[0],e[1],e[2]);break;default:throw"Wrong graph constructor params";}}return{L:b,qa:d}};a.clone=function(a,b,d){if(b)for(var c=Array(a.L.length),e=0;e<a.L.length;e+=2)c[e]=a.L[e],c[e+1]=b(a.L[e+1]);else c=M.Ma(a.L);if(d)for(b=Array(a.qa.length),e=0;e<a.qa.length;e+=3)b[e]=a.qa[e],b[e+1]=a.qa[e+1],b[e+2]=d(a.qa[e+2]);else b=M.Ma(a.qa);return a={L:c,qa:b}};a.XV=function(a,b){for(var d=[],c=[],e=0;e<a.length;e++)d.push(a[e][0], | |
a[e][1]);for(e=0;e<b.length;e++)c.push(b[e][0],b[e][1],b[e][2]);return{L:d,qa:c}};a.wk=h;a.qY=c;a.Uc=e;a.jg=u;a.Wj=g;a.Kr=function(a,b,d,c){if(!C(a,b,d))throw"Edge not found";a=a.qa;for(var e=0;e<a.length;e+=3)if(a[e]==b&&a[e+1]==d&&a[e+2][0]==c[0]&&a[e+2][1]==c[1]){a.splice(e,3);break}};a.C=function(a,b){if(-1==t(a,b)){var d=z(a);h(a,d,b);return d}throw"Non-unique attribute";};a.VP=function(a,b,d,c,e){a=a.qa;for(var f=0;f<a.length;f+=3)a[f]==b&&a[f+1]==d&&a[f+2]==c&&(a[f+2]=e)};a.rJ=function(a,b, | |
d){var c;d=d||[];c=c||[];for(var f={},g=0;g<a.L.length;g+=2){var k=a.L[g],n=a.L[g+1],m=z(b);h(b,m,n);f[k]=m}for(g=0;g<a.qa.length;g+=3)n=f[a.qa[g]],m=f[a.qa[g+1]],k=a.qa[g+2],e(b,n,m,k);for(g=0;g<d.length;g+=3)n=f[d[g]],a=d[g+1],k=d[g+2],e(b,n,a,k);for(g=0;g<c.length;g+=3)d=c[g],m=f[c[g+1]],k=c[g+2],e(b,d,m,k)};a.vn=z;a.fg=t;a.n=function(a,b,d,c){b=t(a,b);d=t(a,d);if(-1!=b&&-1!=d)e(a,b,d,c);else throw"Attributes not found";};a.ia=function(a,b){for(var d=a.L,c=0;c<d.length&&!b(d[c],d[c+1]);c+=2);}; | |
a.Cf=function(a,b){for(var d=a.qa,c=0;c<d.length&&!b(d[c],d[c+1],d[c+2]);c+=3);};a.Df=function(a,b,d){for(var c=a.qa,e=0;e<c.length;e+=3)if(c[e+1]==b){var f=c[e];if(d(f,y(a,f),c[e+2]))break}};a.vi=function(a,b,d){for(var c=a.qa,e=0;e<c.length;e+=3)if(c[e]==b){var f=c[e+1];if(d(f,y(a,f),c[e+2]))break}};a.Qx=p;a.HR=function(a){a=p(a).L;for(var b=[],d=0;d<a.length;d+=2)b.push(a[d+1]);return b};a.MY=function(){};a.ts=function(a,b,d){if(!c(a,b))throw"No such node";var e={};f(a,e);k(a,b,e,d);b=[];for(var g in e)e[g]&& | |
(g=Number(g),b.push(g,y(a,g)));a={L:b,qa:a.qa.slice(0)};n(a);return a};a.Yt=n;a.xN=function(a){for(var d=[],c=a.L,e=0;e<c.length;e+=2){var f=c[e];b(a,f)||d.push(f)}return d};a.An=A;a.match=function(a,b,d,c){var e={};e.tn=L(a);e.un=L(b);e.dw=d||function(a,b){return a==b};e.gq=c||function(a,b){return a==b};c=a.L.length/2;var f=b.L.length/2;e.ai=c;e.xl=f;e.bi=0;e.Wf=e.qr=0;e.ri=e.em=e.fm=0;e.si=e.gm=e.hm=0;e.zm=-1;e.Gg=Array(c);e.Zi=Array(f);e.wj=Array(c);e.xj=Array(f);e.Oj=Array(c);e.Pj=Array(f);e.gs= | |
[1];for(d=0;d<c;d++)e.Gg[d]=-1,e.wj[d]=0,e.Oj[d]=0;for(d=0;d<f;d++)e.Zi[d]=-1,e.xj[d]=0,e.Pj[d]=0;f=Array(c);c=Array(c);if(K(f,c,e)){for(d=0;d<f.length;d++)f[d]=a.L[2*f[d]],c[d]=b.L[2*c[d]];return[f,c]}return null};a.Pa=y;a.ci=Q;a.Jq=b;a.Uh=d;a.$k=x;a.dX=I;a.Sg=O;a.replace=function(a,b,d){for(var c=a.qa,e=z(a),f=0;f<b.length;f++){var g=b[f];u(a,g);for(var k=0;k<c.length;k+=3)c[k]==g&&(c[k]=e),c[k+1]==g&&(c[k+1]=e),c[k]==c[k+1]&&(c.splice(k,3),k-=3)}h(a,e,d)};a.JE=function(a,b,d,c,e){if(!C(a,b,d))throw"Edge not found"; | |
a=a.qa;for(var f=0;f<a.length;f+=3)a[f]==b&&a[f+1]==d&&(a[f]=c,a[f+1]=e)};a.gM=function(a,b){function d(a,b){if(-1!=k.indexOf(a)){var c=k.slice(k.indexOf(a));if(-1!=e[c[c.length-1]].indexOf(c[0])){n.push([a,c[c.length-1]]);return}}k.push(a);for(c=0;c<b.length;c++)b[c]in e&&d(b[c],e[b[c]])}b||(b=A(a)[0]);var c=a.qa;if(c.length){for(var e={},f=0,h=0;h<c.length;h+=3)c[h+1]in e?e[c[h+1]].push(c[h]):e[c[h+1]]=[c[h]],f++;var k=[],n=[];d(b,e[b]);for(h=0;h<n.length;h++)for(var m=f=0;m<c.length;m+=3)n[h][1]== | |
c[m+1]&&n[h][0]==c[m]&&g(a,c[m],c[m+1],f),f++}};a.EL=function(a,b,d){var c=a.L;a=a.qa;var e;e="digraph debug {\n node [shape=box];\n";for(var f=0;f<c.length;f+=2){var g=c[f],h=c[f+1],h=b?b(g,h):String(g);e+=" ";e+=String(g)+' [label="'+h.replace(/\"/g,'\\"')+'"];\n'}for(f=0;f<a.length;f+=3)b=a[f],c=a[f+1],h=a[f+2],e+=" ",e+=String(b)+" -> "+String(c),d&&(e+=' [label="'+d(b,c,h)+'"]'),e+=";\n";return e+="}"}};b4w.module.__scenes=function(a,m){function h(a){for(var b=0;b<a.length;b++){var d=a[b];if(!d.Mf||!d.Mf.length)return d}return null}function c(){if(!ac)throw"No active scene available";return ac}function e(a,b,d){if(!ya.dq||!u(a,b,d))return null;d=a.b4w_shadow_settings;var c={};d.csm_resolution>ya.Lb?(c.csm_resolution=ya.Lb,Sa.error("Shadow map texture has unsupported size. Changed to "+ya.Lb+".")):c.csm_resolution=d.csm_resolution;a=ia.vq(b,ya.Md&&a.b4w_enable_ssao);c.self_shadow_polygon_offset=d.self_shadow_polygon_offset; | |
c.self_shadow_normal_offset=d.self_shadow_normal_offset;c.enable_csm=d.b4w_enable_csm&&1==a.length;c.rf=[];c.PF=[];c.$A=[];for(b=0;b<a.length;b++)c.rf.push(a[b].hc.type),c.PF.push(a[b].hc.Wl),c.$A.push(a[b].hc.distance),"SPOT"!=c.rf[b]&&"POINT"!=c.rf[b]||!c.enable_csm||(Sa.warn("Generating shadows for SPOT or POINT light. Disabling Cascaded Shadow Maps"),c.enable_csm=!1);c.enable_csm?(c.csm_num=d.csm_num,c.csm_first_cascade_border=d.csm_first_cascade_border,c.first_cascade_blur_radius=d.first_cascade_blur_radius, | |
c.csm_last_cascade_border=d.csm_last_cascade_border,c.last_cascade_blur_radius=d.last_cascade_blur_radius,c.fade_last_cascade=d.fade_last_cascade,c.blend_between_cascades=d.blend_between_cascades):(c.csm_num=1,c.csm_first_cascade_border=d.csm_first_cascade_border,c.first_cascade_blur_radius=d.first_cascade_blur_radius,c.csm_last_cascade_border=d.csm_last_cascade_border,c.last_cascade_blur_radius=d.last_cascade_blur_radius,c.fade_last_cascade=!1,c.blend_between_cascades=!1);return c}function u(a,b, | |
d){if(0!=b.length&&ya.Pl)switch(a.b4w_render_shadows){case "OFF":return!1;case "ON":return!0}else return!1;var c=!1,e=!1;a=ya.Md&&a.b4w_enable_ssao;if(0==b.length&&!a)return!1;for(b=0;b<d.length;b++){var f=d[b];f.b4w_shadow_cast&&(c=!0);f.b4w_shadow_receive&&(e=!0);if((a||c)&&e)return!0}return!1}function g(a){for(var b=0;b<a.length;b++)if("SUN"==a[b].hc.type)return!0;return!1}function z(a){if(!ya.mi)return!1;a=ha(a);for(var b=0;b<a.length;b++){var d=a[b];if(d.b4w_water&&d.b4w_water_shore_smoothing)return!0}return!1} | |
function t(a){for(var b=0;b<a.length;b++)for(var d=a[b].particle_systems,c=0;c<d.length;c++)if(ia.hA(a[b],d[c].settings))return!0;return!1}function p(a){for(var b=ha(a),d=[],c=0;c<b.length;c++){var e=b[c];if(e.b4w_water){for(var f={},g=0;g<a.length;g++)for(var h=a[g],l=h.data.materials,k=0;k<l.length;k++)l[k]==e&&(f.Di=h.location[1]);f.dd=e.b4w_water_fog_color.slice(0);f.dd.push(e.b4w_water_fog_density);e.b4w_water_dynamic?(f.hn=!0,f.waves_height=e.b4w_waves_height,f.waves_length=e.b4w_waves_length, | |
f.dst_noise_scale0=e.b4w_water_dst_noise_scale0,f.dst_noise_scale1=e.b4w_water_dst_noise_scale1,f.dst_noise_freq0=e.b4w_water_dst_noise_freq0,f.dst_noise_freq1=e.b4w_water_dst_noise_freq1,f.dir_min_shore_fac=e.b4w_water_dir_min_shore_fac,f.dir_freq=e.b4w_water_dir_freq,f.dir_noise_scale=e.b4w_water_dir_noise_scale,f.dir_noise_freq=e.b4w_water_dir_noise_freq,f.dir_min_noise_fac=e.b4w_water_dir_min_noise_fac,f.dst_min_fac=e.b4w_water_dst_min_fac,f.waves_hor_fac=e.b4w_water_waves_hor_fac):(f.hn=!1,f.waves_height= | |
0,f.waves_length=0);f.Eg=e.b4w_water_enable_caust;f.kK=e.b4w_water_caust_scale;f.jK=e.b4w_water_caust_brightness;f.lK=new Float32Array([.3,.7]);f.ni=null;e=e.texture_slots;for(g=0;g<e.length;g++)h=e[g].texture,!0===h.b4w_shore_dist_map&&"FILE"==h.image.source&&(f.ni=h.image,f.qx=h.image.size[0],f.Sv=h.b4w_max_shore_dist,h=h.b4w_shore_boundings,f.Ql=[(h[0]+h[1])/2,(h[2]+h[3])/2],f.Rl=[h[0]-h[1],h[2]-h[3]]);d.push(f)}}if(0<d.length){f=d[0];if(!f.hn)for(c=0;c<d.length;c++)d[c].hn&&(f=d[c]);return f}return null} | |
function f(a){function b(a){if(a){a=a.nodes;for(var c=0;c<a.length;c++){var e=a[c];"GROUP"==e.type&&e.node_group&&b(e.node_group.node_tree);"GROUP"==e.type&&"B4W_REFRACTION"==e.node_tree_name&&(d.le=!0)}}}var d={le:!1};a=ha(a);for(var c=0;c<a.length;c++){var e=a[c];e.b4w_refractive&&(d.le=!0);e.node_tree&&b(e.node_tree)}return d}function v(a,b){if(ya.co)switch(a.b4w_render_reflections){case "OFF":return!1}else return!1;for(var d=[],c=0,e=0;e<b.length;e++){var f=b[e];f.g.Gd&&"CUBE"==f.g.ig&&c++;if(f.eo.length){for(var g= | |
null,h=0;h<d.length;h++)if(d[h]==f){g=h;break}null==g&&d.push(f)}}return{KE:d,ZD:c,Oh:[],hg:[]}}function k(a,b){var d=a.b4w_sky_settings,c={};c.SP=d.render_sky;c.procedural_skydome=d.procedural_skydome&&b;c.use_as_environment_lighting=d.use_as_environment_lighting;c.Sl=d.color;c.rayleigh_brightness=d.rayleigh_brightness;c.mie_brightness=d.mie_brightness;c.spot_brightness=d.spot_brightness;c.scatter_strength=d.scatter_strength;c.rayleigh_strength=d.rayleigh_strength;c.mie_strength=d.mie_strength;c.rayleigh_collection_power= | |
d.rayleigh_collection_power;c.mie_collection_power=d.mie_collection_power;c.mie_distribution=d.mie_distribution;c.kd=d.reflexible;c.Zc=d.reflexible_only;!b&&d.procedural_skydome&&Sa.warn("There is no sun on the scene. Procedural sky won't be rendered");return c}function n(a){var b={};a=a.b4w_ssao_settings;b.radius_increase=a.radius_increase;b.NN=a.hemisphere;b.UJ=a.blur_depth;b.Rz=a.blur_discard_value;b.influence=a.influence;b.dist_factor=a.dist_factor;b.eQ=a.samples;return b}function A(a){if(!(ya.Ip&& | |
a.b4w_enable_bloom&&a.k.ck))return null;var b={};a=a.b4w_bloom_settings;b.blur=a.blur;b.YL=a.edge_lum;b.key=a.key;return b}function L(a){var b={};a=a.b4w_motion_blur_settings;b.mb_decay_threshold=a.motion_blur_decay_threshold;b.mb_factor=a.motion_blur_factor;return b}function K(a){var b={};a=a.b4w_color_correction_settings;b.brightness=a.brightness;b.contrast=a.contrast;b.exposure=a.exposure;b.saturation=a.saturation;return b}function G(a){var b={};a=a.b4w_god_rays_settings;b.xv=a.intensity;b.pl= | |
a.max_ray_length;b.cm=a.steps_per_pass;return b}function E(a){var b={};b.hh=a.b4w_outline_color;b.Pn=a.b4w_outline_factor;return b}function B(a){var b={};a=a.b4w_glow_settings;b.small_glow_mask_coeff=a.small_glow_mask_coeff;b.large_glow_mask_coeff=a.large_glow_mask_coeff;b.small_glow_mask_width=a.small_glow_mask_width;b.large_glow_mask_width=a.large_glow_mask_width;return b}function y(a,b){var d=a.light_settings,c={};c.Lg=d.environment_energy;c.Yx=d.use_environment_light;c.Ku=d.environment_color; | |
c.Qe=a.horizon_color.slice(0);c.af=a.zenith_color.slice(0);c.MS=a.use_sky_paper;c.LS=a.use_sky_blend;c.NS=a.use_sky_real;c.IF=null;c.tx=null;c.Lu=null;if(c.Yx&&"SKY_TEXTURE"==c.Ku&&(!b.procedural_skydome||!b.use_as_environment_lighting)){for(var d=null,e=0;e<a.texture_slots.length;e++)if(a.texture_slots[e].texture.b4w_use_as_environment_lighting){d=a.texture_slots[e];break}d?c.Lu=d:(Sa.warn("environment lighting is set to 'Sky Texture', but there is no world texture with 'Sky Texture Usage' property set to 'ENVIRONMENT_LIGHTING'"), | |
c.Yx=!1)}for(e=0;e<a.texture_slots.length;e++)if(a.texture_slots[e].texture.b4w_use_as_skydome){d=a.texture_slots[e];c.IF=d;c.tx={RJ:d.blend_factor,PN:d.horizon_factor,dT:d.zenith_up_factor,cT:d.zenith_down_factor,color:d.color,$a:d.default_value,invert:d.invert,KS:d.use_rgb_to_intensity,SJ:d.blend_type,FS:d.use_map_blend,GS:d.use_map_horizon,IS:d.use_map_zenith_up,HS:d.use_map_zenith_down};break}return c}function Q(a){var b=a.fog_settings,d={};d.BS=b.use_fog;d.xv=b.intensity;d.depth=b.depth;d.start= | |
b.start;d.height=b.height;d.tM=b.falloff;d.color=b.use_custom_color?b.color.slice(0):a.horizon_color.slice(0);a=d.color;d.dd=new Float32Array([a[0],a[1],a[2],1/d.depth]);d.Je=new Float32Array([d.xv,d.depth,d.start,d.height]);return d}function b(a,b){if(!ya.Bc)return!1;switch(a.b4w_render_dynamic_grass){case "OFF":return!1;case "ON":return!0}for(var d=!1,c=!1,e=0;e<b.length;e++){for(var f=b[e],g=f.data.materials,h=0;h<g.length;h++)g[h].b4w_terrain&&(d=!0);f=f.particle_systems;for(h=0;h<f.length;h++)g= | |
f[h].settings,"HAIR"==g.type&&g.b4w_dynamic_grass&&(c=!0);if(d&&c)return!0}return!1}function d(a,b){if($b.outlining_overview_mode)return!0;if(ya.enable_selectable)switch(a.b4w_enable_object_selection){case "OFF":return!1;case "ON":return!0;case "AUTO":for(var d=0;d<b.length;d++)if(b[d].ya.g.ii)return!0;return!1}else return!1}function x(a,b){if($b.outlining_overview_mode)return!0;if(ya.enable_outlining)switch(a.b4w_enable_outlining){case "OFF":return!1;case "ON":return!0;case "AUTO":for(var d=0;d< | |
b.length;d++)if(b[d].ya.g.Zb)return!0;return!1}else return!1}function C(a,b){if(ya.Tg)switch(a.b4w_enable_glow_materials){case "OFF":return!1;case "ON":return!0;case "AUTO":for(var d=0;d<b.length;d++)for(var c=b[d].data.materials,e=0;e<c.length;e++)if(Da.gA(c[e]))return!0;return!1}else return!1}function H(a,b){if(ya.le)switch(a.b4w_render_refractions){case "OFF":return!1;case "ON":return!0;case "AUTO":return b.le}else return!1}function I(a){for(var b=0;b<a.length;b++)for(var d=a[b].data.materials, | |
c=0;c<d.length;c++){var e=d[c],f=e.game_settings.alpha_blend;if(e.b4w_render_above_all&&"OPAQUE"!=f&&"CLIP"!=f)return!0}return!1}function O(a,b){switch(a.b4w_enable_anchors_visibility){case "OFF":return!1;case "ON":return!0;case "AUTO":for(var d=0;d<b.length;d++){var c=b[d].ya;if(c.anchor&&c.anchor.Kk)return!0}return!1}}function M(a,b,d){var c=Ba.fg(a,b);Ba.Df(a,c,function(a,b,c){if(c.Nb){switch(c.from){case "COLOR":case "CUBEMAP":a=b.j.Vb;break;case "DEPTH":a=b.j.Ge;break;case "SCREEN":a=null;break; | |
case "MAIN_CUBE_REFLECT":return;default:throw"Wrong slink";}switch(c.to){case "COLOR":case "CUBEMAP":case "DEPTH":case "NONE":case "SCREEN":case "OFFSCREEN":case "RESOLVE":case "COPY":case "u_cube_reflection":case "u_plane_reflection":break;default:if(!a)throw"Connection of SCREEN is forbidden";if(a.we)throw"Batch texture can't use renderbuffer";ua.jA(d.uc,c.to)&&Y.zk(d,a,c.to)}}});for(a=0;a<b.xa.length;a++){var c=b.xa[a],e=b.qg[a];switch(c.to){case "COLOR":case "CUBEMAP":case "DEPTH":case "NONE":case "SCREEN":case "OFFSCREEN":case "RESOLVE":case "COPY":break; | |
default:if(e.we)throw"Batch texture can't use renderbuffer";ua.jA(d.uc,c.to)&&Y.zk(d,e,c.to)}}}function F(a,b){return{Xb:!0,Iu:[!0,!0,!0,!0,!0,!0],gg:a,I:b}}function l(a,b,d,c,e,f){function g(a,b){return a==b?0:a>b?1:-1}for(var h=b.g,l=ia.bb(b,e).W,k=0;k<l.length;k++){var n=l[k];n.Kd||n.Zc||"MAIN"!=n.type&&"NODES_GLOW"!=n.type&&"PARTICLES"!=n.type&&"LINE"!=n.type||!("OPAQUE"==n.ub&&"OPAQUE"==c||"BLEND"==n.ub&&"BLEND"==c||"XRAY"==n.ub&&"XRAY"==c||"NODES_GLOW"==n.type&&"GLOW"==c)||(f||(q(n,a,b,d,c, | |
e),Y.Hc(n),D(n)),a.A.push(F(h,n)),M(d,a,n),r(n))}a.A.sort(function(a,b){return a.I&&b.I?-g(a.I.Ua,b.I.Ua)||-g(a.I.Mi,b.I.Mi)||g(a.I.Mj,b.I.Mj):0})}function q(a,b,d,c,e,f){var g=d.g,h=f.k,l=ia.bb(d,f),k="NO_SHADOWS";d=ja(f,["SHADOW_CAST"]);if(d.length&&a.Ld){switch(e){case "OPAQUE":k="SHADOW_MAPPING_OPAQUE";break;case "BLEND":case "XRAY":k="SHADOW_MAPPING_BLEND";break;case "COLOR_ID":case "REFLECT":case "GLOW":k="NO_SHADOWS";break;case "SHADOW":k="SHADOW_MASK_GENERATION";break;default:throw"Wrong subscene type"; | |
}for(var n=0;n<d.length;n++)Y.Gz(a,f.k.Oc)}d=a.Rb;ua.R(d,"SHADOW_USAGE",k);a.Bc&&(n=ma.Pb(c,"GRASS_MAP"))&&w(a,n,g);if("SHADOW"!=a.type&&"COLOR_ID"!=e||a.Cn){n=b.pr;ua.R(d,"NUM_LIGHTS",n);ua.R(d,"NUM_LFACTORS",0==n%2?n/2:Math.floor(n/2)+1);ua.R(d,"REFLECTION_PASS",0);ua.R(d,"SSAO_ONLY",0);ua.R(d,"INVERT_FRONTFACING",0);(h=h.jc)&&b.If?ua.R(d,"WATER_EFFECTS",1):ua.R(d,"WATER_EFFECTS",0);if(h&&b.Eg&&g.Eg){ua.R(d,"CAUSTICS",1);if(n=f.k.Oc){g=n.rf;for(n=e=0;n<g.length;n++)"SUN"==g[n]&&(e=n);ua.R(d,"SUN_NUM", | |
e)}ua.R(d,"CAUST_SCALE",ua.K(b.Xz));ua.R(d,"CAUST_SPEED",ua.K(b.Yz,2));ua.R(d,"CAUST_BRIGHT",ua.K(b.Wz))}else ua.R(d,"CAUSTICS",0);h&&(ua.R(d,"WAVES_HEIGHT",ua.K(h.waves_height)),ua.R(d,"WAVES_LENGTH",ua.K(h.waves_length)),ua.R(d,"WATER_LEVEL",ua.K(h.Di)));b=l.Oh;l=l.hg;if(-1!==a.Pc.indexOf("u_mirrormap"))ua.R(d,"REFLECTION_TYPE","REFL_MIRRORMAP");else if(a.Gd&&b)b=b.j.Vb,Y.zk(a,b,"u_cube_reflection"),ua.R(d,"REFLECTION_TYPE","REFL_CUBE");else if(a.Gd&&l)for(n=0;n<l.length;n++)b=l[n].j.Vb,Y.zk(a, | |
b,"u_plane_reflection"),ua.R(d,"REFLECTION_TYPE","REFL_PLANE");else ua.R(d,"REFLECTION_TYPE","REFL_NONE");(l=ma.Pb(c,"SKY"))?a.uE?(b=l.j.Vb,Y.zk(a,b,"u_sky")):ya.Er?(a.Zd=l.Zd,ua.R(d,"PROCEDURAL_FOG",1)):ua.R(d,"PROCEDURAL_FOG",0):ua.R(d,"PROCEDURAL_FOG",0);b=f.k.jy;b.Yx&&(ua.R(d,"USE_ENVIRONMENT_LIGHT",1),"SKY_TEXTURE"==b.Ku?(b=b.Lu?Y.fN(b.Lu,!1):l.j.Vb,ua.R(d,"SKY_TEXTURE",1),Y.zk(a,b,"u_sky_texture")):"SKY_COLOR"==b.Ku&&ua.R(d,"SKY_COLOR",1));b=f.k.cH;b.BS&&(ua.R(d,"USE_FOG",1),ua.R(d,"FOG_TYPE", | |
b.tM));a.fo&&a.Ua?(ya.dq&&ua.R(d,"USE_REFRACTION_CORRECTION",1),"MAIN"==a.type&&a.Cn||"NODES_GLOW"==a.type?(ua.R(d,"REFRACTIVE",1),f.k.le?ua.R(d,"USE_REFRACTION",1):ua.R(d,"USE_REFRACTION",0)):f.k.le?ua.R(d,"REFRACTIVE",1):ua.R(d,"REFRACTIVE",0)):(ua.R(d,"REFRACTIVE",0),ua.R(d,"USE_REFRACTION",0),ua.R(d,"USE_REFRACTION_CORRECTION",0));a.kk&&(ya.mi&&a.dy&&ma.Pb(c,"DEPTH_PACK")?ua.R(d,"SHORE_SMOOTHING",1):ua.R(d,"SHORE_SMOOTHING",0),a.water_dynamic&&h&&h.waves_height?ua.R(d,"DYNAMIC",1):ua.R(d,"DYNAMIC", | |
0));"PARTICLES"==a.type&&(ua.R(d,"SIZE_RAMP_LENGTH",a.La.F_),ua.R(d,"COLOR_RAMP_LENGTH",a.La.sA));if(!a.$f)for(a=a.ba,c=0;c<a.length;c++)if(b=a[c],"SCENE"==b.source)for(d=0;d<Oa.length;d++)for(l=Oa[d],h=Oa[d].Mf,n=0;n<h.length;n++)h[n].k==b&&Ba.n(lb,l,f,null)}}function D(a){var b=a.uc.attributes,d=a.pa.jd,c;for(c in b)d[c]||Ma.ha('missing data for "'+c+'" attribute');if("MAIN"==a.type||"NODES_GLOW"==a.type)if(b=ua.BN(a.uc.cy),10<b&&("MAIN"==a.type&&Sa.warn("Varying limit exceeded for main shader - "+ | |
b+', materials: "'+a.sf.join(", ")+'"'),"MAIN"==a.type&&a.Cn||"NODES_GLOW"==a.type))c=d=0,a.hk&&(d=Ma.wn(a.hk)),a.wc&&(c=Ma.wn(a.wc)),Sa.warn("Varying limit exceeded for node shader - "+b+", uv: "+d+", vc: "+c+', materials: "'+a.sf.join(", ")+'"')}function r(a){8<a.ba.length&&Sa.warn(a.type,"too many textures used - "+a.ba.length+' (max 8), materials "'+a.sf.join(", ")+'"')}function w(a,b,d){a.td=b.td;var c=b.td[0],e=b.td[1],f=b.td[2];d=d.zc;d=Math.max(d.max_x-d.min_x,d.max_z-d.min_z);f=0==f?d:Math.max(f, | |
d);b.td[2]=f;b=b.j;N.Wr(b,f/2,-e,-c,f/2);N.ki(b);c=a.lv||0;c=0==c?d:Math.max(c,d);a.lv=c}function P(a){na(a);var b=fa(a,"MAIN_OPAQUE"),d=!0,c=a.k.Oc;Ba.ia(a.k.xb,function(e,f){"SHADOW_CAST"===f.type&&(R(f,a,b.j,f.A,c,d),d=!1)})}function V(a){Ba.ia(a.k.xb,function(a,b){"OUTLINE"===b.type&&(b.Ju=1)})}function R(a,b,d,c,e,f){if(0!=c.length){var g=a.j,h=Ha.rj(d.i,kc);Ha.Jd(h,g.i);Ha.copy(d.Hf,g.nx);if("SUN"===e.rf[a.zf]||"HEMI"===e.rf[a.zf]){h=Yc;sa.Qd(h);for(var l=0;l<c.length;l++){var k=c[l].gg;0== | |
l?sa.Sp(k.Jb,h):sa.dB(h,k.Jb)}c=sa.gB(h,bc);Ma.Il(c,g.jb,c);if(e.enable_csm){b=Hb.copy(d.Ym[a.qu],kc);e=Ea.invert(d.jb,Pc);Ma.Il(b,e,b);Ma.Il(b,g.jb,b);a=d.ru[a.qu];if(f)for(cc=0,Eb=-Infinity,f=2;f<c.length;f+=3)cc=Math.min(cc,c[f]),Eb=Math.max(Eb,c[f]);f=Yc;f.max_x=b[0]+a;f.max_y=b[1]+a;f.max_z=Eb;f.min_x=b[0]-a;f.min_y=b[1]-a;f.min_z=cc}else{d=f=Yc;e=jd;e.set(c);c=Jb/9;h=Ea.identity(Pc);Ea.rotate(h,c,Ma.Bh,h);for(var k=l=-1,n=0;10>n;n++){var r=sa.OJ(e,mb),q=(r.max_x-r.min_x)*(r.max_y-r.min_y);if(-1== | |
l||q<l)l=q,k=n,sa.Sp(r,d);Ma.Il(e,h,e)}d=k*c;0<d&&(c=Ea.identity(Pc),Ea.rotate(c,d,Ma.Bh,c),Ea.multiply(c,g.jb,g.jb),Ha.lf(g.jb,g.Hf));d=f.max_x-f.min_x;c=f.max_y-f.min_y;d&&c&&(e=Math.abs(d-c)/2,2<d/c?(f.max_y+=e,f.min_y-=e):2<c/d&&(f.max_x+=e,f.min_x-=e));f.max_x+=.005;f.max_y+=.005;f.max_z+=.005;f.min_x-=.005;f.min_y-=.005;f.min_z-=.005;ca(a,b.k.xb)}N.vQ(g,f.min_x,f.max_x,f.min_y,f.max_y,-f.max_z,-f.min_z);N.ki(g);Ma.jq(g.Gf,g.Wk)}else"SPOT"!==e.rf[a.zf]&&"POINT"!==e.rf[a.zf]||N.ki(g,g.Za)}}function ca(a, | |
b){for(var d=a.j,c=ma.uN(b,a),e=0;e<c.length;e++){var f=c[e];if("MAIN_OPAQUE"==f.type||"SHADOW_RECEIVE"==f.type||"MAIN_BLEND"==f.type||"MAIN_XRAY"==f.type)if(ya.fr)f.Zx.set(d.Hf,9*a.zf);else{var g=Ha.m(d.Hf),h=Ha.qc(d.Hf),l=Ha.v(d.Hf);Za.set(g[0],g[1],g[2],h,Xc);f.Os.set(Xc,4*a.zf);f.Ns.set(l,4*a.zf)}}}function Z(a,b,d,c,e){for(var f=b.g,g=ia.bb(b,c).W,h=0;h<g.length;h++){var l=g[h];"COLOR_ID"==l.type&&(e||(q(l,a,b,d,"COLOR_ID",c),Y.Hc(l),D(l)),"COLOR_PICKING"==a.type&&"COLOR_ID"==l.ub||"COLOR_PICKING_XRAY"== | |
a.type&&"COLOR_ID_XRAY"==l.ub)&&(e||(Y.Id(l,"USE_OUTLINE",0),Y.Hc(l),D(l)),a.A.push(F(f,l)))}}function da(a,b,d,c,e){c||(e.Bc&&(c=ma.Pb(d,"GRASS_MAP"))&&w(e,c,b),Y.Hc(e),D(e));a.A.push(F(b,e));M(d,a,e);r(e)}function ba(a,b){J(a,b);for(var d=0;d<a.D.length;d++)for(var c=ta.wb(a.D[d].Ia,"ALL",ta.yc),e=0;e<c.length;e++)c[e].parent==a&&ba(c[e],b)}function J(a,b){a.g.uj=b;if(ia.Sq(a))for(var d=0;d<a.D.length;d++)for(var c=a.D[d],e=ja(c.Ia,Tb),f=0;f<e.length;f++)W(a,c,e[f])}function pa(a,b){for(var d=ja(b, | |
Tb),c=a.hc,e=a.g,f=ia.bb(a,b),g=f.Cj,h=Ha.m(e.i),e=Ha.v(e.i),l=0;l<d.length;l++){var k=d[l];k.cr.set(h,3*g);k.Kv.set(c.direction,3*g);k.br.set(c.Tm,3*g);switch(c.type){case "SUN":k.ZF.set(e);k.YF=c.Tm;"SKY"===k.type?(k.lr=c.SD,Hb.copy(c.direction,k.Ex),ka(b,k)):Hb.copy(c.direction,k.Ex);break;case "HEMI":case "POINT":case "SPOT":break;default:Sa.error("Unknown light type: "+c.type+'".')}W(a,f,k);for(var n=0;n<k.A.length;n++){var r=k.A[n].I;r.nl&&Y.yQ(r,a)}}d=fa(b,"MAIN_OPAQUE").j;f=f.ox;c=b.k.Oc; | |
for(l=0;l<f.length;l++)k=f[l],N.kx(k.j,h,e),R(k,b,d,k.A,c,!0),ca(k,b.k.xb)}function W(a,b,d){var c=a.g;a=a.hc;b=b.Cj;var e=xc;e[0]=a.mm&&!c.uj?1:0;e[1]=a.gk&&!c.uj?1:0;d.Lv.set(e,2*b);d.na=!0}function na(a){var b=ta.wb(a,"LAMP",ta.yc),b=ia.vq(b,ya.Md&&a.b4w_enable_ssao);if(b.length)for(var d=0;d<b.length;d++)for(var c=b[d],e=c.g,f=Ha.rj(e.i,kc),e=Ha.dC(e.i,Dc),g=0;g<c.D.length;g++){var h=c.D[g],l=h.ox;if(h.Ia==a)for(h=0;h<l.length;h++)N.kx(l[h].j,f,e)}}function ka(a,b){sb.Ok(b);if(b.lr)for(var d= | |
ja(a,["MAIN_OPAQUE","MAIN_BLEND","MAIN_XRAY","MAIN_GLOW"]),c=0;c<d.length;c++)for(var e=d[c].A,f=0;f<e.length;f++){var g=e[f];g.Xb&&(g=g.I,Y.pK(g)&&sb.VR(g))}}function ha(a){for(var b=[],d=0;d<a.length;d++)for(var c=a[d].data,e=0;e<c.materials.length;e++){var f=c.materials[e];-1==b.indexOf(f)&&b.push(f)}return b}function ra(a,b,d){for(var c=a.k,e=a.Ki.g.S,f=0;f<e.length;f++){var g=e[f];N.ki(g,b/d);c.Oc&&N.Vx(g,c.Oc)}c.Oc&&(c.mr=!0,fa(a,"SHADOW_RECEIVE").na=!0,fa(a,"MAIN_BLEND").na=!0);var h=c.xb; | |
ma.MR(h,function(c,e,f){if(c.zo){var g=c.$j*b,l=c.ak*d;if(e)for(e=0;e<f.xa.length;e++)f.xa[e]==c&&hb.resize(c.Ja,g,l);else switch(hb.ml(c.Ja)&&hb.resize(c.Ja,g,l),c=f.j,c.width=g,c.height=l,f.type){case "DOF":U(a,{dof_power:f.j.dof_power,dof_on:f.j.dof_on});break;case "GLOW_COMBINE":la(a,{small_glow_mask_width:f.small_glow_mask_width,large_glow_mask_width:f.large_glow_mask_width});break;case "BLOOM":za(a,{bloom_blur:f.bloom_blur});break;case "OUTLINE":f=ma.nb(h,f,"POSTPROCESSING");g=ma.nb(h,f,"POSTPROCESSING"); | |
l=ma.nb(h,g,"POSTPROCESSING");c=ma.nb(h,l,"POSTPROCESSING");ma.ne(f,1/b,1/d);ma.ne(g,1/b,1/d);ma.ne(l,1/b,1/d);ma.ne(c,1/b,1/d);break;default:ma.ne(f,1/b,1/d)}}})}function ja(a,b){for(var d=[],c=0;c<b.length;c++){var e=b[c];Ba.ia(a.k.xb,function(a,b){b.type==e&&d.push(b)})}return d}function fa(a,b){return ma.Pb(a.k.xb,b)}function U(a,b){var d=fa(a,"DOF");if(!d)return Sa.error("DOF is not enabled on the scene. Check camera settings"),0;var c=a.k.xb;"boolean"==typeof b.dof_on&&(d.j.dof_on=b.dof_on); | |
"number"==typeof b.dof_distance&&(d.j.dof_distance=b.dof_distance);"number"==typeof b.dof_front&&(d.j.dof_front=b.dof_front);"number"==typeof b.dof_rear&&(d.j.dof_rear=b.dof_rear);if("number"==typeof b.dof_power){d.j.dof_power=b.dof_power;var e=ma.nb(c,d,"POSTPROCESSING"),c=ma.nb(c,e,"POSTPROCESSING");ma.ad(e,d.j.dof_power);ma.ne(e,1/d.j.width,1/d.j.height);ma.ad(c,d.j.dof_power);ma.ne(c,1/d.j.width,1/d.j.height)}}function za(a,b){var d=fa(a,"LUMINANCE_TRUNCED"),c=fa(a,"BLOOM");if(!d||!c)return Sa.error("Bloom is not enabled on the scene"), | |
0;"number"==typeof b.bloom_key&&(d.bloom_key=b.bloom_key,d.na=!0);"number"==typeof b.bloom_edge_lum&&(d.bloom_edge_lum=b.bloom_edge_lum,d.na=!0);if("number"==typeof b.bloom_blur){var e=a.k.xb,d=ma.nb(e,c,"BLOOM_BLUR"),e=ma.nb(e,d,"BLOOM_BLUR");c.bloom_blur=b.bloom_blur;ma.ad(d,b.bloom_blur);ma.ne(d,1/c.j.width,1/c.j.height);ma.ad(e,b.bloom_blur);ma.ne(e,1/c.j.width,1/c.j.height)}}function la(a,b){var d=fa(a,"GLOW_COMBINE");if(!d)return Sa.error("Glow is not enabled on the scene"),null;for(var c=a.k.xb, | |
e=ma.sN(c,d),f=0;f<e.length;++f){var g=e[f];if("POSTPROCESSING"===g.type&&"GLOW_MASK_LARGE"===g.ub)var h=g;if("POSTPROCESSING"===g.type&&"GLOW_MASK_SMALL"===g.ub)var l=g}e=ma.nb(c,h,"POSTPROCESSING");c=ma.nb(c,l,"POSTPROCESSING");"number"==typeof b.small_glow_mask_coeff&&(d.small_glow_mask_coeff=b.small_glow_mask_coeff,d.na=!0);"number"==typeof b.large_glow_mask_coeff&&(d.large_glow_mask_coeff=b.large_glow_mask_coeff,d.na=!0);"number"==typeof b.small_glow_mask_width&&(d.small_glow_mask_width=b.small_glow_mask_width, | |
ma.ad(l,b.small_glow_mask_width),ma.ne(l,1/d.j.width,1/d.j.height),l.na=!0,ma.ad(c,b.small_glow_mask_width),ma.ne(c,1/d.j.width,1/d.j.height),c.na=!0);"number"==typeof b.large_glow_mask_width&&(d.large_glow_mask_width=b.large_glow_mask_width,ma.ad(h,b.large_glow_mask_width),ma.ne(h,1/d.j.width,1/d.j.height),h.na=!0,ma.ad(e,b.large_glow_mask_width),ma.ne(e,1/d.j.width,1/d.j.height),e.na=!0)}function ga(a,b,d){var c=a.k,e=c.jc;if(!e.hn)return e.Di;var f=e.waves_height,g=e.waves_length,h=e.Di,l=Hb.length(c.xh); | |
a=fa(a,"MAIN_OPAQUE").time;l&&(a*=l);var k=xc;k[0]=20/g*(b-.25*a);k[1]=20/g*(d-.25*a);l=Ma.Zz(k);k[0]=17/g*(d+.1*a);k[1]=17/g*(b+.1*a);var k=Ma.Zz(k),l=l+k-1,n=e.dst_noise_scale0,k=e.dst_noise_scale1,r=e.dst_noise_freq0,q=e.dst_noise_freq1,m=xc;m[0]=n*(b+r*a);m[1]=n*(d+r*a);n=Ma.ux(m);m[0]=k*(d-q*a);m[1]=k*(b-q*a);k=Ma.ux(m);k*=f*n;if(e.ni)if(q=(b-e.Ql[0])/e.Rl[0],m=(e.Ql[1]+d)/e.Rl[1],q+=.5,m+=.5,1<q||0>q||1<m||0>m)e=k;else{var c=Ma.BB(c.px,e.qx,q,m),m=e.dir_freq,x=e.dir_noise_scale,p=e.dir_noise_freq, | |
n=e.dir_min_noise_fac,q=e.dst_min_fac,r=g/e.Sv/Math.PI;d=[x/g*(b+p*a),x/g*(d+p*a)];b=Math.sqrt(c);e=f*Math.max(c,e.dir_min_shore_fac)*Math.sin(b/r+m*a)*Math.max(Ma.ux(d),n);f=Math.max(b,q);e=e*(1-f)+k*f;l*=c}else e=k;return h+(e+.05*l)}function S(a,b){a.Hn&&"POSTPROCESSING"==a.type&&b.Xb!=a.Xb&&(a.Xb=b.Xb);b.Xb||"OUTLINE"!=a.type||(a.Ju=0)}function ea(a,b,d,c){var e=Ba.Pa(a,b);N.Tr(e.j,d,c);e.zt=!0;Ba.vi(a,b,function(b,e,f){f.Nb&&f.from==d&&ma.CK(f)&&Fa(a,b,f.to,c)});Ba.Df(a,b,function(b,e,f){f.Nb&& | |
f.from==d&&f.from==f.to&&ea(a,b,d,c)})}function Fa(a,b,d,c){a=Ba.Pa(a,b).A;for(b=0;b<a.length;b++)Y.WP(a[b].I,c,d)}function oa(a){var b=fa(a,"GRASS_MAP");if(b){var d=b.j,c=a.Ki.g;a=Ha.m(c.i);var e=kc;e[0]=0;e[1]=-b.td[2]/2;e[2]=0;b=Ha.v(c.i);Hb.transformQuat(e,b,e);e[0]+=a[0];e[1]=0;e[2]+=a[2];b=Dc;b[0]=0;b[1]=0;b[2]=0;b[3]=1;N.kx(d,e,b)}}function xa(a,b){Ba.ia(a,function(d,c){if("MOTION_BLUR"==c.type){if(!c.xa[0]||!c.qg[0])throw"Wrong MOTION_BLUR subscene";var e=c.xa[0],f=c.qg[0];c.qg[0]=c.j.Vb; | |
Ba.vi(a,d,function(b,d,c){c.Nb&&Fa(a,b,c.to,f)});ea(a,d,e.from,f);Fa(a,d,e.to,c.qg[0]);c.LD=Math.exp(-b/c.mb_factor)}})}function aa(a){return a.k.xh}var Y=m("__batch"),sa=m("__boundings"),N=m("__camera");m("__compat");var Aa=m("__config"),qa=m("__container");m("__constraints");var X=m("__debug"),va=m("__geometry"),Ba=m("__graph"),Ia=m("__hud");m("__lights");var Ea=m("__mat4"),Da=m("__nodemat"),ta=m("__objects"),ia=m("__obj_util"),T=m("__physics"),wa=m("__prerender"),uc=m("__primitives"),Sa=m("__print"), | |
sb=m("__renderer"),ma=m("__scenegraph"),Nb=m("__sfx"),ua=m("__shaders"),hb=m("__textures"),Ha=m("__tsr"),Ma=m("__util"),Hb=m("__vec3"),Za=m("__vec4"),ya=Aa.u,$b=Aa.Zb,Ib=Aa.Ml,Kc="GRASS_MAP SHADOW_CAST MAIN_OPAQUE MAIN_BLEND MAIN_XRAY MAIN_GLOW MAIN_PLANE_REFLECT MAIN_CUBE_REFLECT COLOR_PICKING COLOR_PICKING_XRAY SHADOW_RECEIVE OUTLINE_MASK WIREFRAME".split(" ");a.GU=Kc;var Tb="MAIN_OPAQUE MAIN_BLEND MAIN_XRAY MAIN_GLOW MAIN_PLANE_REFLECT MAIN_CUBE_REFLECT GOD_RAYS GOD_RAYS_COMBINE SKY LUMINANCE_TRUNCED SHADOW_RECEIVE SHADOW_CAST COLOR_PICKING COLOR_PICKING_XRAY OUTLINE_MASK".split(" "), | |
kb="MAIN_OPAQUE SSAO MAIN_BLEND MAIN_XRAY MAIN_GLOW MAIN_PLANE_REFLECT MAIN_CUBE_REFLECT".split(" "),rc="SHADOW_CAST MAIN_OPAQUE MAIN_BLEND MAIN_XRAY MAIN_GLOW MAIN_PLANE_REFLECT MAIN_CUBE_REFLECT COLOR_PICKING COLOR_PICKING_XRAY SHADOW_RECEIVE GOD_RAYS OUTLINE_MASK WIREFRAME".split(" "),Cc="MAIN_OPAQUE MAIN_BLEND MAIN_XRAY MAIN_GLOW MAIN_PLANE_REFLECT MAIN_CUBE_REFLECT".split(" "),Lc=null,ac=null,Oa=[],lb=null,Jb=Math.PI/2,xc=new Float32Array(2),kc=new Float32Array(3),Dc=new Float32Array(4),Xc=new Float32Array(4), | |
Pc=new Float32Array(16),bc=new Float32Array(24),jd=new Float32Array(24),Yc=sa.Qd(),mb=sa.Qd(),cc=0,Eb=-Infinity;a.YV=function(){return{}};a.Sr=function(a){ac=a;Nb.kQ(a)};a.HP=function(a,b){var d=a.k,c=ma.lL(d.xb);if(a==b){ra(a,qa.vC(),qa.uC());for(var e=0;e<c.length;e++)a.k.Vj.push(c[e])}else for(e=a.Mf[0],ra(a,e.k.bk,e.k.bk),e=0;e<c.length;e++)b.k.Vj.push(c[e]);c=ja(a,rc);for(e=0;e<c.length;e++)c[e].xh.set(d.xh);for(e=0;e<d.Vj.length;e++)"SHADOW_CAST"==d.Vj[e].type&&sb.Ok(d.Vj[e])};a.al=function(){Lc|| | |
(Lc=h(Oa));return Lc};a.lq=h;a.q=c;a.wa=function(){return ac?!0:!1};a.Yk=function(a){return a.Ki};a.pj=function(){return Oa};a.eC=function(){if(1==Oa.length)return Oa;for(var a=0;a<Oa.length;a++){var b=Oa[a].k.xb;Ba.ia(b,function(b,d){for(var c=0;c<d.A.length;c++){for(var e=d.A[c].I.ba,f=null,g=0;g<e.length;g++)if("SCENE"==e[g].source&&e[g].vx==Oa[a].name&&"COPY"!=d.type){Sa.error('Texture-scene loop detected. A scene is rendered to texture "'+e[g].name+'" yet this texture belongs to the same scene.'); | |
Ba.fg(lb,Oa[a]);f=d.A[c].I;break}f&&(f.ba=[],f.Pc=[],Y.UR(f,null),Y.Hc(f))}})}for(var d=[],a=0;a<Oa.length;a++)if(b=Oa[a],!b.Mf.length){b=Ba.fg(lb,b);Ba.gM(lb,b);b=Ba.ts(lb,b,Ba.So);b=Ba.Qx(b);Ba.ia(b,function(a,b){d.push(b)});break}return d};a.hJ=function(a,c,h,l,r){a.Mf=a.Mf||[];a.V=null;var q=a.k,m=a.Ki.g;q.rm=[];var w=a.world;q.qO=h.length;q.ck=g(h);q.ns=k(w,q.ck);q.jy=y(w,q.ns);q.cH=Q(w);q.$I=O(a,r);m.S[0].type!=N.Sc&&"HMD"==ya.stereo?(Sa.warn("Head-mounted display stereo is disabled for the non-perspective camera"), | |
r=!1):r="HMD"==ya.stereo;q.PC=r;m.S[0].type!=N.Sc&&"ANAGLYPH"==ya.stereo?(Sa.warn("Anaglyph stereo is disabled for the non-perspective camera"),r=!1):r="ANAGLYPH"==ya.stereo;q.anaglyph_use=r;q.hi=v(a,c);q.TJ=A(a);q.$O=L(a);q.mK=K(a);q.FN=G(a);q.pP=E(a);q.Vh=B(a);q.Mk=ya.Mk&&(0<m.dof_distance||m.be);q.Hj=ya.Hj&&a.b4w_enable_motion_blur;q.Gk=ya.Gk&&a.b4w_enable_color_correction;q.antialiasing=ya.antialiasing&&1==ya.gd&&"NONE"!=a.b4w_antialiasing_quality;q.Md=ya.Md&&a.b4w_enable_ssao;q.cl=ya.cl&&a.b4w_enable_god_rays&& | |
q.ck;q.LL=ya.dq;q.zq=a.b4w_glow_settings.render_glow_over_blend;q.pR=n(a);r=f(l);q.le=H(a,r);q.Oc=e(a,h,l);q.jc=p(l);q.zh=I(l);q.cR=t(l);q.mi=z(l);q.Bc=b(a,l);q.KK=d(a,l);q.outline=x(a,l);q.Tg=C(a,l);switch(a.b4w_reflection_quality){case "LOW":q.cj=Ib.MA;q.Sj=Ib.oE;break;case "MEDIUM":q.cj=Ib.CL;q.Sj=Ib.CP;break;case "HIGH":q.cj=Ib.BL;q.Sj=Ib.BP;break;default:q.cj=Ib.MA,q.Sj=Ib.oE}if(qa.gO())Sa.log("%cENABLE HIDPI MODE","color: #00a"),q.nz="AA_QUALITY_LOW",q.Hd=1,ya.gd=1;else if(1<ya.gd)Sa.log("%cENABLE MSAA RENDERING: "+ | |
ya.gd+"x","color: #00a"),q.Hd=1;else{q.nz="AA_QUALITY_"+a.b4w_antialiasing_quality;switch(a.b4w_antialiasing_quality){case "LOW":q.antialiasing&&(q.Hd=1);break;case "MEDIUM":ya.quality==Aa.Lf||ya.quality==Aa.Kf?q.Hd=1:ya.quality==Aa.wg&&(q.Hd=1.33);break;case "HIGH":ya.quality==Aa.Lf?q.Hd=1:ya.quality==Aa.Kf?q.Hd=1.33:ya.quality==Aa.wg&&(q.Hd=2);break;case "NONE":ya.quality==Aa.Lf||ya.quality==Aa.Kf?q.Hd=1:ya.quality==Aa.wg&&(q.Hd=2)}ya.quality==Aa.ft&&(q.Hd=1)}h=a.Mf.sort(function(a,b){return b.k.bk- | |
a.k.bk});q.xb=ma.kL(q,m,h);q.Vj=[];q.mr=!1;q.Zv=!1;q.$v=!1;q.xh=new Float32Array(3);Oa.push(a);lb||(lb=Ba.create());Ba.C(lb,a);for(q=0;q<c.length;q++)ia.Ow(c[q],!0,a);a=qa.Yc();qa.resize(a.clientWidth,a.clientHeight,!0)};a.iJ=function(a,b,d){for(var c=0;c<b.length;c++)b[c].k&&b[c].k.Jn&&(b[c].k.wh=d,a.k.rm.push(b[c]))};a.iv=function(a){return a.k.xb};a.uB=function(a){Ba.ia(a,function(b,d){var c=null;switch(d.type){case "POSTPROCESSING":c=Y.pu(d.Dr);break;case "SSAO":c=Y.rL(d);break;case "SSAO_BLUR":c= | |
Y.sL(d);break;case "DEPTH_PACK":c=Y.XK();break;case "GOD_RAYS":ma.nb(a,d,"RESOLVE")||ma.nb(a,d,"WIREFRAME")||ma.nb(a,d,"MAIN_BLEND")||ma.nb(a,d,"GOD_RAYS");c=Y.aL(d.jE,d.kk,d.cm);break;case "GOD_RAYS_COMBINE":ma.nb(a,d,"RESOLVE")||ma.nb(a,d,"WIREFRAME")||ma.nb(a,d,"MAIN_BLEND");ma.nb(a,d,"GOD_RAYS");c=Y.bL();break;case "MOTION_BLUR":c=Y.fL();break;case "DOF":var c=Y.YK(),e=ma.nb(a,d,"POSTPROCESSING"),f=ma.nb(a,e,"POSTPROCESSING");ma.ad(e,d.j.dof_power);ma.ad(f,d.j.dof_power);break;case "OUTLINE":var c= | |
Y.gL(),e=ma.nb(a,d,"POSTPROCESSING"),f=ma.nb(a,e,"POSTPROCESSING"),g=ma.nb(a,f,"POSTPROCESSING"),h=ma.nb(a,g,"POSTPROCESSING");ma.ad(f,d.Ht);ma.ad(e,d.Ht);ma.ad(h,d.Pu*d.Pn);ma.ad(g,d.Pu*d.Pn);break;case "GLOW_COMBINE":c=Y.$K();break;case "COMPOSITING":c=Y.VK();break;case "ANTIALIASING":c=Y.PK(d);break;case "SMAA_RESOLVE":case "SMAA_EDGE_DETECTION":case "SMAA_BLENDING_WEIGHT_CALCULATION":case "SMAA_NEIGHBORHOOD_BLENDING":c=Y.pL(d.type);break;case "STEREO":c=Y.tL(d.ub);break;case "SKY":c=Y.jL();break; | |
case "LUMINANCE":c=Y.cL();break;case "AVERAGE_LUMINANCE":c=Y.QK();break;case "LUMINANCE_TRUNCED":c=Y.dL();break;case "BLOOM_BLUR":c=Y.RK();break;case "BLOOM":c=ma.nb(a,d,"BLOOM_BLUR");e=ma.nb(a,c,"BLOOM_BLUR");ma.ad(c,d.bloom_blur);ma.ad(e,d.bloom_blur);c=Y.SK();break;case "VELOCITY":c=Y.xL();break;case "ANCHOR_VISIBILITY":c=Y.OK();break;case "PERFORMANCE":c=Y.hL()}c&&(e=F(ia.bj("NONE"),c),D(c),d.A.push(e),M(a,d,c),r(c))})};a.xk=function(a,b,d){switch(b.type){case "MESH":case "LINE":var c=a.k.xb, | |
e=b.g;!ma.Pb(c,"SHADOW_CAST")&&e.Ld&&(e.Ld=!1);e=ja(a,Kc);d&&b.fk&&T.xk(b,a);for(var f=0;f<e.length;f++){var g=e[f],h=b,k=c,n=a,m=d;switch(g.type){case "MAIN_OPAQUE":l(g,h,k,"OPAQUE",n,m);break;case "MAIN_BLEND":l(g,h,k,"BLEND",n,m);break;case "MAIN_XRAY":l(g,h,k,"XRAY",n,m);break;case "MAIN_GLOW":l(g,h,k,"GLOW",n,m);break;case "MAIN_PLANE_REFLECT":case "MAIN_CUBE_REFLECT":for(var x=h.g,p=ia.bb(h,n).W,C=0;C<p.length;C++){var y=p[C];if(("MAIN"==y.type||"PARTICLES"==y.type||"LINE"==y.type)&&"REFLECT"== | |
y.ub){if("MAIN_PLANE_REFLECT"==g.type){var H;a:{H=n.k.hi.hg;for(var t=0;t<H.length;t++)for(var v=0;v<H[t].length;v++)if(H[t][v]==g){H=t;break a}H=null}if(H==x.je)continue}else{a:{if(n.k.hi)for(H=n.k.hi.Oh,t=0;t<H.length;t++)if(H[t]==g){H=t;break a}H=null}if(H==x.Fe)continue}m||(q(y,g,h,k,"REFLECT",n),H=y.Rb,ua.R(H,"WATER_EFFECTS",0),ua.R(H,"REFLECTION_PASS",1),ua.R(H,"TEXTURE_NORM",0),"MAIN_PLANE_REFLECT"==g.type&&ua.R(H,"INVERT_FRONTFACING",1),Y.Hc(y),D(y));g.A.push(F(x,y))}}break;case "SHADOW_RECEIVE":x= | |
ia.bb(h,n).W;for(p=0;p<x.length;p++)C=x[p],"SHADOW"==C.type&&"RECEIVE"==C.ub&&(m||(q(C,g,h,k,"SHADOW",n),Y.Hc(C),D(C)),g.A.push(F(h.g,C)),M(k,g,C),r(C));break;case "SHADOW_CAST":x=!1;p=h.g;h=ia.bb(h,n).W;C=ma.Pb(k,"GRASS_MAP");for(y=0;y<h.length;y++)H=h[y],"SHADOW"==H.type&&"CAST"==H.ub&&(x=!0,m||(t=g.pr,Y.Id(H,"NUM_LIGHTS",t),Y.Id(H,"NUM_LFACTORS",0==t%2?t/2:Math.floor(t/2)+1),ua.R(H.Rb,"SHADOW_USAGE","SHADOW_CASTING"),H.Bc&&C&&w(H,C,p),Y.Id(H,"SHADOW_TEX_RES",ua.K(n.k.Oc.csm_resolution)),Y.Hc(H), | |
D(H)),g.A.push(F(p,H)));x&&(h=n.k.Oc,m=ma.Pb(k,"MAIN_OPAQUE"),R(g,n,m.j,g.A,h,!0));break;case "COLOR_PICKING":Z(g,h,k,n,m);break;case "COLOR_PICKING_XRAY":Z(g,h,k,n,m);break;case "OUTLINE_MASK":k=h.g;h=ia.bb(h,n).W;for(n=0;n<h.length;n++)x=h[n],"COLOR_ID"==x.type&&"OUTLINE"==x.ub&&(m||(Y.Id(x,"USE_OUTLINE",1),Y.Hc(x),D(x)),g.A.push(F(k,x)));break;case "GRASS_MAP":k=h.g;h=ia.bb(h,n).W;for(n=0;n<h.length;n++)x=h[n],"GRASS_MAP"==x.type&&(m||(Y.Hc(x),D(x)),g.A.push(F(k,x)),x=g.j,H=k.Jb,p=g.td[0],C=g.td[1], | |
y=g.td[2],0==p&&0==C?(p=H.min_y,C=H.max_y):(p=Math.min(p,H.min_y),C=Math.max(C,H.max_y)),H=1E-4*(C-p),g.td[0]=p-H,g.td[1]=C+H,N.Wr(x,y/2,-C,-p,y/2),N.ki(x));break;case "WIREFRAME":for(x=h.g,h=ia.bb(h,n).W,n=0;n<h.length;n++)p=h[n],"WIREFRAME"==p.type&&da(g,x,k,m,p)}}break;case "LAMP":pa(b,a),ta.fR(a)}ia.Ow(b,!0,a)};a.Pw=function(a){a.k.mr=!0};a.rS=function(a,b){var d=a.g.S[0];Ba.ia(b,function(a,b){if("SHADOW_CAST"===b.type){var c=Ha.m(d.i);Ha.Jd(c,b.j.i);Ha.copy(d.Hf,b.j.nx)}})};a.t0=ca;a.jN=function(a, | |
b){for(var d=a.k.Oc,c=new Float32Array(d.csm_num),e=0;e<d.csm_num;e++)c[e]=N.AL(d,b,e);return c};a.$U=da;a.aA=ba;a.Lm=J;a.Av=function(a){return a.g.uj};a.QP=function(a,b,d){b=b.g;a=ja(a,Kc);for(var c=0;c<a.length;c++)for(var e=a[c].A,f=e.length-1;0<=f;f--){var g=e[f];g.gg==b&&(g.I&&d&&va.lA(g.I.pa),e.splice(f,1))}};a.gS=function(a,b){for(var d=a.hc,c=ia.bb(a,b).Cj,e=ja(b,Tb),f=0;f<e.length;f++){var g=e[f];g.br.set(d.Tm,3*c);g.na=!0}};a.zG=pa;a.fa=function(){for(var a=0;a<Oa.length;a++){var b=Oa[a]; | |
Ba.ia(b.k.xb,function(a,b){if("SINK"!=b.type){var d=b.j;sb.TP(d.Le,d.Vb,d.Ge,d.width,d.height);for(var d=b.A,c=0;c<d.length;c++){var e=d[c].I;e&&Y.JK(e)}}});b.k.xb=[];b.k.Vj=[]}ac=Lc=null;Oa.length=0;lb=null};a.DD=function(a,b,d){a=N.nM(a,a.near,a.far,null,!0);var c=uc.SM(a);a=ia.bj("DYNAMIC");a.Jb=a.zc={max_x:1E12,min_x:-1E12,max_y:1E12,min_y:-1E12,max_z:1E12,min_z:-1E12};a.Ac=a.De=sa.QJ();var e=a.Ac.ib;a.Gh=a.Cg=sa.Up([e,0,0],[0,e,0],[0,0,e],a.Ac.N,[0,0,0,1]);d=Y.oL(c,d);b.A.push(F(a,d))};a.QX= | |
function(a){return[a.frame_start,a.frame_end]};a.BF=function(a,b,d){qa.XQ(a,b,d);ac&&ra(ac,a,b)};a.z_=ra;a.XF=ja;a.da=fa;a.OB=function(a){a=fa(a,"MAIN_OPAQUE");var b=a.Qe,d=a.af,c=[],e=[];c[0]=b[0];c[1]=b[1];c[2]=b[2];e[0]=d[0];e[1]=d[1];e[2]=d[2];return[a.Lg,c,e]};a.Ww=function(a,b,d,c){a=ja(a,Tb);for(var e=0;e<a.length;e++){var f=a[e];f.Qe.set(d);f.af.set(c);f.Lg=b;f.na=!0}};a.mC=function(a){if(a=fa(a,"SKY")){var b={};b.color=Array(3);Hb.copy(a.Sl,b.color);b.procedural_skydome=a.procedural_skydome; | |
b.use_as_environment_lighting=a.use_as_environment_lighting;b.rayleigh_brightness=a.rayleigh_brightness;b.mie_brightness=a.mie_brightness;b.spot_brightness=a.spot_brightness;b.scatter_strength=a.scatter_strength;b.rayleigh_strength=a.rayleigh_strength;b.mie_strength=a.mie_strength;b.rayleigh_collection_power=a.rayleigh_collection_power;b.mie_collection_power=a.mie_collection_power;b.mie_distribution=a.mie_distribution;return b}return null};a.sF=function(a,b){var d=fa(a,"SKY");d&&("number"==typeof b.procedural_skydome&& | |
(d.procedural_skydome=b.procedural_skydome),"number"==typeof b.use_as_environment_lighting&&(d.use_as_environment_lighting=b.use_as_environment_lighting),"object"==typeof b.color&&d.Sl.set(b.color),"number"==typeof b.rayleigh_brightness&&(d.rayleigh_brightness=b.rayleigh_brightness),"number"==typeof b.mie_brightness&&(d.mie_brightness=b.mie_brightness),"number"==typeof b.spot_brightness&&(d.spot_brightness=b.spot_brightness),"number"==typeof b.scatter_strength&&(d.scatter_strength=b.scatter_strength), | |
"number"==typeof b.rayleigh_strength&&(d.rayleigh_strength=b.rayleigh_strength),"number"==typeof b.mie_strength&&(d.mie_strength=b.mie_strength),"number"==typeof b.rayleigh_collection_power&&(d.rayleigh_collection_power=b.rayleigh_collection_power),"number"==typeof b.mie_collection_power&&(d.mie_collection_power=b.mie_collection_power),"number"==typeof b.mie_distribution&&(d.mie_distribution=b.mie_distribution),d.na=!0,d.lr=!0,ka(a,d))};a.nX=function(a){return ja(a,kb)[0].Je[0]};a.lX=function(a){return ja(a, | |
kb)[0].Je[1]};a.oX=function(a){return ja(a,kb)[0].Je[2]};a.mX=function(a){return ja(a,kb)[0].Je[3]};a.qQ=function(a,b){for(var d=ja(a,kb),c=0;c<d.length;c++){var e=d[c];e.Je[0]=b;e.na=!0}};a.oQ=function(a,b){for(var d=ja(a,kb),c=0;c<d.length;c++){var e=d[c];e.Je[1]=b;e.na=!0}};a.rQ=function(a,b){for(var d=ja(a,kb),c=0;c<d.length;c++){var e=d[c];e.Je[2]=b;e.na=!0}};a.pQ=function(a,b){for(var d=ja(a,kb),c=0;c<d.length;c++){var e=d[c];e.Je[3]=b;e.na=!0}};a.TB=function(a,b){var d=b||[],c=ja(a,kb)[0].dd; | |
d[0]=c[0];d[1]=c[1];d[2]=c[2];d[3]=c[3];return d};a.$w=function(a,b){for(var d=ja(a,kb),c=0;c<d.length;c++){var e=d[c];e.dd.set(b);e.na=!0}};a.oC=function(a){var b=fa(a,"SSAO");a=fa(a,"SSAO_BLUR");if(!b)return null;var d=b.A[0].I,c={};c.ssao_quality=Y.ev(d,"SSAO_QUALITY")[1];c.ssao_hemisphere=b.ssao_hemisphere;c.ssao_blur_depth=a.ssao_blur_depth;c.Rz=a.ssao_blur_discard_value;c.radius_increase=b.Zl;c.influence=b.Yl;c.dist_factor=b.Xl;c.ssao_only=b.ssao_only;c.ssao_white=Y.ev(d,"SSAO_WHITE")[1];return c}; | |
a.uF=function(a,b){var d=fa(a,"SSAO"),c=fa(a,"SSAO_BLUR");if(!d)return Sa.error("SSAO is not enabled on the scene"),0;if("string"==typeof b.ssao_quality){var e=d.A[0].I;Y.Id(e,"SSAO_QUALITY",b.ssao_quality);Y.Hc(e,!0)}"number"==typeof b.ssao_hemisphere&&(e=d.A[0].I,Y.Id(e,"SSAO_HEMISPHERE",b.ssao_hemisphere),Y.Hc(e,!0));"number"==typeof b.ssao_blur_depth&&(e=c.A[0].I,Y.Id(e,"SSAO_BLUR_DEPTH",b.ssao_blur_depth),Y.Hc(e,!0));"number"==typeof b.ssao_blur_discard_value&&(c.ssao_blur_discard_value=b.ssao_blur_discard_value); | |
"number"==typeof b.Zl&&(d.Zl=b.Zl);"number"==typeof b.Yl&&(d.Yl=b.Yl);"number"==typeof b.Xl&&(d.Xl=b.Xl);if("number"==typeof b.ssao_only){d=fa(a,"MAIN_OPAQUE");d.ssao_only=b.ssao_only;for(var f=0;f<d.A.length;f++)e=d.A[f].I,Y.Id(e,"SSAO_ONLY",b.ssao_only),Y.Hc(e,!0)}"number"==typeof b.ssao_white&&(e=d.A[0].I,Y.Id(e,"SSAO_WHITE",b.ssao_white),Y.Hc(e,!0));d.na=!0;c.na=!0};a.LB=function(a){a=fa(a,"DOF");if(!a)return null;var b={};b.dof_distance=a.j.dof_distance;b.dof_front=a.j.dof_front;b.dof_rear=a.j.dof_rear; | |
b.dof_power=a.j.dof_power;b.be=a.j.be;return b};a.gF=U;a.WB=function(a){var b=ja(a,["GOD_RAYS"]);a=fa(a,"GOD_RAYS_COMBINE");if(!b||!a)return null;var d={};d.god_rays_max_ray_length=b[0].pl;d.god_rays_intensity=a.god_rays_intensity;d.god_rays_steps=Y.ev(b[0].A[0].I,"STEPS_PER_PASS")[1];return d};a.jF=function(a,b){var d=ja(a,["GOD_RAYS"]),c=fa(a,"GOD_RAYS_COMBINE");if(!d||!c)return Sa.error("God Rays are not enabled on the scene"),0;"number"==typeof b.god_rays_intensity&&(c.god_rays_intensity=b.god_rays_intensity); | |
if("number"==typeof b.god_rays_max_ray_length)for(var e=b.god_rays_max_ray_length,f=0;f<d.length;f++)d[f].pl=e,d[f].Ir=e/d[f].cm/(f+1),d[f].na=!0;if("number"==typeof b.god_rays_steps)for(var g=ua.K(b.god_rays_steps,1),e=d[0].pl,f=0;f<d.length;f++){d[f].cm=g;d[f].Ir=e/g/(f+1);d[f].na=!0;var h=d[f].A[0].I;Y.Id(h,"STEPS_PER_PASS",g);Y.Hc(h,!0)}c.na=!0};a.DB=function(a){var b=fa(a,"LUMINANCE_TRUNCED");a=fa(a,"BLOOM");if(!b||!a)return null;var d={};d.bloom_key=b.bloom_key;d.bloom_edge_lum=b.bloom_edge_lum; | |
d.bloom_blur=a.bloom_blur;return d};a.YE=za;a.VB=function(a){a=fa(a,"GLOW_COMBINE");if(!a)return null;var b={};b.small_glow_mask_coeff=a.small_glow_mask_coeff;b.large_glow_mask_coeff=a.large_glow_mask_coeff;b.small_glow_mask_width=a.small_glow_mask_width;b.large_glow_mask_width=a.large_glow_mask_width;return b};a.iF=la;a.AC=function(a){var b=aa(a);a=Hb.length(b);if(0==a)return null;var b=Ma.Fd(Math.atan2(b[0],b[2])),d={};d.wind_dir=b;d.wind_strength=a;return d};a.hQ=function(a){a.k.Zv=!0};a.yC=ga; | |
a.xC=function(a,b){var d=a.k.jc,c=fa(a,"MAIN_OPAQUE");c&&d&&(b.waves_height=d.waves_height,b.waves_length=d.waves_length,c.If&&(b.water_fog_density=c.If[3],d=b.water_fog_color=[],d[0]=c.If[0],d[1]=c.If[1],d[2]=c.If[2]))};a.zF=function(a,b){var d=a.k.jc;if(!d)return Sa.error("set_water_params() - no water parameters on the scene"),null;"number"==typeof b.dst_noise_scale0&&(d.dst_noise_scale0=b.dst_noise_scale0);"number"==typeof b.dst_noise_scale1&&(d.dst_noise_scale1=b.dst_noise_scale1);"number"== | |
typeof b.dst_noise_freq0&&(d.dst_noise_freq0=b.dst_noise_freq0);"number"==typeof b.dst_noise_freq1&&(d.dst_noise_freq1=b.dst_noise_freq1);"number"==typeof b.dir_min_shore_fac&&(d.dir_min_shore_fac=b.dir_min_shore_fac);"number"==typeof b.dir_freq&&(d.dir_freq=b.dir_freq);"number"==typeof b.dir_noise_scale&&(d.dir_noise_scale=b.dir_noise_scale);"number"==typeof b.dir_noise_freq&&(d.dir_noise_freq=b.dir_noise_freq);"number"==typeof b.dir_min_noise_fac&&(d.dir_min_noise_fac=b.dir_min_noise_fac);"number"== | |
typeof b.dst_min_fac&&(d.dst_min_fac=b.dst_min_fac);"number"==typeof b.waves_hor_fac&&(d.waves_hor_fac=b.waves_hor_fac);"number"==typeof b.water_dynamic&&(d.hn=b.water_dynamic);for(var c=ja(a,Cc),e=0;e<c.length;e++){var f=c[e];"number"==typeof b.water_fog_density&&d.dd&&(f.If[3]=b.water_fog_density);"object"==typeof b.water_fog_color&&d.dd&&f.If.set(b.water_fog_color);"number"==typeof b.waves_height&&(f.ey=b.waves_height);"number"==typeof b.waves_length&&(f.fy=b.waves_length);f.na=!0}};a.lC=function(a, | |
b,d){var c=a.k.jc;if(!c.ni)return 100;var e=c.Sv;a=c.Di;var f=(b[0]-c.Ql[0])/c.Rl[0],g=(c.Ql[1]+b[2])/c.Rl[1],f=f+.5,g=g+.5;if(1<f||0>f||1<g||0>g)b=1;else return c=e*Ma.BB(ac.k.px,c.qx,f,g),b=(a-b[1])*d,b=Math.sqrt(c*c+b*b)};a.update=function(a,b){for(var d=c().Ki.g,e=0;e<Oa.length;e++){var f=Oa[e],g=f.k.xb,h=f.k;if(h.jc)var l=Ha.m(d.i),k=l[1]-ga(f,l[0],l[2]);for(l=0;l<h.rm.length;l++){var n=h.rm[l].k,q=n.ua,r=n.Nc;if(!(f.b4w_use_nla&&n.Ls||!q&&!r)&&hb.TG(n)){var m=hb.QG(n),x=hb.SG(n);q&&ya.ag&&(x-= | |
5);var p=hb.US(n);m>=p&&n.ek||m<x?(hb.PE(n.name,n.wh),r&&(n.Nl=hb.Rr(n,a))):m>=p&&!n.ek?hb.ow(n.name,n.wh):hb.UG(n)&&(q?hb.EG(n):(q=hb.Rr(n,a),q!=n.Nl&&(hb.DG(n),n.Zj++),n.Nl=q))}}Ba.ia(g,function(b,d){-1<rc.indexOf(d.type)&&(d.time=a);h.jc&&(d.St=k)})}for(e=0;e<Oa.length;e++)if(f=Oa[e],h=f.k,g=h.xb,d=h.Vj,d.length)for(h.mr&&(P(f),h.mr=!1),h.Zv&&(oa(f),h.Zv=!1),h.$v&&(V(f),h.$v=!1),h.Hj&&xa(g,b),f=ma.Pb(g,"OUTLINE_MASK"),l=0;l<d.length;l++)g=d[l],wa.vw(g),f&&S(g,f),sb.Ok(g);ya.show_hud_debug_info&& | |
Ia.aR(Oa,b)};a.YP=function(a){a.k.$v=!0};a.bv=function(a){var b=[];Ba.ia(a.k.xb,function(a,d){b.push(d)});return b};a.FB=function(){var a=fa(ac,"MAIN_BLEND"),b=ac;return a||b.k.jc?a.St:null};a.$B=function(a){return a.g.rd};a.CG=function(a){Ba.ia(a.k.xb,function(a,b){b.na=!0})};a.SQ=function(a,b){a.Xb=b!=X.op;for(var d=0;d<a.A.length;d++)a.A[d].I.wireframe_mode=b;a.Ua=b==X.pp;a.na=!0};a.RQ=function(a,b){for(var d=0;d<a.A.length;d++)a.A[d].I.wireframe_edge_color=b,a.na=!0};a.fS=function(a,b){var d= | |
b.Rk,c=a.k.xh;if(d&&"WIND"==d.type&&c){var e=Ha.v(b.g.i);Ma.hb(e,Ma.Db,c);Hb.normalize(c,c);Hb.scale(c,d.VF,c);d=ja(a,rc);for(e=0;e<d.length;e++)d[e].xh.set(c)}};a.wP=function(a,b,d){var c=fa(a,"COLOR_PICKING");if(c)return b=qa.Im(b,d,xc,c.j),wa.vw(c),sb.Ok(c),(a=fa(a,"COLOR_PICKING_XRAY"))?(wa.vw(a),sb.Ok(a),c=a.j):c=c.j,b[1]=c.height-b[1],sb.Cw(c.Le,b[0],b[1]);Sa.error("Object Selection is not available on the scene");return null};a.nF=function(a){var b=c();if(b=fa(b,"OUTLINE"))b.hh.set(a),b.na= | |
!0};a.hY=aa;a.yn=function(a){var b={title:"",description:""};a.b4w_tags&&(b.title=a.b4w_tags.title,b.description=a.b4w_tags.description);return b};a.wG=function(a,b){var d=kc;Hb.negate(b,d);for(var c=0;6>c;c++){var e=a.Zm[c],f=a.su[c],g=a.j;Ea.translate(Ma.tH[c],d,e);Ea.multiply(g.Ab,e,g.Gf);Ma.jq(g.Gf,f)}};a.AG=function(a,b,d){Ma.JR(b,d,Ma.Db,a.j.tc)};a.IJ=function(a,b,d){var c=a.k.Oc,e=a.k.hi;d=ia.vq(d,ya.Md&&a.b4w_enable_ssao);for(var f=0;f<b.length;f++){var g=b[f],h=ia.bb(g,a);if(e)if(null!=g.g.je){var l= | |
e.hg;l.length&&(g=g.g.je,h.hg=l[g])}else null!=g.g.Fe&&(l=e.Oh,l.length&&(g=g.g.Fe,h.Oh=l[g]))}for(f=0;f<d.length;f++)if(h=ia.bb(d[f],a),c)for(b=ja(a,["SHADOW_CAST"]),e=0;e<b.length;e++)f==b[e].zf&&h.ox.push(b[e])};a.ED=function(a,b){return a.timeline_markers[b]};a.Xr=function(a){var b=c();if(b=fa(b,"STEREO"))a.distortion_coefs&&(b.fj[0]=a.distortion_coefs[0],b.fj[1]=a.distortion_coefs[1],b.na=!0),a.chromatic_aberration_coefs&&(b.chromatic_aberration_coefs[0]=a.chromatic_aberration_coefs[0],b.chromatic_aberration_coefs[1]= | |
a.chromatic_aberration_coefs[1],b.chromatic_aberration_coefs[2]=a.chromatic_aberration_coefs[2],b.chromatic_aberration_coefs[3]=a.chromatic_aberration_coefs[3],b.na=!0),a.base_line_factor&&(b.fj[2]=a.base_line_factor,b.na=!0),a.inter_lens_factor&&(b.fj[3]=a.inter_lens_factor,b.na=!0),a.enable_hmd_stereo&&(b.enable_hmd_stereo=a.enable_hmd_stereo,b.na=!0)}};b4w.module.__compat=function(a,m){function h(a){return-1<navigator.userAgent.indexOf(a)?!0:!1}function c(){return navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/Windows Phone/i)}function e(){return!window.ActiveXObject&&"ActiveXObject"in window}var u=m("__config"),g=m("__extensions"),z=m("__print"); | |
m("__util");var t="R600;RV610;RV630;RV620;RV635;RV670;RS780;RS880;RV770;RV730;RV710;RV740;CEDAR;REDWOOD;JUNIPER;CYPRESS;PALM (Wrestler/Ontario);SUMO (Llano);SUMO2 (Llano);ARUBA (Trinity/Richland);BARTS;TURKS;CAICOS;CAYMAN".split(";"),p=u.Oi,f=u.u,v=u.context,k=u.Ml,n=u.M,A=u.p;a.ML=function(a){a.getError()==a.INVALID_ENUM&&z.warn("Possible Tegra invalid enum issue detected, ignoring")};a.wQ=function(a){f.ID=a.getParameter(a.MAX_VERTEX_UNIFORM_VECTORS);f.Lb=a.getParameter(a.MAX_TEXTURE_SIZE);f.$h= | |
a.getParameter(a.MAX_CUBE_MAP_TEXTURE_SIZE);f.gd=f.nd?Math.min(f.gd,a.getParameter(a.MAX_SAMPLES)):1;var m=Boolean(g.kN());h("Firefox/28.0")&&(h("Linux")||h("Macintosh"))&&(z.warn("Firefox 28 detected, applying depth hack"),m=!1);h("Windows Phone")||(h("iPad")||h("iPhone")?(z.warn("iOS detected, applying alpha hack, applying vertex animation mix normals hack, disable smaa. Disable ssao for performance. Disable video textures. Initialize WebAudio context with empty sound."),v.alpha||(f.background_color[3]= | |
1),f.OG=!0,f.smaa=!1,f.Md=!1,f.precision="highp",f.uv=!0,k.$m=256):h("Mac OS X")&&h("Safari")&&!h("Chrome")&&(z.warn("OS X / Safari detected, force to wait complete loading. Applying playback rate hack for video textures. Applying canvas alpha hack."),f.VE=!0,n.Jz=!0,n.kA=!0));h("Windows")&&(h("Chrome/40")||h("Firefox/33")||h("Firefox/34")||h("Firefox/35")||h("Firefox/36"))&&(z.warn("Windows/Chrome40 or Firefox33-36 detected. Applying clear procedural skydome hack."),f.$t=!0);h("Mac OS X")&&(f.fr= | |
!0,z.warn("OS X detected, applying shadows hack."));c()&&(z.warn("Mobile detected, applying various hacks for video textures."),f.ag=!0,h("iPad")||h("iPhone")||h("Windows Phone")||(z.warn("Mobile (not iOS) detected, disable playback rate for video textures."),n.ZA=!0));(h("Firefox/35.0")||h("Firefox/36.0"))&&h("Windows")&&(z.warn("Windows/Firefox 35/36 detected, applying shadows slink hack"),f.kB=!0);if(h("iPhone")||e()||h("Edge"))z.warn("iPhone, IE11 or Edge detected. Enable sequential video fallback for video textures."), | |
f.oo=!0;10>a.getParameter(a.MAX_VARYING_VECTORS)&&(z.warn("Not enough varyings, disable shadows on blend objects"),f.Fu=!0);h("Windows Phone")&&(z.warn("Windows Phone detected. Disable wireframe mode, glow materials, ssao, smaa, shadows, reflections, refractions."),f.wireframe_debug=!1,f.precision="highp",f.Tg=!1,f.Md=!1,f.smaa=!1,f.Pl=!1,f.co=!1,f.le=!1,f.yE=!1);h("Firefox")&&f.ag&&(z.warn("Mobile Firefox detected, disable workers."),A.Go=!1);var u=g.fC();if(u){var E=a.getParameter(u.UNMASKED_VENDOR_WEBGL), | |
u=a.getParameter(u.UNMASKED_RENDERER_WEBGL),B=/\b4\d{2}\b/;h("Macintosh")&&-1<u.indexOf("Intel HD Graphics 3000")&&(z.warn("OS X / Intel HD 3000 detected, applying depth hack"),m=!1);-1<E.indexOf("ARM")&&B.test(u)&&(z.warn("ARM Mali-400 series detected, applying depth and frames blending hacks"),m=!1,p.pB=!0);-1<E.indexOf("ARM")&&-1<u.indexOf("Mali-T604")&&(z.warn('ARM Mali-T604 detected, set "highp" precision and disable shadows.'),f.precision="highp",f.Pl=!1);-1<E.indexOf("ARM")&&-1<u.indexOf("Mali-T760")&& | |
(z.warn('ARM Mali-T760 detected, set "highp" precision and disable SSAO.'),f.precision="highp",f.Md=!1,f.pt=!0);-1<E.indexOf("Qualcomm")&&-1<u.indexOf("Adreno")&&(z.warn("Qualcomm Adreno detected, applying shader constants hack."),f.CF=!0,-1<u.indexOf("305")&&(z.warn('Qualcomm Adreno305 detected, set "highp" precision.'),f.precision="highp"),-1<u.indexOf("330")&&(z.warn('Qualcomm Adreno330 detected, set "highp" precision.'),f.precision="highp"),-1<u.indexOf("420")&&(z.warn("Qualcomm Adreno420 detected, setting max cubemap size to 4096, setting max texture size to 4096."), | |
f.Lb=4096,f.$h=4096));-1<E.indexOf("NVIDIA")&&-1<u.indexOf("Tegra 3")&&(z.warn("NVIDIA Tegra 3 detected, force low quality for B4W_LEVELS_OF_QUALITY nodes."),f.Tu=!0);h("Windows")&&h("Chrome")&&!h("Edge")&&(u.match(/NVIDIA GeForce 8..0/)||u.match(/NVIDIA GeForce 9..0/)||u.match(/NVIDIA GeForce( (G|GT|GTS|GTX))? 2../))&&(z.warn("Chrome / Windows / NVIDIA GeForce 8/9/200 series detected, setting max cubemap size to 256, use canvas for resizing."),f.$h=256,f.QE=!0);E="";for(B=0;B<t.length;B++)if(-1< | |
u.indexOf(t[B])){E=t[B];break}E&&(z.warn("Architecture "+E+" detected. Blending between frames and shadows on blend objects will be disabled."),f.pt=!0,f.Fu=!0)}0==a.getParameter(a.MAX_VERTEX_TEXTURE_IMAGE_UNITS)&&(z.warn("Vertex textures are not allowed. Disabling vertex textures"),f.tp=!1);m||(f.pn=!1,f.Sn=!1,f.Bc=!1,f.water_dynamic=!1,f.mi=!1,f.hs=!1,f.smaa=!1);f.GG=Boolean(g.hC());f.dq=m;if(a.getShaderPrecisionFormat)var y=a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.HIGH_FLOAT);a.getShaderPrecisionFormat&& | |
0!==y.precision||(f.precision="mediump");e()&&(z.warn("IE11 detected. Set sky cubemap texture size to 512 (power of two)."),k.$m=512);if(e()&&h("Touch")||h("Edge"))z.warn("IE11 and touchscreen or Edge detected. Behaviour of the mouse move sensor will be changed."),f.Hq=!0;128>=a.getParameter(a.MAX_FRAGMENT_UNIFORM_VECTORS)&&(z.warn("Not enough fragment uniforms, force low quality for B4W_LEVELS_OF_QUALITY nodes."),f.Tu=!0);h("Chrome")&&!h("Edge")&&(z.log("Chrome detected. Some of deprecated functions related to the Doppler effect won't be called."), | |
f.wA=!0);if(h("Chrome")&&!h("Edge")||h("Firefox"))f.Gu=!0;c()&&h("Firefox")&&(z.log("Mobile firefox detected. Applying autoplay media hack."),f.Wv=!0);h("Edge")&&(z.warn("Microsoft Edge detected, set up new minimal texture size."),f.jn=!0);h("SamsungBrowser")&&(z.warn("Default Android browser detected, setting max cubemap size to 1024, setting max texture size to 1024."),f.Lb=1024,f.$h=1024)};a.DK=h;a.YA=c;a.xJ=function(){h("Firefox/35.0")&&h("Windows")&&(z.warn("Windows/Firefox 35 detected, forcing context's alpha"), | |
u.context.alpha=!0)};a.Bv=e};b4w.module.__hud=function(a,m){function h(a){a.font="bold 15px Courier";a.textBaseline="middle";a.shadowBlur=0;a.shadowColor=null}function c(a){e(' SCENE "'+a.name+'"');if(a.k){var c=0,f=0,g=0;t.ia(a.k.xb,function(a,h){if("SINK"==h.type)e(" (F)",h.type);else{var k=h.type,m=Math.round(h.j.width)+"x"+Math.round(h.j.height),p=h.A.length,t=h.an;"MAIN_CUBE_REFLECT"==h.type&&(p*=6);var b=h.Xc&&h.Xb,d=b?h.Ph:0;e(b?" (A)":" (P)",k,h.pr,m,t,"of",p," ",d.toFixed(3));h.an=0;b&&(c+=p,f+=t,g+=d)}});return[c, | |
f,g]}e("No INFO")}function e(){for(var a=80+20*v[0],c=arguments[0],e=1;e<arguments.length;e++){for(var g="",h=0;h<p[e]-String(arguments[e]).length;h++)g+=" ";c+=g+arguments[e]}v[0]++;f.fillText(c,30,a)}function u(a,c,e){c*=a.Cb;e.x=a.x+c;e.y=a.y;e.Cb=a.Cb-2*c;e.qb=a.qb}function g(a){return a.x+a.Cb/2}function z(a){var c=f,e={x:0,y:0,Cb:0,qb:0},g=c.canvas.width,c=c.canvas.height;e.x=0;e.y=0;e.Cb=g;e.qb=c;u(e,.01,e);g=.02*e.qb;e.x=e.x;e.y+=g;e.Cb=e.Cb;e.qb-=2*g;g=e.Cb/8;e.x+=g*a;e.y=e.y;e.Cb=g;e.qb= | |
e.qb;u(e,.02,e);return e}var t=m("__graph");m("__print");var p=[5,19,3,10,4,3,5],f=null,v=[0,0];a.wd=function(a){a=a.getContext("2d");h(a);return f=a};a.zo=function(){f&&h(f)};a.reset=function(){var a=f;a&&(a.clearRect(0,0,a.canvas.width,a.canvas.height),a.fillStyle="rgba(0,0,0,0.5)",a.fillRect(0,0,a.canvas.width,a.canvas.height),v[0]=0,v[1]=0)};a.aR=function(a,g){var h=f;if(h){h.textAlign="left";h.fillStyle="rgba(0,255,0,255)";e(" FPS",(1/g).toFixed(2));v[0]++;for(var m=h=0,p=0,t=0;t<a.length;t++){var u= | |
c(a[t]),h=h+u[0],m=m+u[1],p=p+u[2];v[0]++}e(" -----------------------------------------------");e(" ","TOTAL ACTIVE","","",m,"of",h," ",p.toFixed(3))}};a.print=function(){var a=f;a&&(a.textAlign="left",a.fillStyle="rgba(0,255,0,255)",e.apply(Math,arguments))};a.BZ=function(a,c,e,h,m,p,t){var v=f;if(v){c=z(c);var y=c.qb/5;c.x=c.x;c.y+=4*y;c.Cb=c.Cb;c.qb=y;v.textAlign="center";v.fillStyle="#00FF00";f.fillText(a,g(c),c.y-10);v.strokeStyle="#00FF00";v.lineWidth=.5;v.beginPath();v.moveTo(c.x,c.y); | |
v.lineTo(c.x+c.Cb,c.y);v.lineTo(c.x+c.Cb,c.y+c.qb);v.lineTo(c.x,c.y+c.qb);v.closePath();v.stroke();if(!p&&!t)for(p=1E6,t=-1E6,a=0;a<e.length;a++)p=Math.min(p,e[a]),t=Math.max(t,e[a]);v.textAlign="right";f.fillText(String(p),c.x-10,c.y+c.qb);f.fillText(String(t),c.x-10,c.y);v.textAlign="center";f.fillText(String(h),c.x,c.y+c.qb+15);f.fillText(String(m),c.x+c.Cb,c.y+c.qb+15);v.strokeStyle="#FF0000";v.lineWidth=1.5;v.beginPath();h=c.Cb/(e.length-1);t=c.qb/(t-p);for(a=0;a<e.length;a++)m=c.x+h*a,y=c.y+ | |
c.qb-(e[a]-p)*t,0==a?v.moveTo(m,y):v.lineTo(m,y);v.stroke()}};a.kW=function(a,c,e,h,m,p,t){var v=f;if(v)for(v.textAlign="center",v.fillStyle="#00FF00",v.font="bold 12px Courier",e=z(e),f.fillText(c?"["+a+"]":a,g(e),e.y),0<=p&&f.fillText(p?"[M]":"[ ]",g(e)-15,e.y+30),0<=t&&f.fillText(t?"[S]":"[ ]",g(e)+15,e.y+30),a={x:0,y:0,Cb:0,qb:0},c=0;c<h.length;c++){p=h[c];var y="VOLUME"==p[0];if(y){t=e.y+350;var u=e.Cb,b=a;b.x=e.x;b.y=t;b.Cb=u;b.qb=250}else{t=e.y+10+50*c;var u=e.Cb,b=e.qb,d=a;d.x=e.x;d.y=t;d.Cb= | |
u;d.qb=b}t=v;var u=a,d=c==m,x=p[0],b=p[1],C=p[2],H=p[3],I=(H-C)/p[4],I=1>I?Math.floor(1/I-1E-5).toFixed(0).length:0;p=p[5]?Math.log(b/C)/Math.log(H/C):(b-C)/(H-C);t.textAlign="center";d?t.fillText("["+x+"]",g(u),u.y):t.fillText(x,g(u),u.y);t.strokeStyle="#00FF00";t.lineWidth=y?3:1;y?(t.textAlign="right",t.fillText(H.toFixed(I),g(u)-10,u.y+15),t.textAlign="right",t.fillText(C.toFixed(I),g(u)-10,u.y+u.qb-15)):(t.textAlign="right",t.fillText(C.toFixed(I),u.x+28,u.y+15),t.textAlign="left",t.fillText(H.toFixed(I), | |
u.x+u.Cb-28,u.y+15));t.beginPath();if(y){var O=u.y+15+(u.qb-30)*(1-p);t.moveTo(g(u),u.y+15);t.lineTo(g(u),u.y+u.qb-15);t.moveTo(g(u)-5,u.y+15);t.lineTo(g(u)+5,u.y+15);t.moveTo(g(u)-5,u.y+u.qb-15);t.lineTo(g(u)+5,u.y+u.qb-15);t.moveTo(g(u)-5,O);t.lineTo(g(u)+5,O)}else{var M=u.x+30+(u.Cb-60)*p;t.moveTo(u.x+30,u.y+15);t.lineTo(u.x+u.Cb-30,u.y+15);t.moveTo(u.x+30,u.y+15-5);t.lineTo(u.x+30,u.y+15+5);t.moveTo(u.x+u.Cb-30,u.y+15-5);t.lineTo(u.x+u.Cb-30,u.y+15+5);t.moveTo(M,u.y+15-5);t.lineTo(M,u.y+15+5)}t.stroke(); | |
"EQ_Q"==x?(p=Math.log(1+1/(2*b*b)+Math.sqrt((2+1/(b*b))*(2+1/(b*b))/4-1))/Math.log(2),y?(t.textAlign="left",t.fillText(b.toFixed(I),g(u)+10,O),t.textAlign="left",t.fillText("("+p.toFixed(I+1)+")",g(u)+10,O+10)):(t.textAlign="right",t.fillText(b.toFixed(I),M,u.y+30),t.textAlign="left",t.fillText("("+p.toFixed(I+1)+")",M,u.y+30))):y?(t.textAlign="left",t.fillText(b.toFixed(I),g(u)+10,O)):(t.textAlign="center",t.fillText(b.toFixed(I),M,u.y+30))}}};b4w.module.__nodemat=function(a,m){function h(a,b,e,f,l){var q=Fa.q(),q=g(b,l,q.uuid);if(q in Y)return Y[q];if("SHADOW"!=l&&"COLOR_ID"!=l){b=U.create();for(var r=a.nodes,m=0;m<r.length;m++)if(null==H(b,r[m],0,f,l))return Y[q]=null;if(e&&-1==x(a,b,"GROUP_OUTPUT","group"))return null;m=pa(b);r=e?a.links:a.links.slice();if(!W(b,r,m))return null;if(e)return b;for(m=0;m<r.length;m++){e=r[m];for(var w=n(e.from_node,b),C=n(e.to_node,b),y=0;y<w.length;y++)for(var u=0;u<C.length;u++){var I=w[y],M=C[u],B=U.Pa(b, | |
I),D=U.Pa(b,M);if(!ba(b,I,M,B,D,e))return Y[q]=null}}k(b);a="GLOW"==l?x(a,b,"B4W_GLOW_OUTPUT","material",!0):x(a,b,"OUTPUT","material",!1,!0);-1==a&&(b=t(),a=0);A(b);a=U.ts(b,a,U.So);c(a,f);p(a);K(a);d(a);v(a,f,l)}else f=h(a,b,e,f,"MAIN"),f=U.clone(f,function(a){var b=oa.Om(a);b.O=oa.Ma(a.O);b.Na=oa.Ma(a.Na);return b}),a=x(a,f,"OUTPUT","material",!1,!0),z(f,a),a=U.ts(f,a,U.So),p(a);return Y[q]=a}function c(a,b){var d=[];U.ia(a,function(a,b){"MATERIAL"!=b.type&&"MATERIAL_EXT"!=b.type||d.push({lP:a, | |
node:b})});for(var c=0;c<d.length;++c){var f=d[c].lP,g=d[c].node,h=U.vn(a);U.wk(a,h,g.data.VO);var l=U.vn(a);U.wk(a,l,g.data.WO);U.Uc(a,h,l,[4,2]);for(var k={5:["LIGHTING_APPLY",10],6:["LIGHTING_APPLY",6],7:["MATERIAL_END",3],8:["MATERIAL_END",4],9:["MATERIAL_END",5]},n=U.Jq(a,f),q=[],r=[],m=[],x={},p=0;p<n;p++){var w=U.$k(a,f,p);w in x||(x[w]=0);var C=U.Sg(a,w,f,x[w]++);q.push([w,f,C]);var t=k[C[1]];if(t)switch(t[0]){case "MATERIAL_END":r.push([w,l,[C[0],t[1]]]);break;case "LIGHTING_APPLY":m.push([w, | |
[C[0],t[1]]])}else r.push([w,h,C])}e(a,g.data.value,h,l,m,b);for(p=0;p<q.length;p++)U.Kr(a,q[p][0],q[p][1],q[p][2]);for(p=0;p<r.length;p++)U.Uc(a,r[p][0],r[p][1],r[p][2]);g=U.ci(a,f);h=[];k=[];n={};for(p=0;p<g;p++)q=U.Uh(a,f,p),q in n||(n[q]=0),C=U.Sg(a,f,q,n[q]++),h.push([f,q,C]),k.push([l,q,C]);for(p=0;p<h.length;p++)U.Kr(a,h[p][0],h[p][1],h[p][2]);for(p=0;p<k.length;p++)U.Uc(a,k[p][0],k[p][1],k[p][2]);U.jg(a,f)}}function e(a,b,d,c,e,f){var g={name:"LIGHTING_AMBIENT",type:"LIGHTING_AMBIENT"},h= | |
H(a,g,0,f,null),l=h;u(a,d,h,"E");u(a,d,h,"A");u(a,d,h,"D");h=Fa.q();h=ga.wb(h,"LAMP",ga.yc);if(!b.ve)for(var k,n,q=0;q<h.length;q++){var r=h[q].hc,g={name:"LIGHTING_LAMP",type:"LIGHTING_LAMP"};k=H(a,g,0,f,null);g={name:"LIGHTING_APPLY",type:"LIGHTING_APPLY"};n=H(a,g,0,f,null);u(a,l,n,"color");u(a,l,n,"specular");u(a,k,n,"ldir");u(a,d,n,"normal");u(a,d,n,"D");u(a,d,n,"S");u(a,k,n,"lcolorint");u(a,d,k,"shadow_factor");l="COOKTORR"==b.Vl?"SPECULAR_PHONG":"SPECULAR_"+b.Vl;g={name:l,type:l};g=H(a,g,0, | |
f,null);u(a,k,g,"ldir");u(a,k,g,"lfac");u(a,d,g,"normal");u(a,g,n,"sfactor");"SPECULAR_PHONG"!=l&&"SPECULAR_BLINN"!=l||u(a,k,g,"norm_fac");u(a,d,g,"sp_params");l="HEMI"==r.type?"DIFFUSE_LAMBERT":"DIFFUSE_"+b.en;g={name:l,type:l};g=H(a,g,0,f,null);u(a,k,g,"ldir");u(a,k,g,"lfac");u(a,d,g,"normal");u(a,k,g,"norm_fac");u(a,g,n,"lfactor");"DIFFUSE_LAMBERT"!=l&&u(a,d,g,"dif_params");for(k=0;k<e.length;k++)U.Uc(a,e[k][0],n,e[k][1]);l=n}u(a,l,c,"color");u(a,l,c,"specular")}function u(a,b,d,c){for(var e=U.Pa(a, | |
b),f=U.Pa(a,d),g,h=0;h<f.O.length;h++)if(c==f.O[h].identifier){g=h;break}for(var l,h=0;h<e.Na.length;h++)if(c==e.Na[h].identifier){l=h;break}void 0!=g&&void 0!=l&&U.Uc(a,b,d,[l,g])}function g(a,b,d){switch(b){case "GLOW":return a+d+"11";case "COLOR_ID":case "SHADOW":return a+d+"00";default:return a+d+"10"}}function z(a,b){U.Cf(a,function(d,c,e){var f=U.Pa(a,c);c==b&&"Color"==f.O[e[1]].identifier&&U.Kr(a,d,c,e)})}function t(){var a=U.create(),b={data:null,Wa:[],P:[],O:[{$a:new Float32Array([0,0,0]), | |
identifier:"Color",rc:!1,name:"Color"},{$a:1,identifier:"Alpha",rc:!1,name:"Alpha"}],Na:[],type:"OUTPUT",Ci:[]};U.wk(a,0,b);return a}function p(a){U.ia(a,function(b,d){for(var c=d.O,e=d.Na,g=0;g<c.length;g++)f(a,c[g],b,g,1);for(g=0;g<e.length;g++)f(a,e[g],b,g,0)})}function f(a,b,d,c,e){if(b.rc){var f=!0;U.Cf(a,function(a,b,g){if(!e&&a==d&&g[0]==c||e&&b==d&&g[1]==c)f=!1});f&&(b.rc=!1)}}function v(a,b,d){var c=[];U.Cf(a,function(e,f,g){var h=U.Pa(a,e),l=U.Pa(a,f),h=oa.pf(h.Na[g[0]].$a),l=oa.pf(l.O[g[1]].$a); | |
if(h!=l){var k,n={default_value:[0,0,0],identifier:"Vector",is_linked:!0,name:"Vector"},q={default_value:0,identifier:"Value",is_linked:!0,name:"Value"};h&&!l?k=C("vector_to_scalar","B4W_VECTOSCAL",[n],[q]):!h&&l&&(k=C("scalar_to_vector","B4W_SCALTOVEC",[q],[n]));H(a,k,0,b,d);c.push([e,f,a.L[a.L.length-2],g])}});for(var e=0;e<c.length;++e)U.Kr(a,c[e][0],c[e][1],c[e][3]),U.Uc(a,c[e][0],c[e][2],[c[e][3][0],0]),U.Uc(a,c[e][2],c[e][1],[0,c[e][3][1]])}function k(a){var b=[];U.ia(a,function(d,c){switch(c.type){case "B4W_TRANSLUCENCY":U.Cf(a, | |
function(a,e,f){a==d&&"Translucency"==c.Na[f[0]].name&&b.push(a,e,[f[0]+1,f[1]+1])})}});for(var d=0;d<b.length;d+=3)U.Uc(a,b[d],b[d+1],b[d+2])}function n(a,b){var d=[];U.ia(b,function(b,c){c.name==a.name&&d.push(b)});if(d.length)return d;throw"Node not found";}function A(a){var b=[];U.ia(a,function(a,d){"B4W_PARALLAX"!=d.type&&"REROUTE"!=d.type||b.push(a,d)});for(var d=0;d<b.length;d+=2){var c=b[d],e=b[d+1];if("B4W_PARALLAX"==e.type){var f=L(a,c);if(-1!=f){var g=U.$k(a,f,0);U.Wj(a,f,c,-1);-1!=g&& | |
U.Wj(a,g,f,-1);c=U.Pa(a,f);e.data=c.data;e.P[0]=c.P[0];U.jg(a,f)}e.O.splice(1,1)}else if("REROUTE"==e.type){for(var e=U.$k(a,c,0),h=U.ci(a,c),f=[],g=[],l=[],k=0;k<h;k++){var n=U.Uh(a,c,k),q=g.indexOf(n);-1!=q?l[q]+=1:(g.push(n),l.push(1),f.push(c,n))}if(-1!=e)for(h=U.Sg(a,e,c,0)[0],k=0;k<g.length;k++)for(n=0;n<l[k];n++)q=U.Sg(a,c,g[k],n)[1],U.Uc(a,e,g[k],[h,q]);for(k=0;k<f.length;k+=2)U.Wj(a,f[k],f[k+1],-1)}}}function L(a,b){for(var d=a.qa,c=0;c<d.length;c+=3)if(d[c+1]==b&&1==d[c+2][1])return d[c]; | |
return-1}function K(a){E(a);y(a);G(a)}function G(a){var d=[],c="",e="",f={};U.ia(a,function(a,b){if("GEOMETRY_UV"==b.type||"UVMAP"==b.type||"TEX_COORD_UV"==b.type){d.push(a,b);var g=b.data.value;c?c==g||e||(e=g,f[e]=0):(c=g,f[c]=0);f[g]++}});for(var g in f)if(2>f[g]){for(var h=0;h<d.length;h+=2)d[h+1].data.value==g&&d.splice(h,2);delete f[g];c==g&&(c=e,e="");e==g&&(e="")}if(!(3>d.length)){var h={default_value:[0,0,0],identifier:"UV_geom",is_linked:!1,name:"UV_geom"},l={default_value:[0,0,0],identifier:"UV_cycles", | |
is_linked:!1,name:"UV_cycles"};g=C("merged_uv","UV_MERGED",[],[h,l]);g.uv_layer=c;H(a,g,0,"",void 0);var k=a.L[a.L.length-2];g=a.L[a.L.length-1];if(e){l=C("merged_uv","UV_MERGED",[],[h,l]);l.uv_layer=e;H(a,l,0,"",void 0);var n=a.L[a.L.length-2],l=a.L[a.L.length-1]}else l=null;for(var q=-1,r=null,h=0;h<d.length;h+=2){var m=d[h],x=d[h+1];b(x,d[1])?(q=k,r=g):l&&(q=n,r=l);for(var p=[],w=U.ci(a,m),t={},y=0;y<w;y++){var v=U.Uh(a,m,y);v in t||(t[v]=0);var u=U.Sg(a,m,v,t[v]++);p.push(m,v,u);u=u.splice(0, | |
u.length);switch(x.type){case "GEOMETRY_UV":u[0]=0;r.Na[0].rc=!0;break;case "UVMAP":case "TEX_COORD_UV":u[0]=1,r.Na[1].rc=!0}U.Uc(a,q,v,u)}for(var y=0;y<p.length;y+=3)U.Wj(a,p[y],p[y+1],0);U.jg(a,m)}}}function E(a){var b=[];U.ia(a,function(a,d){"GEOMETRY_VC"!=d.type&&"GEOMETRY_NO"!=d.type&&"GEOMETRY_FB"!=d.type&&"GEOMETRY_VW"!=d.type&&"GEOMETRY_GL"!=d.type&&"GEOMETRY_LO"!=d.type&&"GEOMETRY_OR"!=d.type||b.push(a,d)});for(var d=[],c=0;c<b.length;c+=2){for(var e=b[c],f=b[c+1],g=!0,h=0;h<d.length;h++){var l= | |
d[h];if(Q(f,l.Xd)){g=[];h=U.ci(a,e);for(q=0;q<h;q++){var k=U.Uh(a,e,q),n=U.Sg(a,e,k,0);g.push(e,k,n);U.Uc(a,l.id,k,n)}for(var q=0;q<g.length;q+=3)U.Wj(a,g[q],g[q+1],0);U.jg(a,e);g=!1;break}}g&&(l={id:e,Xd:f},d.push(l))}}function B(a){for(var b={},d=0;d<a.L.length;d+=2)b[a.L[d]]=[];for(d=0;d<a.qa.length;d+=3){for(var c=a.qa[d],e=a.qa[d+1],f=b[e],g=c,h=0;h<=f.length;h++){if(h>=f.length||f[h]>g)f.splice(h,0,g);else if(f[h]!=g)continue;break}for(var e=b[e],c=b[c],g=f=0,h=e.length+c.length,l=[],k=0;k< | |
h;k++)f>e.length||e[f]>c[g]?l.push(c[g++]):l.push(e[f++])}return b}function y(a){var b=[];U.ia(a,function(a,d){"TEXTURE_COLOR"!=d.type&&"TEXTURE_NORMAL"!=d.type||b.push(a,d)});if(b.length){for(var d=B(a),c=[],e=0;e<b.length;e+=2){for(var f=b[e],g=b[e+1],h=!0,l=0;l<c.length;l++){var k=c[l];if(!(3<=k.rl.length||!Q(g,k.Xd)||-1<d[f].indexOf(k.id)||-1<d[k.id].indexOf(f))){for(var n=!1,q=0;q<k.rl.length;q++){var r=k.rl[q].id;if(-1<d[f].indexOf(r)||-1<d[r].indexOf(f)){n=!0;break}}if(!n){for(var l=[],r=U.Jq(a, | |
f),m={},q=0;q<r;q++)n=U.$k(a,f,q),n in m||(m[n]=0),h=U.Sg(a,n,f,m[n]++),l.push(n,f,h);for(var r=[],m=U.ci(a,f),x={},q=0;q<m;q++)n=U.Uh(a,f,q),n in x||(x[n]=0),h=U.Sg(a,f,n,x[n]++),r.push(f,n,h);h=l.concat(r);for(q=0;q<h.length;q+=3)U.Wj(a,h[q],h[q+1],0);U.jg(a,f);q={id:f,Xd:g,ZL:l,$L:r};k.rl.push(q);h=!1;break}}}h&&(k={id:f,Xd:g,rl:[]},c.push(k))}for(e=0;e<c.length;e++){k=c[e];d=k.rl.length;for(l=0;l<d;l++){g=k.rl[l];q=g.Xd;f=g.ZL;g=g.$L;k.Xd.O[l+1].rc=q.O[0].rc;k.Xd.O[l+1].$a=q.O[0].$a;k.Xd.Na[2* | |
(l+1)].rc=q.Na[0].rc;k.Xd.Na[2*(l+1)].$a=q.Na[0].$a;k.Xd.Na[2*(l+1)+1].rc=q.Na[1].rc;k.Xd.Na[2*(l+1)+1].$a=q.Na[1].$a;for(q=0;q<f.length;q+=3)n=f[q],h=f[q+2],h[1]+=l+1,U.Uc(a,n,k.id,h);for(q=0;q<g.length;q+=3)n=g[q+1],h=g[q+2],h[0]+=2*(l+1),U.Uc(a,k.id,n,h);k.Xd.Wa.push(["USE_uv"+(l+2),1])}U.jg(a,k.id);U.wk(a,k.id,k.Xd)}}}function Q(a,b){if(a.type!==b.type)return!1;switch(a.type){case "GEOMETRY_VC":return a.data.value==b.data.value;case "GEOMETRY_NO":case "GEOMETRY_FB":case "GEOMETRY_VW":case "GEOMETRY_GL":case "GEOMETRY_LO":case "GEOMETRY_OR":return!0; | |
case "TEXTURE_COLOR":case "TEXTURE_NORMAL":return a.data.value.uuid==b.data.value.uuid;default:return!1}}function b(a,b){var d=["GEOMETRY_UV","TEX_COORD_UV","UVMAP"];return-1!=d.indexOf(a.type)&&-1!=d.indexOf(b.type)?a.data.value==b.data.value:!1}function d(a){var b=[];U.ia(a,function(a,d){"GEOMETRY_VC"==d.type&&b.push(a,d)});for(var d=0;d<b.length;d+=2){for(var c=b[d],e=b[d+1],f=!1,g=[],h=[],l=[[],[],[]],k=U.ci(a,c),n=0;n<k;n++){var q=U.Uh(a,c,n);if("SEPRGB"!=U.Pa(a,q).type){f=!1;break}g.push(c, | |
q);for(var r={},m=U.ci(a,q),f=0;f<m;f++){var x=U.Uh(a,q,f);x in r||(r[x]=0);var p=U.Sg(a,q,x,r[x]++);g.push(q,x);l[p[0]].push(c,x,p)}h.push(q);f=!0}if(f){for(n=c=k=0;n<l.length;n++)l[n].length&&(k++,c|=1<<2-n);if(k){e.type+=k;e.Na=[];for(n=0;n<l.length;n++)if(l[n].length)for(e.Na.push({$a:0,identifier:"RGB"[n],rc:!0,name:"RGB"[n]}),f=0;f<l[n].length;f+=3)l[n][f+2][0]=oa.ko(c,n);for(n=0;n<g.length;n+=2)U.Wj(a,g[n],g[n+1],0);for(n=0;n<h.length;n++)U.jg(a,h[n]);for(n=0;n<l.length;n++)for(f=0;f<l[n].length;f+= | |
3)U.Uc(a,l[n][f],l[n][f+1],l[n][f+2])}}}}function x(a,b,d,c,e,f){a=a.nodes;for(var g=null,h=0;h<a.length;h++){var l=a[h];e?"GROUP"==l.type&&l.node_tree_name==d&&(g=l):l.type==d&&(g=l)}return g?n(g,b)[0]:(f||S.error('No "'+d+'" node in node '+c),-1)}function C(a,b,d,c){return{name:a,type:b,inputs:d,outputs:c}}function H(a,b,d,c,e){var f=b.name,g=b.type,h=[],k=[],n=[],m=[],x=null,p=[];switch(g){case "BSDF_ANISOTROPIC":case "BSDF_DIFFUSE":case "BSDF_GLOSSY":case "BSDF_GLASS":case "BSDF_HAIR":case "BSDF_TRANSPARENT":case "BSDF_TRANSLUCENT":case "BSDF_REFRACTION":case "BSDF_TOON":case "BSDF_VELVET":case "SUBSURFACE_SCATTERING":case "EMISSION":case "AMBIENT_OCCLUSION":case "VOLUME_ABSORPTION":case "VOLUME_SCATTER":case "BUMP":case "NORMAL_MAP":case "VECT_TRANSFORM":case "BLACKBODY":case "WAVELENGTH":case "SEPXYZ":case "COMBXYZ":case "LIGHT_FALLOFF":case "TEX_IMAGE":case "TEX_ENVIRONMENT":case "TEX_SKY":case "TEX_NOISE":case "TEX_WAVE":case "TEX_MUSGRAVE":case "TEX_GRADIENT":case "TEX_MAGIC":case "TEX_CHECKER":case "TEX_BRICK":case "WIREFRAME":case "LAYER_WEIGHT":case "TANGENT":case "LIGHT_PATH":case "ATTRIBUTE":case "HOLDOUT":case "HAIR_INFO":case "OBJECT_INFO":case "SCRIPT":case "NEW_GEOMETRY":k= | |
ca(b);n=Z(b);S.warn(g+" node is not fully supported.");break;case "BRIGHTCONTRAST":case "ADD_SHADER":case "MIX_SHADER":k=ca(b);n=Z(b);break;case "UVMAP":var C=b.uv_layer;C||(g="EMPTY_UV");if("EMPTY_UV"!=g){var x=F("param_"+g+"_a"),t=F("param_"+g+"_v");h.push(da(x));h.push(da(t));m.push(da(t));x={name:x,value:C}}n=Z(b);break;case "UV_MERGED":x=F("param_UV_MERGED_a");t=F("param_UV_MERGED_v");h.push(da(x));h.push(da(t));n.push(P(b,"UV_geom"));n.push(P(b,"UV_cycles"));m.push(da(t));x={name:x,value:b.uv_layer}; | |
break;case "CAMERA":k=[];n=Z(b);break;case "COMBRGB":case "COMBHSV":k=ca(b);n=Z(b);break;case "CURVE_RGB":case "CURVE_VEC":k=ca(b);n=Z(b);x={value:b};break;case "PARTICLE_INFO":k=ca(b);n=Z(b);for(t=0;t<b.outputs.length;t++){var y=b.outputs[t],v=y.identifier,u=da("v_param_PART_INFO_"+v.replace(" ",""));if(y.is_linked)switch(v){case "Size":p.push(["PART_INFO_SIZE",ea.K(1)]);break;case "Age":p.push(["PART_INFO_AGE",ea.K(1)]);break;case "Lifetime":p.push(["PART_INFO_LT",ea.K(1)]);break;case "Location":p.push(["PART_INFO_LOC", | |
ea.K(1)]);break;case "Index":x=C=da("a_param_PART_INFO_"+y.identifier.replace(" ",""));p.push(["PART_INFO_IND",ea.K(1)]);break;case "Velocity":p.push(["PART_INFO_VEL",ea.K(1)]);break;case "Angular Velocity":p.push(["PART_INFO_A_VEL",ea.K(1)])}"Age"!=v&&"Lifetime"!=v&&"Size"!=v&&(h.push(u),m.push(u))}C&&h.push(C);break;case "GEOMETRY":if(!l(b))return!0;g=q(b,d);if(!g)return S.error("Geometry output is not supported"),null;switch(g){case "GEOMETRY_UV":(C=b.uv_layer)||(g="EMPTY_UV");"EMPTY_UV"!=g&&(x= | |
F("param_GEOMETRY_UV_a"),t=F("param_GEOMETRY_UV_v"),h.push(da(x)),h.push(da(t)),m.push(da(t)),x={name:x,value:C});n.push(P(b,"UV"));break;case "GEOMETRY_VC":(C=b.color_layer)||(g="EMPTY_VC");"EMPTY_VC"!=g&&(x=F("param_GEOMETRY_VC_a"),t=F("param_GEOMETRY_VC_v"),h.push(da(x)),h.push(da(t)),m.push(da(t)),x={name:x,value:C});n.push(P(b,"Vertex Color"));break;case "GEOMETRY_NO":n.push(P(b,"Normal"));break;case "GEOMETRY_FB":n.push(P(b,"Front/Back"));break;case "GEOMETRY_VW":n.push(P(b,"View"));break;case "GEOMETRY_GL":n.push(P(b, | |
"Global"));break;case "GEOMETRY_LO":n.push(P(b,"Local"));break;case "GEOMETRY_OR":C=F("param_GEOMETRY_OR_v"),h.push(da(C)),n.push(P(b,"Orco")),m.push(da(C))}break;case "TEX_COORD":if(!l(b))return!0;g=D(b,d);if(!g)return S.error("Texture coordinate output is not supported"),null;switch(g){case "TEX_COORD_UV":(C=b.uv_layer)||(g="EMPTY_UV");"EMPTY_UV"!=g&&(x=F("param_TEX_COORD_UV_a"),t=F("param_TEX_COORD_UV_v"),h.push(da(x)),h.push(da(t)),m.push(da(t)),x={name:x,value:b.uv_layer});n.push(P(b,"UV")); | |
break;case "TEX_COORD_NO":n.push(P(b,"Normal"));break;case "TEX_COORD_GE":C=F("param_TEX_COORD_GE_v");h.push(da(C));n.push(P(b,"Generated"));m.push(da(C));break;case "TEX_COORD_OB":n.push(P(b,"Object"));S.warn('Output "Object" of node "Texture Coordinate" doesn\'t supported fully.');break;case "TEX_COORD_CA":n.push(P(b,"Camera"));break;case "TEX_COORD_WI":n.push(P(b,"Window"));S.warn('Output "Window" of node "Texture Coordinate" doesn\'t supported fully.');break;case "TEX_COORD_RE":n.push(P(b,"Reflection")), | |
S.warn('Output "Reflection" of node "Texture Coordinate" doesn\'t supported fully.')}break;case "GROUP":C=b.node_tree_name;switch(C){case "B4W_LINEAR_TO_SRGB":if(!I(b,[1],[1])){x=O(b,c,e);break}g="B4W_LINEAR_TO_SRGB";break;case "B4W_NORMAL_VIEW":case "B4W_VECTOR_VIEW":if(!I(b,[1],[1])){x=O(b,c,e);break}g="B4W_VECTOR_VIEW";break;case "B4W_SRGB_TO_LINEAR":if(!I(b,[1],[1])){x=O(b,c,e);break}g="B4W_SRGB_TO_LINEAR";break;case "B4W_REFLECT":if(!I(b,[1,1],[1])){x=O(b,c,e);break}g="B4W_REFLECT";break;case "B4W_REFRACTION":if(!I(b, | |
[1,0],[1])){x=O(b,c,e);break}g="B4W_REFRACTION";break;case "B4W_PARALLAX":if(!I(b,[1,1,0,0,0],[1])){x=O(b,c,e);break}g="B4W_PARALLAX";t=F("temp_texture");m.push(da(t));break;case "B4W_CLAMP":if(!I(b,[1],[1])){x=O(b,c,e);break}g="B4W_CLAMP";break;case "B4W_TRANSLUCENCY":if(!I(b,[0,0,0,0,0],[0])){x=O(b,c,e);break}g="B4W_TRANSLUCENCY";break;case "B4W_TIME":if(!I(b,[],[0])){x=O(b,c,e);break}g="B4W_TIME";break;case "B4W_SMOOTHSTEP":if(!I(b,[0,0,0],[0])){x=O(b,c,e);break}g="B4W_SMOOTHSTEP";break;case "B4W_GLOW_OUTPUT":g= | |
"B4W_GLOW_OUTPUT";break;default:x=O(b,c,e)}k=ca(b);n=Z(b);"B4W_TRANSLUCENCY"==C&&(C=R("TranslucencyParams","TranslucencyParams",[0,0,0,0]),C.rc=n[0].rc,n.push(C));break;case "LAMP":x=b.lamp;if(!x)return S.error("There is no lamp in node: "+b.name),null;n.push(P(b,"Color"));n.push(P(b,"Light Vector"));n.push(P(b,"Distance"));n.push(P(b,"Visibility Factor"));x.uuid in N?p.push(["LAMP_INDEX",String(N[x.uuid])]):(N[x.uuid]=Aa,p.push(["LAMP_INDEX",String(Aa++)]));x=N;break;case "LIGHTING_AMBIENT":k=[R("E", | |
"E",[0,0,0],!0),R("A","A",[0,0,0],!0),R("D","D",[0,0,0],!0)];n=[R("color","color",[0,0,0],!0),R("specular","specular",[0,0,0],!0)];break;case "LIGHTING_BEGIN":n=[R("E","E",[0,0,0],!0),R("A","A",[0,0,0],!0),R("D","D",[0,0,0],!0),R("S","S",[0,0,0],!0),R("normal","normal",[0,0,0],!0),R("dif_params","dif_params",[0,0],!0),R("sp_params","sp_params",[0,0],!0),R("shadow_factor","shadow_factor",0,!0),R("translucency_color","translucency_color",0,!0),R("translucency_params","translucency_params",[0,0,0,0], | |
!0)];break;case "LIGHTING_END":k=[R("color","color",[0,0,0],!0),R("specular","specular",[0,0,0],!0)];break;case "LIGHTING_LAMP":k=[R("shadow_factor","shadow_factor",0,!0)];n=[R("ldir","ldir",[0,0,0],!0),R("lfac","lfac",[0,0],!0),R("lcolorint","lcolorint",[0,0,0],!0),R("norm_fac","norm_fac",0,!0)];break;case "DIFFUSE_LAMBERT":k=[R("ldir","ldir",[0,0,0],!0),R("lfac","lfac",[0,0],!0),R("normal","normal",[0,0,0],!0),R("norm_fac","norm_fac",0,!0)];n=[R("lfactor","lfactor",0,!0)];break;case "DIFFUSE_FRESNEL":case "DIFFUSE_MINNAERT":case "DIFFUSE_OREN_NAYAR":case "DIFFUSE_TOON":k= | |
[R("ldir","ldir",[0,0,0],!0),R("lfac","lfac",[0,0],!0),R("normal","normal",[0,0,0],!0),R("norm_fac","norm_fac",0,!0),R("dif_params","dif_params",[0,0],!0)];n=[R("lfactor","lfactor",0,!0)];break;case "SPECULAR_BLINN":case "SPECULAR_PHONG":k=[R("ldir","ldir",[0,0,0],!0),R("lfac","lfac",[0,0],!0),R("normal","normal",[0,0,0],!0),R("norm_fac","norm_fac",0,!0),R("sp_params","sp_params",[0,0],!0)];n=[R("sfactor","sfactor",0,!0)];break;case "SPECULAR_TOON":case "SPECULAR_WARDISO":k=[R("ldir","ldir",[0,0, | |
0],!0),R("lfac","lfac",[0,0],!0),R("normal","normal",[0,0,0],!0),R("sp_params","sp_params",[0,0],!0)];n=[R("sfactor","sfactor",0,!0)];break;case "LIGHTING_APPLY":k=[R("color","color",[0,0,0,0],!0),R("specular","specular",[0,0,0],!0),R("lfactor","lfactor",0,!0),R("sfactor","sfactor",0,!0),R("ldir","ldir",[0,0,0],!0),R("normal","normal",[0,0,0],!0),R("translucency_params","translucency_params",[0,0,0,0],!0),R("D","D",[0,0,0],!0),R("S","S",[0,0,0],!0),R("lcolorint","lcolorint",[0,0,0],!0),R("translucency_color", | |
"translucency_color",0,!0)];n=[R("color","color",[0,0,0,0],!0),R("specular","specular",[0,0,0],!0)];break;case "NORMAL":k=ca(b);n=Z(b);C=P(b,"Normal");m.push(da(F("param_NORMAL_Normal"),C.$a,3));break;case "MAPPING":C=b.vector_type;g="MAPPING";k.push(w(b,"Vector"));n.push(P(b,"Vector"));var t=b.rotation,y=b.scale,v=b.translation,u=za.create(),A=oa.iM(t);"TEXTURE"==C&&(y[0]=y[0]||1,y[1]=y[1]||1,y[2]=y[2]||1);var z=new Float32Array([y[0],0,0,0,y[1],0,0,0,y[2]]);za.multiply(A,z,u);u=oa.UO(u,la.create()); | |
switch(C){case "POINT":u[12]=v[0];u[13]=v[1];u[14]=v[2];break;case "TEXTURE":u[12]=v[0];u[13]=v[1];u[14]=v[2];u=la.invert(u,u);break;case "NORMAL":la.invert(u,u),la.transpose(u,u)}switch(C){case "NORMAL":p.push(["MAPPING_IS_NORMAL",1]);case "TEXTURE":p.push(["MAPPING_TRS_MATRIX",ea.K(u,16)]);break;case "POINT":0!==xa.length(t)?p.push(["MAPPING_TRS_MATRIX",ea.K(u,16)]):(0!==xa.length(y)&&p.push(["MAPPING_SCALE",ea.K(y,3)]),0!==xa.length(v)&&p.push(["MAPPING_TRANSLATION",ea.K(v,3)]));break;case "VECTOR":0!== | |
xa.length(t)?p.push(["MAPPING_TRS_MATRIX",ea.K(u,16)]):0!==xa.length(y)&&p.push(["MAPPING_SCALE",ea.K(y,3)])}b.use_min&&p.push(["MAPPING_MIN_CLIP",ea.K(b.min,3)]);b.use_max&&p.push(["MAPPING_MAX_CLIP",ea.K(b.max,3)]);break;case "MATERIAL":case "MATERIAL_EXT":x=[];C=[];t=[];y=[R("E","E",[0,0,0],!0),R("A","A",[0,0,0],!0),R("D","D",[0,0,0],!0),R("S","S",[0,0,0],!0),R("normal","normal",[0,0,0],!0),R("dif_params","dif_params",[0,0],!0),R("sp_params","sp_params",[0,0],!0),R("shadow_factor","shadow_factor", | |
0,!0)];v=[R("color","color",[0,0,0],!0),R("specular","specular",[0,0,0],!0),R("normal","normal",[0,0,0],!0)];u=[P(b,"Color"),P(b,"Alpha"),P(b,"Normal")];A=[];z=w(b,"Color");z.$a.splice(3);t.push(z);k.push(z);z=w(b,"Spec");z.$a.splice(3);t.push(z);k.push(z);t.push(R("DiffuseIntensity","DiffuseIntensity",b.diffuse_intensity));k.push(z);var M=w(b,"Normal");M.$a.splice(3);t.push(M);k.push(M);"MATERIAL_EXT"==g?((z=w(b,"Emit"))||(z=R("Emit","Emit",0)),t.push(z),k.push(z),(z=w(b,"Translucency"))?(z.$a=0, | |
z.name="Translucency",z.identifier="Translucency"):z=R("Translucency","Translucency",0),k.push(z),(z=w(b,"Translucency"))?(z.$a=[0,0,0,0],z.name="TranslucencyParams",z.identifier="TranslucencyParams"):z=R("TranslucencyParams","TranslucencyParams",[0,0,0,0]),k.push(z),n=w(b,"Reflectivity"),z=w(b,"Ray Mirror"),n?(z=n,n="Reflectivity"):z?n="Ray Mirror":(z=n,n="Reflectivity"),z||(z=R(n,n,0)),k.push(z),v.push(z),(z=w(b,"SpecTra"))||(z=R("SpecTra","SpecTra",0)),k.push(z),v.push(z),(z=w(b,"Alpha"))||(z= | |
R("Alpha","Alpha",b.alpha)),k.push(z),v.push(z),u.push(P(b,"Diffuse")),u.push(P(b,"Spec")),x.push(["MATERIAL_EXT",1]),C.push(["MATERIAL_EXT",1])):(t.push(R("emit_intensity","emit_intensity",0)),v.push(R("reflect_factor","reflect_factor",0)),v.push(R("specular_alpha","specular_alpha",0)),v.push(R("alpha_in","alpha_in",0)),u.push(R("diffuse_out","diffuse_out",0)),u.push(R("spec_out","spec_out",0)),x.push(["MATERIAL_EXT",0]),C.push(["MATERIAL_EXT",0]));A.push(da(F("param_MATERIAL_alpha"),b.alpha));A.push(da(F("param_MATERIAL_spec_alpha"), | |
b.specular_alpha));n=u;M.rc&&x.push(["USE_MATERIAL_NORMAL",1]);b.use_diffuse&&(x.push(["USE_MATERIAL_DIFFUSE",1]),C.push(["USE_MATERIAL_DIFFUSE",1]));b.use_specular&&C.push(["USE_MATERIAL_SPECULAR",1]);var z=[],B=0;switch(b.specular_shader){case "COOKTORR":case "PHONG":M=b.specular_hardness;break;case "WARDISO":M=b.specular_slope;break;case "TOON":M=b.specular_toon_size;B=b.specular_toon_smooth;break;case "BLINN":M=b.specular_ior;B=b.specular_hardness;break;default:S.error("unsupported specular shader: "+ | |
b.specular_shader+' (material "'+b.material_name+'")'),M=b.specular_hardness}var E,J;switch(b.diffuse_shader){case "LAMBERT":J=E=0;break;case "OREN_NAYAR":E=b.roughness;J=0;break;case "FRESNEL":E=b.diffuse_fresnel;J=b.diffuse_fresnel_factor;break;case "MINNAERT":E=b.darkness;J=0;break;case "TOON":E=b.diffuse_toon_size;J=b.diffuse_toon_smooth;break;default:S.error("unsupported diffuse shader: "+b.diffuse_shader+' (material "'+b.material_name+'")'),J=E=0}z.push(da(F("param_MATERIAL_diffuse"),[E,J], | |
2));z.push(da(F("param_MATERIAL_spec"),[b.specular_intensity,M,B],3));x.push(["SHADELESS_MAT",b.use_shadeless?1:0]);M={name:b.name,value:{Vl:b.specular_shader,en:b.diffuse_shader,ve:b.use_shadeless}};x={name:b.name,value:{Vl:b.specular_shader,en:b.diffuse_shader,ve:b.use_shadeless},VO:{name:"material_begin",type:"MATERIAL_BEGIN",O:t,Na:y,P:z,data:M,Wa:x,Ci:[]},WO:{name:"material_end",type:"MATERIAL_END",O:v,Na:u,P:A,data:M,Wa:C,Ci:[]}};break;case "MATH":switch(b.operation){case "ADD":g="MATH_ADD"; | |
break;case "SUBTRACT":g="MATH_SUBTRACT";break;case "MULTIPLY":g="MATH_MULTIPLY";break;case "DIVIDE":g="MATH_DIVIDE";break;case "SINE":g="MATH_SINE";break;case "COSINE":g="MATH_COSINE";break;case "TANGENT":g="MATH_TANGENT";break;case "ARCSINE":g="MATH_ARCSINE";break;case "ARCCOSINE":g="MATH_ARCCOSINE";break;case "ARCTANGENT":g="MATH_ARCTANGENT";break;case "POWER":g="MATH_POWER";break;case "LOGARITHM":g="MATH_LOGARITHM";break;case "MINIMUM":g="MATH_MINIMUM";break;case "MAXIMUM":g="MATH_MAXIMUM";break; | |
case "ROUND":g="MATH_ROUND";break;case "LESS_THAN":g="MATH_LESS_THAN";break;case "GREATER_THAN":g="MATH_GREATER_THAN";break;case "MODULO":g="MATH_MODULO";break;case "ABSOLUTE":g="MATH_ABSOLUTE";break;default:return S.error("Unsupported MATH operation: "+b.operation),null}p.push(["MATH_USE_CLAMP",Number(b.use_clamp)]);k=ca(b);n=Z(b);break;case "MIX_RGB":switch(b.blend_type){case "MIX":g="MIX_RGB_MIX";break;case "ADD":g="MIX_RGB_ADD";break;case "MULTIPLY":g="MIX_RGB_MULTIPLY";break;case "SUBTRACT":g= | |
"MIX_RGB_SUBTRACT";break;case "SCREEN":g="MIX_RGB_SCREEN";break;case "DIVIDE":g="MIX_RGB_DIVIDE";break;case "DIFFERENCE":g="MIX_RGB_DIFFERENCE";break;case "DARKEN":g="MIX_RGB_DARKEN";break;case "LIGHTEN":g="MIX_RGB_LIGHTEN";break;case "OVERLAY":g="MIX_RGB_OVERLAY";break;case "DODGE":g="MIX_RGB_DODGE";break;case "BURN":g="MIX_RGB_BURN";break;case "HUE":g="MIX_RGB_HUE";break;case "SATURATION":g="MIX_RGB_SATURATION";break;case "VALUE":g="MIX_RGB_VALUE";break;case "COLOR":g="MIX_RGB_COLOR";break;case "SOFT_LIGHT":g= | |
"MIX_RGB_SOFT_LIGHT";break;case "LINEAR_LIGHT":g="MIX_RGB_LINEAR_LIGHT";break;default:return S.error("Unsupported MIX_RGB blend type: "+b.blend_type),null}p.push(["MIX_RGB_USE_CLAMP",Number(b.use_clamp)]);k=ca(b);n=Z(b);break;case "OUTPUT":k=ca(b);n=[];break;case "RGB":C=c+"%join%"+b.name;C={name:"-1",value:C};m.push(C);n.push(P(b,"Color"));break;case "SEPRGB":case "SEPHSV":k=ca(b);n=Z(b);break;case "TEXTURE":g=r(b);if("TEXTURE_EMPTY"==g)n.push(P(b,"Color")),n.push(P(b,"Normal")),n.push(P(b,"Value")); | |
else if("TEXTURE_ENVIRONMENT"==g)k.push(w(b,"Vector")),n.push(P(b,"Color")),n.push(P(b,"Value"));else{if("TEXTURE_NORMAL"==g&&"ENVIRONMENT_MAP"==b.texture.type)return S.error("Wrong output for ENVIRONMENT_MAP texture: "+b.name),null;for(x=0;4>x;++x)x?(z=R("Vector"+x,"Vector"+x,[0,0,0]),"TEXTURE_COLOR"==g&&(t=R("Color"+x,"Color"+x,[0,0,0]),y=R("Value"+x,"Value"+x,0)),"TEXTURE_NORMAL"==g&&(t=R("Normal"+x,"Normal"+x,[0,0,0]),y=R("Value"+x,"Value"+x,0))):(z=w(b,"Vector"),"TEXTURE_COLOR"==g&&(t=P(b,"Color"), | |
y=P(b,"Value")),"TEXTURE_NORMAL"==g&&(t=P(b,"Normal"),y=P(b,"Value"))),k.push(z),n.push(t),n.push(y)}t=F("param_TEXTURE_texture");m.push(da(t));x={name:t,value:b.texture};break;case "VALTORGB":k=ca(b);n=Z(b);x={value:b};C=b.color_ramp.interpolation;"CONSTANT"!=C&&"LINEAR"!=C&&S.warn("Color Ramp node is not fully supported.");break;case "VALUE":g="VALUE";C=c+"%join%"+b.name;C={name:"-1",value:C};m.push(C);n.push(P(b,"Value"));break;case "VECT_MATH":switch(b.operation){case "ADD":g="VECT_MATH_ADD"; | |
break;case "SUBTRACT":g="VECT_MATH_SUBTRACT";break;case "AVERAGE":g="VECT_MATH_AVERAGE";break;case "DOT_PRODUCT":g="VECT_MATH_DOT_PRODUCT";break;case "CROSS_PRODUCT":g="VECT_MATH_CROSS_PRODUCT";break;case "NORMALIZE":g="VECT_MATH_NORMALIZE";break;default:return S.error("Unsupported VECT_MATH operation: "+b.operation),null}k=ca(b);n=Z(b);break;default:k=ca(b),n=Z(b)}g={name:f,type:g,Ci:h,O:k,Na:n,P:m,data:x,Wa:p};f=U.vn(a);U.wk(a,U.vn(a),g);if(!(g="GEOMETRY"!=b.type&&"TEX_COORD"!=b.type)){a:{g=b.outputs; | |
for(k=h=0;k<g.length;k++)if(g[k].is_linked&&h++>d){g=!0;break a}g=!1}g=!g}return g||null!=H(a,b,++d,c,e)?f:null}function I(a,b,d){for(var c=a.inputs,e=a.outputs,f=a.node_tree_name,g=0;g<b.length;g++){var h=c[g],l=b[g];if(!h||h.default_value instanceof Array!=l)return S.warn('Wrong inputs for custom node group "'+a.name+'" of type: "',f,'".Processing as general node group.'),!1}for(g=0;g<d.length;g++)if(b=e[g],c=d[g],!b||b.default_value instanceof Array!=c)return S.warn('Wrong outputs for custom node group "'+ | |
a.name+'" of type: "',f,'".Processing as general node group.'),!1;return!0}function O(a,b,d){var c=a.node_group.node_tree,e={},f;for(f in c)if("links"==f||"nodes"==f){e[f]=[];for(var g=0;g<c[f].length;g++){e[f][g]={};for(var l in c[f][g])if("links"==f){e[f][g][l]={};for(var k in c[f][g][l])e[f][g][l][k]=M(c[f][g][l][k])}else e[f][g][l]=M(c[f][g][l])}}else e[f]=M(c[f]);c=a.node_tree_name;if("B4W_REPLACE"==c||"B4W_LEVELS_OF_QUALITY"==c)f=C("Group input","GROUP_INPUT",[],a.inputs),g=C("Group output", | |
"GROUP_OUTPUT",a.outputs,[]),l=null,l="B4W_REPLACE"==c||"B4W_LEVELS_OF_QUALITY"==c&&(qa.quality==fa.Lf||qa.Tu)?{from_node:f,from_socket:f.outputs[1],to_node:g,to_socket:g.inputs[0]}:{from_node:f,from_socket:f.outputs[0],to_node:g,to_socket:g.inputs[0]},e.nodes=[f,g],e.links=[l];c=a.name;f=e.nodes;g=e.links;for(l=0;l<f.length;l++)f[l].name=J(f[l].type,c,f[l].name);for(l=0;l<g.length;l++)g[l].from_node.name=J(g[l].from_node.type,c,g[l].from_node.name),g[l].to_node.name=J(g[l].to_node.type,c,g[l].to_node.name); | |
return{jP:h(e,a.node_group.uuid,!0,b,d),kP:e.links}}function M(a){var b=typeof a;return"string"!=b&&"number"!=b&&"boolean"!=b&&a?oa.Om(a):a}function F(a){aa[a]||(aa[a]=0);var b=a+"_"+aa[a],b=b.replace(/ /g,"_").replace(/\//g,"_");aa[a]++;return b}function l(a){a=a.outputs;for(var b=0;b<a.length;b++)if(a[b].is_linked)return!0;return!1}function q(a,b){for(var d=a.outputs,c=0,e=0;e<d.length;e++){var f=d[e];if(f.is_linked&&!(c++<b))switch(f.identifier){case "UV":return"GEOMETRY_UV";case "Vertex Color":return"GEOMETRY_VC"; | |
case "Normal":return"GEOMETRY_NO";case "Front/Back":return"GEOMETRY_FB";case "View":return"GEOMETRY_VW";case "Global":return"GEOMETRY_GL";case "Local":return"GEOMETRY_LO";case "Orco":return"GEOMETRY_OR";default:return null}}}function D(a,b){for(var d=a.outputs,c=0,e=0;e<d.length;e++){var f=d[e];if(f.is_linked&&!(c++<b))switch(f.identifier){case "Camera":return"TEX_COORD_CA";case "Generated":return"TEX_COORD_GE";case "Normal":return"TEX_COORD_NO";case "Object":return"TEX_COORD_OB";case "Reflection":return"TEX_COORD_RE"; | |
case "UV":return"TEX_COORD_UV";case "Window":return"TEX_COORD_WI";default:return null}}}function r(a){if(!a.texture)return"TEXTURE_EMPTY";for(var b=a.outputs,d=!1,c=!1,e=!1,f=0;f<b.length;f++){var g=b[f];if(g.is_linked)switch(g.identifier){case "Color":d=!0;break;case "Normal":c=!0;break;case "Value":e=!0;break;default:throw"Unknown texture output";}}if(d)return c&&S.warn('Node "'+a.name+'" has both Color and Normal outputs. Normal will be omitted'),"ENVIRONMENT_MAP"==a.texture.type?"TEXTURE_ENVIRONMENT": | |
"TEXTURE_COLOR";if(c)return"TEXTURE_NORMAL";if(e)return"ENVIRONMENT_MAP"==a.texture.type?"TEXTURE_ENVIRONMENT":"TEXTURE_COLOR"}function w(a,b){for(var d=a.inputs,c=0;c<d.length;c++){var e=d[c];if(e.identifier==b)return V(e)}return null}function P(a,b){for(var d=a.outputs,c=0;c<d.length;c++){var e=d[c];if(e.identifier==b)return V(e)}return null}function V(a){var b=a.name,d=a.identifier,c=a.is_linked;a=a.default_value;a=oa.pf(a)?a.slice(0):a;return{name:b,identifier:d,rc:c,$a:a}}function R(a,b,d,c){return{name:a, | |
identifier:b,rc:c||!1,$a:d}}function ca(a){for(var b=[],d=0;d<a.inputs.length;d++){var c=V(a.inputs[d]);c.$a.length&&c.$a.splice(3);b.push(c)}return b}function Z(a){for(var b=[],d=0;d<a.outputs.length;d++){var c=V(a.outputs[d]);b.push(c)}return b}function da(a,b,d){b=null===b||void 0===b?null:ea.K(b,d);return{name:a,value:b}}function ba(a,b,d,c,e,f){var g=[],h=f.from_socket.identifier;f=f.to_socket.identifier;var l=c.Na;for(c=0;c<l.length;c++)if(l[c].identifier==h){g.push(c);break}e=e.O;for(c=0;c< | |
e.length;c++)if(e[c].identifier==f){g.push(c);break}2==g.length&&U.Uc(a,b,d,g);return!0}function J(a,b,d){return"GROUP_INPUT"==a?b+"*GI*"+d:"GROUP_OUTPUT"==a?b+"*GO*"+d:b+"%join%"+d}function pa(a){var b=[];U.ia(a,function(a,d){"GROUP"==d.type&&b.push(d)});return b}function W(a,b,d){for(var c=0;c<d.length;c++){var e=d[c].data.jP,f=d[c].data.kP;if(!e)return!1;U.ia(e,function(b,d){U.wk(a,U.vn(a),d)});for(e=0;e<f.length;e++)b.push(f[e]);ja(d[c],b,a)}return!0}function na(a,b,d,c,e,f){switch(a.type){case "GROUP":a.name== | |
b&&c.push(d);break;case "GROUP_INPUT":a.name.indexOf(b+"*GI*")||e.push(d);break;case "GROUP_OUTPUT":a.name.indexOf(b+"*GO*")||f.push(d)}}function ka(a,b,d){for(var c=[],e=0;e<d.length;e++){for(var f=d[e],g=null,h=0;h<b.length;h++)if(f.from_socket.identifier==b[h].to_socket.identifier){g=b[h];break}g?(f.from_node=g.from_node,f.from_socket=g.from_socket):c.push(f)}for(e=0;e<b.length;e++)a.splice(a.indexOf(b[e]),1);return c}function ha(a,b){if(b.length)for(var d=b[0].from_node.name,c=0;c<a.length;c++)a[c].from_node.name== | |
d&&b.push(a[c])}function ra(a,b,d,c){for(var e=0;e<c.length;e++){for(var f=c[e],g,h=0;h<d.O.length;h++)if(f.from_socket.identifier==d.O[h].identifier){g=d.O[h].$a;break}for(var h=f,l=b,k=g,q=n(h.to_node,l),r=0;r<q.length;r++)for(var m=U.Pa(l,q[r]),x=0;x<m.O.length;x++){var p=m.O[x];if(p.identifier==h.to_socket.identifier){m=p.$a instanceof Object?0:1;if((k instanceof Object?0:1)==m)p.$a=k;else switch(m){case 0:p=p.$a;p[0]=p[1]=p[2]=k;break;case 1:p.$a=(k[0]+k[1]+k[2])/3}break}}f=a.indexOf(f);-1!= | |
f&&a.splice(f,1)}}function ja(a,b,d){for(var c=a.name,e=[],f=[],g=[],h=[],l=0;l<b.length;l++){var k=b[l];na(k.from_node,c,k,e,g,h);na(k.to_node,c,k,f,g,h)}f=ka(b,f,g);e=ka(b,h,e);ha(b,f);ra(b,d,a,f);if(e.length){var n;U.ia(d,function(a,b){"GROUP_OUTPUT"!=b.type||b.name.indexOf(c+"*GO*")||(n=b)});ra(b,d,n,e)}}var fa=m("__config"),U=m("__graph"),za=m("__mat3"),la=m("__mat4"),ga=m("__objects"),S=m("__print"),ea=m("__shaders"),Fa=m("__scenes"),oa=m("__util"),xa=m("__vec3"),aa={},Y={},sa={},N={},Aa=0; | |
new Float32Array(4);var qa=fa.u;a.LK=h;a.nu=function(a,b,d){var c=Fa.q();a=g(a,"MAIN",c.uuid);if(a in sa)return sa[a];var c=U.create(),f={name:"LIGHTING_BEGIN",type:"LIGHTING_BEGIN"},h=H(c,f,0,b,null),f={name:"LIGHTING_END",type:"LIGHTING_END"},f=H(c,f,0,b,null);e(c,d,h,f,[[h,[8,10]],[h,[9,6]]],b);p(c);return sa[a]=c};a.Qp=function(a){var b=[],d={};aa={};var c=U.Qx(a);U.ia(c,function(a,c){var e;e=[];for(var f=[],g=[],h=[],l=[],k=[],n=0;n<c.O.length;n++){var q=c.O[n];if(q.rc)e.push(null),f.push(null); | |
else{e.push(F("in_"+c.type+"_"+q.identifier));var r=ea.K(q.$a,0);qa.CF&&(0<=c.type.indexOf("MIX_RGB_")&&("Color1"==q.identifier||"Color2"==q.identifier||"Fac"==q.identifier)||0<=c.type.indexOf("MATH_")&&("Value"==q.identifier||"Value_001"==q.identifier)||0<=c.type.indexOf("VECT_MATH_")&&"Vector_001"==q.identifier||0<=c.type.indexOf("LIGHTING_APPLY")||0<=c.type.indexOf("MATERIAL_END")||0<=c.type.indexOf("MATERIAL_BEGIN"))&&(q=r,q=q.replace(/(,)/g,"$1 "),q=q.replace(/(^|[^0-9]|\s)(0\.0)($|[^0-9]|\s)/g, | |
"$1ZERO_VALUE_NODES$3"),q=q.replace(/(^|[^0-9]|\s)(1\.0)($|[^0-9]|\s)/g,"$1UNITY_VALUE_NODES$3"),r=q=q.replace(/\s+/g,""));f.push(r)}}for(n=0;n<c.Na.length;n++)q=c.Na[n],q.rc?g.push(null):g.push(F("out_"+c.type+"_"+q.identifier));for(n=0;n<c.P.length;n++)q=c.P[n],h.push(q.name),l.push(q.value);for(n=0;n<c.Ci.length;n++)k.push(c.Ci[n].name);e={id:c.type,O:e,wv:f,Na:g,P:h,vr:l,Ci:k,Wa:JSON.parse(JSON.stringify(c.Wa))};b.push(e);d[a]=e});U.Cf(c,function(a,b,e){var f=U.Pa(c,a);U.Pa(c,b);var g=f.Na[e[0]]; | |
a=d[a].Na;b=d[b].O;f=a[e[0]]||F("out_"+f.type+"_"+g.identifier);a[e[0]]=f;b[e[1]]=f});return b};a.gA=function(a){if(a.node_tree)for(var b=0;b<a.node_tree.nodes.length;b++){var d=a.node_tree.nodes[b];if("GROUP"==d.type&&"B4W_GLOW_OUTPUT"==d.node_tree_name)return!0}return!1};a.fa=function(){for(var a in Y)delete Y[a];for(a in sa)delete sa[a];for(var b in N)delete N[b];Aa=0}};b4w.module.__shaders=function(a,m){function h(a,b,d){var e=a.Qh;"string"==typeof d&&(a=c(a,d))&&(d=a[1]);for(a=0;a<e.length;a++)if(e[a][0]==b){e[a][1]=d;return}e.push([b,d])}function c(a,b){for(var d=a.Qh,c=0;c<d.length;c++)if(d[c][0]==b)return d[c];return!1}function e(a,b){var d=a+b;if(B[d])return B[d];if(y){var c=y[b];if(!c)return null;c=m("__gpp_parser").vZ.parse(c)}else if(c=m("shader_texts")[b],!c)return null;return B[d]=c}function u(a,b,d){function c(b){b=b.b;for(var d=0;d<b.length;d++){var r= | |
b[d];switch(r.type){case "condition":a:for(var r=r.b,t=0;t<r.length;t++){var H=r[t];switch(H.type){case "if":case "elif":if(f(H.d)){c(H.group);break a}break;case "else":c(H.group);break a;case "ifdef":H.name in n&&c(H.group);break;case "ifndef":H.name in n||c(H.group)}}break;case "include":r=e(G.shaders_dir,G.ZQ+r.file);c(r);break;case "var":case "export":case "import":break;case "define":t=r.name;n[t]=r.a;r.P&&(m[t]=r.P);break;case "error":throw"Shader error: #error "+r.a.join(" ");case "line":break; | |
case "pragma":k.push("#pragma "+r.name+" "+r.a.join(" "));break;case "undef":r=r.name;delete n[r];delete m[r];break;case "warning":L.warn("Shader warning: #warning "+r.a.join(" "));break;case "extension":r=g(r.a,n,m,!1);k.push("#extension "+r.join(" "));break;case "#":break;case "node":x[r.name]=r;break;case "nodes_global":r=l;for(t=0;t<r.length;t++){var H=r[t],A=x[H.id];if(A)for(var I=0,B=0;B<A.h.length;B++){var E=A.h[B];if("node_param"==E.type){var Q;if("PARTICLE_INFO"==H.id&&E.c)if(1==n.PARTICLE_BATCH)switch(Q= | |
!1,I){case 0:Q=v(H.Wa,"PART_INFO_IND")||v(H.Wa,"PART_INFO_AGE")||v(H.Wa,"PART_INFO_LT")||v(H.Wa,"PART_INFO_SIZE");break;case 1:Q=v(H.Wa,"PART_INFO_LOC");break;case 2:Q=v(H.Wa,"PART_INFO_VEL");break;case 3:Q=v(H.Wa,"PART_INFO_A_VEL");break;case 4:Q=v(H.Wa,"PART_INFO_IND")}else Q=!1;else Q=!0;Q&&(E=E.qualifier.join(" ")+" ","vert"==a?E+=H.Ci[I]:"frag"==a&&(E+=H.P[I],null!==H.vr[I]&&(E+=" = "+H.vr[I])),E+=";",k.push(E));I++}}}break;case "nodes_main":r=l;for(t=0;t<r.length;t++)if(H=r[t],A=x[H.id]){I= | |
{};B={};for(E=0;E<H.Wa.length;E++)B[H.Wa[E][0]]=[H.Wa[E][1]];z=u=y=0;E=H;Q=A.h;for(var K=I,R=B,la=0;la<Q.length;la++){var ga=Q[la];switch(ga.type){case "node_in":var S=E.O[y];if(null!==E.wv[y]){if(("MATERIAL_BEGIN"==E.id&&3===y||!R.MATERIAL_EXT&&("MATERIAL_BEGIN"==E.id&&4===y||"MATERIAL_END"==E.id&&3===y||"MATERIAL_END"==E.id&&4===y||"MATERIAL_END"==E.id&&5===y)||"TEXTURE_COLOR"==E.id||"TEXTURE_NORMAL"==E.id)&&ga.c){K[ga.name]=E.wv[y];y++;continue}var ea=ga.qualifier.join(" ")+" ",ea=ea+S,ea=ea+(" = "+ | |
E.wv[y]),ea=ea+";";k.push(ea)}K[ga.name]=S;y++;break;case "node_out":S=E.Na[u];if(!ga.c||-1<p.indexOf(S))ea=ga.qualifier.join(" ")+" ",ea+=S,ea+=";",k.push(ea),K[ga.name]=S;-1<p.indexOf(S)&&(R["USE_OUT_"+ga.name]=[1]);u++;break;case "node_param":"vert"==a?S=E.Ci[z]:"frag"==a&&(S=E.P[z]),K[ga.name]=S,z++}}k.push("{");h(H,A.f,I,B);k.push("}")}break;case "textline":r=g(r.a,n,m,!1);k.push(r.join(" "));break;default:throw"Unknown element type: "+r.type;}}}function f(a,b){var d;d=g(a,n,m,!0,b);for(var c= | |
[],e=0;e<d.length;e++)if(d[e]instanceof Object)switch(d[e].type){case "conditional_expr":var h=c.pop(),l=c.pop();c.pop()?c.push(l):c.push(h);break;case "logical_or_expr":h=c.pop();for(l=0;l<d[e].e-1;l++)k=c.pop(),h=h||k;c.push(h);break;case "logical_and_expr":h=c.pop();for(l=0;l<d[e].e-1;l++)k=c.pop(),h=h&&k;c.push(h);break;case "logical_bitor_expr":h=c.pop();for(l=0;l<d[e].e-1;l++)h|=c.pop();c.push(h);break;case "logical_bitxor_expr":h=c.pop();for(l=0;l<d[e].e-1;l++)h^=c.pop();c.push(h);break;case "logical_bitand_expr":h= | |
c.pop();for(l=0;l<d[e].e-1;l++)h&=c.pop();c.push(h);break;case "equal_expr":h=c.pop();l=c.pop();c.push(l==h);break;case "non_equal_expr":h=c.pop();l=c.pop();c.push(l!=h);break;case "le_expr":h=c.pop();l=c.pop();c.push(l<=h);break;case "ge_expr":h=c.pop();l=c.pop();c.push(l>=h);break;case "l_expr":h=c.pop();l=c.pop();c.push(l<h);break;case "g_expr":h=c.pop();l=c.pop();c.push(l>h);break;case "left_shift_expr":l=c.pop();h=c.pop();c.push(l<<h);break;case "right_shift_expr":l=c.pop();h=c.pop();c.push(l>> | |
h);break;case "add_expr":l=c.pop();h=c.pop();c.push(l+h);break;case "sub_expr":l=c.pop();h=c.pop();c.push(l-h);break;case "mul_expr":l=c.pop();h=c.pop();c.push(l*h);break;case "div_expr":l=c.pop();h=c.pop();c.push(l/h);break;case "mod_expr":l=c.pop();h=c.pop();c.push(l%h);break;case "pre_inc_expr":case "post_inc_expr":k=c.pop();c.push(++k);break;case "pre_dec_expr":case "post_dec_expr":k=c.pop();c.push(--k);break;case "positive_expr":k=c.pop();c.push(+k);break;case "negative_expr":k=c.pop();c.push(-k); | |
break;case "one_compl_expr":k=c.pop();c.push(~k);break;case "logic_negative_expr":k=c.pop();c.push(!k);break;default:K.ha("Unknown operation type: "+d[e].type)}else{var k=d[e];/^[a-zA-Z_$][a-zA-Z_$0-9]*$/.test(k)?c.push(0):c.push(parseFloat(d[e]))}1==c.length?d=c[0]:(K.ha("Incorrect expression: "+d.join(" ")),d=void 0);return d}function h(a,b,d,c){for(var e=0;e<b.length;e++){var l=b[e];switch(l.type){case "node_condition":a:for(var r=a,l=l.b,x=d,p=c,t=0;t<l.length;t++){var C=l[t];switch(C.type){case "node_if":case "node_elif":if(f(C.d, | |
p)){h(r,C.f,x,p);break a}break;case "node_else":h(r,C.f,x,p);break a;case "node_ifdef":(C.name in n||C.name in p)&&h(r,C.f,x,p);break;case "node_ifndef":C.name in n||C.name in p||h(r,C.f,x,p)}}break;case "textline":r=[];for(x=0;x<l.a.length;x++)p=l.a[x],p in d?r.push(d[p]):r.push(p);r=g(r,n,m,!0,c);k.push(r.join(" "))}}}var l=d.Jj;d=d.Qh||[];for(var k=[],n={},r=0;r<d.length;r++)n[d[r][0]]=[d[r][1]];for(r=0;r<l.length;r++)n["USE_NODE_"+l[r].id]=[1];var m={},x={},p=[];for(r in l)for(var t in l[r].O)p.push(l[r].O[t]); | |
c(b);var y=0,u=0,z=0;return k.join("\n")}function g(a,b,d,c,e){var f=[];z(a,b,d,c,f,e);return f}function z(a,b,d,c,e,f){for(var g=0;g<a.length;g++){var h=a[g];h in b||f&&h in f?(h=f&&f[h]||b[h],0==h.length&&c?e.push(0):z(h,b,d,c,e,f)):e.push(h)}}function t(a,b,d,c){c=a.createShader(c);a.shaderSource(c,d);a.compileShader(c);A.yK(c,b,d);return c}function p(a,b){!b&&a.length?b=a.length:b||(b=1);switch(b){case 1:return f(a);case 2:return"vec2("+f(a[0])+","+f(a[1])+")";case 3:return"vec3("+f(a[0])+","+ | |
f(a[1])+","+f(a[2])+")";case 4:return"vec4("+f(a[0])+","+f(a[1])+","+f(a[2])+","+f(a[3])+")";case 9:return"mat3("+f(a[0])+","+f(a[1])+","+f(a[2])+","+f(a[3])+","+f(a[4])+","+f(a[5])+","+f(a[6])+","+f(a[7])+","+f(a[8])+")";case 16:return"mat4("+f(a[0])+","+f(a[1])+","+f(a[2])+","+f(a[3])+","+f(a[4])+","+f(a[5])+","+f(a[6])+","+f(a[7])+","+f(a[8])+","+f(a[9])+","+f(a[10])+","+f(a[11])+","+f(a[12])+","+f(a[13])+","+f(a[14])+","+f(a[15])+")";default:throw"Wrong glsl value dimension";}}function f(a){return a% | |
1?String(a):String(a)+".0"}function v(a,b){for(var d=0;d<a.length;d++)if(a[d][0]==b)return!0;return!1}var k=m("__assets"),n=m("__config"),A=m("__debug"),L=m("__print"),K=m("__util"),G=n.hd,E={},B={},y=null,Q="anchors.glslf anchors.glslv color_id.glslf color_id.glslv shadow.glslf shadow.glslv grass_map.glslf grass_map.glslv halo.glslf halo.glslv line.glslf line.glslv main.glslf main.glslv main_stack.glslf particle_system.glslf particle_system_stack.glslf particle_system.glslv procedural_skydome.glslf procedural_skydome.glslv special_lens_flares.glslf special_lens_flares.glslv special_skydome.glslf special_skydome.glslv special_water.glslf special_water.glslv wireframe.glslf wireframe.glslv postprocessing/antialiasing.glslf postprocessing/bloom_combine.glslf postprocessing/compositing.glslf postprocessing/depth_pack.glslf postprocessing/dof.glslf postprocessing/glow.glslf postprocessing/bloom_blur.glslf postprocessing/god_rays.glslf postprocessing/god_rays.glslv postprocessing/god_rays_combine.glslf postprocessing/luminance.glslf postprocessing/luminance_av.glslf postprocessing/luminance_trunced.glslf postprocessing/luminance_trunced.glslv postprocessing/motion_blur.glslf postprocessing/outline.glslf postprocessing/performance.glslf postprocessing/postprocessing.glslf postprocessing/postprocessing.glslv postprocessing/smaa.glslf postprocessing/smaa.glslv postprocessing/ssao.glslf postprocessing/ssao_blur.glslf postprocessing/stereo.glslf include/blending.glslf include/caustics.glslf include/color_util.glslf include/depth_fetch.glslf include/dynamic_grass.glslv include/environment.glslf include/fog.glslf include/fxaa.glslf include/halo_color.glslf include/lighting_nodes.glslf include/math.glslv include/mirror.glslf include/nodes.glslf include/nodes.glslv include/pack.glslf include/particles.glslv include/particles_nodes.glslf include/particles_nodes.glslv include/precision_statement.glslf include/procedural.glslf include/refraction.glslf include/scale_texcoord.glslv include/shadow.glslf include/shadow.glslv include/skin.glslv include/std_enums.glsl include/to_world.glslv include/wind_bending.glslv".split(" "), | |
b=[],d=null,x=!1;a.oe=function(a){d=a};a.R=h;a.lN=c;a.NY=function(a,b){for(var d=a.Qh,c=0;c<d.length;c++)if(d[c][0]==b&&1==d[c][1])return!0;return!1};a.mQ=function(a){a.Qh=[];for(var b="ALPHA ALPHA_CLIP ANAGLYPH BEND_CENTER_ONLY BILLBOARD_PRES_GLOB_ORIENTATION CAUSTICS CSM_BLEND_BETWEEEN_CASCADES CSM_FADE_LAST_CASCADE CSM_SECTION0 CSM_SECTION1 CSM_SECTION2 CSM_SECTION3 DEBUG_SPHERE DEBUG_SPHERE_DYNAMIC DEPTH_RGBA DISABLE_DISTORTION_CORRECTION DISABLE_FOG DOUBLE_SIDED_LIGHTING DYNAMIC DYNAMIC_GRASS DYNAMIC_GRASS_COLOR DYNAMIC_GRASS_SIZE FOAM FRAMES_BLENDING BILLBOARD_JITTERED BILLBOARD_SPHERICAL HAIR_BILLBOARD SHADOW_TEX_RES MAIN_BEND_COL MAX_BONES NUM_NORMALMAPS PARALLAX PARALLAX_STEPS PROCEDURAL_FOG PROCEDURAL_SKYDOME REFLECTION REFLECTION_PASS REFLECTION_TYPE REFRACTIVE USE_REFRACTION USE_REFRACTION_CORRECTION SHORE_SMOOTHING SKINNED SKY_COLOR SKY_TEXTURE SSAO_HEMISPHERE SSAO_BLUR_DEPTH SSAO_ONLY SSAO_WHITE STATIC_BATCH TEXTURE_COLOR TEXTURE_NORM TEXTURE_SPEC TEXTURE_STENCIL_ALPHA_MASK VERTEX_ANIM VERTEX_ANIM_MIX_NORMALS_FACTOR VERTEX_COLOR WATER_EFFECTS WIND_BEND DETAIL_BEND SHORE_PARAMS ALPHA_AS_SPEC DEPTH_RGBA MTEX_NEGATIVE MTEX_RGBTOINT NUM_LIGHTS NUM_LFACTORS NUM_LAMP_LIGHTS MAX_STEPS BILLBOARD_ALIGN SHADOW_USAGE POST_EFFECT SSAO_QUALITY TEXTURE_BLEND_TYPE TEXTURE_COORDS AA_METHOD AU_QUALIFIER BILLBOARD BILLBOARD_RANDOM PRECISION EPSILON USE_ENVIRONMENT_LIGHT USE_FOG WEBGL2 WO_SKYBLEND WO_SKYPAPER WO_SKYREAL WO_SKYTEX WOMAP_BLEND WOMAP_HORIZ WOMAP_ZENUP WOMAP_ZENDOWN WIREFRAME_QUALITY SIZE_RAMP_LENGTH COLOR_RAMP_LENGTH PARTICLES_SHADELESS NUM_CAST_LAMPS SUN_NUM MAC_OS_SHADOW_HACK USE_COLOR_RAMP HALO_PARTICLES PARTICLE_BATCH".split(" "), | |
d=0;d<b.length;d++){var c=b[d],e;switch(c){case "ALPHA":case "ALPHA_CLIP":case "ANAGLYPH":case "BILLBOARD_PRES_GLOB_ORIENTATION":case "CAUSTICS":case "CSM_SECTION0":case "CSM_SECTION1":case "CSM_SECTION2":case "CSM_SECTION3":case "DEBUG_SPHERE":case "DEBUG_SPHERE_DYNAMIC":case "DEPTH_RGBA":case "DISABLE_DISTORTION_CORRECTION":case "DISABLE_FOG":case "DOUBLE_SIDED_LIGHTING":case "DYNAMIC":case "DYNAMIC_GRASS":case "DYNAMIC_GRASS_COLOR":case "DYNAMIC_GRASS_SIZE":case "FOAM":case "FRAMES_BLENDING":case "BILLBOARD_JITTERED":case "MAIN_BEND_COL":case "MAX_BONES":case "MTEX_NEGATIVE":case "MTEX_RGBTOINT":case "NUM_LIGHTS":case "NUM_LFACTORS":case "NUM_NORMALMAPS":case "PARALLAX":case "PARALLAX_STEPS":case "PROCEDURAL_FOG":case "PROCEDURAL_SKYDOME":case "REFLECTION":case "REFLECTION_PASS":case "REFLECTION_TYPE":case "REFRACTIVE":case "USE_REFRACTION":case "USE_REFRACTION_CORRECTION":case "SHORE_SMOOTHING":case "SKINNED":case "SKY_COLOR":case "SKY_TEXTURE":case "SSAO_HEMISPHERE":case "SSAO_BLUR_DEPTH":case "SSAO_ONLY":case "SSAO_WHITE":case "STATIC_BATCH":case "TEXTURE_COLOR":case "TEXTURE_NORM":case "TEXTURE_SPEC":case "TEXTURE_STENCIL_ALPHA_MASK":case "VERTEX_ANIM":case "VERTEX_COLOR":case "WATER_EFFECTS":case "WIND_BEND":case "DETAIL_BEND":case "SHORE_PARAMS":case "BILLBOARD":case "BILLBOARD_RANDOM":case "HAIR_BILLBOARD":case "USE_ENVIRONMENT_LIGHT":case "USE_FOG":case "WO_SKYBLEND":case "WO_SKYPAPER":case "WO_SKYREAL":case "WO_SKYTEX":case "WOMAP_BLEND":case "WOMAP_HORIZ":case "WOMAP_ZENUP":case "WOMAP_ZENDOWN":case "WIREFRAME_QUALITY":case "SIZE_RAMP_LENGTH":case "COLOR_RAMP_LENGTH":case "PARTICLES_SHADELESS":case "SMAA_JITTER":case "NUM_CAST_LAMPS":case "SUN_NUM":case "MAC_OS_SHADOW_HACK":case "USE_COLOR_RAMP":case "HALO_PARTICLES":case "PARTICLE_BATCH":e= | |
0;break;case "ALPHA_AS_SPEC":case "BEND_CENTER_ONLY":case "CSM_BLEND_BETWEEEN_CASCADES":case "CSM_FADE_LAST_CASCADE":case "DEPTH_RGBA":case "BILLBOARD_SPHERICAL":case "NUM_LAMP_LIGHTS":case "MAX_STEPS":e=1;break;case "WEBGL2":e=n.u.nd|0;break;case "EPSILON":e="highp"==n.u.precision?1E-6:1E-4;break;case "SHADOW_TEX_RES":e=p(2048);break;case "AA_METHOD":e="AA_METHOD_FXAA_QUALITY";break;case "AU_QUALIFIER":e="NOT_ASSIGNED";break;case "BILLBOARD_ALIGN":e="BILLBOARD_ALIGN_VIEW";break;case "POST_EFFECT":e= | |
"POST_EFFECT_NONE";break;case "SHADOW_USAGE":e="NO_SHADOWS";break;case "SSAO_QUALITY":e="SSAO_QUALITY_32";break;case "TEXTURE_BLEND_TYPE":e="TEXTURE_BLEND_TYPE_MIX";break;case "TEXTURE_COORDS":e="TEXTURE_COORDS_UV_ORCO";break;case "PRECISION":e=n.u.precision;break;case "VERTEX_ANIM_MIX_NORMALS_FACTOR":e="u_va_frame_factor";break;default:L.error("Unknown directive ("+a.qm+", "+a.Uk+"): "+c)}h(a,c,e)}};a.fY=function(a){return a.qm};a.kX=function(a){return a.Uk};a.GY=function(a,b){for(var d=b.Qh,e=0;e< | |
d.length;e++){var f=d[e][0],g=d[e][1];c(a,f)&&h(a,f,g)}};a.hN=function(a){var b=JSON.stringify(a),c=E[b];if(c)return c;var f=a.Uk,c=e(G.shaders_dir,a.qm),f=e(G.shaders_dir,f);if(!c||!f)return null;var g=u("vert",c,a),h=u("frag",f,a),c=d,l=t(c,b,g,c.VERTEX_SHADER),k=t(c,b,h,c.FRAGMENT_SHADER),f=c.createProgram();c.attachShader(f,l);c.attachShader(f,k);c.linkProgram(f);c.validateProgram(f);c.getProgramParameter(f,c.VALIDATE_STATUS)==c.zT&&L.error("shader program is not valid",b);A.zK(f,b,l,k,g,h);a= | |
{cy:l,rB:k,Kl:f,attributes:{},dk:{},Vn:[],pw:{},nr:!0,cw:!1,rG:[],Rb:a};h=c.getProgramParameter(f,c.ACTIVE_ATTRIBUTES);for(g=0;g<h;g++)l=c.getActiveAttrib(f,g).name,a.attributes[l]=c.getAttribLocation(f,l);h=c.getProgramParameter(f,c.ACTIVE_UNIFORMS);for(g=0;g<h;g++)l=c.getActiveUniform(f,g).name.split("[0]").join(""),a.dk[l]=c.getUniformLocation(f,l);return E[b]=c=a};a.GO=function(){x=!1;if(b4w.module_check("shader_texts"))x=!0;else{for(var a=[],b=k.Ws,d=0;d<Q.length;d++){var c=K.Mn(G.shaders_dir+ | |
Q[d]);a.push({id:Q[d],type:b,url:c})}b=function(a,b){y||(y={});y[b]=a};a.length?k.Xc(a,b,function(){x=!0}):L.error("Shaders have not been found.")}};a.AK=function(){return x};a.aW=function(){return b};a.IB=function(){return E};a.fa=function(){for(var a in E){var c=E[a];d.deleteProgram(c.Kl);d.deleteShader(c.cy);d.deleteShader(c.rB);delete E[a]}for(var e in B)delete B[e];for(var f in b)delete b[f]};a.bW=function(a){var b=a.Qh;L.log("Shader: "+a.qm+" "+a.Uk+", "+String(b.length)+" directives: ");for(a= | |
0;a<b.length;a++)L.log(" "+b[a][0],b[a][1])};a.K=p;a.jA=function(a,b){return b in a.dk?!0:!1};a.BN=function(a){return(d.getShaderSource(a).match(/(?:^|\s)varying(?=\s)/g)||[]).length}};b4w.module.__assets=function(a,m){function h(){return L.bO()?m(L.hd.Kp).data:null}function c(){var a={qp:null,XI:function(b){switch(a.responseType){case "json":case "text":return b;case "arraybuffer":b=atob(b);for(var d=b.length,c=new Int8Array(d),e=0;e<d;e++)c[e]=b.charCodeAt(e);return c.buffer;default:return b}},status:0,readyState:0,response:"",responseType:"",onreadystatechange:null,overrideMimeType:function(){},addEventListener:function(){},open:function(b,d){a.qp=d;a.readyState=1},send:function(){a.status= | |
404;a.readyState=4;var b=h();b&&a.qp in b&&(a.status=200,b[a.qp]&&(a.response=a.XI(b[a.qp])));if("[object Function]"==={}.toString.call(a.onreadystatechange))a.onreadystatechange()}};return a}function e(d){for(var c=0,e=0;e<d.length;e++){var h=d[e];20===h.state&&c++;if(c>=b.YO)break;if(10===h.state)switch(h.state=20,c++,h.type){case a.Oo:u(h,"arraybuffer");break;case a.ok:u(h,"json");break;case a.Ws:u(h,"text");break;case a.qy:g(h);break;case a.Po:z(h);break;case a.ry:t(h);break;case a.Ro:p(h);break; | |
case a.Qo:f(h);break;default:B.ha("Wrong asset type: "+h.type)}}}function u(b,d){var e=h(),f=e&&b.url in e?new c:new XMLHttpRequest,e=null;if("GET"==b.kg)f.open("GET",b.url,!0);else if("POST"==b.kg)switch(f.open("POST",b.url,!0),b.Jl){case a.ny:e="text/plain";break;case a.my:e="application/json"}if(b.di)for(var g in b.di)"Content-Type"==g?e=b.di[g]:f.setRequestHeader(g,b.di[g]);e&&f.setRequestHeader("Content-Type",e);"text"==d?(f.overrideMimeType("text/plain"),f.responseType="text"):"json"==d?(f.overrideMimeType("application/json"), | |
f.responseType="text"):f.responseType=d;f.onreadystatechange=function(){if(40!=b.state&&4==f.readyState){if(200==f.status||0==f.status){var a=f.response;if(a){if("json"==d&&"string"==typeof a)try{a=JSON.parse(a,b.nO)}catch(c){G.error(c+" (parsing JSON "+b.url+")");b.dc(null,b.id,b.type,b.url,b.Fb);return}b.dc(a,b.id,b.type,b.url,b.Fb)}else G.error("empty responce when trying to get "+b.url),b.dc(null,b.id,b.type,b.url,b.Fb)}else G.error(f.status+" when trying to get "+b.url),b.dc(null,b.id,b.type, | |
b.url,b.Fb);b.state=30}};f.addEventListener("progress",function(a){a.lengthComputable&&b.wE(a.loaded/a.total)},!1);f.send(b.Tj)}function g(a){"GET"!=a.kg&&B.ha("Unsupported request type for audio buffer");var b=h(),d=b&&a.url in b?new c:new XMLHttpRequest;d.open("GET",a.url,!0);d.responseType="arraybuffer";d.onreadystatechange=function(){if(40!=a.state&&4==d.readyState)if(200==d.status||0==d.status){var b=d.response;b?E.HL(b,function(b){a.dc(b,a.id,a.type,a.url,a.Fb);a.state=30},function(){a.dc(null, | |
a.id,a.type,a.url,a.Fb);G.error("failed to decode "+a.url);a.state=30}):(a.dc(null,a.id,a.type,a.url,a.Fb),G.error("empty responce when trying to get "+a.url),a.state=30)}else a.dc(null,a.id,a.type,a.url,a.Fb),G.error(d.status+" when trying to get "+a.url),a.state=30};d.send(a.Tj)}function z(a){"GET"!=a.kg&&B.ha("Unsupported request type for image element");var b=document.createElement("img");Q.allow_cors&&(b.crossOrigin="Anonymous");b.onload=function(){40!=a.state&&(a.dc(b,a.id,a.type,a.url,a.Fb), | |
a.state=30)};b.addEventListener("error",function(){40!=a.state&&(a.dc(null,a.id,a.type,a.url,a.Fb),G.error("could not load image: "+a.url),a.state=30)},!1);var d=h();if(d&&a.url in d)if(d[a.url]){var c=k(a.url);b.src="data:"+c+";base64,"+d[a.url]}else K.Bv()?(d=document.createEvent("CustomEvent"),d.initCustomEvent("error",!1,!1,null)):d=new CustomEvent("error"),b.dispatchEvent(d);else b.src=a.url}function t(a){"GET"!=a.kg&&B.ha("Unsupported request type for audio element");var b=document.createElement("audio"); | |
if(Q.allow_cors||Q.wA)b.crossOrigin="Anonymous";b.addEventListener("loadeddata",function(){40!=a.state&&(a.dc(b,a.id,a.type,a.url,a.Fb),a.state=30)},!1);b.addEventListener("error",function(){40!=a.state&&(a.dc(null,a.id,a.type,a.url,a.Fb),G.error("could not load sound: "+a.url),a.state=30)},!1);b.addEventListener("stalled",function(){40!=a.state&&(a.dc(null,a.id,a.type,a.url,a.Fb),G.error("could not load sound: "+a.url),a.state=30)},!1);var d=h();if(d&&a.url in d)if(d[a.url]){var c=n(a.url);b.src= | |
"data:"+c+";base64,"+d[a.url];40!=a.state&&(a.dc(b,a.id,a.type,a.url,a.Fb),a.state=30)}else K.Bv()?(d=document.createEvent("CustomEvent"),d.initCustomEvent("error",!1,!1,null)):d=new CustomEvent("error"),b.dispatchEvent(d);else b.src=a.url,Q.ag&&b.load();Q.Wv&&(b.autoplay=!0,b.pause());setTimeout(function(){b.eR=1},5E3)}function p(a){function b(){40!=a.state&&(a.dc(null,a.id,a.type,a.url),G.error("could not load video: "+a.url,a.Fb),a.state=30)}"GET"!=a.kg&&B.ha("Unsupported request type for video element"); | |
var d=document.createElement("video");d.muted=!0;if(Q.allow_cors||Q.ag)d.crossOrigin="Anonymous";d.addEventListener("loadeddata",function(){d.removeEventListener("error",b,!1);40!=a.state&&(a.dc(d,a.id,a.type,a.url,a.Fb),a.state=30)},!1);d.addEventListener("error",b,!1);var c=h();if(c&&a.url in c)if(c[a.url]){var e=A(a.url);d.src="data:"+e+";base64,"+c[a.url];40!=a.state&&d.addEventListener("loadeddata",function(){a.dc(d,a.id,a.type,a.url,a.Fb);a.state=30},!1)}else K.Bv()?(c=document.createEvent("CustomEvent"), | |
c.initCustomEvent("error",!1,!1,null)):c=new CustomEvent("error"),d.dispatchEvent(c);else d.src=a.url,Q.ag&&d.load();Q.Wv&&(d.autoplay=!0,d.pause());setTimeout(function(){d.eR=1},1E4)}function f(b){function d(a){b.dc(a,b.id,b.type,b.url,b.Fb);b.state=30}"GET"!=b.kg&&B.ha("Unsupported request type for seq video element");var e=h(),f=e&&b.url in e?new c:new XMLHttpRequest;if(null==b.Jl&&null==b.Tj)f.open("GET",b.url,!0);else switch(f.open("POST",b.url,!0),b.Jl){case a.ny:f.setRequestHeader("Content-type", | |
"text/plain");break;case a.my:f.setRequestHeader("Content-type","application/json")}f.responseType="arraybuffer";f.onreadystatechange=function(){if(40!=b.state&&4==f.readyState)if(200==f.status||0==f.status){var a=f.response;a?v(a,d):(b.dc(null,b.id,b.type,b.url,b.Fb),G.error("empty responce when trying to get "+b.url),b.state=30)}else b.dc(null,b.id,b.type,b.url,b.Fb),G.error(f.status+" when trying to get "+b.url),b.state=30};f.addEventListener("progress",function(a){a.lengthComputable&&b.wE(a.loaded/ | |
a.total)},!1);f.send(b.Tj)}function v(a,b){for(var d=new Int32Array(a),c=new Int8Array(a),e=d[3],f={images:[],Qz:[],Pg:d[4]},g=20,h=0;h<e;h++){var k=d[g/4],n=new Blob([c.subarray(g+4,g+4+k)],{type:"image/jpg"}),m=document.createElement("img");m.src=window.URL.createObjectURL(n);f.images.push(m);f.Qz.push(n);g+=k+8-k%4}m.onload=function(){for(var a=0;a<f.images.length;a++)window.URL.revokeObjectURL(f.images[a].src);delete f.Qz;b(f)}}function k(a){var b="image";switch(B.hv(a).toLowerCase()){case "jpeg":case "jpg":b+= | |
"/jpeg";break;case "png":b+="/png"}return b}function n(a){var b="audio";switch(B.hv(a).toLowerCase()){case "ogv":case "ogg":b+="/ogg";break;case "mp3":b+="/mpeg";break;case "m4v":case "mp4":b+="/mp4";break;case "webm":b+="/webm"}return b}function A(a){var b="video";switch(B.hv(a).toLowerCase()){case "ogv":b+="/ogg";break;case "webm":b+="/webm";break;case "m4v":b+="/mp4"}return b}var L=m("__config"),K=m("__compat"),G=m("__print"),E=m("__sfx"),B=m("__util"),y=m("__version"),Q=L.u,b=L.Pf;a.Oo=10;a.ok= | |
20;a.Ws=30;a.qy=40;a.Po=50;a.ry=60;a.Ro=70;a.Qo=80;a.my=a.ok;a.ny=a.Ws;var d=[],x=0,C={};a.wo=function(a){a=a.split(".");var b=Array(2);b[0]=a.slice(0,-1).join(".");b[1]=String(a.slice(-1));return b};a.WX=function(a){if(C[a])return C[a];var d=b.ww?a+y.timestamp():a,c=new XMLHttpRequest;c.overrideMimeType("text/plain");c.open("GET",d,!1);c.send(null);if(200==c.status||0==c.status){d=c.responseText;if(d.length)return C[a]=d;B.ha("Error XHR: responce is empty, GET "+a)}else B.ha("Error XHR: "+c.status+ | |
", GET "+a)};a.fa=function(){for(var a=0;a<d.length;a++)d[a].state=40;d=[];x=0;C={}};a.Xc=function(a,c,f,g,k){for(var l=0;l<a.length;l++){var n=a[l],n={id:n.id,type:n.type,url:n.url,kg:n.kg?n.kg:"GET",Jl:n.Jl?n.Jl:null,di:n.di?n.di:null,Tj:n.Tj?n.Tj:null,Fb:n.Fb?n.Fb:null,state:10,dc:c||function(){},kE:f||function(){},wE:g||function(){},nO:k||null,lE:x};if(b.ww){var m=h();m&&n.url in m||(n.url+=y.timestamp())}d.push(n)}e(d);x++};a.update=function(){e(d);for(var a=d,b=0,c=!0,f=0;f<a.length;f++){var g= | |
a[f];g.lE===a[b].lE?30!==g.state&&(c=!1):(c&&(a[f-1].kE(),c=f-b,a.splice(b,c),f-=c),b=f,c=30===a[f].state?!0:!1);f===a.length-1&&c&&(a[f].kE(),a.splice(b))}}};b4w.module.__sfx=function(a,m){function h(){var a=window.AudioContext||window.webkitAudioContext;if(a){a=new a;if(a.createGain)return a;G.warn("deprecated WebAudio implementation");return null}G.warn("WebAudio is not supported");return null}function c(a,b,d){var c=a.M;if("NONE"!=c.behavior){var f=c.loop,h=c.pitch;if(c.src&&(f||0<=d)){c.At=Math.floor(5E4*Math.random());var l=M.currentTime+b,l=Math.max(0,l);c.qe=l;c.state=20;e(a);"POSITIONAL"==c.behavior||"BACKGROUND_SOUND"==c.behavior?(b=M.createBufferSource(), | |
b.buffer=c.src,b.playbackRate.value=h,y.qf(b.onended)&&(b.onended=function(){c.state=50}),f?(c.ic&&c.ic.disconnect(),b.loop=!0,b.start(l),c.duration=0):(f=b.buffer?b.buffer.duration:0,d>f?(f=l+d+c.ce,b.loop=!0,b.start(l),b.stop(f),c.duration=d):(b.loop=!1,b.start(l),c.duration=f)),b.connect(c.Dd),c.ic=b,g(c),z(c)):"BACKGROUND_MUSIC"==c.behavior&&(E.Fk(c.Et),E.Fk(c.Ft),d=function(){var b=a.M,d=b.src;d&&(d.volume=1,d.loop=b.loop,b.ic=b.ic||M.createMediaElementSource(d),b.ic.connect(b.Dd),20==b.state&& | |
(d.currentTime&&(d.currentTime=0),d.play()))},0==b?d():c.Et=E.as(d,1E3*b),c.duration=f?0:L(a));t(c,l)}}}function e(a){var b=a.M;if(!b.Dd){var c=B.m(a.g.i);a=B.v(a.g.i);if(d.jr){var e=M.createBiquadFilter();e.type="peaking"}else e=null;var f=M.createGain();switch(b.behavior){case "POSITIONAL":var g=M.createPanner();"string"!=typeof g.panningModel?(g.panningModel=g.EQUALPOWER,g.distanceModel=g.INVERSE_DISTANCE):(g.panningModel="equalpower",g.distanceModel="inverse");g.setPosition(c[0],c[1],c[2]);Q.copy(c, | |
b.Hv);c=x;y.hb(a,y.xc,c);g.setOrientation(c[0],c[1],c[2]);Q.copy(c,b.direction);g.refDistance=b.dist_ref;g.maxDistance=b.dist_max;g.rolloffFactor=b.attenuation;g.coneInnerAngle=b.tA;g.coneOuterAngle=b.uA;g.coneOuterGain=b.vA;var h=M.createGain();h.gain.value=A(b);e?(g.connect(e),e.connect(h)):g.connect(h);h.connect(f);b.Dd=g;if(b.jk){var l=M.createGain();f.connect(l);l.connect(M?F.Ka.Dd:null)}else l=null,f.connect(M?F.Ka.Dd:null);break;case "BACKGROUND_SOUND":g=null;h=M.createGain();h.gain.value= | |
A(b);e?(b.Dd=e,e.connect(h)):b.Dd=h;h.connect(f);b.jk?(l=M.createGain(),f.connect(l),l.connect(M?F.Ka.Dd:null)):(l=null,f.connect(M?F.Ka.Dd:null));break;case "BACKGROUND_MUSIC":l=g=null,h=M.createGain(),h.gain.value=A(b),e?(b.Dd=e,e.connect(h)):b.Dd=h,h.connect(f),f.connect(M?F.Ka.Dd:null)}b.Rn=g;b.Zf=e;b.Xk=h;b.jj=f;b.EE=l}}function u(a){var b=a.M,d=b.duration,b=b.UA+b.VA*Math.random();c(a,b,d)}function g(a){a.jk&&a.EE.gain.cancelScheduledValues(a.qe);a.Gl&&a.ic.playbackRate.cancelScheduledValues(a.qe); | |
a.Mo=a.qe}function z(a){if(a.jk||a.Gl){var b=a.EE,d=a.ic,c=d.buffer?d.buffer.duration:0;if(c){var e=a.qe;q[0]=a.At;for(var f=0;5>f;){var g=a.pitch+a.Gl*y.Xe(q);if(e>=a.Mo){if(a.jk){var h=1-y.J(a.jk,0,1)*Math.random();b.gain.setValueAtTime(h,e)}a.Gl&&d.playbackRate.setValueAtTime(g,e);f++}e+=c/g}a.Mo=e-.001}}}function t(a,b){if(a.kj||a.ce){var d=a.jj;d.gain.cancelScheduledValues(b);a.kj?(d.gain.setValueAtTime(0,b),d.gain.linearRampToValueAtTime(1,b+a.kj)):d.gain.setValueAtTime(1,b);a.ce&&!a.loop&& | |
(d.gain.setValueAtTime(1,b+a.duration),d.gain.linearRampToValueAtTime(0,b+a.duration+a.ce))}}function p(a){if("SPEAKER"!=a.type)throw"Wrong object type";var b=a.M;if(50==b.state)b.state=30;else if(20==b.state||40==b.state){var d=b.jj,c=M.currentTime;b.ce&&(d.gain.setValueAtTime(d.gain.value,c),d.gain.linearRampToValueAtTime(0,c+b.ce));"BACKGROUND_MUSIC"==b.behavior?b.src&&(E.Fk(b.Et),E.Fk(b.Ft),b.Ft=E.as(function(){var b=a.M.src;b&&(b.currentTime&&(b.currentTime=0),b.pause())},1E3*b.ce)):(d=b.ic, | |
b.duration<d.buffer.duration?b.ce&&20==b.state?d.stop(c+b.ce):20==b.state&&(d.stop(0),d.disconnect()):d.disconnect(),b.qe=0,b.nw=0,b.Nt=0);b.state=30}}function f(a){a=a.M;if(20==a.state){var b=M.currentTime;a.nw=b;if("BACKGROUND_MUSIC"==a.behavior){var d=a.src;d&&d.pause()}else{if(b>a.qe){q[0]=a.At;for(var c=a.ic.buffer.duration,e=a.qe;e<b;)d=a.pitch+a.Gl*y.Xe(q),e+=c/d;d*=c/d-(e-b)}else d=0;a.Nt=d;a.ic.stop(0);a.ic.disconnect();g(a)}a.state=40}}function v(a){var b=a.M;if(40==b.state){var d=M.currentTime; | |
b.qe+=d-b.nw;"BACKGROUND_MUSIC"==b.behavior?b.src.play():(k(a),b.Mo=d,a=b.ic,y.qf(a.onended)&&(a.onended=function(){b.state=50}),a.start(b.qe,b.Nt),z(b));t(b,b.qe);b.state=20}}function k(a){a=a.M;var b=M.createBufferSource();b.loop=a.ic.loop;b.buffer=a.ic.buffer;b.playbackRate.value=a.ic.playbackRate.value;a.Rn?b.connect(a.Rn):b.connect(a.Xk);a.ic=b}function n(a){a=a.M;return!a||20!=a.state&&40!=a.state&&30!=a.state&&50!=a.state?!1:!0}function A(a){return a.muted?0:a.volume}function L(a){a=a.M;return(a= | |
a.src)?a.duration:0}var K=m("__config"),G=m("__print"),E=m("__time"),B=m("__tsr"),y=m("__util"),Q=m("__vec3"),b=K.u,d=K.M;a.py=10;a.Vs=20;a.oy=30;var x=new Float32Array(3),C=new Float32Array(3),H=new Float32Array(3),I=[],O=[],M=null,F=null,l=[],q=[1],D=null;a.nL=function(){return{zi:-1,Mg:"",behavior:"NONE",ej:!1,muted:!1,volume:1,pitch:1,attenuation:1,dist_ref:1,dist_max:1E4,tA:360,uA:360,vA:1,Kc:!1,loop:!1,UA:0,VA:0,jk:0,Gl:0,kj:0,ce:0,qe:0,nw:0,Nt:0,duration:0,Mo:0,At:1,src:null,state:10,Hv:new Float32Array(3), | |
direction:new Float32Array(3),xx:new Float32Array(3),Et:-1,Ft:-1,hj:0}};a.wd=function(){var a=document.createElement("audio"),b=document.createElement("video");a.canPlayType&&(""!=a.canPlayType("audio/ogg")&&(I.push("ogg"),I.push("ogv")),""!=a.canPlayType("audio/mpeg")&&I.push("mp3"),""!=a.canPlayType("audio/mp4")&&(I.push("mp4"),I.push("m4v")),""!=a.canPlayType("audio/webm")&&I.push("webm"));b.canPlayType&&(""!=b.canPlayType("video/ogg")&&O.push("ogv"),""!=b.canPlayType("video/mp4")&&O.push("m4v"), | |
""!=b.canPlayType("video/webm")&&O.push("webm"));(M=d.gy?h():null)&&G.log("%cINIT WEBAUDIO: "+M.sampleRate+"Hz","color: #00a")};a.Iz=function(a){var d={Dj:new Float32Array(3),yD:new Float32Array(3),ol:new Float32Array(3)};a.Ka=d;if(M){var c=M.createGain(),e=M.createGain();d.Xk=c;d.jj=e;c.connect(e);e.connect(M.destination);if(a.b4w_enable_dynamic_compressor){var e=M.createDynamicsCompressor(),f=a.b4w_dynamic_compressor_settings;e.threshold.value=f.threshold;e.knee.value=f.knee;e.ratio.value=f.ratio; | |
e.attack.value=f.attack;e.release.value=f.release;e.connect(c);d.Vm=e;d.Dd=e}else d.Vm=null,d.Dd=c;c=M.listener;d.ej=b.Gu;d.ej||(c.dopplerFactor=a.audio_doppler_factor,c.speedOfSound=a.audio_doppler_speed);d.muted=!1;d.volume=1;d.hj=0}};a.kQ=function(a){F=a};a.Du=function(a){a||(a="ogg");return-1<I.indexOf(a)?a:"ogg"==a&&-1<I.indexOf("mp4")?"mp4":"mp3"==a&&-1<I.indexOf("ogg")?"ogg":"mp4"==a&&-1<I.indexOf("ogg")?"ogg":"ogv"==a&&-1<I.indexOf("m4v")?"m4v":"webm"==a&&-1<I.indexOf("m4v")?"m4v":"m4v"== | |
a&&-1<I.indexOf("webm")?"webm":""};a.Eu=function(a){a||(a="webm");return-1<O.indexOf(a)?a:"ogv"==a&&-1<O.indexOf("m4v")?"m4v":"webm"==a&&-1<O.indexOf("m4v")?"m4v":"m4v"==a&&-1<O.indexOf("webm")?"webm":""};a.yi=function(a,d){var c=a.data,e=d.M;e.zi=a.data.sound.uuid;e.Mg=a.data.sound.filepath;switch(c.b4w_behavior){case "POSITIONAL":case "BACKGROUND_SOUND":e.behavior=M?c.b4w_behavior:"NONE";break;case "BACKGROUND_MUSIC":var f;M?(window.MediaElementAudioSourceNode?f=!0:(G.warn("MediaElementAudioSourceNode not found"), | |
f=!1),f=f?"BACKGROUND_MUSIC":"BACKGROUND_SOUND"):f="NONE";e.behavior=f;break;default:throw"Wrong speaker behavior";}c.sound||(e.behavior="NONE");e.ej=c.b4w_disable_doppler||b.Gu;e.muted=c.muted;e.volume=c.volume;e.pitch=c.pitch;e.attenuation=c.attenuation;e.dist_ref=c.distance_reference;e.dist_max=c.distance_max||1E4;e.tA=c.cone_angle_inner;e.uA=c.cone_angle_outer;e.vA=c.cone_volume_outer;e.Kc=c.b4w_cyclic_play;e.loop=c.b4w_loop;e.UA=c.b4w_delay;e.VA=c.b4w_delay_random;e.jk=c.b4w_volume_random;e.Gl= | |
c.b4w_pitch_random;e.kj=c.b4w_fade_in;e.ce=c.b4w_fade_out;l.push(d)};a.LF=function(b){if("SPEAKER"!=b.type)throw"Wrong object type";switch(b.M.behavior){case "POSITIONAL":return a.Vs;case "BACKGROUND_SOUND":return a.Vs;case "BACKGROUND_MUSIC":return a.oy;case "NONE":return a.py;default:throw"Wrong speaker behavior";}};a.tS=function(a,b){var d=a.M;switch(d.behavior){case "POSITIONAL":case "BACKGROUND_SOUND":case "BACKGROUND_MUSIC":d.src=b;break;case "NONE":break;default:throw"Wrong speaker behavior"; | |
}};a.pE=function(){var a=M.createBufferSource();a.buffer=M.createBuffer(1,22050,22050);a.connect(M.destination);a.start(0)};a.HL=function(a,b,d){M?M.decodeAudioData(a,b,d):d()};a.hR=function(a){p(a);a.M=null;l.splice(l.indexOf(a),1)};a.fa=function(){for(var a=0;a<l.length;a++){var b=l[a].M;"BACKGROUND_MUSIC"==b.behavior?(b=b.src)&&b.pause():b.ic&&b.ic.disconnect()}F&&F.Ka&&(a=F.Ka,a.Dj[0]=0,a.Dj[1]=0,a.Dj[2]=0,a.ol[0]=0,a.ol[1]=0,a.ol[2]=0);F=null;l.splice(0);D=null};a.update=function(a){if(M&&0!= | |
l.length){for(var b=0;b<l.length;b++){var d=l[b],c=d.M,e=c.ic,f=M.currentTime;!c.loop&&20==c.state&&c.duration&&c.qe+c.duration<f&&("BACKGROUND_MUSIC"==c.behavior||e&&!y.qf(e.onended))&&(c.state=50);c.Kc&&50==c.state&&u(d);20==c.state&&3>c.Mo-f&&z(c)}D&&D.qh.length&&(-1==D.Nb||a>D.tz+D.bB[D.Nb])&&(b=D,-1<b.Nb&&p(b.qh[b.Nb]),-1==b.Nb&&b.random?d=Math.round(Math.random()*(b.qh.length-1)):b.random?(d=1+Math.round(Math.random()*(b.qh.length-2)),d=(b.Nb+d)%b.qh.length):d=(b.Nb+1)%b.qh.length,u(b.qh[d]), | |
b.Nb=d,b.tz=a)}};a.play=c;a.Cr=u;a.stop=p;a.Wq=function(a){return 20==a.M.state};a.gR=f;a.iR=v;a.rw=function(a,b){var d=a.M;d.pitch=b;!n(a)||"POSITIONAL"!=d.behavior&&"BACKGROUND_SOUND"!=d.behavior||(d.ic.playbackRate.value=b,g(d),z(d))};a.bC=function(a){return a.M.pitch};a.Kc=function(a,b){a.M.Kc=Boolean(b)};a.Pq=function(a){return a.M.Kc};a.FO=function(a,b,d,c){if(M&&a.Ka){var e=x;e[0]=0;e[1]=-1;e[2]=0;Q.transformQuat(e,d,e);C[0]=0;C[1]=0;C[2]=-1;Q.transformQuat(C,d,C);d=M.listener;d.setPosition(b[0], | |
b[1],b[2]);d.setOrientation(e[0],e[1],e[2],C[0],C[1],C[2]);Q.copy(e,a.Ka.yD);!a.Ka.ej&&c&&(H[0]=(b[0]-a.Ka.Dj[0])/c,H[1]=(b[1]-a.Ka.Dj[1])/c,H[2]=(b[2]-a.Ka.Dj[2])/c,y.Tl(H,a.Ka.ol,c,.3,H),d.setVelocity(H[0],H[1],H[2]),Q.copy(H,a.Ka.ol));Q.copy(b,a.Ka.Dj)}};a.zD=function(a,b){if(M&&F.Ka&&!F.Ka.ej){var d=x;b?Q.copy(b,d):Q.copy(F.Ka.yD,d);Q.scale(d,a,d);M.listener.setVelocity(d[0],d[1],d[2]);Q.copy(d,F.Ka.ol)}};a.jR=function(a,b){var d=a.M;if(n(a)&&"POSITIONAL"==d.behavior){var c=B.m(a.g.i),e=B.v(a.g.i), | |
f=d.Rn;f.setPosition(c[0],c[1],c[2]);var g=x;y.hb(e,y.xc,g);f.setOrientation(g[0],g[1],g[2]);e=d.Hv;!d.ej&&b&&(C[0]=(c[0]-e[0])/b,C[1]=(c[1]-e[1])/b,C[2]=(c[2]-e[2])/b,y.Tl(C,d.xx,b,.3,C),f.setVelocity(C[0],C[1],C[2]),Q.copy(C,d.xx));Q.copy(c,e)}};a.MF=function(a,b,d){var c=a.M;if(n(a)&&"POSITIONAL"==c.behavior&&!c.ej){var e=x;d?Q.copy(d,e):Q.copy(c.direction,e);Q.scale(e,b,e);c.Rn.setVelocity(e[0],e[1],e[2]);Q.copy(e,c.xx);a=B.m(a.g.i);Q.copy(a,c.Hv)}};a.kv=function(a){return a.M.behavior};a.eA= | |
function(){for(var a=0;a<l.length;a++)if(n(l[a]))return!0;return!1};a.DQ=function(a){var b=F.Ka;b&&(b.volume=a,M&&(b.Xk.gain.value=A(b)))};a.tN=function(){var a=F.Ka;return a?a.volume:0};a.lx=function(a,b){var d=a.M;d.volume=b;n(a)&&(d.Xk.gain.value=A(d))};a.wC=function(a){return a.M.volume};a.dg=function(a,b){a.M.muted=Boolean(b);n(a)&&(a.M.Xk.gain.value=A(a.M))};a.fD=function(a){return a.M.muted};a.gP=function(a){var b=F.Ka;b&&(b.muted=Boolean(a),M&&(b.Xk.gain.value=A(b)))};a.jO=function(){var a= | |
F.Ka;return a?a.muted:!1};a.wq=function(){return l};a.pause=function(){for(var a=0;a<l.length;a++)f(l[a])};a.wf=function(){for(var a=0;a<l.length;a++)v(l[a])};a.eF=function(a,b){if(a.Ka&&a.Ka.Vm){var d=a.Ka.Vm;d.threshold.value=b.threshold;d.knee.value=b.knee;d.ratio.value=b.ratio;d.attack.value=b.attack;d.release.value=b.release}};a.JB=function(a){if(!a.Ka||!a.Ka.Vm)return null;a=a.Ka.Vm;return{threshold:a.threshold.value,knee:a.knee.value,ratio:a.ratio.value,attack:a.attack.value,release:a.release.value}}; | |
a.aB=function(a,b,d){if(n(a)){a=a.M;var c=a.jj,e=M.currentTime;c.gain.setValueAtTime(c.gain.value,e);c.gain.linearRampToValueAtTime(b,e+d);a.hj=d}};a.tG=function(a){if(n(a)){a=a.M;var b=a.jj,d=M.currentTime;b.gain.setValueAtTime(b.gain.value,d);b.gain.linearRampToValueAtTime(1,d+a.hj);a.hj=0}};a.WL=function(a,b){if(M){var d=F.Ka,c=d.jj,e=M.currentTime;c.gain.setValueAtTime(c.gain.value,e);c.gain.linearRampToValueAtTime(a,e+b);d.hj=b}};a.PR=function(){if(M){var a=F.Ka,b=a.jj,d=M.currentTime;b.gain.setValueAtTime(b.gain.value, | |
d);b.gain.linearRampToValueAtTime(1,d+a.hj);a.hj=0}};a.Az=function(a,b,d){D={Nb:-1,tz:0,random:d,qh:[],bB:[]};for(d=0;d<a.length;d++){var c=a[d],e=L(c);0==e?G.warn("Ignoring speaker with zero duration: "+c.name):(p(c),c.M.Kc=!1,D.qh.push(c),D.bB.push(e+b))}};a.MB=L;a.oA=function(){if(D)for(var a=D.qh,b=0;b<a.length;b++)p(a[b]);D=null};a.cC=function(a){return(a=a.M)&&"POSITIONAL"==a.behavior?{dist_ref:a.dist_ref,dist_max:a.dist_max,attenuation:a.attenuation}:null};a.qF=function(a,b){var d=a.M;if(d&& | |
"POSITIONAL"==d.behavior){d.dist_ref=b.dist_ref;d.dist_max=b.dist_max;d.attenuation=b.attenuation;var c=d.Rn;c&&(c.refDistance=d.dist_ref,c.maxDistance=d.dist_max,c.rolloffFactor=d.attenuation)}};a.hF=function(a,b){var d=a.M;d&&d.Zf&&(d.Zf.frequency.value=b.freq,d.Zf.Q.value=b.Q,d.Zf.gain.value=b.gain)};a.RB=function(a){return(a=a.M)&&a.Zf?{freq:a.Zf.frequency.value,Q:a.Zf.Q.value,gain:a.Zf.gain.value}:null};a.QB=function(a,b,d,c){a=a.M;if(!a||!a.Zf)return null;a.Zf.getFrequencyResponse(b,d,c)}};"object"==typeof module&&module.Nu&&(GLOBAL.b4w={module:{}}); | |
b4w.module.__version=function(a){function m(){var a=h,c=a.getDate(),c=10>c?"0"+String(c):String(c),g=a.getMonth()+1,g=10>g?"0"+String(g):String(g),m=String(a.getFullYear()),t=a.getHours(),t=10>t?"0"+String(t):String(t),p=a.getMinutes(),p=10>p?"0"+String(p):String(p),a=a.getSeconds(),a=10>a?"0"+String(a):String(a);return c+"."+g+"."+m+" "+t+":"+p+":"+a}var h=new Date(2016,2,31,11,34,58),c=[16,3];a.version=function(){return c};a.Ko=function(){for(var a="",h=0;h<c.length;h++)a=1==h?a+(10>c[h]?"0"+c[h]: | |
c[h]):a+c[h],h!=c.length-1&&(a+=".");return a};a.type=function(){return"RELEASE"};a.PA=function(){return h};a.xu=m;a.timestamp=function(){var a=m(),a=a.split(" ").join("").split(":").join("").split(".").join("");return"?t="+a}};"object"==typeof module&&module.Nu&&b4w.module.__version(exports);b4w.module.shader_texts=function(a){a["anchors.glslf"]={type:"group",b:[{type:"include",file:"precision_statement.glslf"},{type:"textline",a:"void main ( ) { gl_FragColor = vec4 ( 1.0 ) ; }".split(" ")}]};a["anchors.glslv"]={type:"group",b:[{type:"var",name:"ANCHOR_NUM",a:["0"]},{type:"include",file:"math.glslv"},{type:"textline",a:"attribute float a_index ; uniform vec3 u_position [ ANCHOR_NUM ] ; uniform mat4 u_view_proj_matrix ; void main ( ) { gl_Position = u_view_proj_matrix * vec4 ( u_position [ int ( a_index ) ] , 1.0 ) ; gl_PointSize = 4.0 ; }".split(" ")}]}; | |
a["color_id.glslf"]={type:"group",b:[{type:"var",name:"WATER_LEVEL",a:["0.0"]},{type:"var",name:"WAVES_HEIGHT",a:["0.0"]},{type:"var",name:"NUM_LAMP_LIGHTS",a:["0"]},{type:"var",name:"NUM_VALUES",a:["0"]},{type:"var",name:"NUM_RGBS",a:["0"]},{type:"var",name:"MAPPING_TRS_MATRIX",a:["mat4","(","0.0",")"]},{type:"var",name:"MAPPING_SCALE",a:["vec3","(","0.0",")"]},{type:"var",name:"MAPPING_TRANSLATION",a:["vec3","(","0.0",")"]},{type:"var",name:"MAPPING_MIN_CLIP",a:["vec3","(","0.0",")"]},{type:"var", | |
name:"MAPPING_MAX_CLIP",a:["vec3","(","0.0",")"]},{type:"var",name:"MAPPING_IS_NORMAL",a:["0.0"]},{type:"var",name:"RGB_IND",a:["0"]},{type:"var",name:"VALUE_IND",a:["0"]},{type:"var",name:"LAMP_INDEX",a:["0"]},{type:"var",name:"NUM_LIGHTS",a:["0"]},{type:"var",name:"LAMP_IND",a:["0"]},{type:"var",name:"LAMP_SPOT_SIZE",a:["0"]},{type:"var",name:"LAMP_SPOT_BLEND",a:["0"]},{type:"var",name:"LAMP_LIGHT_DIST",a:["0"]},{type:"var",name:"LAMP_LIGHT_FACT_IND",a:["0"]},{type:"var",name:"LAMP_FAC_CHANNELS", | |
a:["rgb"]},{type:"var",name:"LAMP_SHADOW_MAP_IND",a:["0"]},{type:"var",name:"NUM_LFACTORS",a:["0"]},{type:"include",file:"precision_statement.glslf"},{type:"include",file:"std_enums.glsl"},{type:"condition",b:[{type:"if",d:["NODES","ALPHA",{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"include",file:"pack.glslf"},{type:"include",file:"procedural.glslf"},{type:"condition",b:[{type:"if",d:["CAUSTICS"],group:{type:"group",b:[{type:"include",file:"caustics.glslf"}]}}]},{type:"include",file:"color_util.glslf"}, | |
{type:"include",file:"math.glslv"}]}}]},{type:"condition",b:[{type:"if",d:["NODES","ALPHA",{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:"uniform float u_time ; uniform float u_environment_energy ;".split(" ")},{type:"condition",b:[{type:"if",d:["NUM_LIGHTS",0,{type:"g_expr",e:2}],group:{type:"group",b:[{type:"textline",a:"uniform vec3 u_light_positions [ NUM_LIGHTS ] ; uniform vec3 u_light_directions [ NUM_LIGHTS ] ; uniform vec3 u_light_color_intensities [ NUM_LIGHTS ] ; uniform vec4 u_light_factors [ NUM_LFACTORS ] ;".split(" ")}]}}]}, | |
{type:"textline",a:["uniform","vec3","u_camera_eye_frag",";"]},{type:"condition",b:[{type:"if",d:["USE_NODE_B4W_VECTOR_VIEW","REFLECTION_TYPE","REFL_PLANE",{type:"equal_expr",e:2},{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","mat3","u_view_tsr_frag",";"]}]}}]},{type:"condition",b:[{type:"if",d:["USE_ENVIRONMENT_LIGHT","SKY_TEXTURE",{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","samplerCube","u_sky_texture",";"]}]}},{type:"elif", | |
d:["USE_ENVIRONMENT_LIGHT","SKY_COLOR",{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:"uniform vec3 u_horizon_color ; uniform vec3 u_zenith_color ;".split(" ")}]}}]}]}},{type:"else",group:{type:"group",b:[{type:"textline",a:["uniform","vec4","u_diffuse_color",";"]},{type:"condition",b:[{type:"if",d:["TEXTURE_COLOR"],group:{type:"group",b:[{type:"textline",a:"uniform sampler2D u_sampler ; uniform float u_alpha_factor ;".split(" ")}]}}]}]}}]},{type:"condition",b:[{type:"if", | |
d:["USE_OUTLINE",{type:"logic_negative_expr",e:1}],group:{type:"group",b:[{type:"textline",a:["uniform","vec3","u_color_id",";"]}]}}]},{type:"condition",b:[{type:"if",d:["USE_NODE_CURVE_VEC","USE_NODE_CURVE_RGB","USE_NODE_VALTORGB",{type:"logical_or_expr",e:3}],group:{type:"group",b:[{type:"textline",a:["uniform","sampler2D","u_nodes_texture",";"]}]}}]},{type:"condition",b:[{type:"if",d:["NODES","ALPHA",{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["REFLECTION_TYPE", | |
"REFL_PLANE",{type:"equal_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","sampler2D","u_plane_reflection",";"]}]}},{type:"elif",d:["REFLECTION_TYPE","REFL_CUBE",{type:"equal_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","samplerCube","u_cube_reflection",";"]}]}},{type:"elif",d:["REFLECTION_TYPE","REFL_MIRRORMAP",{type:"equal_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","samplerCube","u_mirrormap",";"]}]}}]},{type:"condition",b:[{type:"if",d:["USE_NODE_B4W_REFRACTION"], | |
group:{type:"group",b:[{type:"textline",a:["uniform","sampler2D","u_refractmap",";"]},{type:"condition",b:[{type:"if",d:["USE_REFRACTION"],group:{type:"group",b:[{type:"textline",a:["uniform","PRECISION","sampler2D","u_scene_depth",";"]}]}}]}]}}]},{type:"textline",a:"uniform float u_emit ; uniform float u_ambient ; uniform vec4 u_fresnel_params ;".split(" ")},{type:"condition",b:[{type:"if",d:["REFLECTION_TYPE","REFL_MIRRORMAP",{type:"equal_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform", | |
"float","u_mirror_factor",";"]}]}},{type:"elif",d:["REFLECTION_TYPE","REFL_PLANE",{type:"equal_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","vec4","u_refl_plane",";"]}]}}]},{type:"condition",b:[{type:"if",d:["USE_NODE_LAMP"],group:{type:"group",b:[{type:"textline",a:"uniform vec3 u_lamp_light_positions [ NUM_LAMP_LIGHTS ] ; uniform vec3 u_lamp_light_directions [ NUM_LAMP_LIGHTS ] ; uniform vec3 u_lamp_light_color_intensities [ NUM_LAMP_LIGHTS ] ; uniform vec4 u_lamp_light_factors [ NUM_LAMP_LIGHTS ] ;".split(" ")}]}}]}, | |
{type:"condition",b:[{type:"if",d:["USE_NODE_VALUE"],group:{type:"group",b:[{type:"textline",a:"uniform float u_node_values [ NUM_VALUES ] ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["USE_NODE_RGB"],group:{type:"group",b:[{type:"textline",a:"uniform vec3 u_node_rgbs [ NUM_RGBS ] ;".split(" ")}]}}]}]}}]},{type:"condition",b:[{type:"if",d:["USE_OUTLINE"],group:{type:"group",b:[{type:"textline",a:["uniform","float","u_outline_intensity",";"]}]}}]},{type:"condition",b:[{type:"if",d:["NODES", | |
"ALPHA",{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:"varying vec3 bC ; varying vec4 bD ;".split(" ")},{type:"condition",b:[{type:"if",d:["USE_NODE_MATERIAL_BEGIN","USE_NODE_GEOMETRY_NO","CAUSTICS","CALC_TBN_SPACE",{type:"logical_or_expr",e:4}],group:{type:"group",b:[{type:"textline",a:["varying","vec3","bE",";"]}]}}]},{type:"condition",b:[{type:"if",d:["CALC_TBN_SPACE"],group:{type:"group",b:[{type:"textline",a:["varying","vec4","bF",";"]}]}}]},{type:"condition",b:[{type:"if", | |
d:["REFLECTION_TYPE","REFL_PLANE",{type:"equal_expr",e:2},"USE_NODE_B4W_REFRACTION",{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["varying","vec3","bG",";"]}]}}]},{type:"condition",b:[{type:"if",d:["USE_NODE_B4W_REFRACTION","USE_REFRACTION",{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["varying","float","bH",";"]}]}}]},{type:"condition",b:[{type:"if",d:["SHADOW_USAGE","SHADOW_MASK_GENERATION",{type:"equal_expr",e:2}],group:{type:"group",b:[{type:"textline", | |
a:"varying vec4 bI ; varying vec4 bJ ; varying vec4 bK ; varying vec4 bL ; uniform vec4 u_pcf_blur_radii ; uniform vec4 u_csm_center_dists ; uniform sampler2D u_shadow_map0 ; uniform sampler2D u_shadow_map1 ; uniform sampler2D u_shadow_map2 ; uniform sampler2D u_shadow_map3 ; uniform sampler2D u_shadow_mask ;".split(" ")}]}}]}]}},{type:"else",group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["TEXTURE_COLOR"],group:{type:"group",b:[{type:"textline",a:["varying","vec2","bM",";"]}]}}]}]}}]}, | |
{type:"condition",b:[{type:"if",d:["NODES","ALPHA",{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"include",file:"shadow.glslf"},{type:"include",file:"mirror.glslf"},{type:"include",file:"environment.glslf"},{type:"condition",b:[{type:"if",d:["USE_NODE_B4W_REFRACTION"],group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["USE_REFRACTION"],group:{type:"group",b:[{type:"include",file:"refraction.glslf"}]}}]}]}}]},{type:"include",file:"nodes.glslf"}]}}]},{type:"textline",a:"void main ( ) { mat4 qN ; float qO , qP ; vec4 qQ ; vec3 qR , qS , qT , qU ;".split(" ")}, | |
{type:"condition",b:[{type:"if",d:["ALPHA"],group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["NODES"],group:{type:"group",b:[{type:"textline",a:"qR = u_camera_eye_frag - bC ; qR = normalize ( qR ) ;".split(" ")},{type:"condition",b:[{type:"if",d:["USE_NODE_B4W_VECTOR_VIEW","REFLECTION_TYPE","REFL_PLANE",{type:"equal_expr",e:2},{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:"qN = O ( u_view_tsr_frag ) ; qM ( qR , qN , qS , qT , qU , qQ , qO ) ;".split(" ")}]}},{type:"else", | |
group:{type:"group",b:[{type:"textline",a:"qM ( qR , mat4 ( 0.0 ) , qS , qT , qU , qQ , qO ) ;".split(" ")}]}}]},{type:"textline",a:["qO","=","qO",";"]}]}},{type:"else",group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["TEXTURE_COLOR"],group:{type:"group",b:[{type:"textline",a:"qO = ( texture2D ( u_sampler , bM ) ) . a ;".split(" ")},{type:"condition",b:[{type:"if",d:["TEXTURE_BLEND_TYPE","TEXTURE_BLEND_TYPE_MIX",{type:"equal_expr",e:2}],group:{type:"group",b:[{type:"textline",a:"qP = u_alpha_factor * qO ; qP += ( 1.0 - step ( 0.0 , qP ) ) ; qO = mix ( qP , 1.0 , u_diffuse_color . a ) ;".split(" ")}]}}]}]}}, | |
{type:"else",group:{type:"group",b:[{type:"textline",a:"qO = u_diffuse_color . a ;".split(" ")}]}}]}]}}]},{type:"textline",a:"if ( qO < 0.5 ) discard ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["USE_OUTLINE"],group:{type:"group",b:[{type:"textline",a:"gl_FragColor = vec4 ( 1.0 , 1.0 , 1.0 , u_outline_intensity ) ;".split(" ")}]}},{type:"else",group:{type:"group",b:[{type:"textline",a:"gl_FragColor = vec4 ( u_color_id , 1.0 ) ;".split(" ")}]}}]},{type:"textline",a:["}"]}]};a["color_id.glslv"]= | |
{type:"group",b:[{type:"var",name:"AU_QUALIFIER",a:["uniform"]},{type:"var",name:"MAX_BONES",a:["0"]},{type:"var",name:"VERTEX_ANIM_MIX_NORMALS_FACTOR",a:["u_va_frame_factor"]},{type:"include",file:"std_enums.glsl"},{type:"include",file:"precision_statement.glslf"},{type:"include",file:"math.glslv"},{type:"include",file:"to_world.glslv"},{type:"include",file:"scale_texcoord.glslv"},{type:"textline",a:["attribute","vec3","a_position",";"]},{type:"condition",b:[{type:"if",d:["USE_NODE_MATERIAL_BEGIN", | |
"USE_NODE_GEOMETRY_NO","CAUSTICS","CALC_TBN_SPACE","WIND_BEND","MAIN_BEND_COL","DETAIL_BEND",{type:"logical_and_expr",e:3},{type:"logical_or_expr",e:5}],group:{type:"group",b:[{type:"textline",a:["attribute","vec3","a_normal",";"]}]}}]},{type:"condition",b:[{type:"if",d:["NODES","ALPHA",{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["CALC_TBN_SPACE"],group:{type:"group",b:[{type:"textline",a:["attribute","vec4","a_tangent",";"]}]}}]}]}}]},{type:"condition", | |
b:[{type:"if",d:["SKINNED"],group:{type:"group",b:[{type:"textline",a:["attribute","vec4","a_influence",";"]}]}}]},{type:"condition",b:[{type:"if",d:["WIND_BEND"],group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["MAIN_BEND_COL"],group:{type:"group",b:[{type:"textline",a:["attribute","float","a_bending_col_main",";"]},{type:"condition",b:[{type:"if",d:["DETAIL_BEND"],group:{type:"group",b:[{type:"textline",a:"attribute vec3 a_bending_col_detail ; AU_QUALIFIER float au_detail_bending_amp ; AU_QUALIFIER float au_branch_bending_amp ; AU_QUALIFIER float au_detail_bending_freq ;".split(" ")}]}}]}]}}]}, | |
{type:"textline",a:"AU_QUALIFIER float au_wind_bending_amp ; AU_QUALIFIER float au_wind_bending_freq ;".split(" ")},{type:"condition",b:[{type:"if",d:["BEND_CENTER_ONLY"],group:{type:"group",b:[{type:"textline",a:["attribute","vec3","a_emitter_center",";"]}]}}]}]}}]},{type:"condition",b:[{type:"if",d:["WIND_BEND","BILLBOARD",{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["AU_QUALIFIER","vec3","au_center_pos",";"]}]}}]},{type:"condition",b:[{type:"if",d:["VERTEX_ANIM"],group:{type:"group", | |
b:[{type:"textline",a:["attribute","vec3","a_position_next",";"]},{type:"condition",b:[{type:"if",d:["NODES","ALPHA",{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["USE_NODE_MATERIAL_BEGIN","USE_NODE_GEOMETRY_NO","CAUSTICS","CALC_TBN_SPACE",{type:"logical_or_expr",e:4}],group:{type:"group",b:[{type:"textline",a:["attribute","vec3","a_normal_next",";"]},{type:"condition",b:[{type:"if",d:["CALC_TBN_SPACE"],group:{type:"group",b:[{type:"textline",a:["attribute", | |
"vec4","a_tangent_next",";"]}]}}]}]}}]}]}}]}]}}]},{type:"condition",b:[{type:"if",d:["TEXTURE_COLOR"],group:{type:"group",b:[{type:"textline",a:["attribute","vec2","a_texcoord",";"]}]}}]},{type:"condition",b:[{type:"if",d:["STATIC_BATCH"],group:{type:"group",b:[{type:"textline",a:"const mat3 u_model_tsr = mat3 ( 0.0 , 0.0 , 0.0 , 1.0 , 0.0 , 0.0 , 0.0 , 1.0 , 0.0 ) ;".split(" ")}]}},{type:"else",group:{type:"group",b:[{type:"textline",a:["uniform","mat3","u_model_tsr",";"]}]}}]},{type:"textline", | |
a:"uniform mat3 u_view_tsr ; uniform mat4 u_proj_matrix ;".split(" ")},{type:"condition",b:[{type:"if",d:["BILLBOARD","DYNAMIC_GRASS",{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","vec3","u_camera_eye",";"]}]}}]},{type:"condition",b:[{type:"if",d:["NODES","ALPHA",{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["SMAA_JITTER"],group:{type:"group",b:[{type:"textline",a:["uniform","vec2","u_subpixel_jitter",";"]}]}}]},{type:"condition", | |
b:[{type:"if",d:["USE_NODE_B4W_REFRACTION"],group:{type:"group",b:[{type:"textline",a:["uniform","PRECISION","float","u_view_max_depth",";"]}]}}]}]}}]},{type:"condition",b:[{type:"if",d:["SKINNED"],group:{type:"group",b:[{type:"textline",a:"uniform vec4 u_quatsb [ MAX_BONES ] ; uniform vec4 u_transb [ MAX_BONES ] ; uniform vec4 u_arm_rel_trans ; uniform vec4 u_arm_rel_quat ;".split(" ")},{type:"condition",b:[{type:"if",d:["FRAMES_BLENDING"],group:{type:"group",b:[{type:"textline",a:"uniform vec4 u_quatsa [ MAX_BONES ] ; uniform vec4 u_transa [ MAX_BONES ] ; uniform float u_frame_factor ;".split(" ")}]}}]}]}}]}, | |
{type:"condition",b:[{type:"if",d:["WIND_BEND"],group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["BILLBOARD_JITTERED"],group:{type:"group",b:[{type:"textline",a:"uniform float u_jitter_amp ; uniform float u_jitter_freq ;".split(" ")}]}}]},{type:"textline",a:"uniform vec3 u_wind ; uniform float u_time ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["VERTEX_ANIM"],group:{type:"group",b:[{type:"textline",a:["uniform","float","u_va_frame_factor",";"]}]}}]},{type:"condition",b:[{type:"if", | |
d:["TEXTURE_COLOR"],group:{type:"group",b:[{type:"textline",a:["uniform","vec3","u_texture_scale",";"]}]}}]},{type:"condition",b:[{type:"if",d:["NODES","ALPHA",{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:"varying vec3 bC ; varying vec4 bD ;".split(" ")},{type:"condition",b:[{type:"if",d:["USE_NODE_MATERIAL_BEGIN","USE_NODE_GEOMETRY_NO","CAUSTICS","CALC_TBN_SPACE","WIND_BEND","MAIN_BEND_COL","DETAIL_BEND",{type:"logical_and_expr",e:3},{type:"logical_or_expr",e:5}],group:{type:"group", | |
b:[{type:"textline",a:["varying","vec3","bE",";"]}]}}]},{type:"condition",b:[{type:"if",d:["CALC_TBN_SPACE"],group:{type:"group",b:[{type:"textline",a:["varying","vec4","bF",";"]}]}}]},{type:"condition",b:[{type:"if",d:["REFLECTION_TYPE","REFL_PLANE",{type:"equal_expr",e:2},"USE_NODE_B4W_REFRACTION",{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["varying","vec3","bG",";"]}]}}]},{type:"condition",b:[{type:"if",d:["USE_NODE_B4W_REFRACTION","REFRACTIVE",{type:"logical_and_expr", | |
e:2}],group:{type:"group",b:[{type:"textline",a:["varying","float","bH",";"]}]}}]}]}},{type:"else",group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["TEXTURE_COLOR"],group:{type:"group",b:[{type:"textline",a:["varying","vec2","bM",";"]}]}}]}]}}]},{type:"include",file:"skin.glslv"},{type:"include",file:"wind_bending.glslv"},{type:"condition",b:[{type:"if",d:["NODES","ALPHA",{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"include",file:"nodes.glslv"}]}}]},{type:"textline",a:"void main ( ) { vec4 tv ; float tw , tx , ty ; vec3 tz , tA , tB , tC , tD , tE ; mat4 tF , tG , tH ; tF = O ( u_view_tsr ) ; tz = a_position ;".split(" ")}, | |
{type:"condition",b:[{type:"if",d:["NODES","ALPHA","CALC_TBN_SPACE","USE_NODE_MATERIAL_BEGIN","USE_NODE_GEOMETRY_NO","CAUSTICS","WIND_BEND","MAIN_BEND_COL","DETAIL_BEND",{type:"logical_and_expr",e:3},{type:"logical_or_expr",e:5},{type:"logical_and_expr",e:3}],group:{type:"group",b:[{type:"textline",a:["tA","=","a_normal",";"]},{type:"condition",b:[{type:"if",d:["CALC_TBN_SPACE"],group:{type:"group",b:[{type:"textline",a:"tB = vec3 ( a_tangent ) ; tC = a_tangent [ 3 ] * cross ( tA , tB ) ;".split(" ")}]}}, | |
{type:"else",group:{type:"group",b:[{type:"textline",a:"tB = vec3 ( 0.0 ) ; tC = vec3 ( 0.0 ) ;".split(" ")}]}}]}]}},{type:"else",group:{type:"group",b:[{type:"textline",a:"tA = vec3 ( 0.0 ) ; tB = vec3 ( 0.0 ) ; tC = vec3 ( 0.0 ) ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["VERTEX_ANIM"],group:{type:"group",b:[{type:"textline",a:"tz = mix ( tz , a_position_next , u_va_frame_factor ) ;".split(" ")},{type:"condition",b:[{type:"if",d:["NODES","ALPHA",{type:"logical_and_expr",e:2}],group:{type:"group", | |
b:[{type:"condition",b:[{type:"if",d:["USE_NODE_MATERIAL_BEGIN","USE_NODE_GEOMETRY_NO","CAUSTICS","CALC_TBN_SPACE",{type:"logical_or_expr",e:4}],group:{type:"group",b:[{type:"textline",a:"tA = mix ( tA , a_normal_next , VERTEX_ANIM_MIX_NORMALS_FACTOR ) ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["CALC_TBN_SPACE"],group:{type:"group",b:[{type:"textline",a:"tD = vec3 ( a_tangent ) ; tE = a_tangent_next [ 3 ] * cross ( a_normal_next , tD ) ; tB = mix ( tB , tD , u_va_frame_factor ) ; tC = mix ( tC , tE , u_va_frame_factor ) ;".split(" ")}]}}]}]}}]}]}}]}, | |
{type:"condition",b:[{type:"if",d:["SKINNED"],group:{type:"group",b:[{type:"textline",a:"sB ( tz , tB , tC , tA ) ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["WIND_BEND","BILLBOARD",{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["tC","=","au_center_pos",";"]}]}},{type:"else",group:{type:"group",b:[{type:"textline",a:"tC = vec3 ( 0.0 ) ;".split(" ")}]}}]},{type:"textline",a:"tG = O ( u_model_tsr ) ;".split(" ")},{type:"condition",b:[{type:"if",d:["BILLBOARD"],group:{type:"group", | |
b:[{type:"textline",a:"tB = ( tG * vec4 ( tC , 1.0 ) ) . xyz ;".split(" ")},{type:"condition",b:[{type:"if",d:["BILLBOARD_PRES_GLOB_ORIENTATION","STATIC_BATCH",{type:"logic_negative_expr",e:1},{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:"tH = ru ( u_camera_eye , tB , tF , tG ) ;".split(" ")}]}},{type:"else",group:{type:"group",b:[{type:"textline",a:"tH = ro ( u_camera_eye , tB , tF ) ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["WIND_BEND","BILLBOARD_JITTERED", | |
{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:"tH = tH * rg ( u_wind , u_time , u_jitter_amp , u_jitter_freq , tB ) ;".split(" ")}]}}]},{type:"textline",a:"c tI = rB ( tz - tC , tC , vec3 ( 0.0 ) , vec3 ( 0.0 ) , vec3 ( 0.0 ) , tH ) ; tI . b = tB ;".split(" ")}]}},{type:"else",group:{type:"group",b:[{type:"textline",a:"c tI = rB ( tz , tC , vec3 ( 0.0 ) , vec3 ( 0.0 ) , vec3 ( 0.0 ) , tG ) ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["WIND_BEND"],group:{type:"group", | |
b:[{type:"condition",b:[{type:"if",d:["NODES","ALPHA",{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:"tp ( tI . a , tI . b , tA ) ;".split(" ")}]}},{type:"else",group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["MAIN_BEND_COL","DETAIL_BEND",{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["tA","=","a_normal",";"]}]}},{type:"else",group:{type:"group",b:[{type:"textline",a:"tA = vec3 ( 0.0 ) ;".split(" ")}]}}]},{type:"textline",a:"tp ( tI . a , tI . b , tA ) ;".split(" ")}]}}]}]}}]}, | |
{type:"condition",b:[{type:"if",d:["NODES","ALPHA",{type:"logical_and_expr",e:2},{type:"logic_negative_expr",e:1}],group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["TEXTURE_COLOR"],group:{type:"group",b:[{type:"textline",a:"bM = rE ( a_texcoord , u_texture_scale ) ;".split(" ")}]}}]}]}}]},{type:"condition",b:[{type:"if",d:["NODES","ALPHA",{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:"bC = tI . a ;".split(" ")},{type:"condition",b:[{type:"if",d:["USE_NODE_MATERIAL_BEGIN", | |
"USE_NODE_GEOMETRY_NO","CAUSTICS","CALC_TBN_SPACE","WIND_BEND","MAIN_BEND_COL","DETAIL_BEND",{type:"logical_and_expr",e:3},{type:"logical_or_expr",e:5}],group:{type:"group",b:[{type:"textline",a:"bE = tI . e ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["CALC_TBN_SPACE"],group:{type:"group",b:[{type:"textline",a:"tw = ( dot ( cross ( tI . e , tI . c ) , tI . d ) < 0.0 ) ? - 1.0 : 1.0 ; bF = vec4 ( tI . c , tw ) ;".split(" ")}]}}]},{type:"textline",a:"bD = tF * vec4 ( tI . a , 1.0 ) ; tv = u_proj_matrix * bD ;".split(" ")}, | |
{type:"condition",b:[{type:"if",d:["SMAA_JITTER"],group:{type:"group",b:[{type:"textline",a:"tv . xy += u_subpixel_jitter * tv . w ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["REFLECTION_TYPE","REFL_PLANE",{type:"equal_expr",e:2},"USE_NODE_B4W_REFRACTION",{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:"tw = tv . x ; tx = tv . y ; ty = tv . w ; bG . x = ( tw + ty ) / 2.0 ; bG . y = ( tx + ty ) / 2.0 ; bG . z = ty ;".split(" ")}]}}]},{type:"condition",b:[{type:"if", | |
d:["USE_NODE_B4W_REFRACTION","REFRACTIVE",{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:"bH = - bD . z / u_view_max_depth ;".split(" ")}]}}]},{type:"textline",a:["tu","(",")",";"]}]}}]},{type:"textline",a:"gl_Position = u_proj_matrix * tF * vec4 ( tI . a , 1.0 ) ; }".split(" ")}]};a["grass_map.glslf"]={type:"group",b:[{type:"include",file:"precision_statement.glslf"},{type:"condition",b:[{type:"if",d:["DYNAMIC_GRASS_SIZE"],group:{type:"group",b:[{type:"condition",b:[{type:"if", | |
d:["DYNAMIC_GRASS_COLOR"],group:{type:"group",b:[{type:"textline",a:["varying","vec4","tv",";"]}]}},{type:"else",group:{type:"group",b:[{type:"textline",a:["varying","float","tv",";"]}]}}]}]}},{type:"else",group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["DYNAMIC_GRASS_COLOR"],group:{type:"group",b:[{type:"textline",a:["varying","vec3","tv",";"]}]}}]}]}}]},{type:"textline",a:["void","main","(",")","{"]},{type:"condition",b:[{type:"if",d:["DYNAMIC_GRASS_SIZE"],group:{type:"group",b:[{type:"condition", | |
b:[{type:"if",d:["DYNAMIC_GRASS_COLOR"],group:{type:"group",b:[{type:"textline",a:["gl_FragColor","=","tv",";"]}]}},{type:"else",group:{type:"group",b:[{type:"textline",a:"gl_FragColor = vec4 ( tv , vec3 ( 1.0 ) ) ;".split(" ")}]}}]}]}},{type:"else",group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["DYNAMIC_GRASS_COLOR"],group:{type:"group",b:[{type:"textline",a:"gl_FragColor = vec4 ( 1.0 , tv ) ;".split(" ")}]}},{type:"else",group:{type:"group",b:[{type:"textline",a:"gl_FragColor = vec4 ( 1.0 ) ;".split(" ")}]}}]}]}}]}, | |
{type:"textline",a:["}"]}]};a["grass_map.glslv"]={type:"group",b:[{type:"include",file:"math.glslv"},{type:"include",file:"to_world.glslv"},{type:"textline",a:["attribute","vec3","a_position",";"]},{type:"condition",b:[{type:"if",d:["DYNAMIC_GRASS_SIZE"],group:{type:"group",b:[{type:"textline",a:["attribute","float","a_grass_size",";"]}]}}]},{type:"condition",b:[{type:"if",d:["DYNAMIC_GRASS_COLOR"],group:{type:"group",b:[{type:"textline",a:["attribute","vec3","a_grass_color",";"]}]}}]},{type:"condition", | |
b:[{type:"if",d:["STATIC_BATCH"],group:{type:"group",b:[{type:"textline",a:"const mat3 u_model_tsr = mat3 ( 0.0 , 0.0 , 0.0 , 1.0 , 0.0 , 0.0 , 0.0 , 1.0 , 0.0 ) ;".split(" ")}]}},{type:"else",group:{type:"group",b:[{type:"textline",a:["uniform","mat3","u_model_tsr",";"]}]}}]},{type:"textline",a:"uniform mat3 u_view_tsr ; uniform mat4 u_proj_matrix ;".split(" ")},{type:"condition",b:[{type:"if",d:["BILLBOARD"],group:{type:"group",b:[{type:"textline",a:["uniform","vec3","u_camera_eye",";"]}]}}]},{type:"condition", | |
b:[{type:"if",d:["WIND_BEND","BILLBOARD_JITTERED",{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:"uniform vec3 u_wind ; uniform float u_time ; uniform float u_jitter_amp ; uniform float u_jitter_freq ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["DYNAMIC_GRASS_SIZE"],group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["DYNAMIC_GRASS_COLOR"],group:{type:"group",b:[{type:"textline",a:["varying","vec4","tv",";"]}]}},{type:"else",group:{type:"group",b:[{type:"textline", | |
a:["varying","float","tv",";"]}]}}]}]}},{type:"else",group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["DYNAMIC_GRASS_COLOR"],group:{type:"group",b:[{type:"textline",a:["varying","vec3","tv",";"]}]}}]}]}}]},{type:"textline",a:"void main ( ) { vec4 tw ; vec3 tx ; mat4 ty , tz , tA ; ty = O ( u_view_tsr ) ; tz = O ( u_model_tsr ) ;".split(" ")},{type:"condition",b:[{type:"if",d:["BILLBOARD"],group:{type:"group",b:[{type:"textline",a:"tx = ( tz * vec4 ( vec3 ( 0.0 ) , 1.0 ) ) . xyz ; tA = ro ( u_camera_eye , tx , ty ) ;".split(" ")}, | |
{type:"condition",b:[{type:"if",d:["WIND_BEND","BILLBOARD_JITTERED",{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:"tA = tA * rg ( u_wind , u_time , u_jitter_amp , u_jitter_freq , vec3 ( 0.0 ) ) ;".split(" ")}]}}]},{type:"textline",a:"c tB = rB ( a_position , vec3 ( 0.0 ) , vec3 ( 0.0 ) , vec3 ( 0.0 ) , vec3 ( 0.0 ) , tA ) ; tB . b = tx ;".split(" ")}]}},{type:"else",group:{type:"group",b:[{type:"textline",a:"c tB = rB ( a_position , vec3 ( 0.0 ) , vec3 ( 0.0 ) , vec3 ( 0.0 ) , vec3 ( 0.0 ) , tz ) ;".split(" ")}]}}]}, | |
{type:"textline",a:"tw = u_proj_matrix * ty * vec4 ( tB . a , 1.0 ) ;".split(" ")},{type:"condition",b:[{type:"if",d:["DYNAMIC_GRASS_SIZE"],group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["DYNAMIC_GRASS_COLOR"],group:{type:"group",b:[{type:"textline",a:"tv = vec4 ( a_grass_size , a_grass_color ) ;".split(" ")}]}},{type:"else",group:{type:"group",b:[{type:"textline",a:["tv","=","a_grass_size",";"]}]}}]}]}},{type:"else",group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["DYNAMIC_GRASS_COLOR"], | |
group:{type:"group",b:[{type:"textline",a:["tv","=","a_grass_color",";"]}]}}]}]}}]},{type:"textline",a:["gl_Position","=","tw",";","}"]}]};a["halo.glslf"]={type:"group",b:[{type:"var",name:"NUM_LINES",a:["0"]},{type:"var",name:"NUM_RINGS",a:["0"]},{type:"var",name:"NUM_STARS",a:["0"]},{type:"var",name:"WAVES_HEIGHT",a:["0.0"]},{type:"include",file:"precision_statement.glslf"},{type:"textline",a:"uniform vec4 u_diffuse_color ; uniform vec3 u_halo_rings_color ; uniform vec3 u_halo_lines_color ; uniform float u_halo_hardness ; uniform float u_halo_size ;".split(" ")}, | |
{type:"condition",b:[{type:"if",d:["SKY_STARS"],group:{type:"group",b:[{type:"textline",a:["uniform","vec3","u_sun_intensity",";"]},{type:"condition",b:[{type:"if",d:["WATER_EFFECTS","DISABLE_FOG",{type:"logic_negative_expr",e:1},{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:"uniform float u_halo_stars_blend ; uniform float u_halo_stars_height ; uniform float u_cam_water_depth ; varying vec4 tw ;".split(" ")}]}}]}]}}]},{type:"textline",a:"varying vec2 bM ; varying float tx ;".split(" ")}, | |
{type:"include",file:"color_util.glslf"},{type:"include",file:"halo_color.glslf"},{type:"textline",a:"void main ( ) { float ud ; vec3 ue ; vec4 uf ; uf = uc ( ) ; ue = uf . rgb ; ud = uf . a ; bu ( ue ) ; bx ( ue , ud ) ; gl_FragColor = vec4 ( ue , ud ) ; }".split(" ")}]};a["halo.glslv"]={type:"group",b:[{type:"var",name:"PRECISION",a:["lowp"]},{type:"include",file:"math.glslv"},{type:"include",file:"to_world.glslv"},{type:"textline",a:"attribute vec3 a_position ; attribute vec2 a_halo_bb_vertex ; attribute float a_random_vals ; uniform mat3 u_view_tsr ; uniform mat4 u_proj_matrix ; uniform PRECISION float u_halo_size ; varying vec2 bM ; varying float tx ;".split(" ")}, | |
{type:"condition",b:[{type:"if",d:["STATIC_BATCH"],group:{type:"group",b:[{type:"textline",a:"const mat3 u_model_tsr = mat3 ( 0.0 , 0.0 , 0.0 , 1.0 , 0.0 , 0.0 , 0.0 , 1.0 , 0.0 ) ;".split(" ")}]}},{type:"else",group:{type:"group",b:[{type:"textline",a:["uniform","mat3","u_model_tsr",";"]}]}}]},{type:"condition",b:[{type:"if",d:["WATER_EFFECTS","DISABLE_FOG",{type:"logic_negative_expr",e:1},{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["varying","vec4","tw",";"]}]}}]}, | |
{type:"textline",a:"void main ( ) { vec4 ud , ue ; vec3 uf ; mat4 ug , uh , ui ; ug = O ( u_view_tsr ) ; uh = O ( u_model_tsr ) ; uf = ( uh * vec4 ( a_position , 1.0 ) ) . xyz ; bM = a_halo_bb_vertex * 2.0 ; tx = a_random_vals ;".split(" ")},{type:"condition",b:[{type:"if",d:["SKY_STARS"],group:{type:"group",b:[{type:"textline",a:"uh = qT ( uf , ug ) ; ui = ug ; ui [ 3 ] [ 0 ] = 0.0 ; ui [ 3 ] [ 1 ] = 0.0 ; ui [ 3 ] [ 2 ] = 0.0 ;".split(" ")}]}},{type:"else",group:{type:"group",b:[{type:"textline", | |
a:"uh = qT ( uf , ug ) ;".split(" ")}]}}]},{type:"textline",a:"ud = vec4 ( a_halo_bb_vertex * 2.0 * u_halo_size , 0.0 , 1.0 ) ; ud = uh * ud ;".split(" ")},{type:"condition",b:[{type:"if",d:["SKY_STARS"],group:{type:"group",b:[{type:"textline",a:"ue = u_proj_matrix * ui * ud ; ue . z = 0.99999 * ue . w ;".split(" ")},{type:"condition",b:[{type:"if",d:["WATER_EFFECTS","DISABLE_FOG",{type:"logic_negative_expr",e:1},{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["tw","=","ud", | |
";"]}]}}]}]}},{type:"else",group:{type:"group",b:[{type:"textline",a:"ue = u_proj_matrix * ug * ud ;".split(" ")}]}}]},{type:"textline",a:["gl_Position","=","ue",";","}"]}]};a["line.glslf"]={type:"group",b:[{type:"include",file:"precision_statement.glslf"},{type:"include",file:"color_util.glslf"},{type:"textline",a:"uniform vec4 u_diffuse_color ; void main ( ) { float ud ; vec3 ue ; ue = u_diffuse_color . xyz ; ud = u_diffuse_color . a ; bu ( ue ) ;".split(" ")},{type:"condition",b:[{type:"if",d:["ALPHA"], | |
group:{type:"group",b:[{type:"textline",a:"bx ( ue , ud ) ;".split(" ")}]}}]},{type:"textline",a:"gl_FragColor = vec4 ( ue , ud ) ; }".split(" ")}]};a["line.glslv"]={type:"group",b:[{type:"var",name:"AU_QUALIFIER",a:["uniform"]},{type:"var",name:"PRECISION",a:["lowp"]},{type:"var",name:"MAX_BONES",a:["0"]},{type:"include",file:"math.glslv"},{type:"include",file:"to_world.glslv"},{type:"textline",a:"attribute vec3 a_position ; attribute vec3 a_direction ; uniform mat3 u_model_tsr ; uniform mat3 u_view_tsr ; uniform mat4 u_proj_matrix ; uniform float u_height ; uniform float u_line_width ;".split(" ")}, | |
{type:"define",name:"M_PI",a:["3.14159265359"]},{type:"textline",a:"void main ( ) { mat2 ud ; float ue ; vec2 uf , ug ; vec4 uh ; mat4 ui , uj ; ui = O ( u_view_tsr ) ; uj = O ( u_model_tsr ) ; c uk = rB ( a_position , vec3 ( 0.0 ) , vec3 ( 0.0 ) , vec3 ( 0.0 ) , normalize ( a_direction ) , uj ) ; uh = u_proj_matrix * ui * vec4 ( uk . a , 1.0 ) ; uh . xyz /= uh . w ; uf = ( u_proj_matrix * ui * vec4 ( uk . e , 0.0 ) ) . xy ; ue = M_PI / 2.0 ; ud = mat2 ( cos ( ue ) , sin ( ue ) , - sin ( ue ) , cos ( ue ) ) ; uf = ud * normalize ( uf ) ; ug = ( u_line_width / u_height ) * vec2 ( u_proj_matrix [ 0 ] [ 0 ] / u_proj_matrix [ 1 ] [ 1 ] , 1.0 ) ; gl_Position = vec4 ( uh . xy + uf . xy * ug / 2.0 , uh . z , 1.0 ) ; gl_Position *= uh . w ; }".split(" ")}]}; | |
a["main.glslf"]={type:"group",b:[{type:"var",name:"WATER_LEVEL",a:["0.0"]},{type:"var",name:"WAVES_HEIGHT",a:["0.0"]},{type:"var",name:"NUM_LAMP_LIGHTS",a:["0"]},{type:"var",name:"NUM_VALUES",a:["0"]},{type:"var",name:"NUM_RGBS",a:["0"]},{type:"var",name:"PARALLAX_STEPS",a:["0.0"]},{type:"var",name:"PARALLAX_LOD_DIST",a:["0.0"]},{type:"var",name:"WATER_LEVEL",a:["0.0"]},{type:"var",name:"WAVES_HEIGHT",a:["0.0"]},{type:"var",name:"NUM_LIGHTS",a:["0"]},{type:"var",name:"LAMP_IND",a:["0"]},{type:"var", | |
name:"LAMP_SPOT_SIZE",a:["0"]},{type:"var",name:"LAMP_SPOT_BLEND",a:["0"]},{type:"var",name:"LAMP_LIGHT_DIST",a:["0"]},{type:"var",name:"LAMP_LIGHT_FACT_IND",a:["0"]},{type:"var",name:"LAMP_FAC_CHANNELS",a:["rgb"]},{type:"var",name:"LAMP_SHADOW_MAP_IND",a:["0"]},{type:"var",name:"NUM_LFACTORS",a:["0"]},{type:"include",file:"std_enums.glsl"},{type:"include",file:"precision_statement.glslf"},{type:"include",file:"pack.glslf"},{type:"condition",b:[{type:"if",d:["SHADELESS",{type:"logic_negative_expr", | |
e:1}],group:{type:"group",b:[{type:"include",file:"procedural.glslf"},{type:"condition",b:[{type:"if",d:["CAUSTICS"],group:{type:"group",b:[{type:"include",file:"caustics.glslf"}]}}]}]}}]},{type:"include",file:"color_util.glslf"},{type:"include",file:"math.glslv"},{type:"textline",a:["uniform","float","u_time",";"]},{type:"condition",b:[{type:"if",d:["USE_ENVIRONMENT_LIGHT","SKY_TEXTURE",{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","samplerCube","u_sky_texture", | |
";"]}]}},{type:"elif",d:["USE_ENVIRONMENT_LIGHT","SKY_COLOR",{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:"uniform vec3 u_horizon_color ; uniform vec3 u_zenith_color ;".split(" ")}]}}]},{type:"textline",a:["uniform","float","u_environment_energy",";"]},{type:"condition",b:[{type:"if",d:["SHADELESS",{type:"logic_negative_expr",e:1}],group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["NUM_LIGHTS",0,{type:"g_expr",e:2}],group:{type:"group",b:[{type:"textline",a:"uniform vec3 u_light_positions [ NUM_LIGHTS ] ; uniform vec3 u_light_directions [ NUM_LIGHTS ] ; uniform vec3 u_light_color_intensities [ NUM_LIGHTS ] ; uniform vec4 u_light_factors [ NUM_LFACTORS ] ;".split(" ")}]}}]}, | |
{type:"condition",b:[{type:"if",d:["WATER_EFFECTS","CAUSTICS",{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","vec4","u_sun_quaternion",";"]}]}}]}]}}]},{type:"textline",a:["uniform","vec3","u_camera_eye_frag",";"]},{type:"condition",b:[{type:"if",d:["NORMAL_TEXCOORD","REFLECTION_TYPE","REFL_PLANE",{type:"equal_expr",e:2},"USE_NODE_B4W_VECTOR_VIEW",{type:"logical_or_expr",e:3}],group:{type:"group",b:[{type:"textline",a:["uniform","mat3","u_view_tsr_frag",";"]}]}}]}, | |
{type:"condition",b:[{type:"if",d:["DISABLE_FOG",{type:"logic_negative_expr",e:1}],group:{type:"group",b:[{type:"textline",a:["uniform","vec4","u_fog_color_density",";"]},{type:"condition",b:[{type:"if",d:["WATER_EFFECTS"],group:{type:"group",b:[{type:"textline",a:"uniform vec4 u_underwater_fog_color_density ; uniform float u_cam_water_depth ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["PROCEDURAL_FOG"],group:{type:"group",b:[{type:"textline",a:["uniform","mat4","u_cube_fog",";"]}]}}]}, | |
{type:"condition",b:[{type:"if",d:["USE_FOG"],group:{type:"group",b:[{type:"textline",a:["uniform","vec4","u_fog_params",";"]}]}}]}]}}]},{type:"condition",b:[{type:"if",d:["WATER_EFFECTS","DISABLE_FOG",{type:"logic_negative_expr",e:1},{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","vec3","u_sun_intensity",";"]}]}}]},{type:"condition",b:[{type:"if",d:["WATER_EFFECTS","CAUSTICS",{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","vec3", | |
"u_sun_direction",";"]}]}}]},{type:"condition",b:[{type:"if",d:["REFLECTION_TYPE","REFL_PLANE",{type:"equal_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","sampler2D","u_plane_reflection",";"]}]}},{type:"elif",d:["REFLECTION_TYPE","REFL_CUBE",{type:"equal_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","samplerCube","u_cube_reflection",";"]}]}},{type:"elif",d:["REFLECTION_TYPE","REFL_MIRRORMAP",{type:"equal_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform", | |
"samplerCube","u_mirrormap",";"]}]}}]},{type:"condition",b:[{type:"if",d:["SHADOW_USAGE","SHADOW_MAPPING_OPAQUE",{type:"equal_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","sampler2D","u_shadow_mask",";"]}]}},{type:"elif",d:["SHADOW_USAGE","SHADOW_MAPPING_BLEND",{type:"equal_expr",e:2}],group:{type:"group",b:[{type:"textline",a:"uniform vec4 u_pcf_blur_radii ; uniform vec4 u_csm_center_dists ; uniform PRECISION sampler2D u_shadow_map0 ;".split(" ")},{type:"condition",b:[{type:"if", | |
d:["CSM_SECTION1","NUM_CAST_LAMPS",1,{type:"g_expr",e:2},{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","PRECISION","sampler2D","u_shadow_map1",";"]}]}}]},{type:"condition",b:[{type:"if",d:["CSM_SECTION2","NUM_CAST_LAMPS",2,{type:"g_expr",e:2},{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","PRECISION","sampler2D","u_shadow_map2",";"]}]}}]},{type:"condition",b:[{type:"if",d:["CSM_SECTION3","NUM_CAST_LAMPS",3,{type:"g_expr",e:2}, | |
{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","PRECISION","sampler2D","u_shadow_map3",";"]}]}}]}]}}]},{type:"condition",b:[{type:"if",d:["REFRACTIVE","USE_NODE_B4W_REFRACTION",{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","sampler2D","u_refractmap",";"]}]}}]},{type:"condition",b:[{type:"if",d:["USE_NODE_B4W_REFRACTION","USE_REFRACTION","REFRACTIVE","USE_REFRACTION_CORRECTION",{type:"logical_and_expr",e:4}],group:{type:"group", | |
b:[{type:"textline",a:["uniform","PRECISION","sampler2D","u_scene_depth",";"]}]}}]},{type:"textline",a:"uniform float u_emit ; uniform float u_ambient ; uniform vec4 u_fresnel_params ;".split(" ")},{type:"condition",b:[{type:"if",d:["REFLECTION_TYPE","REFL_PLANE",{type:"equal_expr",e:2},"REFLECTION_TYPE","REFL_CUBE",{type:"equal_expr",e:2},{type:"logical_or_expr",e:2}],group:{type:"group",b:[]}},{type:"elif",d:["REFLECTION_TYPE","REFL_MIRRORMAP",{type:"equal_expr",e:2}],group:{type:"group",b:[{type:"textline", | |
a:["uniform","float","u_mirror_factor",";"]}]}}]},{type:"condition",b:[{type:"if",d:["REFLECTION_TYPE","REFL_PLANE",{type:"equal_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","vec4","u_refl_plane",";"]}]}}]},{type:"condition",b:[{type:"if",d:["USE_NODE_LAMP"],group:{type:"group",b:[{type:"textline",a:"uniform vec3 u_lamp_light_positions [ NUM_LAMP_LIGHTS ] ; uniform vec3 u_lamp_light_directions [ NUM_LAMP_LIGHTS ] ; uniform vec3 u_lamp_light_color_intensities [ NUM_LAMP_LIGHTS ] ; uniform vec4 u_lamp_light_factors [ NUM_LAMP_LIGHTS ] ;".split(" ")}]}}]}, | |
{type:"condition",b:[{type:"if",d:["USE_NODE_VALUE"],group:{type:"group",b:[{type:"textline",a:"uniform float u_node_values [ NUM_VALUES ] ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["USE_NODE_RGB"],group:{type:"group",b:[{type:"textline",a:"uniform vec3 u_node_rgbs [ NUM_RGBS ] ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["USE_NODE_CURVE_VEC","USE_NODE_CURVE_RGB","USE_NODE_VALTORGB",{type:"logical_or_expr",e:3}],group:{type:"group",b:[{type:"textline",a:["uniform","sampler2D", | |
"u_nodes_texture",";"]}]}}]},{type:"textline",a:["varying","vec3","bC",";"]},{type:"condition",b:[{type:"if",d:["USE_NODE_MATERIAL_BEGIN","USE_NODE_GEOMETRY_NO","CAUSTICS","CALC_TBN_SPACE","WIND_BEND","MAIN_BEND_COL","DETAIL_BEND",{type:"logical_and_expr",e:3},"USE_NODE_TEX_COORD_NO",{type:"logical_or_expr",e:6}],group:{type:"group",b:[{type:"textline",a:["varying","vec3","bE",";"]}]}}]},{type:"condition",b:[{type:"if",d:["NODES","DISABLE_FOG",{type:"logic_negative_expr",e:1},"TEXTURE_NORM_CO","PARALLAX", | |
{type:"logical_and_expr",e:2},"WATER_EFFECTS","CAUSTICS",{type:"logical_and_expr",e:2},"SHADOW_USAGE","SHADOW_MASK_GENERATION",{type:"equal_expr",e:2},"SHADOW_USAGE","SHADOW_MAPPING_BLEND",{type:"equal_expr",e:2},{type:"logical_or_expr",e:6}],group:{type:"group",b:[{type:"textline",a:["varying","vec4","bD",";"]}]}}]},{type:"condition",b:[{type:"if",d:["TEXTURE_NORM_CO","CALC_TBN_SPACE",{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["varying","vec4","bF",";"]}]}}]},{type:"condition", | |
b:[{type:"if",d:["SHADOW_USAGE","SHADOW_MAPPING_BLEND",{type:"equal_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["varying","vec4","bI",";"]},{type:"condition",b:[{type:"if",d:["CSM_SECTION1","NUM_CAST_LAMPS",1,{type:"g_expr",e:2},{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["varying","vec4","bJ",";"]}]}}]},{type:"condition",b:[{type:"if",d:["CSM_SECTION2","NUM_CAST_LAMPS",2,{type:"g_expr",e:2},{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline", | |
a:["varying","vec4","bK",";"]}]}}]},{type:"condition",b:[{type:"if",d:["CSM_SECTION3","NUM_CAST_LAMPS",3,{type:"g_expr",e:2},{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["varying","vec4","bL",";"]}]}}]}]}}]},{type:"condition",b:[{type:"if",d:["REFLECTION_TYPE","REFL_PLANE",{type:"equal_expr",e:2},"SHADOW_USAGE","SHADOW_MAPPING_OPAQUE",{type:"equal_expr",e:2},"REFRACTIVE","USE_NODE_B4W_REFRACTION",{type:"logical_or_expr",e:4}],group:{type:"group",b:[{type:"textline",a:["varying", | |
"vec3","bG",";"]}]}}]},{type:"condition",b:[{type:"if",d:["REFRACTIVE","USE_NODE_B4W_REFRACTION",{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["varying","float","bH",";"]}]}}]},{type:"include",file:"mirror.glslf"},{type:"include",file:"environment.glslf"},{type:"condition",b:[{type:"if",d:["SHADELESS",{type:"logic_negative_expr",e:1}],group:{type:"group",b:[{type:"include",file:"shadow.glslf"}]}}]},{type:"condition",b:[{type:"if",d:["USE_NODE_B4W_REFRACTION","USE_REFRACTION", | |
{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"include",file:"refraction.glslf"}]}}]},{type:"include",file:"nodes.glslf"},{type:"condition",b:[{type:"if",d:["DISABLE_FOG",{type:"logic_negative_expr",e:1}],group:{type:"group",b:[{type:"include",file:"fog.glslf"}]}}]},{type:"textline",a:"void main ( ) { vec2 uK ; mat4 uL ; vec4 uM ; vec3 uN , uO , uP , uQ , uR ; float uS , uT , uU ;".split(" ")},{type:"condition",b:[{type:"if",d:["NODES","DISABLE_FOG",{type:"logic_negative_expr",e:1}, | |
"TEXTURE_NORM_CO","PARALLAX",{type:"logical_and_expr",e:2},"WATER_EFFECTS","CAUSTICS",{type:"logical_and_expr",e:2},"SHADOW_USAGE","SHADOW_MASK_GENERATION",{type:"equal_expr",e:2},"SHADOW_USAGE","SHADOW_MAPPING_BLEND",{type:"equal_expr",e:2},{type:"logical_or_expr",e:6}],group:{type:"group",b:[{type:"textline",a:"uS = length ( bD ) ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["WATER_EFFECTS"],group:{type:"group",b:[{type:"textline",a:"uT = bC . y - WATER_LEVEL ;".split(" ")}]}}]},{type:"condition", | |
b:[{type:"if",d:["WATER_EFFECTS","DISABLE_FOG",{type:"logic_negative_expr",e:1},"CAUSTICS","WATER_EFFECTS",{type:"logical_and_expr",e:2},{type:"logical_or_expr",e:3}],group:{type:"group",b:[{type:"textline",a:["uN","=","u_sun_intensity",";"]}]}}]},{type:"textline",a:"uO = normalize ( u_camera_eye_frag - bC ) ;".split(" ")},{type:"condition",b:[{type:"if",d:["USE_NODE_B4W_VECTOR_VIEW","REFLECTION_TYPE","REFL_PLANE",{type:"equal_expr",e:2},{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline", | |
a:"uL = O ( u_view_tsr_frag ) ; qM ( uO , uL , uP , uQ , uR , uM , uU ) ;".split(" ")}]}},{type:"else",group:{type:"group",b:[{type:"textline",a:"qM ( uO , mat4 ( 0.0 ) , uP , uQ , uR , uM , uU ) ;".split(" ")}]}}]},{type:"textline",a:"uP = uP ; uU = uU ; uR = uR ; uM = uM ;".split(" ")},{type:"condition",b:[{type:"if",d:["SHADELESS",{type:"logic_negative_expr",e:1}],group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["WATER_EFFECTS"],group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["WETTABLE"], | |
group:{type:"group",b:[{type:"textline",a:"uP = max ( uP - sqrt ( 0.01 * - min ( uT , 0.0 ) ) , 0.5 * uP ) ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["CAUSTICS"],group:{type:"group",b:[{type:"textline",a:"bp ( uP , uT , u_time , uM , uR , u_sun_direction , uN , u_sun_quaternion , bC , uS ) ;".split(" ")}]}}]}]}}]}]}}]},{type:"condition",b:[{type:"if",d:["ALPHA"],group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["ALPHA_CLIP"],group:{type:"group",b:[{type:"textline",a:"if ( uU < 0.5 ) discard ; uU = 1.0 ;".split(" ")}]}}]}]}}, | |
{type:"else",group:{type:"group",b:[{type:"textline",a:["uU","=","1.0",";"]}]}}]},{type:"condition",b:[{type:"if",d:["DISABLE_FOG",{type:"logic_negative_expr",e:1}],group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["WATER_EFFECTS"],group:{type:"group",b:[{type:"textline",a:"uJ ( uP , length ( bD ) , uO , uT ) ;".split(" ")}]}},{type:"else",group:{type:"group",b:[{type:"textline",a:"uJ ( uP , length ( bD ) , uO , 1.0 ) ;".split(" ")}]}}]}]}}]},{type:"condition",b:[{type:"if",d:["SSAO_ONLY", | |
"SHADOW_USAGE","SHADOW_MAPPING_OPAQUE",{type:"equal_expr",e:2},{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:"uK = texture2DProj ( u_shadow_mask , bG ) . rg ; uT = uK . g ; uP = vec3 ( uT ) ;".split(" ")}]}}]},{type:"textline",a:["bu","(","uP",")",";"]},{type:"condition",b:[{type:"if",d:["ALPHA","ALPHA_CLIP",{type:"logic_negative_expr",e:1},{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:"bx ( uP , uU ) ;".split(" ")}]}}]},{type:"textline",a:"gl_FragColor = vec4 ( uP , uU ) ; }".split(" ")}]}; | |
a["main.glslv"]={type:"group",b:[{type:"var",name:"AU_QUALIFIER",a:["uniform"]},{type:"var",name:"MAX_BONES",a:["0"]},{type:"var",name:"NUM_CAST_LAMPS",a:["0"]},{type:"var",name:"PRECISION",a:["lowp"]},{type:"var",name:"VERTEX_ANIM_MIX_NORMALS_FACTOR",a:["u_va_frame_factor"]},{type:"include",file:"std_enums.glsl"},{type:"include",file:"math.glslv"},{type:"include",file:"to_world.glslv"},{type:"include",file:"scale_texcoord.glslv"},{type:"textline",a:["attribute","vec3","a_position",";"]},{type:"condition", | |
b:[{type:"if",d:["NODES",{type:"logic_negative_expr",e:1},"USE_NODE_MATERIAL_BEGIN","USE_NODE_GEOMETRY_NO","CAUSTICS","CALC_TBN_SPACE","WIND_BEND","MAIN_BEND_COL","DETAIL_BEND",{type:"logical_and_expr",e:3},"USE_NODE_TEX_COORD_NO",{type:"logical_or_expr",e:7}],group:{type:"group",b:[{type:"textline",a:["attribute","vec3","a_normal",";"]}]}}]},{type:"condition",b:[{type:"if",d:["TEXTURE_NORM_CO","CALC_TBN_SPACE",{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["attribute","vec4", | |
"a_tangent",";"]}]}}]},{type:"condition",b:[{type:"if",d:["SKINNED"],group:{type:"group",b:[{type:"textline",a:["attribute","vec4","a_influence",";"]}]}}]},{type:"condition",b:[{type:"if",d:["WIND_BEND","DYNAMIC_GRASS","BILLBOARD",{type:"logical_or_expr",e:3}],group:{type:"group",b:[{type:"textline",a:["AU_QUALIFIER","vec3","au_center_pos",";"]}]}}]},{type:"condition",b:[{type:"if",d:["WIND_BEND"],group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["MAIN_BEND_COL"],group:{type:"group",b:[{type:"textline", | |
a:["attribute","float","a_bending_col_main",";"]},{type:"condition",b:[{type:"if",d:["DETAIL_BEND"],group:{type:"group",b:[{type:"textline",a:"attribute vec3 a_bending_col_detail ; AU_QUALIFIER float au_detail_bending_amp ; AU_QUALIFIER float au_branch_bending_amp ; AU_QUALIFIER float au_detail_bending_freq ;".split(" ")}]}}]}]}}]},{type:"textline",a:"AU_QUALIFIER float au_wind_bending_amp ; AU_QUALIFIER float au_wind_bending_freq ;".split(" ")},{type:"condition",b:[{type:"if",d:["BEND_CENTER_ONLY"], | |
group:{type:"group",b:[{type:"textline",a:["attribute","vec3","a_emitter_center",";"]}]}}]}]}}]},{type:"condition",b:[{type:"if",d:["VERTEX_ANIM"],group:{type:"group",b:[{type:"textline",a:["attribute","vec3","a_position_next",";"]},{type:"condition",b:[{type:"if",d:["NODES",{type:"logic_negative_expr",e:1},"USE_NODE_MATERIAL_BEGIN","USE_NODE_GEOMETRY_NO","CAUSTICS","CALC_TBN_SPACE","USE_NODE_TEX_COORD_NO",{type:"logical_or_expr",e:6}],group:{type:"group",b:[{type:"textline",a:["attribute","vec3", | |
"a_normal_next",";"]},{type:"condition",b:[{type:"if",d:["TEXTURE_NORM_CO","CALC_TBN_SPACE",{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["attribute","vec4","a_tangent_next",";"]}]}}]}]}}]}]}}]},{type:"condition",b:[{type:"if",d:["NODES",{type:"logic_negative_expr",e:1}],group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["TEXCOORD"],group:{type:"group",b:[{type:"textline",a:["attribute","vec2","a_texcoord",";"]}]}}]},{type:"condition",b:[{type:"if",d:["VERTEX_COLOR"], | |
group:{type:"group",b:[{type:"textline",a:["attribute","vec3","a_color",";"]}]}}]}]}}]},{type:"condition",b:[{type:"if",d:["STATIC_BATCH"],group:{type:"group",b:[{type:"textline",a:"const mat3 u_model_tsr = mat3 ( 0.0 , 0.0 , 0.0 , 1.0 , 0.0 , 0.0 , 0.0 , 1.0 , 0.0 ) ;".split(" ")}]}},{type:"else",group:{type:"group",b:[{type:"textline",a:["uniform","mat3","u_model_tsr",";"]}]}}]},{type:"condition",b:[{type:"if",d:["REFLECTION_PASS"],group:{type:"group",b:[{type:"textline",a:"uniform mat4 u_view_matrix ; uniform mat3 u_view_tsr ;".split(" ")}]}}, | |
{type:"else",group:{type:"group",b:[{type:"textline",a:["uniform","mat3","u_view_tsr",";"]}]}}]},{type:"textline",a:["uniform","mat4","u_proj_matrix",";"]},{type:"condition",b:[{type:"if",d:["NODES",{type:"logic_negative_expr",e:1},"BILLBOARD","DYNAMIC_GRASS",{type:"logical_or_expr",e:3}],group:{type:"group",b:[{type:"textline",a:["uniform","vec3","u_camera_eye",";"]}]}}]},{type:"condition",b:[{type:"if",d:["SMAA_JITTER"],group:{type:"group",b:[{type:"textline",a:["uniform","vec2","u_subpixel_jitter", | |
";"]}]}}]},{type:"condition",b:[{type:"if",d:["DYNAMIC_GRASS"],group:{type:"group",b:[{type:"textline",a:"uniform PRECISION sampler2D u_grass_map_depth ; uniform sampler2D u_grass_map_color ; uniform vec4 u_camera_quat ; uniform vec3 u_grass_map_dim ; uniform float u_grass_size ; uniform float u_scale_threshold ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["SKINNED"],group:{type:"group",b:[{type:"textline",a:"uniform vec4 u_quatsb [ MAX_BONES ] ; uniform vec4 u_transb [ MAX_BONES ] ; uniform vec4 u_arm_rel_trans ; uniform vec4 u_arm_rel_quat ;".split(" ")}, | |
{type:"condition",b:[{type:"if",d:["FRAMES_BLENDING"],group:{type:"group",b:[{type:"textline",a:"uniform vec4 u_quatsa [ MAX_BONES ] ; uniform vec4 u_transa [ MAX_BONES ] ; uniform float u_frame_factor ;".split(" ")}]}}]}]}}]},{type:"condition",b:[{type:"if",d:["WIND_BEND"],group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["BILLBOARD_JITTERED"],group:{type:"group",b:[{type:"textline",a:"uniform float u_jitter_amp ; uniform float u_jitter_freq ;".split(" ")}]}}]},{type:"textline",a:"uniform vec3 u_wind ; uniform PRECISION float u_time ;".split(" ")}]}}]}, | |
{type:"condition",b:[{type:"if",d:["VERTEX_ANIM"],group:{type:"group",b:[{type:"textline",a:["uniform","float","u_va_frame_factor",";"]}]}}]},{type:"condition",b:[{type:"if",d:["NODES",{type:"logic_negative_expr",e:1}],group:{type:"group",b:[{type:"textline",a:["uniform","vec3","u_texture_scale",";"]}]}}]},{type:"condition",b:[{type:"if",d:["SHADOW_USAGE","SHADOW_MAPPING_BLEND",{type:"equal_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","float","u_normal_offset",";"]},{type:"condition", | |
b:[{type:"if",d:["MAC_OS_SHADOW_HACK"],group:{type:"group",b:[{type:"textline",a:"uniform mat3 u_v_light_tsr [ NUM_CAST_LAMPS ] ;".split(" ")}]}},{type:"else",group:{type:"group",b:[{type:"textline",a:"uniform vec4 u_v_light_ts [ NUM_CAST_LAMPS ] ; uniform vec4 u_v_light_r [ NUM_CAST_LAMPS ] ;".split(" ")}]}}]},{type:"textline",a:["uniform","mat4","u_p_light_matrix0",";"]},{type:"condition",b:[{type:"if",d:["CSM_SECTION1","NUM_CAST_LAMPS",1,{type:"g_expr",e:2},{type:"logical_or_expr",e:2}],group:{type:"group", | |
b:[{type:"textline",a:["uniform","mat4","u_p_light_matrix1",";"]}]}}]},{type:"condition",b:[{type:"if",d:["CSM_SECTION2","NUM_CAST_LAMPS",2,{type:"g_expr",e:2},{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","mat4","u_p_light_matrix2",";"]}]}}]},{type:"condition",b:[{type:"if",d:["CSM_SECTION3","NUM_CAST_LAMPS",3,{type:"g_expr",e:2},{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","mat4","u_p_light_matrix3",";"]}]}}]}]}}]},{type:"condition", | |
b:[{type:"if",d:["REFRACTIVE","USE_NODE_B4W_REFRACTION",{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","PRECISION","float","u_view_max_depth",";"]}]}}]},{type:"textline",a:["varying","vec3","bC",";"]},{type:"condition",b:[{type:"if",d:["NODES",{type:"logic_negative_expr",e:1},"USE_NODE_MATERIAL_BEGIN","USE_NODE_GEOMETRY_NO","CAUSTICS","CALC_TBN_SPACE","WIND_BEND","MAIN_BEND_COL","DETAIL_BEND",{type:"logical_and_expr",e:3},"USE_NODE_TEX_COORD_NO",{type:"logical_or_expr", | |
e:7}],group:{type:"group",b:[{type:"textline",a:["varying","vec3","bE",";"]}]}}]},{type:"condition",b:[{type:"if",d:["NODES","DISABLE_FOG",{type:"logic_negative_expr",e:1},"TEXTURE_NORM_CO","PARALLAX",{type:"logical_and_expr",e:2},"WATER_EFFECTS","CAUSTICS",{type:"logical_and_expr",e:2},"SHADOW_USAGE","SHADOW_MASK_GENERATION",{type:"equal_expr",e:2},"SHADOW_USAGE","SHADOW_MAPPING_BLEND",{type:"equal_expr",e:2},{type:"logical_or_expr",e:6}],group:{type:"group",b:[{type:"textline",a:["varying","vec4", | |
"bD",";"]}]}}]},{type:"condition",b:[{type:"if",d:["TEXTURE_NORM_CO","CALC_TBN_SPACE",{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["varying","vec4","bF",";"]}]}}]},{type:"condition",b:[{type:"if",d:["NODES",{type:"logic_negative_expr",e:1}],group:{type:"group",b:[{type:"textline",a:["varying","vec3","uK",";"]},{type:"condition",b:[{type:"if",d:["TEXCOORD"],group:{type:"group",b:[{type:"textline",a:["varying","vec2","bM",";"]}]}}]},{type:"condition",b:[{type:"if",d:["VERTEX_COLOR", | |
"DYNAMIC_GRASS",{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["varying","vec3","uL",";"]}]}}]}]}}]},{type:"condition",b:[{type:"if",d:["SHADOW_USAGE","SHADOW_MAPPING_BLEND",{type:"equal_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["varying","vec4","bI",";"]},{type:"condition",b:[{type:"if",d:["CSM_SECTION1","NUM_CAST_LAMPS",1,{type:"g_expr",e:2},{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["varying","vec4","bJ",";"]}]}}]},{type:"condition", | |
b:[{type:"if",d:["CSM_SECTION2","NUM_CAST_LAMPS",2,{type:"g_expr",e:2},{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["varying","vec4","bK",";"]}]}}]},{type:"condition",b:[{type:"if",d:["CSM_SECTION3","NUM_CAST_LAMPS",3,{type:"g_expr",e:2},{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["varying","vec4","bL",";"]}]}}]}]}}]},{type:"condition",b:[{type:"if",d:["REFLECTION_TYPE","REFL_PLANE",{type:"equal_expr",e:2},"SHADOW_USAGE","SHADOW_MAPPING_OPAQUE", | |
{type:"equal_expr",e:2},"REFRACTIVE","USE_NODE_B4W_REFRACTION",{type:"logical_or_expr",e:4}],group:{type:"group",b:[{type:"textline",a:["varying","vec3","bG",";"]}]}}]},{type:"condition",b:[{type:"if",d:["REFRACTIVE","NODES",{type:"logic_negative_expr",e:1},"USE_NODE_B4W_REFRACTION",{type:"logical_or_expr",e:2},{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["varying","float","bH",";"]}]}}]},{type:"include",file:"dynamic_grass.glslv"},{type:"include",file:"shadow.glslv"}, | |
{type:"include",file:"skin.glslv"},{type:"include",file:"wind_bending.glslv"},{type:"condition",b:[{type:"if",d:["NODES"],group:{type:"group",b:[{type:"include",file:"nodes.glslv"}]}}]},{type:"textline",a:"void main ( ) { vec4 vD , vE ; float vF ; vec3 vG , vH , vI , vJ , vK , vL , vM ; mat4 vN , vO , vP , vQ ;".split(" ")},{type:"condition",b:[{type:"if",d:["REFLECTION_PASS"],group:{type:"group",b:[{type:"textline",a:["vN","=","u_view_matrix",";"]},{type:"condition",b:[{type:"if",d:["NODES","DISABLE_FOG", | |
{type:"logic_negative_expr",e:1},"TEXTURE_NORM_CO","PARALLAX",{type:"logical_and_expr",e:2},"WATER_EFFECTS","CAUSTICS",{type:"logical_and_expr",e:2},"SHADOW_USAGE","SHADOW_MASK_GENERATION",{type:"equal_expr",e:2},"SHADOW_USAGE","SHADOW_MAPPING_BLEND",{type:"equal_expr",e:2},{type:"logical_or_expr",e:6}],group:{type:"group",b:[{type:"textline",a:"vO = O ( u_view_tsr ) ;".split(" ")}]}}]}]}},{type:"else",group:{type:"group",b:[{type:"textline",a:"vN = O ( u_view_tsr ) ;".split(" ")}]}}]},{type:"textline", | |
a:"vP = O ( u_model_tsr ) ; vG = a_position ;".split(" ")},{type:"condition",b:[{type:"if",d:["CALC_TBN_SPACE","USE_NODE_MATERIAL_BEGIN","USE_NODE_GEOMETRY_NO","CAUSTICS","WIND_BEND","MAIN_BEND_COL","DETAIL_BEND",{type:"logical_and_expr",e:3},"NODES",{type:"logic_negative_expr",e:1},{type:"logical_or_expr",e:6}],group:{type:"group",b:[{type:"textline",a:["vH","=","a_normal",";"]}]}},{type:"else",group:{type:"group",b:[{type:"textline",a:"vH = vec3 ( 0.0 ) ;".split(" ")}]}}]},{type:"condition",b:[{type:"if", | |
d:["CALC_TBN_SPACE","NODES",{type:"logic_negative_expr",e:1},"TEXTURE_NORM_CO","TEXTURE_COORDS_UV_ORCO",{type:"equal_expr",e:2},{type:"logical_and_expr",e:2},{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:"vI = vec3 ( a_tangent ) ; vJ = a_tangent [ 3 ] * cross ( vH , vI ) ;".split(" ")}]}},{type:"elif",d:["NODES",{type:"logic_negative_expr",e:1},"TEXTURE_NORM_CO","TEXTURE_COORDS_NORMAL",{type:"equal_expr",e:2},{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline", | |
a:"vK = ( vP * vec4 ( a_position , 1.0 ) ) . xyz ; vL = normalize ( ( vP * vec4 ( a_normal , 0.0 ) ) . xyz ) ; vK = vK - u_camera_eye ; vJ = cross ( vK , vL ) ; vI = cross ( vL , vJ ) ;".split(" ")}]}},{type:"else",group:{type:"group",b:[{type:"textline",a:"vI = vec3 ( 0.0 ) ; vJ = vec3 ( 0.0 ) ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["VERTEX_ANIM"],group:{type:"group",b:[{type:"textline",a:"vG = mix ( vG , a_position_next , u_va_frame_factor ) ;".split(" ")},{type:"condition",b:[{type:"if", | |
d:["NODES",{type:"logic_negative_expr",e:1},"USE_NODE_MATERIAL_BEGIN","USE_NODE_GEOMETRY_NO","CAUSTICS","CALC_TBN_SPACE",{type:"logical_or_expr",e:5}],group:{type:"group",b:[{type:"textline",a:"vH = mix ( vH , a_normal_next , VERTEX_ANIM_MIX_NORMALS_FACTOR ) ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["TEXTURE_NORM_CO"],group:{type:"group",b:[{type:"textline",a:"vL = vec3 ( a_tangent ) ; vK = a_tangent_next [ 3 ] * cross ( a_normal_next , vL ) ; vI = mix ( vI , vL , u_va_frame_factor ) ; vJ = mix ( vJ , vK , u_va_frame_factor ) ;".split(" ")}]}}]}]}}]}, | |
{type:"condition",b:[{type:"if",d:["SKINNED"],group:{type:"group",b:[{type:"textline",a:"sB ( vG , vI , vJ , vH ) ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["WIND_BEND","DYNAMIC_GRASS","BILLBOARD",{type:"logical_or_expr",e:3}],group:{type:"group",b:[{type:"textline",a:["vK","=","au_center_pos",";"]}]}},{type:"else",group:{type:"group",b:[{type:"textline",a:"vK = vec3 ( 0.0 ) ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["DYNAMIC_GRASS"],group:{type:"group",b:[{type:"textline", | |
a:"c vR = vq ( vG , vI , vJ , vH , vK , u_grass_map_depth , u_grass_map_color , u_grass_map_dim , u_grass_size , u_camera_eye , u_camera_quat , vN ) ;".split(" ")}]}},{type:"else",group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["BILLBOARD"],group:{type:"group",b:[{type:"textline",a:"vL = ( vP * vec4 ( vK , 1.0 ) ) . xyz ;".split(" ")},{type:"condition",b:[{type:"if",d:["BILLBOARD_PRES_GLOB_ORIENTATION","STATIC_BATCH",{type:"logic_negative_expr",e:1},{type:"logical_and_expr",e:2}],group:{type:"group", | |
b:[{type:"textline",a:"vQ = ru ( u_camera_eye , vL , vN , vP ) ;".split(" ")}]}},{type:"else",group:{type:"group",b:[{type:"textline",a:"vQ = ro ( u_camera_eye , vL , vN ) ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["WIND_BEND","BILLBOARD_JITTERED",{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:"vM = ( vP * vec4 ( vK , 1.0 ) ) . xyz ; vQ = vQ * rg ( u_wind , u_time , u_jitter_amp , u_jitter_freq , vM ) ;".split(" ")}]}}]},{type:"textline",a:"c vR = rB ( vG - vK , vK , vI , vJ , vH , vQ ) ; vR . b = vL ;".split(" ")}]}}, | |
{type:"else",group:{type:"group",b:[{type:"textline",a:"c vR = rB ( vG , vK , vI , vJ , vH , vP ) ;".split(" ")}]}}]}]}}]},{type:"condition",b:[{type:"if",d:["TEXTURE_NORM_CO","CALC_TBN_SPACE",{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:"vF = ( dot ( cross ( vR . e , vR . c ) , vR . d ) < 0.0 ) ? - 1.0 : 1.0 ; bF = vec4 ( vR . c , vF ) ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["WIND_BEND"],group:{type:"group",b:[{type:"textline",a:"tp ( vR . a , vR . b , vH ) ;".split(" ")}]}}]}, | |
{type:"textline",a:"bC = vR . a ;".split(" ")},{type:"condition",b:[{type:"if",d:["NODES",{type:"logic_negative_expr",e:1},"USE_NODE_MATERIAL_BEGIN","USE_NODE_GEOMETRY_NO","CAUSTICS","CALC_TBN_SPACE","WIND_BEND","MAIN_BEND_COL","DETAIL_BEND",{type:"logical_and_expr",e:3},{type:"logical_or_expr",e:6}],group:{type:"group",b:[{type:"textline",a:"bE = vR . e ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["NODES",{type:"logic_negative_expr",e:1}],group:{type:"group",b:[{type:"textline",a:"uK = u_camera_eye - vR . a ;".split(" ")}, | |
{type:"condition",b:[{type:"if",d:["TEXCOORD"],group:{type:"group",b:[{type:"textline",a:"bM = rE ( a_texcoord , u_texture_scale ) ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["DYNAMIC_GRASS"],group:{type:"group",b:[{type:"textline",a:"uL = vR . f ;".split(" ")}]}},{type:"elif",d:["VERTEX_COLOR"],group:{type:"group",b:[{type:"textline",a:["uL","=","a_color",";"]}]}}]}]}}]},{type:"textline",a:"vD = vN * vec4 ( vR . a , 1.0 ) ;".split(" ")},{type:"condition",b:[{type:"if",d:["NODES","DISABLE_FOG", | |
{type:"logic_negative_expr",e:1},"TEXTURE_NORM_CO","PARALLAX",{type:"logical_and_expr",e:2},"WATER_EFFECTS","CAUSTICS",{type:"logical_and_expr",e:2},"SHADOW_USAGE","SHADOW_MASK_GENERATION",{type:"equal_expr",e:2},"SHADOW_USAGE","SHADOW_MAPPING_BLEND",{type:"equal_expr",e:2},{type:"logical_or_expr",e:6}],group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["REFLECTION_PASS"],group:{type:"group",b:[{type:"textline",a:"vE = vO * vec4 ( vR . a , 1.0 ) ; bD = vE ;".split(" ")}]}},{type:"else",group:{type:"group", | |
b:[{type:"textline",a:["bD","=","vD",";"]}]}}]}]}}]},{type:"textline",a:"vE = u_proj_matrix * vD ;".split(" ")},{type:"condition",b:[{type:"if",d:["SMAA_JITTER"],group:{type:"group",b:[{type:"textline",a:"vE . xy += u_subpixel_jitter * vE . w ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["REFLECTION_TYPE","REFL_PLANE",{type:"equal_expr",e:2},"SHADOW_USAGE","SHADOW_MAPPING_OPAQUE",{type:"equal_expr",e:2},"REFRACTIVE","USE_NODE_B4W_REFRACTION",{type:"logical_or_expr",e:4}],group:{type:"group", | |
b:[{type:"textline",a:"bG = L ( vE ) ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["SHADOW_USAGE","SHADOW_MAPPING_BLEND",{type:"equal_expr",e:2}],group:{type:"group",b:[{type:"textline",a:"vC ( vR . a , vR . e ) ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["REFRACTIVE","NODES",{type:"logic_negative_expr",e:1},"USE_NODE_B4W_REFRACTION",{type:"logical_or_expr",e:2},{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:"bH = - vD . z / u_view_max_depth ;".split(" ")}]}}]}, | |
{type:"condition",b:[{type:"if",d:["NODES"],group:{type:"group",b:[{type:"textline",a:["tu","(",")",";"]}]}}]},{type:"textline",a:["gl_Position","=","vE",";","}"]}]};a["main_stack.glslf"]={type:"group",b:[{type:"var",name:"WATER_LEVEL",a:["0.0"]},{type:"var",name:"WAVES_HEIGHT",a:["0.0"]},{type:"var",name:"NUM_LAMP_LIGHTS",a:["0"]},{type:"var",name:"NUM_VALUES",a:["0"]},{type:"var",name:"NUM_RGBS",a:["0"]},{type:"var",name:"PARALLAX_STEPS",a:["0.0"]},{type:"var",name:"PARALLAX_LOD_DIST",a:["0.0"]}, | |
{type:"var",name:"WATER_LEVEL",a:["0.0"]},{type:"var",name:"WAVES_HEIGHT",a:["0.0"]},{type:"var",name:"NUM_LIGHTS",a:["0"]},{type:"var",name:"LAMP_IND",a:["0"]},{type:"var",name:"LAMP_SPOT_SIZE",a:["0"]},{type:"var",name:"LAMP_SPOT_BLEND",a:["0"]},{type:"var",name:"LAMP_LIGHT_DIST",a:["0"]},{type:"var",name:"LAMP_LIGHT_FACT_IND",a:["0"]},{type:"var",name:"LAMP_FAC_CHANNELS",a:["rgb"]},{type:"var",name:"LAMP_SHADOW_MAP_IND",a:["0"]},{type:"var",name:"NUM_LFACTORS",a:["0"]},{type:"include",file:"std_enums.glsl"}, | |
{type:"include",file:"precision_statement.glslf"},{type:"include",file:"pack.glslf"},{type:"condition",b:[{type:"if",d:["SHADELESS",{type:"logic_negative_expr",e:1}],group:{type:"group",b:[{type:"include",file:"procedural.glslf"},{type:"condition",b:[{type:"if",d:["CAUSTICS"],group:{type:"group",b:[{type:"include",file:"caustics.glslf"}]}}]}]}}]},{type:"include",file:"color_util.glslf"},{type:"include",file:"math.glslv"},{type:"textline",a:["uniform","float","u_time",";"]},{type:"condition",b:[{type:"if", | |
d:["USE_ENVIRONMENT_LIGHT","SKY_TEXTURE",{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","samplerCube","u_sky_texture",";"]}]}},{type:"elif",d:["USE_ENVIRONMENT_LIGHT","SKY_COLOR",{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:"uniform vec3 u_horizon_color ; uniform vec3 u_zenith_color ;".split(" ")}]}}]},{type:"textline",a:["uniform","float","u_environment_energy",";"]},{type:"condition",b:[{type:"if",d:["SHADELESS",{type:"logic_negative_expr", | |
e:1}],group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["NUM_LIGHTS",0,{type:"g_expr",e:2}],group:{type:"group",b:[{type:"textline",a:"uniform vec3 u_light_positions [ NUM_LIGHTS ] ; uniform vec3 u_light_directions [ NUM_LIGHTS ] ; uniform vec3 u_light_color_intensities [ NUM_LIGHTS ] ; uniform vec4 u_light_factors [ NUM_LFACTORS ] ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["WATER_EFFECTS","CAUSTICS",{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform", | |
"vec4","u_sun_quaternion",";"]}]}}]}]}}]},{type:"condition",b:[{type:"if",d:["NORMAL_TEXCOORD","REFLECTION_TYPE","REFL_PLANE",{type:"equal_expr",e:2},{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","mat3","u_view_tsr_frag",";"]}]}}]},{type:"condition",b:[{type:"if",d:["DISABLE_FOG",{type:"logic_negative_expr",e:1}],group:{type:"group",b:[{type:"textline",a:["uniform","vec4","u_fog_color_density",";"]},{type:"condition",b:[{type:"if",d:["WATER_EFFECTS"],group:{type:"group", | |
b:[{type:"textline",a:"uniform vec4 u_underwater_fog_color_density ; uniform float u_cam_water_depth ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["PROCEDURAL_FOG"],group:{type:"group",b:[{type:"textline",a:["uniform","mat4","u_cube_fog",";"]}]}}]},{type:"condition",b:[{type:"if",d:["USE_FOG"],group:{type:"group",b:[{type:"textline",a:["uniform","vec4","u_fog_params",";"]}]}}]}]}}]},{type:"condition",b:[{type:"if",d:["WATER_EFFECTS","DISABLE_FOG",{type:"logic_negative_expr",e:1},{type:"logical_or_expr", | |
e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","vec3","u_sun_intensity",";"]}]}}]},{type:"condition",b:[{type:"if",d:["WATER_EFFECTS","CAUSTICS",{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","vec3","u_sun_direction",";"]}]}}]},{type:"condition",b:[{type:"if",d:["TEXTURE_COLOR0_CO"],group:{type:"group",b:[{type:"textline",a:["uniform","sampler2D","u_colormap0",";"]}]}}]},{type:"condition",b:[{type:"if",d:["TEXTURE_SPEC","ALPHA_AS_SPEC",{type:"logic_negative_expr", | |
e:1},{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","sampler2D","u_specmap0",";"]}]}}]},{type:"condition",b:[{type:"if",d:["TEXTURE_NORM_CO"],group:{type:"group",b:[{type:"textline",a:["uniform","sampler2D","u_normalmap0",";"]}]}}]},{type:"condition",b:[{type:"if",d:["TEXTURE_STENCIL_ALPHA_MASK"],group:{type:"group",b:[{type:"textline",a:"uniform sampler2D u_colormap1 ; uniform sampler2D u_stencil0 ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["REFLECTION_TYPE", | |
"REFL_PLANE",{type:"equal_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","sampler2D","u_plane_reflection",";"]}]}},{type:"elif",d:["REFLECTION_TYPE","REFL_CUBE",{type:"equal_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","samplerCube","u_cube_reflection",";"]}]}},{type:"elif",d:["REFLECTION_TYPE","REFL_MIRRORMAP",{type:"equal_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","samplerCube","u_mirrormap",";"]}]}}]},{type:"condition",b:[{type:"if",d:["SHADOW_USAGE", | |
"SHADOW_MAPPING_OPAQUE",{type:"equal_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","sampler2D","u_shadow_mask",";"]}]}},{type:"elif",d:["SHADOW_USAGE","SHADOW_MAPPING_BLEND",{type:"equal_expr",e:2}],group:{type:"group",b:[{type:"textline",a:"uniform vec4 u_pcf_blur_radii ; uniform vec4 u_csm_center_dists ; uniform PRECISION sampler2D u_shadow_map0 ;".split(" ")},{type:"condition",b:[{type:"if",d:["CSM_SECTION1","NUM_CAST_LAMPS",1,{type:"g_expr",e:2},{type:"logical_or_expr",e:2}], | |
group:{type:"group",b:[{type:"textline",a:["uniform","PRECISION","sampler2D","u_shadow_map1",";"]}]}}]},{type:"condition",b:[{type:"if",d:["CSM_SECTION2","NUM_CAST_LAMPS",2,{type:"g_expr",e:2},{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","PRECISION","sampler2D","u_shadow_map2",";"]}]}}]},{type:"condition",b:[{type:"if",d:["CSM_SECTION3","NUM_CAST_LAMPS",3,{type:"g_expr",e:2},{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","PRECISION", | |
"sampler2D","u_shadow_map3",";"]}]}}]}]}}]},{type:"condition",b:[{type:"if",d:["REFRACTIVE"],group:{type:"group",b:[{type:"textline",a:["uniform","sampler2D","u_refractmap",";"]}]}}]},{type:"condition",b:[{type:"if",d:["REFRACTIVE","USE_REFRACTION_CORRECTION",{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","PRECISION","sampler2D","u_scene_depth",";"]}]}}]},{type:"textline",a:"uniform float u_emit ; uniform float u_ambient ; uniform vec4 u_fresnel_params ; uniform float u_specular_alpha ;".split(" ")}, | |
{type:"condition",b:[{type:"if",d:["REFLECTION_TYPE","REFL_PLANE",{type:"equal_expr",e:2},"REFLECTION_TYPE","REFL_CUBE",{type:"equal_expr",e:2},{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","float","u_reflect_factor",";"]}]}},{type:"elif",d:["REFLECTION_TYPE","REFL_MIRRORMAP",{type:"equal_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","float","u_mirror_factor",";"]}]}}]},{type:"condition",b:[{type:"if",d:["REFLECTION_TYPE","REFL_PLANE",{type:"equal_expr", | |
e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","vec4","u_refl_plane",";"]}]}}]},{type:"textline",a:"uniform vec4 u_diffuse_color ; uniform vec2 u_diffuse_params ; uniform float u_diffuse_intensity ;".split(" ")},{type:"condition",b:[{type:"if",d:["TEXTURE_NORM_CO"],group:{type:"group",b:[{type:"textline",a:["uniform","float","u_normal_factor",";"]}]}}]},{type:"condition",b:[{type:"if",d:["TEXTURE_COLOR0_CO"],group:{type:"group",b:[{type:"textline",a:"uniform float u_diffuse_color_factor ; uniform float u_alpha_factor ;".split(" ")}]}}]}, | |
{type:"condition",b:[{type:"if",d:["TEXTURE_SPEC"],group:{type:"group",b:[{type:"textline",a:["uniform","float","u_specular_color_factor",";"]}]}}]},{type:"textline",a:"uniform vec3 u_specular_color ; uniform vec3 u_specular_params ;".split(" ")},{type:"condition",b:[{type:"if",d:["TEXTURE_NORM_CO","PARALLAX",{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["uniform","float","u_parallax_scale",";"]}]}}]},{type:"condition",b:[{type:"if",d:["REFRACTIVE"],group:{type:"group", | |
b:[{type:"textline",a:["uniform","float","u_refr_bump",";"]}]}}]},{type:"textline",a:"varying vec3 bC ; varying vec3 bE ;".split(" ")},{type:"condition",b:[{type:"if",d:["NODES","DISABLE_FOG",{type:"logic_negative_expr",e:1},"TEXTURE_NORM_CO","PARALLAX",{type:"logical_and_expr",e:2},"WATER_EFFECTS","CAUSTICS",{type:"logical_and_expr",e:2},"SHADOW_USAGE","SHADOW_MASK_GENERATION",{type:"equal_expr",e:2},"SHADOW_USAGE","SHADOW_MAPPING_BLEND",{type:"equal_expr",e:2},{type:"logical_or_expr",e:6}],group:{type:"group", | |
b:[{type:"textline",a:["varying","vec4","bD",";"]}]}}]},{type:"condition",b:[{type:"if",d:["TEXTURE_NORM_CO","CALC_TBN_SPACE",{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["varying","vec4","bF",";"]}]}}]},{type:"textline",a:["varying","vec3","uK",";"]},{type:"condition",b:[{type:"if",d:["TEXCOORD"],group:{type:"group",b:[{type:"textline",a:["varying","vec2","bM",";"]}]}}]},{type:"condition",b:[{type:"if",d:["VERTEX_COLOR","DYNAMIC_GRASS",{type:"logical_or_expr",e:2}],group:{type:"group", | |
b:[{type:"textline",a:["varying","vec3","uL",";"]}]}}]},{type:"condition",b:[{type:"if",d:["SHADOW_USAGE","SHADOW_MAPPING_BLEND",{type:"equal_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["varying","vec4","bI",";"]},{type:"condition",b:[{type:"if",d:["CSM_SECTION1","NUM_CAST_LAMPS",1,{type:"g_expr",e:2},{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["varying","vec4","bJ",";"]}]}}]},{type:"condition",b:[{type:"if",d:["CSM_SECTION2","NUM_CAST_LAMPS",2,{type:"g_expr", | |
e:2},{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["varying","vec4","bK",";"]}]}}]},{type:"condition",b:[{type:"if",d:["CSM_SECTION3","NUM_CAST_LAMPS",3,{type:"g_expr",e:2},{type:"logical_or_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["varying","vec4","bL",";"]}]}}]}]}}]},{type:"condition",b:[{type:"if",d:["REFLECTION_TYPE","REFL_PLANE",{type:"equal_expr",e:2},"SHADOW_USAGE","SHADOW_MAPPING_OPAQUE",{type:"equal_expr",e:2},"REFRACTIVE",{type:"logical_or_expr", | |
e:3}],group:{type:"group",b:[{type:"textline",a:["varying","vec3","bG",";"]}]}}]},{type:"condition",b:[{type:"if",d:["REFRACTIVE"],group:{type:"group",b:[{type:"textline",a:["varying","float","bH",";"]}]}}]},{type:"condition",b:[{type:"if",d:["SHADELESS",{type:"logic_negative_expr",e:1}],group:{type:"group",b:[{type:"include",file:"shadow.glslf"}]}}]},{type:"include",file:"mirror.glslf"},{type:"condition",b:[{type:"if",d:["REFRACTIVE"],group:{type:"group",b:[{type:"include",file:"refraction.glslf"}]}}]}, | |
{type:"include",file:"environment.glslf"},{type:"condition",b:[{type:"if",d:["SHADELESS",{type:"logic_negative_expr",e:1}],group:{type:"group",b:[{type:"include",file:"lighting_nodes.glslf"}]}}]},{type:"condition",b:[{type:"if",d:["DISABLE_FOG",{type:"logic_negative_expr",e:1}],group:{type:"group",b:[{type:"include",file:"fog.glslf"}]}}]},{type:"textline",a:"void main ( ) { vec4 xI , xJ , xK , xL ; mat4 xM ; mat3 xN ; vec2 xO , xP , xQ , xR ; vec3 xS , xT , xU , xV , xW , xX , xY , xZ , x_ ; float ya , yb , yc , yd , ye ;".split(" ")}, | |
{type:"condition",b:[{type:"if",d:["NODES","DISABLE_FOG",{type:"logic_negative_expr",e:1},"TEXTURE_NORM_CO","PARALLAX",{type:"logical_and_expr",e:2},"WATER_EFFECTS","CAUSTICS",{type:"logical_and_expr",e:2},"SHADOW_USAGE","SHADOW_MASK_GENERATION",{type:"equal_expr",e:2},"SHADOW_USAGE","SHADOW_MAPPING_BLEND",{type:"equal_expr",e:2},{type:"logical_or_expr",e:6}],group:{type:"group",b:[{type:"textline",a:"ya = length ( bD ) ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["WATER_EFFECTS"],group:{type:"group", | |
b:[{type:"textline",a:"yb = bC . y - WATER_LEVEL ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["WATER_EFFECTS","DISABLE_FOG",{type:"logic_negative_expr",e:1},"CAUSTICS","WATER_EFFECTS",{type:"logical_and_expr",e:2},{type:"logical_or_expr",e:3}],group:{type:"group",b:[{type:"textline",a:["xS","=","u_sun_intensity",";"]}]}}]},{type:"condition",b:[{type:"if",d:["TEXCOORD"],group:{type:"group",b:[{type:"textline",a:["xO","=","bM",";"]}]}}]},{type:"textline",a:"xT = normalize ( bE ) ;".split(" ")}, | |
{type:"condition",b:[{type:"if",d:["DOUBLE_SIDED_LIGHTING"],group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["INVERT_FRONTFACING"],group:{type:"group",b:[{type:"textline",a:["if","(","!","gl_FrontFacing",")"]}]}},{type:"else",group:{type:"group",b:[{type:"textline",a:["if","(","gl_FrontFacing",")"]}]}}]},{type:"textline",a:"xT = xT ; else xT = - xT ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["TEXTURE_NORM_CO"],group:{type:"group",b:[{type:"textline",a:"xU = cross ( xT , bF . xyz ) * bF . w ; xN = mat3 ( bF . xyz , xU , xT ) ;".split(" ")}]}}]}, | |
{type:"condition",b:[{type:"if",d:["NORMAL_TEXCOORD"],group:{type:"group",b:[{type:"textline",a:"xM = O ( u_view_tsr_frag ) ; xP = normalize ( xM * vec4 ( bE , 0.0 ) ) . st ; xP = xP * vec2 ( 0.495 ) + vec2 ( 0.5 ) ;".split(" ")}]}}]},{type:"condition",b:[{type:"if",d:["TEXTURE_NORM_CO","PARALLAX",{type:"logical_and_expr",e:2}],group:{type:"group",b:[{type:"textline",a:"if ( ya < PARALLAX_LOD_DIST ) { yc = clamp ( 0.5 * ( PARALLAX_LOD_DIST - ya ) , 0.0 , 1.0 ) ; yc = u_parallax_scale * yc ; xU = normalize ( uK * xN ) ; yd = 1.0 / PARALLAX_STEPS ; xQ = xU . xy * yc / ( PARALLAX_STEPS * xU . z ) ; yc = 1.0 ;".split(" ")}, | |
{type:"condition",b:[{type:"if",d:["TEXTURE_NORM_CO","TEXTURE_COORDS_NORMAL",{type:"equal_expr",e:2}],group:{type:"group",b:[{type:"textline",a:["xR","=","xP",";"]}]}},{type:"else",group:{type:"group",b:[{type:"textline",a:["xR","=","xO",";"]}]}}]},{type:"textline",a:"ye = texture2D ( u_normalmap0 , xR ) . a ; for ( float yf = 1.0 ; yf <= PARALLAX_STEPS ; yf ++ ) { if ( ye < yc ) { yc -= yd ; xR -= xQ ; ye = texture2D ( u_normalmap0 , xR ) . a ; } } xQ = xR + xQ ; yd = texture2D ( u_normalmap0 , xQ ) . a - ( yc + yd ) ; yc = ye - yc ; yd = yc / ( yc - yd ) ; xR = yd * xQ + ( 1.0 - yd ) * xR ;".split(" ")}, | |
{type:"condition",b:[{type:"if",d:["TEXTURE_NORM_CO","TEXTURE_COORDS_NORMAL",{type:"equal_expr",e:2}],group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["TEXCOORD"],group:{type:"group",b:[{type:"textline",a:"xO += xR - xP ;".split(" ")}]}}]},{type:"textline",a:["xP","=","xR",";"]}]}},{type:"else",group:{type:"group",b:[{type:"condition",b:[{type:"if",d:["NORMAL_TEXCOORD"],group:{type:"group",b:[{type:"textline",a:"xP += xR - xO ;".split(" ")}]}}]},{type:"textline" |