diff --git a/tools/astray/Box2dWeb.min.js b/tools/astray/Box2dWeb.min.js deleted file mode 100644 index f005184..0000000 --- a/tools/astray/Box2dWeb.min.js +++ /dev/null @@ -1,445 +0,0 @@ -var Box2D={}; -(function(F,G){function K(){}if(!(Object.prototype.defineProperty instanceof Function)&&Object.prototype.__defineGetter__ instanceof Function&&Object.prototype.__defineSetter__ instanceof Function)Object.defineProperty=function(y,w,A){A.get instanceof Function&&y.__defineGetter__(w,A.get);A.set instanceof Function&&y.__defineSetter__(w,A.set)};F.inherit=function(y,w){K.prototype=w.prototype;y.prototype=new K;y.prototype.constructor=y};F.generateCallback=function(y,w){return function(){w.apply(y,arguments)}}; -F.NVector=function(y){if(y===G)y=0;for(var w=Array(y||0),A=0;A=0&&b>=0)&&this.lowerBound.IsValid()&&this.upperBound.IsValid()};B.prototype.GetCenter=function(){return new p((this.lowerBound.x+ -this.upperBound.x)/2,(this.lowerBound.y+this.upperBound.y)/2)};B.prototype.GetExtents=function(){return new p((this.upperBound.x-this.lowerBound.x)/2,(this.upperBound.y-this.lowerBound.y)/2)};B.prototype.Contains=function(b){var e=true;return e=(e=(e=(e=e&&this.lowerBound.x<=b.lowerBound.x)&&this.lowerBound.y<=b.lowerBound.y)&&b.upperBound.x<=this.upperBound.x)&&b.upperBound.y<=this.upperBound.y};B.prototype.RayCast=function(b,e){var f=-Number.MAX_VALUE,m=Number.MAX_VALUE,r=e.p1.x,s=e.p1.y,v=e.p2.x- -e.p1.x,t=e.p2.y-e.p1.y,x=Math.abs(t),C=b.normal,J=0,T=0,P=J=0;P=0;if(Math.abs(v)J){P=T;T=J;J=P;P=1}if(T>f){C.x=P;C.y=0;f=T}m=Math.min(m,J);if(f>m)return false}if(xJ){P=T;T=J;J=P;P=1}if(T>f){C.y=P;C.x=0;f= -T}m=Math.min(m,J);if(f>m)return false}b.fraction=f;return true};B.prototype.TestOverlap=function(b){var e=b.lowerBound.y-this.upperBound.y,f=this.lowerBound.y-b.upperBound.y;if(b.lowerBound.x-this.upperBound.x>0||e>0)return false;if(this.lowerBound.x-b.upperBound.x>0||f>0)return false;return true};B.Combine=function(b,e){var f=new B;f.Combine(b,e);return f};B.prototype.Combine=function(b,e){this.lowerBound.x=Math.min(b.lowerBound.x,e.lowerBound.x);this.lowerBound.y=Math.min(b.lowerBound.y,e.lowerBound.y); -this.upperBound.x=Math.max(b.upperBound.x,e.upperBound.x);this.upperBound.y=Math.max(b.upperBound.y,e.upperBound.y)};Q.b2Bound=function(){};Q.prototype.IsLower=function(){return(this.value&1)==0};Q.prototype.IsUpper=function(){return(this.value&1)==1};Q.prototype.Swap=function(b){var e=this.value,f=this.proxy,m=this.stabbingCount;this.value=b.value;this.proxy=b.proxy;this.stabbingCount=b.stabbingCount;b.value=e;b.proxy=f;b.stabbingCount=m};V.b2BoundValues=function(){};V.prototype.b2BoundValues=function(){this.lowerValues= -new Vector_a2j_Number;this.lowerValues[0]=0;this.lowerValues[1]=0;this.upperValues=new Vector_a2j_Number;this.upperValues[0]=0;this.upperValues[1]=0};M.b2Collision=function(){};M.ClipSegmentToLine=function(b,e,f,m){if(m===undefined)m=0;var r,s=0;r=e[0];var v=r.v;r=e[1];var t=r.v,x=f.x*v.x+f.y*v.y-m;r=f.x*t.x+f.y*t.y-m;x<=0&&b[s++].Set(e[0]);r<=0&&b[s++].Set(e[1]);if(x*r<0){f=x/(x-r);r=b[s];r=r.v;r.x=v.x+f*(t.x-v.x);r.y=v.y+f*(t.y-v.y);r=b[s];r.id=(x>0?e[0]:e[1]).id;++s}return s};M.EdgeSeparation= -function(b,e,f,m,r){if(f===undefined)f=0;parseInt(b.m_vertexCount);var s=b.m_vertices;b=b.m_normals;var v=parseInt(m.m_vertexCount),t=m.m_vertices,x,C;x=e.R;C=b[f];b=x.col1.x*C.x+x.col2.x*C.y;m=x.col1.y*C.x+x.col2.y*C.y;x=r.R;var J=x.col1.x*b+x.col1.y*m;x=x.col2.x*b+x.col2.y*m;for(var T=0,P=Number.MAX_VALUE,X=0;XT){T=t;C=P}}v=M.EdgeSeparation(e,f,C,m,r);t=parseInt(C-1>=0?C-1:s-1);x=M.EdgeSeparation(e,f,t,m,r);J=parseInt(C+1v&&x>T){$=-1;P=t;X=x}else if(T>v){$=1;P=J;X=T}else{b[0]=C;return v}for(;;){C=$==-1?P-1>=0?P-1:s-1:P+1X){P=C;X=v}else break}b[0]=P;return X};M.FindIncidentEdge=function(b,e,f,m,r,s){if(m===undefined)m=0;parseInt(e.m_vertexCount);var v=e.m_normals,t=parseInt(r.m_vertexCount); -e=r.m_vertices;r=r.m_normals;var x;x=f.R;f=v[m];v=x.col1.x*f.x+x.col2.x*f.y;var C=x.col1.y*f.x+x.col2.y*f.y;x=s.R;f=x.col1.x*v+x.col1.y*C;C=x.col2.x*v+x.col2.y*C;v=f;x=0;for(var J=Number.MAX_VALUE,T=0;Tv)){var x=0;M.s_edgeBO[0]=x;var C=M.FindMaxSeparation(M.s_edgeBO, -m,r,e,f);x=M.s_edgeBO[0];if(!(C>v)){var J=0,T=0;if(C>0.98*t+0.0010){t=m;m=e;e=r;f=f;J=x;b.m_type=E.e_faceB;T=1}else{t=e;m=m;e=f;f=r;J=s;b.m_type=E.e_faceA;T=0}s=M.s_incidentEdge;M.FindIncidentEdge(s,t,e,J,m,f);x=parseInt(t.m_vertexCount);r=t.m_vertices;t=r[J];var P;P=J+1s*s)){b.m_type=E.e_circles;b.m_localPoint.SetV(e.m_p);b.m_localPlaneNormal.SetZero();b.m_pointCount=1;b.m_points[0].m_localPoint.SetV(m.m_p);b.m_points[0].m_id.key=0}};M.CollidePolygonAndCircle=function(b,e,f,m,r){var s=b.m_pointCount=0,v=0,t,x;x=r.R;t=m.m_p;var C=r.position.y+(x.col1.y*t.x+x.col2.y*t.y);s=r.position.x+(x.col1.x*t.x+x.col2.x*t.y)-f.position.x;v=C-f.position.y;x=f.R;f=s* -x.col1.x+v*x.col1.y;x=s*x.col2.x+v*x.col2.y;var J=0;C=-Number.MAX_VALUE;r=e.m_radius+m.m_radius;var T=parseInt(e.m_vertexCount),P=e.m_vertices;e=e.m_normals;for(var X=0;Xr)return;if(s>C){C=s;J=X}}s=parseInt(J);v=parseInt(s+1r*r)return;b.m_pointCount=1;b.m_type=E.e_faceA;b.m_localPlaneNormal.x=f-t.x;b.m_localPlaneNormal.y=x-t.y;b.m_localPlaneNormal.Normalize();b.m_localPoint.SetV(t)}else if(C<=0){if((f-P.x)*(f-P.x)+(x-P.y)*(x-P.y)>r*r)return;b.m_pointCount=1;b.m_type=E.e_faceA;b.m_localPlaneNormal.x=f-P.x;b.m_localPlaneNormal.y=x-P.y;b.m_localPlaneNormal.Normalize();b.m_localPoint.SetV(P)}else{J=0.5*(t.x+P.x);t=0.5*(t.y+P.y);C=(f-J)*e[s].x+ -(x-t)*e[s].y;if(C>r)return;b.m_pointCount=1;b.m_type=E.e_faceA;b.m_localPlaneNormal.x=e[s].x;b.m_localPlaneNormal.y=e[s].y;b.m_localPlaneNormal.Normalize();b.m_localPoint.Set(J,t)}}b.m_points[0].m_localPoint.SetV(m.m_p);b.m_points[0].m_id.key=0};M.TestOverlap=function(b,e){var f=e.lowerBound,m=b.upperBound,r=f.x-m.x,s=f.y-m.y;f=b.lowerBound;m=e.upperBound;var v=f.y-m.y;if(r>0||s>0)return false;if(f.x-m.x>0||v>0)return false;return true};Box2D.postDefs.push(function(){Box2D.Collision.b2Collision.s_incidentEdge= -M.MakeClipPointVector();Box2D.Collision.b2Collision.s_clipPoints1=M.MakeClipPointVector();Box2D.Collision.b2Collision.s_clipPoints2=M.MakeClipPointVector();Box2D.Collision.b2Collision.s_edgeAO=new Vector_a2j_Number(1);Box2D.Collision.b2Collision.s_edgeBO=new Vector_a2j_Number(1);Box2D.Collision.b2Collision.s_localTangent=new p;Box2D.Collision.b2Collision.s_localNormal=new p;Box2D.Collision.b2Collision.s_planePoint=new p;Box2D.Collision.b2Collision.s_normal=new p;Box2D.Collision.b2Collision.s_tangent= -new p;Box2D.Collision.b2Collision.s_tangent2=new p;Box2D.Collision.b2Collision.s_v11=new p;Box2D.Collision.b2Collision.s_v12=new p;Box2D.Collision.b2Collision.b2CollidePolyTempVec=new p;Box2D.Collision.b2Collision.b2_nullFeature=255});L.b2ContactID=function(){this.features=new c};L.prototype.b2ContactID=function(){this.features._m_id=this};L.prototype.Set=function(b){this.key=b._key};L.prototype.Copy=function(){var b=new L;b.key=this.key;return b};Object.defineProperty(L.prototype,"key",{enumerable:false, -configurable:true,get:function(){return this._key}});Object.defineProperty(L.prototype,"key",{enumerable:false,configurable:true,set:function(b){if(b===undefined)b=0;this._key=b;this.features._referenceEdge=this._key&255;this.features._incidentEdge=(this._key&65280)>>8&255;this.features._incidentVertex=(this._key&16711680)>>16&255;this.features._flip=(this._key&4278190080)>>24&255}});I.b2ContactPoint=function(){this.position=new p;this.velocity=new p;this.normal=new p;this.id=new L};W.b2Distance= -function(){};W.Distance=function(b,e,f){++W.b2_gjkCalls;var m=f.proxyA,r=f.proxyB,s=f.transformA,v=f.transformB,t=W.s_simplex;t.ReadCache(e,m,s,r,v);var x=t.m_vertices,C=W.s_saveA,J=W.s_saveB,T=0;t.GetClosestPoint().LengthSquared();for(var P=0,X,$=0;$<20;){T=t.m_count;for(P=0;Pe+r&&b.distance>Number.MIN_VALUE){b.distance-=e+r;f=w.SubtractVV(b.pointB,b.pointA);f.Normalize();b.pointA.x+=e*f.x;b.pointA.y+=e*f.y;b.pointB.x-=r*f.x;b.pointB.y-=r*f.y}else{X=new p;X.x=0.5*(b.pointA.x+b.pointB.x);X.y=0.5*(b.pointA.y+b.pointB.y);b.pointA.x=b.pointB.x=X.x;b.pointA.y=b.pointB.y=X.y;b.distance=0}}};Box2D.postDefs.push(function(){Box2D.Collision.b2Distance.s_simplex=new h;Box2D.Collision.b2Distance.s_saveA= -new Vector_a2j_Number(3);Box2D.Collision.b2Distance.s_saveB=new Vector_a2j_Number(3)});Y.b2DistanceInput=function(){};k.b2DistanceOutput=function(){this.pointA=new p;this.pointB=new p};z.b2DistanceProxy=function(){};z.prototype.Set=function(b){switch(b.GetType()){case K.e_circleShape:b=b instanceof F?b:null;this.m_vertices=new Vector(1,true);this.m_vertices[0]=b.m_p;this.m_count=1;this.m_radius=b.m_radius;break;case K.e_polygonShape:b=b instanceof G?b:null;this.m_vertices=b.m_vertices;this.m_count= -b.m_vertexCount;this.m_radius=b.m_radius;break;default:y.b2Assert(false)}};z.prototype.GetSupport=function(b){for(var e=0,f=this.m_vertices[0].x*b.x+this.m_vertices[0].y*b.y,m=1;mf){e=m;f=r}}return e};z.prototype.GetSupportVertex=function(b){for(var e=0,f=this.m_vertices[0].x*b.x+this.m_vertices[0].y*b.y,m=1;mf){e=m;f=r}}return this.m_vertices[e]}; -z.prototype.GetVertexCount=function(){return this.m_count};z.prototype.GetVertex=function(b){if(b===undefined)b=0;y.b2Assert(0<=b&&b0?f.x:-f.x);f=y.b2_aabbExtension+y.b2_aabbMultiplier*(f.y>0?f.y:-f.y);b.aabb.lowerBound.x=e.lowerBound.x-m;b.aabb.lowerBound.y=e.lowerBound.y-f;b.aabb.upperBound.x=e.upperBound.x+ -m;b.aabb.upperBound.y=e.upperBound.y+f;this.InsertLeaf(b);return true};u.prototype.Rebalance=function(b){if(b===undefined)b=0;if(this.m_root!=null)for(var e=0;e>m&1?f.child2:f.child1;m=m+1&31}++this.m_path;this.RemoveLeaf(f);this.InsertLeaf(f)}};u.prototype.GetFatAABB=function(b){return b.aabb};u.prototype.GetUserData=function(b){return b.userData};u.prototype.Query=function(b,e){if(this.m_root!=null){var f=new Vector,m=0;for(f[m++]= -this.m_root;m>0;){var r=f[--m];if(r.aabb.TestOverlap(e))if(r.IsLeaf()){if(!b(r))break}else{f[m++]=r.child1;f[m++]=r.child2}}}};u.prototype.RayCast=function(b,e){if(this.m_root!=null){var f=e.p1,m=e.p2,r=w.SubtractVV(f,m);r.Normalize();r=w.CrossFV(1,r);var s=w.AbsV(r),v=e.maxFraction,t=new B,x=0,C=0;x=f.x+v*(m.x-f.x);C=f.y+v*(m.y-f.y);t.lowerBound.x=Math.min(f.x,x);t.lowerBound.y=Math.min(f.y,C);t.upperBound.x=Math.max(f.x,x);t.upperBound.y=Math.max(f.y,C);var J=new Vector,T=0;for(J[T++]=this.m_root;T> -0;){v=J[--T];if(v.aabb.TestOverlap(t)!=false){x=v.aabb.GetCenter();C=v.aabb.GetExtents();if(!(Math.abs(r.x*(f.x-x.x)+r.y*(f.y-x.y))-s.x*C.x-s.y*C.y>0))if(v.IsLeaf()){x=new S;x.p1=e.p1;x.p2=e.p2;x.maxFraction=e.maxFraction;v=b(x,v);if(v==0)break;if(v>0){x=f.x+v*(m.x-f.x);C=f.y+v*(m.y-f.y);t.lowerBound.x=Math.min(f.x,x);t.lowerBound.y=Math.min(f.y,C);t.upperBound.x=Math.max(f.x,x);t.upperBound.y=Math.max(f.y,C)}}else{J[T++]=v.child1;J[T++]=v.child2}}}}};u.prototype.AllocateNode=function(){if(this.m_freeList){var b= -this.m_freeList;this.m_freeList=b.parent;b.parent=null;b.child1=null;b.child2=null;return b}return new H};u.prototype.FreeNode=function(b){b.parent=this.m_freeList;this.m_freeList=b};u.prototype.InsertLeaf=function(b){++this.m_insertionCount;if(this.m_root==null){this.m_root=b;this.m_root.parent=null}else{var e=b.aabb.GetCenter(),f=this.m_root;if(f.IsLeaf()==false){do{var m=f.child1;f=f.child2;f=Math.abs((m.aabb.lowerBound.x+m.aabb.upperBound.x)/2-e.x)+Math.abs((m.aabb.lowerBound.y+m.aabb.upperBound.y)/ -2-e.y)=m?t:m;++e.m_pairCount;return true}, -r)}for(f=e.m_moveBuffer.length=0;fx){var J=r.x-this.p1.x,T=r.y-this.p1.y;r=J*f+T*t;if(0<=r&&r<=m*C){m=-s*T+v*J;if(-x*C<=m&&m<=C*(1+x)){r/=C;m=Math.sqrt(f*f+t*t);f/=m;t/=m;b[0]=r;e.Set(f, -t);return true}}}return false};Z.prototype.Extend=function(b){this.ExtendForward(b);this.ExtendBackward(b)};Z.prototype.ExtendForward=function(b){var e=this.p2.x-this.p1.x,f=this.p2.y-this.p1.y;b=Math.min(e>0?(b.upperBound.x-this.p1.x)/e:e<0?(b.lowerBound.x-this.p1.x)/e:Number.POSITIVE_INFINITY,f>0?(b.upperBound.y-this.p1.y)/f:f<0?(b.lowerBound.y-this.p1.y)/f:Number.POSITIVE_INFINITY);this.p2.x=this.p1.x+e*b;this.p2.y=this.p1.y+f*b};Z.prototype.ExtendBackward=function(b){var e=-this.p2.x+this.p1.x, -f=-this.p2.y+this.p1.y;b=Math.min(e>0?(b.upperBound.x-this.p2.x)/e:e<0?(b.lowerBound.x-this.p2.x)/e:Number.POSITIVE_INFINITY,f>0?(b.upperBound.y-this.p2.y)/f:f<0?(b.lowerBound.y-this.p2.y)/f:Number.POSITIVE_INFINITY);this.p1.x=this.p2.x+e*b;this.p1.y=this.p2.y+f*b};d.b2SeparationFunction=function(){this.m_localPoint=new p;this.m_axis=new p};d.prototype.Initialize=function(b,e,f,m,r){this.m_proxyA=e;this.m_proxyB=m;var s=parseInt(b.count);y.b2Assert(01){b=b.metric;s=this.GetMetric();if(s<0.5*b||2*b0?w.CrossFV(1,b):w.CrossVF(b,1);default:y.b2Assert(false);return new p}};h.prototype.GetClosestPoint= -function(){switch(this.m_count){case 0:y.b2Assert(false);return new p;case 1:return this.m_v1.w;case 2:return new p(this.m_v1.a*this.m_v1.w.x+this.m_v2.a*this.m_v2.w.x,this.m_v1.a*this.m_v1.w.y+this.m_v2.a*this.m_v2.w.y);default:y.b2Assert(false);return new p}};h.prototype.GetWitnessPoints=function(b,e){switch(this.m_count){case 0:y.b2Assert(false);break;case 1:b.SetV(this.m_v1.wA);e.SetV(this.m_v1.wB);break;case 2:b.x=this.m_v1.a*this.m_v1.wA.x+this.m_v2.a*this.m_v2.wA.x;b.y=this.m_v1.a*this.m_v1.wA.y+ -this.m_v2.a*this.m_v2.wA.y;e.x=this.m_v1.a*this.m_v1.wB.x+this.m_v2.a*this.m_v2.wB.x;e.y=this.m_v1.a*this.m_v1.wB.y+this.m_v2.a*this.m_v2.wB.y;break;case 3:e.x=b.x=this.m_v1.a*this.m_v1.wA.x+this.m_v2.a*this.m_v2.wA.x+this.m_v3.a*this.m_v3.wA.x;e.y=b.y=this.m_v1.a*this.m_v1.wA.y+this.m_v2.a*this.m_v2.wA.y+this.m_v3.a*this.m_v3.wA.y;break;default:y.b2Assert(false)}};h.prototype.GetMetric=function(){switch(this.m_count){case 0:y.b2Assert(false);return 0;case 1:return 0;case 2:return w.SubtractVV(this.m_v1.w, -this.m_v2.w).Length();case 3:return w.CrossVV(w.SubtractVV(this.m_v2.w,this.m_v1.w),w.SubtractVV(this.m_v3.w,this.m_v1.w));default:y.b2Assert(false);return 0}};h.prototype.Solve2=function(){var b=this.m_v1.w,e=this.m_v2.w,f=w.SubtractVV(e,b);b=-(b.x*f.x+b.y*f.y);if(b<=0)this.m_count=this.m_v1.a=1;else{e=e.x*f.x+e.y*f.y;if(e<=0){this.m_count=this.m_v2.a=1;this.m_v1.Set(this.m_v2)}else{f=1/(e+b);this.m_v1.a=e*f;this.m_v2.a=b*f;this.m_count=2}}};h.prototype.Solve3=function(){var b=this.m_v1.w,e=this.m_v2.w, -f=this.m_v3.w,m=w.SubtractVV(e,b),r=w.Dot(b,m),s=w.Dot(e,m);r=-r;var v=w.SubtractVV(f,b),t=w.Dot(b,v),x=w.Dot(f,v);t=-t;var C=w.SubtractVV(f,e),J=w.Dot(e,C);C=w.Dot(f,C);J=-J;v=w.CrossVV(m,v);m=v*w.CrossVV(e,f);f=v*w.CrossVV(f,b);b=v*w.CrossVV(b,e);if(r<=0&&t<=0)this.m_count=this.m_v1.a=1;else if(s>0&&r>0&&b<=0){x=1/(s+r);this.m_v1.a=s*x;this.m_v2.a=r*x;this.m_count=2}else if(x>0&&t>0&&f<=0){s=1/(x+t);this.m_v1.a=x*s;this.m_v3.a=t*s;this.m_count=2;this.m_v2.Set(this.m_v3)}else if(s<=0&&J<=0){this.m_count= -this.m_v2.a=1;this.m_v1.Set(this.m_v2)}else if(x<=0&&C<=0){this.m_count=this.m_v3.a=1;this.m_v1.Set(this.m_v3)}else if(C>0&&J>0&&m<=0){s=1/(C+J);this.m_v2.a=C*s;this.m_v3.a=J*s;this.m_count=2;this.m_v1.Set(this.m_v3)}else{s=1/(m+f+b);this.m_v1.a=m*s;this.m_v2.a=f*s;this.m_v3.a=b*s;this.m_count=3}};l.b2SimplexCache=function(){this.indexA=new Vector_a2j_Number(3);this.indexB=new Vector_a2j_Number(3)};j.b2SimplexVertex=function(){};j.prototype.Set=function(b){this.wA.SetV(b.wA);this.wB.SetV(b.wB);this.w.SetV(b.w); -this.a=b.a;this.indexA=b.indexA;this.indexB=b.indexB};o.b2TimeOfImpact=function(){};o.TimeOfImpact=function(b){++o.b2_toiCalls;var e=b.proxyA,f=b.proxyB,m=b.sweepA,r=b.sweepB;y.b2Assert(m.t0==r.t0);y.b2Assert(1-m.t0>Number.MIN_VALUE);var s=e.m_radius+f.m_radius;b=b.tolerance;var v=0,t=0,x=0;o.s_cache.count=0;for(o.s_distanceInput.useRadii=false;;){m.GetTransform(o.s_xfA,v);r.GetTransform(o.s_xfB,v);o.s_distanceInput.proxyA=e;o.s_distanceInput.proxyB=f;o.s_distanceInput.transformA=o.s_xfA;o.s_distanceInput.transformB= -o.s_xfB;W.Distance(o.s_distanceOutput,o.s_cache,o.s_distanceInput);if(o.s_distanceOutput.distance<=0){v=1;break}o.s_fcn.Initialize(o.s_cache,e,o.s_xfA,f,o.s_xfB);var C=o.s_fcn.Evaluate(o.s_xfA,o.s_xfB);if(C<=0){v=1;break}if(t==0)x=C>s?w.Max(s-b,0.75*s):w.Max(C-b,0.02*s);if(C-x<0.5*b){if(t==0){v=1;break}break}var J=v,T=v,P=1;C=C;m.GetTransform(o.s_xfA,P);r.GetTransform(o.s_xfB,P);var X=o.s_fcn.Evaluate(o.s_xfA,o.s_xfB);if(X>=x){v=1;break}for(var $=0;;){var ba=0;ba=$&1?T+(x-C)*(P-T)/(X-C):0.5*(T+P); -m.GetTransform(o.s_xfA,ba);r.GetTransform(o.s_xfB,ba);var ca=o.s_fcn.Evaluate(o.s_xfA,o.s_xfB);if(w.Abs(ca-x)<0.025*b){J=ba;break}if(ca>x){T=ba;C=ca}else{P=ba;X=ca}++$;++o.b2_toiRootIters;if($==50)break}o.b2_toiMaxRootIters=w.Max(o.b2_toiMaxRootIters,$);if(J<(1+100*Number.MIN_VALUE)*v)break;v=J;t++;++o.b2_toiIters;if(t==1E3)break}o.b2_toiMaxIters=w.Max(o.b2_toiMaxIters,t);return v};Box2D.postDefs.push(function(){Box2D.Collision.b2TimeOfImpact.b2_toiCalls=0;Box2D.Collision.b2TimeOfImpact.b2_toiIters= -0;Box2D.Collision.b2TimeOfImpact.b2_toiMaxIters=0;Box2D.Collision.b2TimeOfImpact.b2_toiRootIters=0;Box2D.Collision.b2TimeOfImpact.b2_toiMaxRootIters=0;Box2D.Collision.b2TimeOfImpact.s_cache=new l;Box2D.Collision.b2TimeOfImpact.s_distanceInput=new Y;Box2D.Collision.b2TimeOfImpact.s_xfA=new U;Box2D.Collision.b2TimeOfImpact.s_xfB=new U;Box2D.Collision.b2TimeOfImpact.s_fcn=new d;Box2D.Collision.b2TimeOfImpact.s_distanceOutput=new k});q.b2TOIInput=function(){this.proxyA=new z;this.proxyB=new z;this.sweepA= -new A;this.sweepB=new A};n.b2WorldManifold=function(){this.m_normal=new p};n.prototype.b2WorldManifold=function(){this.m_points=new Vector(y.b2_maxManifoldPoints);for(var b=0;bNumber.MIN_VALUE*Number.MIN_VALUE){x=Math.sqrt(x);this.m_normal.x=v/x;this.m_normal.y=t/x}else{this.m_normal.x=1;this.m_normal.y=0}v=e+f*this.m_normal.y;m=m-r*this.m_normal.y;this.m_points[0].x=0.5*(s+f*this.m_normal.x+(b-r*this.m_normal.x));this.m_points[0].y=0.5*(v+m);break;case E.e_faceA:t=e.R;v=b.m_localPlaneNormal;x=t.col1.x*v.x+t.col2.x*v.y;C=t.col1.y* -v.x+t.col2.y*v.y;t=e.R;v=b.m_localPoint;J=e.position.x+t.col1.x*v.x+t.col2.x*v.y;T=e.position.y+t.col1.y*v.x+t.col2.y*v.y;this.m_normal.x=x;this.m_normal.y=C;for(s=0;sthis.m_radius){D.SetV(u);return Math.PI*this.m_radius*this.m_radius}z=this.m_radius*this.m_radius;var O=H*H;H=z*(Math.asin(H/this.m_radius)+Math.PI/2)+H*Math.sqrt(z-O);z=-2/3*Math.pow(z-O,1.5)/H;D.x=u.x+k.x*z;D.y=u.y+k.y*z;return H};G.prototype.GetLocalPosition= -function(){return this.m_p};G.prototype.SetLocalPosition=function(k){this.m_p.SetV(k)};G.prototype.GetRadius=function(){return this.m_radius};G.prototype.SetRadius=function(k){if(k===undefined)k=0;this.m_radius=k};G.prototype.b2CircleShape=function(k){if(k===undefined)k=0;this.__super.b2Shape.call(this);this.m_type=U.e_circleShape;this.m_radius=k};K.b2EdgeChainDef=function(){};K.prototype.b2EdgeChainDef=function(){this.vertexCount=0;this.isALoop=true;this.vertices=[]};Box2D.inherit(y,Box2D.Collision.Shapes.b2Shape); -y.prototype.__super=Box2D.Collision.Shapes.b2Shape.prototype;y.b2EdgeShape=function(){Box2D.Collision.Shapes.b2Shape.b2Shape.apply(this,arguments);this.s_supportVec=new V;this.m_v1=new V;this.m_v2=new V;this.m_coreV1=new V;this.m_coreV2=new V;this.m_normal=new V;this.m_direction=new V;this.m_cornerDir1=new V;this.m_cornerDir2=new V};y.prototype.TestPoint=function(){return false};y.prototype.RayCast=function(k,z,u){var D,H=z.p2.x-z.p1.x,O=z.p2.y-z.p1.y;D=u.R;var E=u.position.x+(D.col1.x*this.m_v1.x+ -D.col2.x*this.m_v1.y),R=u.position.y+(D.col1.y*this.m_v1.x+D.col2.y*this.m_v1.y),N=u.position.y+(D.col1.y*this.m_v2.x+D.col2.y*this.m_v2.y)-R;u=-(u.position.x+(D.col1.x*this.m_v2.x+D.col2.x*this.m_v2.y)-E);D=100*Number.MIN_VALUE;var S=-(H*N+O*u);if(S>D){E=z.p1.x-E;var aa=z.p1.y-R;R=E*N+aa*u;if(0<=R&&R<=z.maxFraction*S){z=-H*aa+O*E;if(-D*S<=z&&z<=S*(1+D)){R/=S;k.fraction=R;z=Math.sqrt(N*N+u*u);k.normal.x=N/z;k.normal.y=u/z;return true}}}return false};y.prototype.ComputeAABB=function(k,z){var u=z.R, -D=z.position.x+(u.col1.x*this.m_v1.x+u.col2.x*this.m_v1.y),H=z.position.y+(u.col1.y*this.m_v1.x+u.col2.y*this.m_v1.y),O=z.position.x+(u.col1.x*this.m_v2.x+u.col2.x*this.m_v2.y);u=z.position.y+(u.col1.y*this.m_v2.x+u.col2.y*this.m_v2.y);if(D0)if(k>0)return 0;else{O.x=-k/(E-k)*O.x+E/(E-k)*u.x;O.y=-k/(E-k)*O.y+E/(E-k)*u.y}else if(k>0){u.x=-k/(E-k)*O.x+E/(E-k)*u.x;u.y=-k/(E-k)*O.y+E/(E-k)*u.y}D.x=(H.x+O.x+u.x)/3;D.y=(H.y+O.y+u.y)/3;return 0.5*((O.x-H.x)*(u.y-H.y)-(O.y-H.y)*(u.x-H.x))};y.prototype.GetLength=function(){return this.m_length};y.prototype.GetVertex1=function(){return this.m_v1};y.prototype.GetVertex2= -function(){return this.m_v2};y.prototype.GetCoreVertex1=function(){return this.m_coreV1};y.prototype.GetCoreVertex2=function(){return this.m_coreV2};y.prototype.GetNormalVector=function(){return this.m_normal};y.prototype.GetDirectionVector=function(){return this.m_direction};y.prototype.GetCorner1Vector=function(){return this.m_cornerDir1};y.prototype.GetCorner2Vector=function(){return this.m_cornerDir2};y.prototype.Corner1IsConvex=function(){return this.m_cornerConvex1};y.prototype.Corner2IsConvex= -function(){return this.m_cornerConvex2};y.prototype.GetFirstVertex=function(k){var z=k.R;return new V(k.position.x+(z.col1.x*this.m_coreV1.x+z.col2.x*this.m_coreV1.y),k.position.y+(z.col1.y*this.m_coreV1.x+z.col2.y*this.m_coreV1.y))};y.prototype.GetNextEdge=function(){return this.m_nextEdge};y.prototype.GetPrevEdge=function(){return this.m_prevEdge};y.prototype.Support=function(k,z,u){if(z===undefined)z=0;if(u===undefined)u=0;var D=k.R,H=k.position.x+(D.col1.x*this.m_coreV1.x+D.col2.x*this.m_coreV1.y), -O=k.position.y+(D.col1.y*this.m_coreV1.x+D.col2.y*this.m_coreV1.y),E=k.position.x+(D.col1.x*this.m_coreV2.x+D.col2.x*this.m_coreV2.y);k=k.position.y+(D.col1.y*this.m_coreV2.x+D.col2.y*this.m_coreV2.y);if(H*z+O*u>E*z+k*u){this.s_supportVec.x=H;this.s_supportVec.y=O}else{this.s_supportVec.x=E;this.s_supportVec.y=k}return this.s_supportVec};y.prototype.b2EdgeShape=function(k,z){this.__super.b2Shape.call(this);this.m_type=U.e_edgeShape;this.m_nextEdge=this.m_prevEdge=null;this.m_v1=k;this.m_v2=z;this.m_direction.Set(this.m_v2.x- -this.m_v1.x,this.m_v2.y-this.m_v1.y);this.m_length=this.m_direction.Normalize();this.m_normal.Set(this.m_direction.y,-this.m_direction.x);this.m_coreV1.Set(-F.b2_toiSlop*(this.m_normal.x-this.m_direction.x)+this.m_v1.x,-F.b2_toiSlop*(this.m_normal.y-this.m_direction.y)+this.m_v1.y);this.m_coreV2.Set(-F.b2_toiSlop*(this.m_normal.x+this.m_direction.x)+this.m_v2.x,-F.b2_toiSlop*(this.m_normal.y+this.m_direction.y)+this.m_v2.y);this.m_cornerDir1=this.m_normal;this.m_cornerDir2.Set(-this.m_normal.x,-this.m_normal.y)}; -y.prototype.SetPrevEdge=function(k,z,u,D){this.m_prevEdge=k;this.m_coreV1=z;this.m_cornerDir1=u;this.m_cornerConvex1=D};y.prototype.SetNextEdge=function(k,z,u,D){this.m_nextEdge=k;this.m_coreV2=z;this.m_cornerDir2=u;this.m_cornerConvex2=D};w.b2MassData=function(){this.mass=0;this.center=new V(0,0);this.I=0};Box2D.inherit(A,Box2D.Collision.Shapes.b2Shape);A.prototype.__super=Box2D.Collision.Shapes.b2Shape.prototype;A.b2PolygonShape=function(){Box2D.Collision.Shapes.b2Shape.b2Shape.apply(this,arguments)}; -A.prototype.Copy=function(){var k=new A;k.Set(this);return k};A.prototype.Set=function(k){this.__super.Set.call(this,k);if(Box2D.is(k,A)){k=k instanceof A?k:null;this.m_centroid.SetV(k.m_centroid);this.m_vertexCount=k.m_vertexCount;this.Reserve(this.m_vertexCount);for(var z=0;zNumber.MIN_VALUE);this.m_normals[u].SetV(B.CrossVF(D, -1));this.m_normals[u].Normalize()}this.m_centroid=A.ComputeCentroid(this.m_vertices,this.m_vertexCount)};A.AsVector=function(k,z){if(z===undefined)z=0;var u=new A;u.SetAsVector(k,z);return u};A.prototype.SetAsBox=function(k,z){if(k===undefined)k=0;if(z===undefined)z=0;this.m_vertexCount=4;this.Reserve(4);this.m_vertices[0].Set(-k,-z);this.m_vertices[1].Set(k,-z);this.m_vertices[2].Set(k,z);this.m_vertices[3].Set(-k,z);this.m_normals[0].Set(0,-1);this.m_normals[1].Set(1,0);this.m_normals[2].Set(0, -1);this.m_normals[3].Set(-1,0);this.m_centroid.SetZero()};A.AsBox=function(k,z){if(k===undefined)k=0;if(z===undefined)z=0;var u=new A;u.SetAsBox(k,z);return u};A.prototype.SetAsOrientedBox=function(k,z,u,D){if(k===undefined)k=0;if(z===undefined)z=0;if(u===undefined)u=null;if(D===undefined)D=0;this.m_vertexCount=4;this.Reserve(4);this.m_vertices[0].Set(-k,-z);this.m_vertices[1].Set(k,-z);this.m_vertices[2].Set(k,z);this.m_vertices[3].Set(-k,z);this.m_normals[0].Set(0,-1);this.m_normals[1].Set(1,0); -this.m_normals[2].Set(0,1);this.m_normals[3].Set(-1,0);this.m_centroid=u;k=new Q;k.position=u;k.R.Set(D);for(u=0;u0)return false}return true};A.prototype.RayCast=function(k,z,u){var D=0,H=z.maxFraction,O=0,E=0,R,N;O=z.p1.x-u.position.x;E=z.p1.y-u.position.y;R=u.R;var S=O*R.col1.x+E*R.col1.y,aa=O*R.col2.x+E*R.col2.y;O=z.p2.x-u.position.x;E=z.p2.y-u.position.y;R=u.R;z=O*R.col1.x+E*R.col1.y-S;R=O*R.col2.x+E*R.col2.y-aa;for(var Z=parseInt(-1),d=0;d0&&O=0){k.fraction=D;R=u.R;N=this.m_normals[Z];k.normal.x=R.col1.x*N.x+R.col2.x*N.y;k.normal.y=R.col1.y*N.x+R.col2.y*N.y;return true}return false};A.prototype.ComputeAABB=function(k,z){for(var u=z.R,D=this.m_vertices[0],H=z.position.x+(u.col1.x*D.x+u.col2.x*D.y),O=z.position.y+(u.col1.y*D.x+u.col2.y*D.y),E=H,R=O,N=1;NS?E:S;R=R>D?R:D}k.lowerBound.x=H-this.m_radius;k.lowerBound.y=O-this.m_radius;k.upperBound.x=E+this.m_radius;k.upperBound.y=R+this.m_radius};A.prototype.ComputeMass=function(k,z){if(z===undefined)z=0;if(this.m_vertexCount==2){k.center.x=0.5*(this.m_vertices[0].x+this.m_vertices[1].x);k.center.y=0.5*(this.m_vertices[0].y+this.m_vertices[1].y);k.mass=0;k.I=0}else{for(var u=0,D=0,H=0,O=0,E=1/3,R=0;R0)if(aa){if(!S){N=k-1;R++}}else if(S){z=k-1;R++}S=aa}switch(R){case 0:if(S){k=new w;this.ComputeMass(k,1);D.SetV(B.MulX(u,k.center));return k.mass}else return 0;case 1:if(N==-1)N=this.m_vertexCount-1;else z=this.m_vertexCount-1}k=parseInt((N+1)%this.m_vertexCount);H=parseInt((z+1)%this.m_vertexCount);O=(0-E[N])/(E[k]-E[N]);E=(0-E[z])/(E[H]-E[z]);N=new V(this.m_vertices[N].x* -(1-O)+this.m_vertices[k].x*O,this.m_vertices[N].y*(1-O)+this.m_vertices[k].y*O);z=new V(this.m_vertices[z].x*(1-E)+this.m_vertices[H].x*E,this.m_vertices[z].y*(1-E)+this.m_vertices[H].y*E);E=0;O=new V;R=this.m_vertices[k];for(k=k;k!=H;){k=(k+1)%this.m_vertexCount;S=k==H?z:this.m_vertices[k];aa=0.5*((R.x-N.x)*(S.y-N.y)-(R.y-N.y)*(S.x-N.x));E+=aa;O.x+=aa*(N.x+R.x+S.x)/3;O.y+=aa*(N.y+R.y+S.y)/3;R=S}O.Multiply(1/E);D.SetV(B.MulX(u,O));return E};A.prototype.GetVertexCount=function(){return this.m_vertexCount}; -A.prototype.GetVertices=function(){return this.m_vertices};A.prototype.GetNormals=function(){return this.m_normals};A.prototype.GetSupport=function(k){for(var z=0,u=this.m_vertices[0].x*k.x+this.m_vertices[0].y*k.y,D=1;Du){z=D;u=H}}return z};A.prototype.GetSupportVertex=function(k){for(var z=0,u=this.m_vertices[0].x*k.x+this.m_vertices[0].y*k.y,D=1;Du){z=D;u=H}}return this.m_vertices[z]};A.prototype.Validate=function(){return false};A.prototype.b2PolygonShape=function(){this.__super.b2Shape.call(this);this.m_type=U.e_polygonShape;this.m_centroid=new V;this.m_vertices=new Vector;this.m_normals=new Vector};A.prototype.Reserve=function(k){if(k===undefined)k=0;for(var z=parseInt(this.m_vertices.length);zd)d=q;if(j>h)h=j}l=(d-N)*(h-Z);if(l<0.95*z){z=l;k.R.col1.x=E;k.R.col1.y=R;k.R.col2.x=S;k.R.col2.y=aa;E=0.5*(N+d);R=0.5*(Z+h);S=k.R;k.center.x=O.x+(S.col1.x*E+S.col2.x*R);k.center.y=O.y+(S.col1.y*E+S.col2.y*R);k.extents.x=0.5*(d-N);k.extents.y=0.5*(h-Z)}}};Box2D.postDefs.push(function(){Box2D.Collision.Shapes.b2PolygonShape.s_mat=new p});U.b2Shape=function(){};U.prototype.Copy=function(){return null};U.prototype.Set=function(k){this.m_radius= -k.m_radius};U.prototype.GetType=function(){return this.m_type};U.prototype.TestPoint=function(){return false};U.prototype.RayCast=function(){return false};U.prototype.ComputeAABB=function(){};U.prototype.ComputeMass=function(){};U.prototype.ComputeSubmergedArea=function(){return 0};U.TestOverlap=function(k,z,u,D){var H=new L;H.proxyA=new W;H.proxyA.Set(k);H.proxyB=new W;H.proxyB.Set(u);H.transformA=z;H.transformB=D;H.useRadii=true;k=new Y;k.count=0;z=new I;M.Distance(z,k,H);return z.distance<10*Number.MIN_VALUE}; -U.prototype.b2Shape=function(){this.m_type=U.e_unknownShape;this.m_radius=F.b2_linearSlop};Box2D.postDefs.push(function(){Box2D.Collision.Shapes.b2Shape.e_unknownShape=parseInt(-1);Box2D.Collision.Shapes.b2Shape.e_circleShape=0;Box2D.Collision.Shapes.b2Shape.e_polygonShape=1;Box2D.Collision.Shapes.b2Shape.e_edgeShape=2;Box2D.Collision.Shapes.b2Shape.e_shapeTypeCount=3;Box2D.Collision.Shapes.b2Shape.e_hitCollide=1;Box2D.Collision.Shapes.b2Shape.e_missCollide=0;Box2D.Collision.Shapes.b2Shape.e_startsInsideCollide= -parseInt(-1)})})(); -(function(){var F=Box2D.Common.b2Color,G=Box2D.Common.b2Settings,K=Box2D.Common.Math.b2Math;F.b2Color=function(){this._b=this._g=this._r=0};F.prototype.b2Color=function(y,w,A){if(y===undefined)y=0;if(w===undefined)w=0;if(A===undefined)A=0;this._r=Box2D.parseUInt(255*K.Clamp(y,0,1));this._g=Box2D.parseUInt(255*K.Clamp(w,0,1));this._b=Box2D.parseUInt(255*K.Clamp(A,0,1))};F.prototype.Set=function(y,w,A){if(y===undefined)y=0;if(w===undefined)w=0;if(A===undefined)A=0;this._r=Box2D.parseUInt(255*K.Clamp(y, -0,1));this._g=Box2D.parseUInt(255*K.Clamp(w,0,1));this._b=Box2D.parseUInt(255*K.Clamp(A,0,1))};Object.defineProperty(F.prototype,"r",{enumerable:false,configurable:true,set:function(y){if(y===undefined)y=0;this._r=Box2D.parseUInt(255*K.Clamp(y,0,1))}});Object.defineProperty(F.prototype,"g",{enumerable:false,configurable:true,set:function(y){if(y===undefined)y=0;this._g=Box2D.parseUInt(255*K.Clamp(y,0,1))}});Object.defineProperty(F.prototype,"b",{enumerable:false,configurable:true,set:function(y){if(y=== -undefined)y=0;this._b=Box2D.parseUInt(255*K.Clamp(y,0,1))}});Object.defineProperty(F.prototype,"color",{enumerable:false,configurable:true,get:function(){return this._r<<16|this._g<<8|this._b}});G.b2Settings=function(){};G.b2MixFriction=function(y,w){if(y===undefined)y=0;if(w===undefined)w=0;return Math.sqrt(y*w)};G.b2MixRestitution=function(y,w){if(y===undefined)y=0;if(w===undefined)w=0;return y>w?y:w};G.b2Assert=function(y){if(!y)throw"Assertion Failed";};Box2D.postDefs.push(function(){Box2D.Common.b2Settings.VERSION= -"2.1alpha";Box2D.Common.b2Settings.USHRT_MAX=65535;Box2D.Common.b2Settings.b2_pi=Math.PI;Box2D.Common.b2Settings.b2_maxManifoldPoints=2;Box2D.Common.b2Settings.b2_aabbExtension=0.1;Box2D.Common.b2Settings.b2_aabbMultiplier=2;Box2D.Common.b2Settings.b2_polygonRadius=2*G.b2_linearSlop;Box2D.Common.b2Settings.b2_linearSlop=0.0050;Box2D.Common.b2Settings.b2_angularSlop=2/180*G.b2_pi;Box2D.Common.b2Settings.b2_toiSlop=8*G.b2_linearSlop;Box2D.Common.b2Settings.b2_maxTOIContactsPerIsland=32;Box2D.Common.b2Settings.b2_maxTOIJointsPerIsland= -32;Box2D.Common.b2Settings.b2_velocityThreshold=1;Box2D.Common.b2Settings.b2_maxLinearCorrection=0.2;Box2D.Common.b2Settings.b2_maxAngularCorrection=8/180*G.b2_pi;Box2D.Common.b2Settings.b2_maxTranslation=2;Box2D.Common.b2Settings.b2_maxTranslationSquared=G.b2_maxTranslation*G.b2_maxTranslation;Box2D.Common.b2Settings.b2_maxRotation=0.5*G.b2_pi;Box2D.Common.b2Settings.b2_maxRotationSquared=G.b2_maxRotation*G.b2_maxRotation;Box2D.Common.b2Settings.b2_contactBaumgarte=0.2;Box2D.Common.b2Settings.b2_timeToSleep= -0.5;Box2D.Common.b2Settings.b2_linearSleepTolerance=0.01;Box2D.Common.b2Settings.b2_angularSleepTolerance=2/180*G.b2_pi})})(); -(function(){var F=Box2D.Common.Math.b2Mat22,G=Box2D.Common.Math.b2Mat33,K=Box2D.Common.Math.b2Math,y=Box2D.Common.Math.b2Sweep,w=Box2D.Common.Math.b2Transform,A=Box2D.Common.Math.b2Vec2,U=Box2D.Common.Math.b2Vec3;F.b2Mat22=function(){this.col1=new A;this.col2=new A};F.prototype.b2Mat22=function(){this.SetIdentity()};F.FromAngle=function(p){if(p===undefined)p=0;var B=new F;B.Set(p);return B};F.FromVV=function(p,B){var Q=new F;Q.SetVV(p,B);return Q};F.prototype.Set=function(p){if(p===undefined)p=0; -var B=Math.cos(p);p=Math.sin(p);this.col1.x=B;this.col2.x=-p;this.col1.y=p;this.col2.y=B};F.prototype.SetVV=function(p,B){this.col1.SetV(p);this.col2.SetV(B)};F.prototype.Copy=function(){var p=new F;p.SetM(this);return p};F.prototype.SetM=function(p){this.col1.SetV(p.col1);this.col2.SetV(p.col2)};F.prototype.AddM=function(p){this.col1.x+=p.col1.x;this.col1.y+=p.col1.y;this.col2.x+=p.col2.x;this.col2.y+=p.col2.y};F.prototype.SetIdentity=function(){this.col1.x=1;this.col2.x=0;this.col1.y=0;this.col2.y= -1};F.prototype.SetZero=function(){this.col1.x=0;this.col2.x=0;this.col1.y=0;this.col2.y=0};F.prototype.GetAngle=function(){return Math.atan2(this.col1.y,this.col1.x)};F.prototype.GetInverse=function(p){var B=this.col1.x,Q=this.col2.x,V=this.col1.y,M=this.col2.y,L=B*M-Q*V;if(L!=0)L=1/L;p.col1.x=L*M;p.col2.x=-L*Q;p.col1.y=-L*V;p.col2.y=L*B;return p};F.prototype.Solve=function(p,B,Q){if(B===undefined)B=0;if(Q===undefined)Q=0;var V=this.col1.x,M=this.col2.x,L=this.col1.y,I=this.col2.y,W=V*I-M*L;if(W!= -0)W=1/W;p.x=W*(I*B-M*Q);p.y=W*(V*Q-L*B);return p};F.prototype.Abs=function(){this.col1.Abs();this.col2.Abs()};G.b2Mat33=function(){this.col1=new U;this.col2=new U;this.col3=new U};G.prototype.b2Mat33=function(p,B,Q){if(p===undefined)p=null;if(B===undefined)B=null;if(Q===undefined)Q=null;if(!p&&!B&&!Q){this.col1.SetZero();this.col2.SetZero();this.col3.SetZero()}else{this.col1.SetV(p);this.col2.SetV(B);this.col3.SetV(Q)}};G.prototype.SetVVV=function(p,B,Q){this.col1.SetV(p);this.col2.SetV(B);this.col3.SetV(Q)}; -G.prototype.Copy=function(){return new G(this.col1,this.col2,this.col3)};G.prototype.SetM=function(p){this.col1.SetV(p.col1);this.col2.SetV(p.col2);this.col3.SetV(p.col3)};G.prototype.AddM=function(p){this.col1.x+=p.col1.x;this.col1.y+=p.col1.y;this.col1.z+=p.col1.z;this.col2.x+=p.col2.x;this.col2.y+=p.col2.y;this.col2.z+=p.col2.z;this.col3.x+=p.col3.x;this.col3.y+=p.col3.y;this.col3.z+=p.col3.z};G.prototype.SetIdentity=function(){this.col1.x=1;this.col2.x=0;this.col3.x=0;this.col1.y=0;this.col2.y= -1;this.col3.y=0;this.col1.z=0;this.col2.z=0;this.col3.z=1};G.prototype.SetZero=function(){this.col1.x=0;this.col2.x=0;this.col3.x=0;this.col1.y=0;this.col2.y=0;this.col3.y=0;this.col1.z=0;this.col2.z=0;this.col3.z=0};G.prototype.Solve22=function(p,B,Q){if(B===undefined)B=0;if(Q===undefined)Q=0;var V=this.col1.x,M=this.col2.x,L=this.col1.y,I=this.col2.y,W=V*I-M*L;if(W!=0)W=1/W;p.x=W*(I*B-M*Q);p.y=W*(V*Q-L*B);return p};G.prototype.Solve33=function(p,B,Q,V){if(B===undefined)B=0;if(Q===undefined)Q=0; -if(V===undefined)V=0;var M=this.col1.x,L=this.col1.y,I=this.col1.z,W=this.col2.x,Y=this.col2.y,k=this.col2.z,z=this.col3.x,u=this.col3.y,D=this.col3.z,H=M*(Y*D-k*u)+L*(k*z-W*D)+I*(W*u-Y*z);if(H!=0)H=1/H;p.x=H*(B*(Y*D-k*u)+Q*(k*z-W*D)+V*(W*u-Y*z));p.y=H*(M*(Q*D-V*u)+L*(V*z-B*D)+I*(B*u-Q*z));p.z=H*(M*(Y*V-k*Q)+L*(k*B-W*V)+I*(W*Q-Y*B));return p};K.b2Math=function(){};K.IsValid=function(p){if(p===undefined)p=0;return isFinite(p)};K.Dot=function(p,B){return p.x*B.x+p.y*B.y};K.CrossVV=function(p,B){return p.x* -B.y-p.y*B.x};K.CrossVF=function(p,B){if(B===undefined)B=0;return new A(B*p.y,-B*p.x)};K.CrossFV=function(p,B){if(p===undefined)p=0;return new A(-p*B.y,p*B.x)};K.MulMV=function(p,B){return new A(p.col1.x*B.x+p.col2.x*B.y,p.col1.y*B.x+p.col2.y*B.y)};K.MulTMV=function(p,B){return new A(K.Dot(B,p.col1),K.Dot(B,p.col2))};K.MulX=function(p,B){var Q=K.MulMV(p.R,B);Q.x+=p.position.x;Q.y+=p.position.y;return Q};K.MulXT=function(p,B){var Q=K.SubtractVV(B,p.position),V=Q.x*p.R.col1.x+Q.y*p.R.col1.y;Q.y=Q.x* -p.R.col2.x+Q.y*p.R.col2.y;Q.x=V;return Q};K.AddVV=function(p,B){return new A(p.x+B.x,p.y+B.y)};K.SubtractVV=function(p,B){return new A(p.x-B.x,p.y-B.y)};K.Distance=function(p,B){var Q=p.x-B.x,V=p.y-B.y;return Math.sqrt(Q*Q+V*V)};K.DistanceSquared=function(p,B){var Q=p.x-B.x,V=p.y-B.y;return Q*Q+V*V};K.MulFV=function(p,B){if(p===undefined)p=0;return new A(p*B.x,p*B.y)};K.AddMM=function(p,B){return F.FromVV(K.AddVV(p.col1,B.col1),K.AddVV(p.col2,B.col2))};K.MulMM=function(p,B){return F.FromVV(K.MulMV(p, -B.col1),K.MulMV(p,B.col2))};K.MulTMM=function(p,B){var Q=new A(K.Dot(p.col1,B.col1),K.Dot(p.col2,B.col1)),V=new A(K.Dot(p.col1,B.col2),K.Dot(p.col2,B.col2));return F.FromVV(Q,V)};K.Abs=function(p){if(p===undefined)p=0;return p>0?p:-p};K.AbsV=function(p){return new A(K.Abs(p.x),K.Abs(p.y))};K.AbsM=function(p){return F.FromVV(K.AbsV(p.col1),K.AbsV(p.col2))};K.Min=function(p,B){if(p===undefined)p=0;if(B===undefined)B=0;return pB?p:B};K.MaxV=function(p,B){return new A(K.Max(p.x,B.x),K.Max(p.y,B.y))};K.Clamp=function(p,B,Q){if(p===undefined)p=0;if(B===undefined)B=0;if(Q===undefined)Q=0;return pQ?Q:p};K.ClampV=function(p,B,Q){return K.MaxV(B,K.MinV(p,Q))};K.Swap=function(p,B){var Q=p[0];p[0]=B[0];B[0]=Q};K.Random=function(){return Math.random()*2-1};K.RandomRange=function(p,B){if(p===undefined)p=0;if(B===undefined)B=0;var Q=Math.random();return Q= -(B-p)*Q+p};K.NextPowerOfTwo=function(p){if(p===undefined)p=0;p|=p>>1&2147483647;p|=p>>2&1073741823;p|=p>>4&268435455;p|=p>>8&16777215;p|=p>>16&65535;return p+1};K.IsPowerOfTwo=function(p){if(p===undefined)p=0;return p>0&&(p&p-1)==0};Box2D.postDefs.push(function(){Box2D.Common.Math.b2Math.b2Vec2_zero=new A(0,0);Box2D.Common.Math.b2Math.b2Mat22_identity=F.FromVV(new A(1,0),new A(0,1));Box2D.Common.Math.b2Math.b2Transform_identity=new w(K.b2Vec2_zero,K.b2Mat22_identity)});y.b2Sweep=function(){this.localCenter= -new A;this.c0=new A;this.c=new A};y.prototype.Set=function(p){this.localCenter.SetV(p.localCenter);this.c0.SetV(p.c0);this.c.SetV(p.c);this.a0=p.a0;this.a=p.a;this.t0=p.t0};y.prototype.Copy=function(){var p=new y;p.localCenter.SetV(this.localCenter);p.c0.SetV(this.c0);p.c.SetV(this.c);p.a0=this.a0;p.a=this.a;p.t0=this.t0;return p};y.prototype.GetTransform=function(p,B){if(B===undefined)B=0;p.position.x=(1-B)*this.c0.x+B*this.c.x;p.position.y=(1-B)*this.c0.y+B*this.c.y;p.R.Set((1-B)*this.a0+B*this.a); -var Q=p.R;p.position.x-=Q.col1.x*this.localCenter.x+Q.col2.x*this.localCenter.y;p.position.y-=Q.col1.y*this.localCenter.x+Q.col2.y*this.localCenter.y};y.prototype.Advance=function(p){if(p===undefined)p=0;if(this.t0Number.MIN_VALUE){var B=(p-this.t0)/(1-this.t0);this.c0.x=(1-B)*this.c0.x+B*this.c.x;this.c0.y=(1-B)*this.c0.y+B*this.c.y;this.a0=(1-B)*this.a0+B*this.a;this.t0=p}};w.b2Transform=function(){this.position=new A;this.R=new F};w.prototype.b2Transform=function(p,B){if(p===undefined)p= -null;if(B===undefined)B=null;if(p){this.position.SetV(p);this.R.SetM(B)}};w.prototype.Initialize=function(p,B){this.position.SetV(p);this.R.SetM(B)};w.prototype.SetIdentity=function(){this.position.SetZero();this.R.SetIdentity()};w.prototype.Set=function(p){this.position.SetV(p.position);this.R.SetM(p.R)};w.prototype.GetAngle=function(){return Math.atan2(this.R.col1.y,this.R.col1.x)};A.b2Vec2=function(){};A.prototype.b2Vec2=function(p,B){if(p===undefined)p=0;if(B===undefined)B=0;this.x=p;this.y=B}; -A.prototype.SetZero=function(){this.y=this.x=0};A.prototype.Set=function(p,B){if(p===undefined)p=0;if(B===undefined)B=0;this.x=p;this.y=B};A.prototype.SetV=function(p){this.x=p.x;this.y=p.y};A.prototype.GetNegative=function(){return new A(-this.x,-this.y)};A.prototype.NegativeSelf=function(){this.x=-this.x;this.y=-this.y};A.Make=function(p,B){if(p===undefined)p=0;if(B===undefined)B=0;return new A(p,B)};A.prototype.Copy=function(){return new A(this.x,this.y)};A.prototype.Add=function(p){this.x+=p.x; -this.y+=p.y};A.prototype.Subtract=function(p){this.x-=p.x;this.y-=p.y};A.prototype.Multiply=function(p){if(p===undefined)p=0;this.x*=p;this.y*=p};A.prototype.MulM=function(p){var B=this.x;this.x=p.col1.x*B+p.col2.x*this.y;this.y=p.col1.y*B+p.col2.y*this.y};A.prototype.MulTM=function(p){var B=K.Dot(this,p.col1);this.y=K.Dot(this,p.col2);this.x=B};A.prototype.CrossVF=function(p){if(p===undefined)p=0;var B=this.x;this.x=p*this.y;this.y=-p*B};A.prototype.CrossFV=function(p){if(p===undefined)p=0;var B= -this.x;this.x=-p*this.y;this.y=p*B};A.prototype.MinV=function(p){this.x=this.xp.x?this.x:p.x;this.y=this.y>p.y?this.y:p.y};A.prototype.Abs=function(){if(this.x<0)this.x=-this.x;if(this.y<0)this.y=-this.y};A.prototype.Length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)};A.prototype.LengthSquared=function(){return this.x*this.x+this.y*this.y};A.prototype.Normalize=function(){var p=Math.sqrt(this.x*this.x+ -this.y*this.y);if(p0;a.SetNextEdge(c,g,e,f);c.SetPrevEdge(a,g,e,f);return b};k.prototype.CreateFixture=function(a){if(this.m_world.IsLocked()==true)return null;var c=new S;c.Create(this,this.m_xf,a);this.m_flags&k.e_activeFlag&&c.CreateProxy(this.m_world.m_contactManager.m_broadPhase,this.m_xf);c.m_next=this.m_fixtureList;this.m_fixtureList=c;++this.m_fixtureCount;c.m_body=this;c.m_density>0&&this.ResetMassData();this.m_world.m_flags|= -h.e_newFixture;return c};k.prototype.CreateFixture2=function(a,c){if(c===undefined)c=0;var g=new aa;g.shape=a;g.density=c;return this.CreateFixture(g)};k.prototype.DestroyFixture=function(a){if(this.m_world.IsLocked()!=true){for(var c=this.m_fixtureList,g=null;c!=null;){if(c==a){if(g)g.m_next=a.m_next;else this.m_fixtureList=a.m_next;break}g=c;c=c.m_next}for(c=this.m_contactList;c;){g=c.contact;c=c.next;var b=g.GetFixtureA(),e=g.GetFixtureB();if(a==b||a==e)this.m_world.m_contactManager.Destroy(g)}this.m_flags& -k.e_activeFlag&&a.DestroyProxy(this.m_world.m_contactManager.m_broadPhase);a.Destroy();a.m_body=null;a.m_next=null;--this.m_fixtureCount;this.ResetMassData()}};k.prototype.SetPositionAndAngle=function(a,c){if(c===undefined)c=0;var g;if(this.m_world.IsLocked()!=true){this.m_xf.R.Set(c);this.m_xf.position.SetV(a);g=this.m_xf.R;var b=this.m_sweep.localCenter;this.m_sweep.c.x=g.col1.x*b.x+g.col2.x*b.y;this.m_sweep.c.y=g.col1.y*b.x+g.col2.y*b.y;this.m_sweep.c.x+=this.m_xf.position.x;this.m_sweep.c.y+= -this.m_xf.position.y;this.m_sweep.c0.SetV(this.m_sweep.c);this.m_sweep.a0=this.m_sweep.a=c;b=this.m_world.m_contactManager.m_broadPhase;for(g=this.m_fixtureList;g;g=g.m_next)g.Synchronize(b,this.m_xf,this.m_xf);this.m_world.m_contactManager.FindNewContacts()}};k.prototype.SetTransform=function(a){this.SetPositionAndAngle(a.position,a.GetAngle())};k.prototype.GetTransform=function(){return this.m_xf};k.prototype.GetPosition=function(){return this.m_xf.position};k.prototype.SetPosition=function(a){this.SetPositionAndAngle(a, -this.GetAngle())};k.prototype.GetAngle=function(){return this.m_sweep.a};k.prototype.SetAngle=function(a){if(a===undefined)a=0;this.SetPositionAndAngle(this.GetPosition(),a)};k.prototype.GetWorldCenter=function(){return this.m_sweep.c};k.prototype.GetLocalCenter=function(){return this.m_sweep.localCenter};k.prototype.SetLinearVelocity=function(a){this.m_type!=k.b2_staticBody&&this.m_linearVelocity.SetV(a)};k.prototype.GetLinearVelocity=function(){return this.m_linearVelocity};k.prototype.SetAngularVelocity= -function(a){if(a===undefined)a=0;if(this.m_type!=k.b2_staticBody)this.m_angularVelocity=a};k.prototype.GetAngularVelocity=function(){return this.m_angularVelocity};k.prototype.GetDefinition=function(){var a=new z;a.type=this.GetType();a.allowSleep=(this.m_flags&k.e_allowSleepFlag)==k.e_allowSleepFlag;a.angle=this.GetAngle();a.angularDamping=this.m_angularDamping;a.angularVelocity=this.m_angularVelocity;a.fixedRotation=(this.m_flags&k.e_fixedRotationFlag)==k.e_fixedRotationFlag;a.bullet=(this.m_flags& -k.e_bulletFlag)==k.e_bulletFlag;a.awake=(this.m_flags&k.e_awakeFlag)==k.e_awakeFlag;a.linearDamping=this.m_linearDamping;a.linearVelocity.SetV(this.GetLinearVelocity());a.position=this.GetPosition();a.userData=this.GetUserData();return a};k.prototype.ApplyForce=function(a,c){if(this.m_type==k.b2_dynamicBody){this.IsAwake()==false&&this.SetAwake(true);this.m_force.x+=a.x;this.m_force.y+=a.y;this.m_torque+=(c.x-this.m_sweep.c.x)*a.y-(c.y-this.m_sweep.c.y)*a.x}};k.prototype.ApplyTorque=function(a){if(a=== -undefined)a=0;if(this.m_type==k.b2_dynamicBody){this.IsAwake()==false&&this.SetAwake(true);this.m_torque+=a}};k.prototype.ApplyImpulse=function(a,c){if(this.m_type==k.b2_dynamicBody){this.IsAwake()==false&&this.SetAwake(true);this.m_linearVelocity.x+=this.m_invMass*a.x;this.m_linearVelocity.y+=this.m_invMass*a.y;this.m_angularVelocity+=this.m_invI*((c.x-this.m_sweep.c.x)*a.y-(c.y-this.m_sweep.c.y)*a.x)}};k.prototype.Split=function(a){for(var c=this.GetLinearVelocity().Copy(),g=this.GetAngularVelocity(), -b=this.GetWorldCenter(),e=this.m_world.CreateBody(this.GetDefinition()),f,m=this.m_fixtureList;m;)if(a(m)){var r=m.m_next;if(f)f.m_next=r;else this.m_fixtureList=r;this.m_fixtureCount--;m.m_next=e.m_fixtureList;e.m_fixtureList=m;e.m_fixtureCount++;m.m_body=e;m=r}else{f=m;m=m.m_next}this.ResetMassData();e.ResetMassData();f=this.GetWorldCenter();a=e.GetWorldCenter();f=F.AddVV(c,F.CrossFV(g,F.SubtractVV(f,b)));c=F.AddVV(c,F.CrossFV(g,F.SubtractVV(a,b)));this.SetLinearVelocity(f);e.SetLinearVelocity(c); -this.SetAngularVelocity(g);e.SetAngularVelocity(g);this.SynchronizeFixtures();e.SynchronizeFixtures();return e};k.prototype.Merge=function(a){var c;for(c=a.m_fixtureList;c;){var g=c.m_next;a.m_fixtureCount--;c.m_next=this.m_fixtureList;this.m_fixtureList=c;this.m_fixtureCount++;c.m_body=e;c=g}b.m_fixtureCount=0;var b=this,e=a;b.GetWorldCenter();e.GetWorldCenter();b.GetLinearVelocity().Copy();e.GetLinearVelocity().Copy();b.GetAngularVelocity();e.GetAngularVelocity();b.ResetMassData();this.SynchronizeFixtures()}; -k.prototype.GetMass=function(){return this.m_mass};k.prototype.GetInertia=function(){return this.m_I};k.prototype.GetMassData=function(a){a.mass=this.m_mass;a.I=this.m_I;a.center.SetV(this.m_sweep.localCenter)};k.prototype.SetMassData=function(a){A.b2Assert(this.m_world.IsLocked()==false);if(this.m_world.IsLocked()!=true)if(this.m_type==k.b2_dynamicBody){this.m_invI=this.m_I=this.m_invMass=0;this.m_mass=a.mass;if(this.m_mass<=0)this.m_mass=1;this.m_invMass=1/this.m_mass;if(a.I>0&&(this.m_flags&k.e_fixedRotationFlag)== -0){this.m_I=a.I-this.m_mass*(a.center.x*a.center.x+a.center.y*a.center.y);this.m_invI=1/this.m_I}var c=this.m_sweep.c.Copy();this.m_sweep.localCenter.SetV(a.center);this.m_sweep.c0.SetV(F.MulX(this.m_xf,this.m_sweep.localCenter));this.m_sweep.c.SetV(this.m_sweep.c0);this.m_linearVelocity.x+=this.m_angularVelocity*-(this.m_sweep.c.y-c.y);this.m_linearVelocity.y+=this.m_angularVelocity*+(this.m_sweep.c.x-c.x)}};k.prototype.ResetMassData=function(){this.m_invI=this.m_I=this.m_invMass=this.m_mass=0;this.m_sweep.localCenter.SetZero(); -if(!(this.m_type==k.b2_staticBody||this.m_type==k.b2_kinematicBody)){for(var a=y.Make(0,0),c=this.m_fixtureList;c;c=c.m_next)if(c.m_density!=0){var g=c.GetMassData();this.m_mass+=g.mass;a.x+=g.center.x*g.mass;a.y+=g.center.y*g.mass;this.m_I+=g.I}if(this.m_mass>0){this.m_invMass=1/this.m_mass;a.x*=this.m_invMass;a.y*=this.m_invMass}else this.m_invMass=this.m_mass=1;if(this.m_I>0&&(this.m_flags&k.e_fixedRotationFlag)==0){this.m_I-=this.m_mass*(a.x*a.x+a.y*a.y);this.m_I*=this.m_inertiaScale;A.b2Assert(this.m_I> -0);this.m_invI=1/this.m_I}else this.m_invI=this.m_I=0;c=this.m_sweep.c.Copy();this.m_sweep.localCenter.SetV(a);this.m_sweep.c0.SetV(F.MulX(this.m_xf,this.m_sweep.localCenter));this.m_sweep.c.SetV(this.m_sweep.c0);this.m_linearVelocity.x+=this.m_angularVelocity*-(this.m_sweep.c.y-c.y);this.m_linearVelocity.y+=this.m_angularVelocity*+(this.m_sweep.c.x-c.x)}};k.prototype.GetWorldPoint=function(a){var c=this.m_xf.R;a=new y(c.col1.x*a.x+c.col2.x*a.y,c.col1.y*a.x+c.col2.y*a.y);a.x+=this.m_xf.position.x; -a.y+=this.m_xf.position.y;return a};k.prototype.GetWorldVector=function(a){return F.MulMV(this.m_xf.R,a)};k.prototype.GetLocalPoint=function(a){return F.MulXT(this.m_xf,a)};k.prototype.GetLocalVector=function(a){return F.MulTMV(this.m_xf.R,a)};k.prototype.GetLinearVelocityFromWorldPoint=function(a){return new y(this.m_linearVelocity.x-this.m_angularVelocity*(a.y-this.m_sweep.c.y),this.m_linearVelocity.y+this.m_angularVelocity*(a.x-this.m_sweep.c.x))};k.prototype.GetLinearVelocityFromLocalPoint=function(a){var c= -this.m_xf.R;a=new y(c.col1.x*a.x+c.col2.x*a.y,c.col1.y*a.x+c.col2.y*a.y);a.x+=this.m_xf.position.x;a.y+=this.m_xf.position.y;return new y(this.m_linearVelocity.x-this.m_angularVelocity*(a.y-this.m_sweep.c.y),this.m_linearVelocity.y+this.m_angularVelocity*(a.x-this.m_sweep.c.x))};k.prototype.GetLinearDamping=function(){return this.m_linearDamping};k.prototype.SetLinearDamping=function(a){if(a===undefined)a=0;this.m_linearDamping=a};k.prototype.GetAngularDamping=function(){return this.m_angularDamping}; -k.prototype.SetAngularDamping=function(a){if(a===undefined)a=0;this.m_angularDamping=a};k.prototype.SetType=function(a){if(a===undefined)a=0;if(this.m_type!=a){this.m_type=a;this.ResetMassData();if(this.m_type==k.b2_staticBody){this.m_linearVelocity.SetZero();this.m_angularVelocity=0}this.SetAwake(true);this.m_force.SetZero();this.m_torque=0;for(a=this.m_contactList;a;a=a.next)a.contact.FlagForFiltering()}};k.prototype.GetType=function(){return this.m_type};k.prototype.SetBullet=function(a){if(a)this.m_flags|= -k.e_bulletFlag;else this.m_flags&=~k.e_bulletFlag};k.prototype.IsBullet=function(){return(this.m_flags&k.e_bulletFlag)==k.e_bulletFlag};k.prototype.SetSleepingAllowed=function(a){if(a)this.m_flags|=k.e_allowSleepFlag;else{this.m_flags&=~k.e_allowSleepFlag;this.SetAwake(true)}};k.prototype.SetAwake=function(a){if(a){this.m_flags|=k.e_awakeFlag;this.m_sleepTime=0}else{this.m_flags&=~k.e_awakeFlag;this.m_sleepTime=0;this.m_linearVelocity.SetZero();this.m_angularVelocity=0;this.m_force.SetZero();this.m_torque= -0}};k.prototype.IsAwake=function(){return(this.m_flags&k.e_awakeFlag)==k.e_awakeFlag};k.prototype.SetFixedRotation=function(a){if(a)this.m_flags|=k.e_fixedRotationFlag;else this.m_flags&=~k.e_fixedRotationFlag;this.ResetMassData()};k.prototype.IsFixedRotation=function(){return(this.m_flags&k.e_fixedRotationFlag)==k.e_fixedRotationFlag};k.prototype.SetActive=function(a){if(a!=this.IsActive()){var c;if(a){this.m_flags|=k.e_activeFlag;a=this.m_world.m_contactManager.m_broadPhase;for(c=this.m_fixtureList;c;c= -c.m_next)c.CreateProxy(a,this.m_xf)}else{this.m_flags&=~k.e_activeFlag;a=this.m_world.m_contactManager.m_broadPhase;for(c=this.m_fixtureList;c;c=c.m_next)c.DestroyProxy(a);for(a=this.m_contactList;a;){c=a;a=a.next;this.m_world.m_contactManager.Destroy(c.contact)}this.m_contactList=null}}};k.prototype.IsActive=function(){return(this.m_flags&k.e_activeFlag)==k.e_activeFlag};k.prototype.IsSleepingAllowed=function(){return(this.m_flags&k.e_allowSleepFlag)==k.e_allowSleepFlag};k.prototype.GetFixtureList= -function(){return this.m_fixtureList};k.prototype.GetJointList=function(){return this.m_jointList};k.prototype.GetControllerList=function(){return this.m_controllerList};k.prototype.GetContactList=function(){return this.m_contactList};k.prototype.GetNext=function(){return this.m_next};k.prototype.GetUserData=function(){return this.m_userData};k.prototype.SetUserData=function(a){this.m_userData=a};k.prototype.GetWorld=function(){return this.m_world};k.prototype.b2Body=function(a,c){this.m_flags=0; -if(a.bullet)this.m_flags|=k.e_bulletFlag;if(a.fixedRotation)this.m_flags|=k.e_fixedRotationFlag;if(a.allowSleep)this.m_flags|=k.e_allowSleepFlag;if(a.awake)this.m_flags|=k.e_awakeFlag;if(a.active)this.m_flags|=k.e_activeFlag;this.m_world=c;this.m_xf.position.SetV(a.position);this.m_xf.R.Set(a.angle);this.m_sweep.localCenter.SetZero();this.m_sweep.t0=1;this.m_sweep.a0=this.m_sweep.a=a.angle;var g=this.m_xf.R,b=this.m_sweep.localCenter;this.m_sweep.c.x=g.col1.x*b.x+g.col2.x*b.y;this.m_sweep.c.y=g.col1.y* -b.x+g.col2.y*b.y;this.m_sweep.c.x+=this.m_xf.position.x;this.m_sweep.c.y+=this.m_xf.position.y;this.m_sweep.c0.SetV(this.m_sweep.c);this.m_contactList=this.m_controllerList=this.m_jointList=null;this.m_controllerCount=0;this.m_next=this.m_prev=null;this.m_linearVelocity.SetV(a.linearVelocity);this.m_angularVelocity=a.angularVelocity;this.m_linearDamping=a.linearDamping;this.m_angularDamping=a.angularDamping;this.m_force.Set(0,0);this.m_sleepTime=this.m_torque=0;this.m_type=a.type;if(this.m_type== -k.b2_dynamicBody)this.m_invMass=this.m_mass=1;else this.m_invMass=this.m_mass=0;this.m_invI=this.m_I=0;this.m_inertiaScale=a.inertiaScale;this.m_userData=a.userData;this.m_fixtureList=null;this.m_fixtureCount=0};k.prototype.SynchronizeFixtures=function(){var a=k.s_xf1;a.R.Set(this.m_sweep.a0);var c=a.R,g=this.m_sweep.localCenter;a.position.x=this.m_sweep.c0.x-(c.col1.x*g.x+c.col2.x*g.y);a.position.y=this.m_sweep.c0.y-(c.col1.y*g.x+c.col2.y*g.y);g=this.m_world.m_contactManager.m_broadPhase;for(c=this.m_fixtureList;c;c= -c.m_next)c.Synchronize(g,a,this.m_xf)};k.prototype.SynchronizeTransform=function(){this.m_xf.R.Set(this.m_sweep.a);var a=this.m_xf.R,c=this.m_sweep.localCenter;this.m_xf.position.x=this.m_sweep.c.x-(a.col1.x*c.x+a.col2.x*c.y);this.m_xf.position.y=this.m_sweep.c.y-(a.col1.y*c.x+a.col2.y*c.y)};k.prototype.ShouldCollide=function(a){if(this.m_type!=k.b2_dynamicBody&&a.m_type!=k.b2_dynamicBody)return false;for(var c=this.m_jointList;c;c=c.next)if(c.other==a)if(c.joint.m_collideConnected==false)return false; -return true};k.prototype.Advance=function(a){if(a===undefined)a=0;this.m_sweep.Advance(a);this.m_sweep.c.SetV(this.m_sweep.c0);this.m_sweep.a=this.m_sweep.a0;this.SynchronizeTransform()};Box2D.postDefs.push(function(){Box2D.Dynamics.b2Body.s_xf1=new K;Box2D.Dynamics.b2Body.e_islandFlag=1;Box2D.Dynamics.b2Body.e_awakeFlag=2;Box2D.Dynamics.b2Body.e_allowSleepFlag=4;Box2D.Dynamics.b2Body.e_bulletFlag=8;Box2D.Dynamics.b2Body.e_fixedRotationFlag=16;Box2D.Dynamics.b2Body.e_activeFlag=32;Box2D.Dynamics.b2Body.b2_staticBody= -0;Box2D.Dynamics.b2Body.b2_kinematicBody=1;Box2D.Dynamics.b2Body.b2_dynamicBody=2});z.b2BodyDef=function(){this.position=new y;this.linearVelocity=new y};z.prototype.b2BodyDef=function(){this.userData=null;this.position.Set(0,0);this.angle=0;this.linearVelocity.Set(0,0);this.angularDamping=this.linearDamping=this.angularVelocity=0;this.awake=this.allowSleep=true;this.bullet=this.fixedRotation=false;this.type=k.b2_staticBody;this.active=true;this.inertiaScale=1};u.b2ContactFilter=function(){};u.prototype.ShouldCollide= -function(a,c){var g=a.GetFilterData(),b=c.GetFilterData();if(g.groupIndex==b.groupIndex&&g.groupIndex!=0)return g.groupIndex>0;return(g.maskBits&b.categoryBits)!=0&&(g.categoryBits&b.maskBits)!=0};u.prototype.RayCollide=function(a,c){if(!a)return true;return this.ShouldCollide(a instanceof S?a:null,c)};Box2D.postDefs.push(function(){Box2D.Dynamics.b2ContactFilter.b2_defaultFilter=new u});D.b2ContactImpulse=function(){this.normalImpulses=new Vector_a2j_Number(A.b2_maxManifoldPoints);this.tangentImpulses= -new Vector_a2j_Number(A.b2_maxManifoldPoints)};H.b2ContactListener=function(){};H.prototype.BeginContact=function(){};H.prototype.EndContact=function(){};H.prototype.PreSolve=function(){};H.prototype.PostSolve=function(){};Box2D.postDefs.push(function(){Box2D.Dynamics.b2ContactListener.b2_defaultListener=new H});O.b2ContactManager=function(){};O.prototype.b2ContactManager=function(){this.m_world=null;this.m_contactCount=0;this.m_contactFilter=u.b2_defaultFilter;this.m_contactListener=H.b2_defaultListener; -this.m_contactFactory=new j(this.m_allocator);this.m_broadPhase=new B};O.prototype.AddPair=function(a,c){var g=a instanceof S?a:null,b=c instanceof S?c:null,e=g.GetBody(),f=b.GetBody();if(e!=f){for(var m=f.GetContactList();m;){if(m.other==e){var r=m.contact.GetFixtureA(),s=m.contact.GetFixtureB();if(r==g&&s==b)return;if(r==b&&s==g)return}m=m.next}if(f.ShouldCollide(e)!=false)if(this.m_contactFilter.ShouldCollide(g,b)!=false){m=this.m_contactFactory.Create(g,b);g=m.GetFixtureA();b=m.GetFixtureB(); -e=g.m_body;f=b.m_body;m.m_prev=null;m.m_next=this.m_world.m_contactList;if(this.m_world.m_contactList!=null)this.m_world.m_contactList.m_prev=m;this.m_world.m_contactList=m;m.m_nodeA.contact=m;m.m_nodeA.other=f;m.m_nodeA.prev=null;m.m_nodeA.next=e.m_contactList;if(e.m_contactList!=null)e.m_contactList.prev=m.m_nodeA;e.m_contactList=m.m_nodeA;m.m_nodeB.contact=m;m.m_nodeB.other=e;m.m_nodeB.prev=null;m.m_nodeB.next=f.m_contactList;if(f.m_contactList!=null)f.m_contactList.prev=m.m_nodeB;f.m_contactList= -m.m_nodeB;++this.m_world.m_contactCount}}};O.prototype.FindNewContacts=function(){this.m_broadPhase.UpdatePairs(Box2D.generateCallback(this,this.AddPair))};O.prototype.Destroy=function(a){var c=a.GetFixtureA(),g=a.GetFixtureB();c=c.GetBody();g=g.GetBody();a.IsTouching()&&this.m_contactListener.EndContact(a);if(a.m_prev)a.m_prev.m_next=a.m_next;if(a.m_next)a.m_next.m_prev=a.m_prev;if(a==this.m_world.m_contactList)this.m_world.m_contactList=a.m_next;if(a.m_nodeA.prev)a.m_nodeA.prev.next=a.m_nodeA.next; -if(a.m_nodeA.next)a.m_nodeA.next.prev=a.m_nodeA.prev;if(a.m_nodeA==c.m_contactList)c.m_contactList=a.m_nodeA.next;if(a.m_nodeB.prev)a.m_nodeB.prev.next=a.m_nodeB.next;if(a.m_nodeB.next)a.m_nodeB.next.prev=a.m_nodeB.prev;if(a.m_nodeB==g.m_contactList)g.m_contactList=a.m_nodeB.next;this.m_contactFactory.Destroy(a);--this.m_contactCount};O.prototype.Collide=function(){for(var a=this.m_world.m_contactList;a;){var c=a.GetFixtureA(),g=a.GetFixtureB(),b=c.GetBody(),e=g.GetBody();if(b.IsAwake()==false&&e.IsAwake()== -false)a=a.GetNext();else{if(a.m_flags&l.e_filterFlag){if(e.ShouldCollide(b)==false){c=a;a=c.GetNext();this.Destroy(c);continue}if(this.m_contactFilter.ShouldCollide(c,g)==false){c=a;a=c.GetNext();this.Destroy(c);continue}a.m_flags&=~l.e_filterFlag}if(this.m_broadPhase.TestOverlap(c.m_proxy,g.m_proxy)==false){c=a;a=c.GetNext();this.Destroy(c)}else{a.Update(this.m_contactListener);a=a.GetNext()}}}};Box2D.postDefs.push(function(){Box2D.Dynamics.b2ContactManager.s_evalCP=new p});E.b2DebugDraw=function(){}; -E.prototype.b2DebugDraw=function(){};E.prototype.SetFlags=function(){};E.prototype.GetFlags=function(){};E.prototype.AppendFlags=function(){};E.prototype.ClearFlags=function(){};E.prototype.SetSprite=function(){};E.prototype.GetSprite=function(){};E.prototype.SetDrawScale=function(){};E.prototype.GetDrawScale=function(){};E.prototype.SetLineThickness=function(){};E.prototype.GetLineThickness=function(){};E.prototype.SetAlpha=function(){};E.prototype.GetAlpha=function(){};E.prototype.SetFillAlpha= -function(){};E.prototype.GetFillAlpha=function(){};E.prototype.SetXFormScale=function(){};E.prototype.GetXFormScale=function(){};E.prototype.DrawPolygon=function(){};E.prototype.DrawSolidPolygon=function(){};E.prototype.DrawCircle=function(){};E.prototype.DrawSolidCircle=function(){};E.prototype.DrawSegment=function(){};E.prototype.DrawTransform=function(){};Box2D.postDefs.push(function(){Box2D.Dynamics.b2DebugDraw.e_shapeBit=1;Box2D.Dynamics.b2DebugDraw.e_jointBit=2;Box2D.Dynamics.b2DebugDraw.e_aabbBit= -4;Box2D.Dynamics.b2DebugDraw.e_pairBit=8;Box2D.Dynamics.b2DebugDraw.e_centerOfMassBit=16;Box2D.Dynamics.b2DebugDraw.e_controllerBit=32});R.b2DestructionListener=function(){};R.prototype.SayGoodbyeJoint=function(){};R.prototype.SayGoodbyeFixture=function(){};N.b2FilterData=function(){this.categoryBits=1;this.maskBits=65535;this.groupIndex=0};N.prototype.Copy=function(){var a=new N;a.categoryBits=this.categoryBits;a.maskBits=this.maskBits;a.groupIndex=this.groupIndex;return a};S.b2Fixture=function(){this.m_filter= -new N};S.prototype.GetType=function(){return this.m_shape.GetType()};S.prototype.GetShape=function(){return this.m_shape};S.prototype.SetSensor=function(a){if(this.m_isSensor!=a){this.m_isSensor=a;if(this.m_body!=null)for(a=this.m_body.GetContactList();a;){var c=a.contact,g=c.GetFixtureA(),b=c.GetFixtureB();if(g==this||b==this)c.SetSensor(g.IsSensor()||b.IsSensor());a=a.next}}};S.prototype.IsSensor=function(){return this.m_isSensor};S.prototype.SetFilterData=function(a){this.m_filter=a.Copy();if(!this.m_body)for(a= -this.m_body.GetContactList();a;){var c=a.contact,g=c.GetFixtureA(),b=c.GetFixtureB();if(g==this||b==this)c.FlagForFiltering();a=a.next}};S.prototype.GetFilterData=function(){return this.m_filter.Copy()};S.prototype.GetBody=function(){return this.m_body};S.prototype.GetNext=function(){return this.m_next};S.prototype.GetUserData=function(){return this.m_userData};S.prototype.SetUserData=function(a){this.m_userData=a};S.prototype.TestPoint=function(a){return this.m_shape.TestPoint(this.m_body.GetTransform(), -a)};S.prototype.RayCast=function(a,c){return this.m_shape.RayCast(a,c,this.m_body.GetTransform())};S.prototype.GetMassData=function(a){if(a===undefined)a=null;if(a==null)a=new I;this.m_shape.ComputeMass(a,this.m_density);return a};S.prototype.SetDensity=function(a){if(a===undefined)a=0;this.m_density=a};S.prototype.GetDensity=function(){return this.m_density};S.prototype.GetFriction=function(){return this.m_friction};S.prototype.SetFriction=function(a){if(a===undefined)a=0;this.m_friction=a};S.prototype.GetRestitution= -function(){return this.m_restitution};S.prototype.SetRestitution=function(a){if(a===undefined)a=0;this.m_restitution=a};S.prototype.GetAABB=function(){return this.m_aabb};S.prototype.b2Fixture=function(){this.m_aabb=new U;this.m_shape=this.m_next=this.m_body=this.m_userData=null;this.m_restitution=this.m_friction=this.m_density=0};S.prototype.Create=function(a,c,g){this.m_userData=g.userData;this.m_friction=g.friction;this.m_restitution=g.restitution;this.m_body=a;this.m_next=null;this.m_filter=g.filter.Copy(); -this.m_isSensor=g.isSensor;this.m_shape=g.shape.Copy();this.m_density=g.density};S.prototype.Destroy=function(){this.m_shape=null};S.prototype.CreateProxy=function(a,c){this.m_shape.ComputeAABB(this.m_aabb,c);this.m_proxy=a.CreateProxy(this.m_aabb,this)};S.prototype.DestroyProxy=function(a){if(this.m_proxy!=null){a.DestroyProxy(this.m_proxy);this.m_proxy=null}};S.prototype.Synchronize=function(a,c,g){if(this.m_proxy){var b=new U,e=new U;this.m_shape.ComputeAABB(b,c);this.m_shape.ComputeAABB(e,g); -this.m_aabb.Combine(b,e);c=F.SubtractVV(g.position,c.position);a.MoveProxy(this.m_proxy,this.m_aabb,c)}};aa.b2FixtureDef=function(){this.filter=new N};aa.prototype.b2FixtureDef=function(){this.userData=this.shape=null;this.friction=0.2;this.density=this.restitution=0;this.filter.categoryBits=1;this.filter.maskBits=65535;this.filter.groupIndex=0;this.isSensor=false};Z.b2Island=function(){};Z.prototype.b2Island=function(){this.m_bodies=new Vector;this.m_contacts=new Vector;this.m_joints=new Vector}; -Z.prototype.Initialize=function(a,c,g,b,e,f){if(a===undefined)a=0;if(c===undefined)c=0;if(g===undefined)g=0;var m=0;this.m_bodyCapacity=a;this.m_contactCapacity=c;this.m_jointCapacity=g;this.m_jointCount=this.m_contactCount=this.m_bodyCount=0;this.m_allocator=b;this.m_listener=e;this.m_contactSolver=f;for(m=this.m_bodies.length;mA.b2_maxTranslationSquared){e.m_linearVelocity.Normalize();e.m_linearVelocity.x*=A.b2_maxTranslation*a.inv_dt;e.m_linearVelocity.y*=A.b2_maxTranslation*a.inv_dt}m=a.dt*e.m_angularVelocity;if(m*m>A.b2_maxRotationSquared)e.m_angularVelocity=e.m_angularVelocity<0?-A.b2_maxRotation*a.inv_dt:A.b2_maxRotation*a.inv_dt;e.m_sweep.c0.SetV(e.m_sweep.c);e.m_sweep.a0=e.m_sweep.a;e.m_sweep.c.x+=a.dt*e.m_linearVelocity.x;e.m_sweep.c.y+= -a.dt*e.m_linearVelocity.y;e.m_sweep.a+=a.dt*e.m_angularVelocity;e.SynchronizeTransform()}}for(b=0;bm||F.Dot(e.m_linearVelocity,e.m_linearVelocity)>c)g=e.m_sleepTime=0;else{e.m_sleepTime+=a.dt;g=F.Min(g,e.m_sleepTime)}}}if(g>=A.b2_timeToSleep)for(b=0;bA.b2_maxTranslationSquared){g.m_linearVelocity.Normalize();g.m_linearVelocity.x*=A.b2_maxTranslation* -a.inv_dt;g.m_linearVelocity.y*=A.b2_maxTranslation*a.inv_dt}e=a.dt*g.m_angularVelocity;if(e*e>A.b2_maxRotationSquared)g.m_angularVelocity=g.m_angularVelocity<0?-A.b2_maxRotation*a.inv_dt:A.b2_maxRotation*a.inv_dt;g.m_sweep.c0.SetV(g.m_sweep.c);g.m_sweep.a0=g.m_sweep.a;g.m_sweep.c.x+=a.dt*g.m_linearVelocity.x;g.m_sweep.c.y+=a.dt*g.m_linearVelocity.y;g.m_sweep.a+=a.dt*g.m_angularVelocity;g.SynchronizeTransform()}}for(c=0;c0?1/a:0;b.dtRatio=this.m_inv_dt0*a;b.warmStarting=h.m_warmStarting;this.m_contactManager.Collide();b.dt>0&&this.Solve(b);h.m_continuousPhysics&&b.dt>0&&this.SolveTOI(b);if(b.dt>0)this.m_inv_dt0=b.inv_dt;this.m_flags&=~h.e_locked};h.prototype.ClearForces=function(){for(var a=this.m_bodyList;a;a=a.m_next){a.m_force.SetZero();a.m_torque=0}};h.prototype.DrawDebugData= -function(){if(this.m_debugDraw!=null){this.m_debugDraw.m_sprite.graphics.clear();var a=this.m_debugDraw.GetFlags(),c,g,b;new y;new y;new y;var e;new U;new U;e=[new y,new y,new y,new y];var f=new w(0,0,0);if(a&E.e_shapeBit)for(c=this.m_bodyList;c;c=c.m_next){e=c.m_xf;for(g=c.GetFixtureList();g;g=g.m_next){b=g.GetShape();if(c.IsActive()==false)f.Set(0.5,0.5,0.3);else if(c.GetType()==k.b2_staticBody)f.Set(0.5,0.9,0.5);else if(c.GetType()==k.b2_kinematicBody)f.Set(0.5,0.5,0.9);else c.IsAwake()==false? -f.Set(0.6,0.6,0.6):f.Set(0.9,0.7,0.7);this.DrawShape(b,e,f)}}if(a&E.e_jointBit)for(c=this.m_jointList;c;c=c.m_next)this.DrawJoint(c);if(a&E.e_controllerBit)for(c=this.m_controllerList;c;c=c.m_next)c.Draw(this.m_debugDraw);if(a&E.e_pairBit){f.Set(0.3,0.9,0.9);for(c=this.m_contactManager.m_contactList;c;c=c.GetNext()){b=c.GetFixtureA();g=c.GetFixtureB();b=b.GetAABB().GetCenter();g=g.GetAABB().GetCenter();this.m_debugDraw.DrawSegment(b,g,f)}}if(a&E.e_aabbBit){b=this.m_contactManager.m_broadPhase;e=[new y, -new y,new y,new y];for(c=this.m_bodyList;c;c=c.GetNext())if(c.IsActive()!=false)for(g=c.GetFixtureList();g;g=g.GetNext()){var m=b.GetFatAABB(g.m_proxy);e[0].Set(m.lowerBound.x,m.lowerBound.y);e[1].Set(m.upperBound.x,m.lowerBound.y);e[2].Set(m.upperBound.x,m.upperBound.y);e[3].Set(m.lowerBound.x,m.upperBound.y);this.m_debugDraw.DrawPolygon(e,4,f)}}if(a&E.e_centerOfMassBit)for(c=this.m_bodyList;c;c=c.m_next){e=h.s_xf;e.R=c.m_xf.R;e.position=c.GetWorldCenter();this.m_debugDraw.DrawTransform(e)}}};h.prototype.QueryAABB= -function(a,c){var g=this.m_contactManager.m_broadPhase;g.Query(function(b){return a(g.GetUserData(b))},c)};h.prototype.QueryShape=function(a,c,g){if(g===undefined)g=null;if(g==null){g=new K;g.SetIdentity()}var b=this.m_contactManager.m_broadPhase,e=new U;c.ComputeAABB(e,g);b.Query(function(f){f=b.GetUserData(f)instanceof S?b.GetUserData(f):null;if(Y.TestOverlap(c,g,f.GetShape(),f.GetBody().GetTransform()))return a(f);return true},e)};h.prototype.QueryPoint=function(a,c){var g=this.m_contactManager.m_broadPhase, -b=new U;b.lowerBound.Set(c.x-A.b2_linearSlop,c.y-A.b2_linearSlop);b.upperBound.Set(c.x+A.b2_linearSlop,c.y+A.b2_linearSlop);g.Query(function(e){e=g.GetUserData(e)instanceof S?g.GetUserData(e):null;if(e.TestPoint(c))return a(e);return true},b)};h.prototype.RayCast=function(a,c,g){var b=this.m_contactManager.m_broadPhase,e=new V,f=new Q(c,g);b.RayCast(function(m,r){var s=b.GetUserData(r);s=s instanceof S?s:null;if(s.RayCast(e,m)){var v=e.fraction,t=new y((1-v)*c.x+v*g.x,(1-v)*c.y+v*g.y);return a(s, -t,e.normal,v)}return m.maxFraction},f)};h.prototype.RayCastOne=function(a,c){var g;this.RayCast(function(b,e,f,m){if(m===undefined)m=0;g=b;return m},a,c);return g};h.prototype.RayCastAll=function(a,c){var g=new Vector;this.RayCast(function(b){g[g.length]=b;return 1},a,c);return g};h.prototype.GetBodyList=function(){return this.m_bodyList};h.prototype.GetJointList=function(){return this.m_jointList};h.prototype.GetContactList=function(){return this.m_contactList};h.prototype.IsLocked=function(){return(this.m_flags& -h.e_locked)>0};h.prototype.Solve=function(a){for(var c,g=this.m_controllerList;g;g=g.m_next)g.Step(a);g=this.m_island;g.Initialize(this.m_bodyCount,this.m_contactCount,this.m_jointCount,null,this.m_contactManager.m_contactListener,this.m_contactSolver);for(c=this.m_bodyList;c;c=c.m_next)c.m_flags&=~k.e_islandFlag;for(var b=this.m_contactList;b;b=b.m_next)b.m_flags&=~l.e_islandFlag;for(b=this.m_jointList;b;b=b.m_next)b.m_islandFlag=false;parseInt(this.m_bodyCount);b=this.s_stack;for(var e=this.m_bodyList;e;e= -e.m_next)if(!(e.m_flags&k.e_islandFlag))if(!(e.IsAwake()==false||e.IsActive()==false))if(e.GetType()!=k.b2_staticBody){g.Clear();var f=0;b[f++]=e;for(e.m_flags|=k.e_islandFlag;f>0;){c=b[--f];g.AddBody(c);c.IsAwake()==false&&c.SetAwake(true);if(c.GetType()!=k.b2_staticBody){for(var m,r=c.m_contactList;r;r=r.next)if(!(r.contact.m_flags&l.e_islandFlag))if(!(r.contact.IsSensor()==true||r.contact.IsEnabled()==false||r.contact.IsTouching()==false)){g.AddContact(r.contact);r.contact.m_flags|=l.e_islandFlag; -m=r.other;if(!(m.m_flags&k.e_islandFlag)){b[f++]=m;m.m_flags|=k.e_islandFlag}}for(c=c.m_jointList;c;c=c.next)if(c.joint.m_islandFlag!=true){m=c.other;if(m.IsActive()!=false){g.AddJoint(c.joint);c.joint.m_islandFlag=true;if(!(m.m_flags&k.e_islandFlag)){b[f++]=m;m.m_flags|=k.e_islandFlag}}}}}g.Solve(a,this.m_gravity,this.m_allowSleep);for(f=0;f0&&c<1){c=(1-c)*s+c;if(c>1)c=1}b.m_toi=c;b.m_flags|=l.e_toiFlag}if(Number.MIN_VALUE0;){c=f[b++];--m;e.AddBody(c);c.IsAwake()==false&&c.SetAwake(true);if(c.GetType()==k.b2_dynamicBody){for(g=c.m_contactList;g;g=g.next){if(e.m_contactCount==e.m_contactCapacity)break;if(!(g.contact.m_flags&l.e_islandFlag))if(!(g.contact.IsSensor()==true||g.contact.IsEnabled()== -false||g.contact.IsTouching()==false)){e.AddContact(g.contact);g.contact.m_flags|=l.e_islandFlag;s=g.other;if(!(s.m_flags&k.e_islandFlag)){if(s.GetType()!=k.b2_staticBody){s.Advance(r);s.SetAwake(true)}f[b+m]=s;++m;s.m_flags|=k.e_islandFlag}}}for(c=c.m_jointList;c;c=c.next)if(e.m_jointCount!=e.m_jointCapacity)if(c.joint.m_islandFlag!=true){s=c.other;if(s.IsActive()!=false){e.AddJoint(c.joint);c.joint.m_islandFlag=true;if(!(s.m_flags&k.e_islandFlag)){if(s.GetType()!=k.b2_staticBody){s.Advance(r);s.SetAwake(true)}f[b+ -m]=s;++m;s.m_flags|=k.e_islandFlag}}}}}b=h.s_timestep;b.warmStarting=false;b.dt=(1-r)*a.dt;b.inv_dt=1/b.dt;b.dtRatio=0;b.velocityIterations=a.velocityIterations;b.positionIterations=a.positionIterations;e.SolveTOI(b);for(r=r=0;r0;for(c=0;c0){j.m_fixtureA.m_body.SetAwake(true);j.m_fixtureB.m_body.SetAwake(true)}var o=parseInt(j.m_fixtureA.GetType()), -q=parseInt(j.m_fixtureB.GetType());o=this.m_registers[o][q];o.poolCount++;j.m_next=o.pool;o.pool=j;o=o.destroyFcn;o(j,this.m_allocator)};V.b2ContactRegister=function(){};M.b2ContactResult=function(){this.position=new N;this.normal=new N;this.id=new aa};L.b2ContactSolver=function(){this.m_step=new H;this.m_constraints=new Vector};L.prototype.b2ContactSolver=function(){};L.prototype.Initialize=function(j,o,q,n){if(q===undefined)q=0;var a;this.m_step.Set(j);this.m_allocator=n;j=0;for(this.m_constraintCount= -q;this.m_constraints.length -0);L.s_worldManifold.Initialize(m,e.m_xf,g,f.m_xf,b);c=L.s_worldManifold.m_normal.x;a=L.s_worldManifold.m_normal.y;n=this.m_constraints[j];n.bodyA=e;n.bodyB=f;n.manifold=m;n.normal.x=c;n.normal.y=a;n.pointCount=m.m_pointCount;n.friction=r;n.restitution=s;n.localPlaneNormal.x=m.m_localPlaneNormal.x;n.localPlaneNormal.y=m.m_localPlaneNormal.y;n.localPoint.x=m.m_localPoint.x;n.localPoint.y=m.m_localPoint.y;n.radius=g+b;n.type=m.m_type;for(g=0;g0?n:0;q=n-o.normalImpulse;c=q*b;q=q*e;x.x-=J*c;x.y-=J*q;v-=T*(o.rA.x*q-o.rA.y*c);C.x+=P*c;C.y+=P*q;t+=X*(o.rB.x*q-o.rB.y*c);o.normalImpulse=n}else{o=a.points[0];j=a.points[1];q=o.normalImpulse;g=j.normalImpulse;var ba=(C.x-t*o.rB.y-x.x+v*o.rA.y)*b+(C.y+t*o.rB.x-x.y-v*o.rA.x)*e,ca=(C.x-t*j.rB.y-x.x+v*j.rA.y)*b+(C.y+ -t*j.rB.x-x.y-v*j.rA.x)*e;n=ba-o.velocityBias;c=ca-j.velocityBias;f=a.K;n-=f.col1.x*q+f.col2.x*g;for(c-=f.col1.y*q+f.col2.y*g;;){f=a.normalMass;$=-(f.col1.x*n+f.col2.x*c);f=-(f.col1.y*n+f.col2.y*c);if($>=0&&f>=0){q=$-q;g=f-g;a=q*b;q=q*e;b=g*b;e=g*e;x.x-=J*(a+b);x.y-=J*(q+e);v-=T*(o.rA.x*q-o.rA.y*a+j.rA.x*e-j.rA.y*b);C.x+=P*(a+b);C.y+=P*(q+e);t+=X*(o.rB.x*q-o.rB.y*a+j.rB.x*e-j.rB.y*b);o.normalImpulse=$;j.normalImpulse=f;break}$=-o.normalMass*n;f=0;ca=a.K.col1.y*$+c;if($>=0&&ca>=0){q=$-q;g=f-g;a=q*b; -q=q*e;b=g*b;e=g*e;x.x-=J*(a+b);x.y-=J*(q+e);v-=T*(o.rA.x*q-o.rA.y*a+j.rA.x*e-j.rA.y*b);C.x+=P*(a+b);C.y+=P*(q+e);t+=X*(o.rB.x*q-o.rB.y*a+j.rB.x*e-j.rB.y*b);o.normalImpulse=$;j.normalImpulse=f;break}$=0;f=-j.normalMass*c;ba=a.K.col2.x*f+n;if(f>=0&&ba>=0){q=$-q;g=f-g;a=q*b;q=q*e;b=g*b;e=g*e;x.x-=J*(a+b);x.y-=J*(q+e);v-=T*(o.rA.x*q-o.rA.y*a+j.rA.x*e-j.rA.y*b);C.x+=P*(a+b);C.y+=P*(q+e);t+=X*(o.rB.x*q-o.rB.y*a+j.rB.x*e-j.rB.y*b);o.normalImpulse=$;j.normalImpulse=f;break}f=$=0;ba=n;ca=c;if(ba>=0&&ca>=0){q= -$-q;g=f-g;a=q*b;q=q*e;b=g*b;e=g*e;x.x-=J*(a+b);x.y-=J*(q+e);v-=T*(o.rA.x*q-o.rA.y*a+j.rA.x*e-j.rA.y*b);C.x+=P*(a+b);C.y+=P*(q+e);t+=X*(o.rB.x*q-o.rB.y*a+j.rB.x*e-j.rB.y*b);o.normalImpulse=$;j.normalImpulse=f;break}break}}r.m_angularVelocity=v;s.m_angularVelocity=t}};L.prototype.FinalizeVelocityConstraints=function(){for(var j=0;j-1.5*O.b2_linearSlop};Box2D.postDefs.push(function(){Box2D.Dynamics.Contacts.b2ContactSolver.s_worldManifold=new l;Box2D.Dynamics.Contacts.b2ContactSolver.s_psm=new u});Box2D.inherit(I,Box2D.Dynamics.Contacts.b2Contact); -I.prototype.__super=Box2D.Dynamics.Contacts.b2Contact.prototype;I.b2EdgeAndCircleContact=function(){Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this,arguments)};I.Create=function(){return new I};I.Destroy=function(){};I.prototype.Reset=function(j,o){this.__super.Reset.call(this,j,o)};I.prototype.Evaluate=function(){var j=this.m_fixtureA.GetBody(),o=this.m_fixtureB.GetBody();this.b2CollideEdgeAndCircle(this.m_manifold,this.m_fixtureA.GetShape()instanceof G?this.m_fixtureA.GetShape():null,j.m_xf, -this.m_fixtureB.GetShape()instanceof F?this.m_fixtureB.GetShape():null,o.m_xf)};I.prototype.b2CollideEdgeAndCircle=function(){};Box2D.inherit(W,Box2D.Dynamics.Contacts.b2Contact);W.prototype.__super=Box2D.Dynamics.Contacts.b2Contact.prototype;W.b2NullContact=function(){Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this,arguments)};W.prototype.b2NullContact=function(){this.__super.b2Contact.call(this)};W.prototype.Evaluate=function(){};Box2D.inherit(Y,Box2D.Dynamics.Contacts.b2Contact);Y.prototype.__super= -Box2D.Dynamics.Contacts.b2Contact.prototype;Y.b2PolyAndCircleContact=function(){Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this,arguments)};Y.Create=function(){return new Y};Y.Destroy=function(){};Y.prototype.Reset=function(j,o){this.__super.Reset.call(this,j,o);O.b2Assert(j.GetType()==y.e_polygonShape);O.b2Assert(o.GetType()==y.e_circleShape)};Y.prototype.Evaluate=function(){var j=this.m_fixtureA.m_body,o=this.m_fixtureB.m_body;S.CollidePolygonAndCircle(this.m_manifold,this.m_fixtureA.GetShape()instanceof -K?this.m_fixtureA.GetShape():null,j.m_xf,this.m_fixtureB.GetShape()instanceof F?this.m_fixtureB.GetShape():null,o.m_xf)};Box2D.inherit(k,Box2D.Dynamics.Contacts.b2Contact);k.prototype.__super=Box2D.Dynamics.Contacts.b2Contact.prototype;k.b2PolyAndEdgeContact=function(){Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this,arguments)};k.Create=function(){return new k};k.Destroy=function(){};k.prototype.Reset=function(j,o){this.__super.Reset.call(this,j,o);O.b2Assert(j.GetType()==y.e_polygonShape); -O.b2Assert(o.GetType()==y.e_edgeShape)};k.prototype.Evaluate=function(){var j=this.m_fixtureA.GetBody(),o=this.m_fixtureB.GetBody();this.b2CollidePolyAndEdge(this.m_manifold,this.m_fixtureA.GetShape()instanceof K?this.m_fixtureA.GetShape():null,j.m_xf,this.m_fixtureB.GetShape()instanceof G?this.m_fixtureB.GetShape():null,o.m_xf)};k.prototype.b2CollidePolyAndEdge=function(){};Box2D.inherit(z,Box2D.Dynamics.Contacts.b2Contact);z.prototype.__super=Box2D.Dynamics.Contacts.b2Contact.prototype;z.b2PolygonContact= -function(){Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this,arguments)};z.Create=function(){return new z};z.Destroy=function(){};z.prototype.Reset=function(j,o){this.__super.Reset.call(this,j,o)};z.prototype.Evaluate=function(){var j=this.m_fixtureA.GetBody(),o=this.m_fixtureB.GetBody();S.CollidePolygons(this.m_manifold,this.m_fixtureA.GetShape()instanceof K?this.m_fixtureA.GetShape():null,j.m_xf,this.m_fixtureB.GetShape()instanceof K?this.m_fixtureB.GetShape():null,o.m_xf)};u.b2PositionSolverManifold= -function(){};u.prototype.b2PositionSolverManifold=function(){this.m_normal=new N;this.m_separations=new Vector_a2j_Number(O.b2_maxManifoldPoints);this.m_points=new Vector(O.b2_maxManifoldPoints);for(var j=0;j0);var o=0,q=0,n=0,a,c=0,g=0;switch(j.type){case Z.e_circles:a=j.bodyA.m_xf.R;n=j.localPoint;o=j.bodyA.m_xf.position.x+(a.col1.x*n.x+a.col2.x*n.y);q=j.bodyA.m_xf.position.y+(a.col1.y* -n.x+a.col2.y*n.y);a=j.bodyB.m_xf.R;n=j.points[0].localPoint;c=j.bodyB.m_xf.position.x+(a.col1.x*n.x+a.col2.x*n.y);a=j.bodyB.m_xf.position.y+(a.col1.y*n.x+a.col2.y*n.y);n=c-o;g=a-q;var b=n*n+g*g;if(b>Number.MIN_VALUE*Number.MIN_VALUE){b=Math.sqrt(b);this.m_normal.x=n/b;this.m_normal.y=g/b}else{this.m_normal.x=1;this.m_normal.y=0}this.m_points[0].x=0.5*(o+c);this.m_points[0].y=0.5*(q+a);this.m_separations[0]=n*this.m_normal.x+g*this.m_normal.y-j.radius;break;case Z.e_faceA:a=j.bodyA.m_xf.R;n=j.localPlaneNormal; -this.m_normal.x=a.col1.x*n.x+a.col2.x*n.y;this.m_normal.y=a.col1.y*n.x+a.col2.y*n.y;a=j.bodyA.m_xf.R;n=j.localPoint;c=j.bodyA.m_xf.position.x+(a.col1.x*n.x+a.col2.x*n.y);g=j.bodyA.m_xf.position.y+(a.col1.y*n.x+a.col2.y*n.y);a=j.bodyB.m_xf.R;for(o=0;o0||L>0?1/Math.max(M,L):0};V.prototype.Step=function(M){M=M.dt;if(!(M<=Number.MIN_VALUE)){if(M>this.maxTimestep&&this.maxTimestep>0)M=this.maxTimestep; -for(var L=this.m_bodyList;L;L=L.nextBody){var I=L.body;if(I.IsAwake()){var W=I.GetWorldVector(G.MulMV(this.T,I.GetLocalVector(I.GetLinearVelocity())));I.SetLinearVelocity(new K(I.GetLinearVelocity().x+W.x*M,I.GetLinearVelocity().y+W.y*M))}}}}})(); -(function(){var F=Box2D.Common.b2Settings,G=Box2D.Common.Math.b2Mat22,K=Box2D.Common.Math.b2Mat33,y=Box2D.Common.Math.b2Math,w=Box2D.Common.Math.b2Vec2,A=Box2D.Common.Math.b2Vec3,U=Box2D.Dynamics.Joints.b2DistanceJoint,p=Box2D.Dynamics.Joints.b2DistanceJointDef,B=Box2D.Dynamics.Joints.b2FrictionJoint,Q=Box2D.Dynamics.Joints.b2FrictionJointDef,V=Box2D.Dynamics.Joints.b2GearJoint,M=Box2D.Dynamics.Joints.b2GearJointDef,L=Box2D.Dynamics.Joints.b2Jacobian,I=Box2D.Dynamics.Joints.b2Joint,W=Box2D.Dynamics.Joints.b2JointDef, -Y=Box2D.Dynamics.Joints.b2JointEdge,k=Box2D.Dynamics.Joints.b2LineJoint,z=Box2D.Dynamics.Joints.b2LineJointDef,u=Box2D.Dynamics.Joints.b2MouseJoint,D=Box2D.Dynamics.Joints.b2MouseJointDef,H=Box2D.Dynamics.Joints.b2PrismaticJoint,O=Box2D.Dynamics.Joints.b2PrismaticJointDef,E=Box2D.Dynamics.Joints.b2PulleyJoint,R=Box2D.Dynamics.Joints.b2PulleyJointDef,N=Box2D.Dynamics.Joints.b2RevoluteJoint,S=Box2D.Dynamics.Joints.b2RevoluteJointDef,aa=Box2D.Dynamics.Joints.b2WeldJoint,Z=Box2D.Dynamics.Joints.b2WeldJointDef; -Box2D.inherit(U,Box2D.Dynamics.Joints.b2Joint);U.prototype.__super=Box2D.Dynamics.Joints.b2Joint.prototype;U.b2DistanceJoint=function(){Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this,arguments);this.m_localAnchor1=new w;this.m_localAnchor2=new w;this.m_u=new w};U.prototype.GetAnchorA=function(){return this.m_bodyA.GetWorldPoint(this.m_localAnchor1)};U.prototype.GetAnchorB=function(){return this.m_bodyB.GetWorldPoint(this.m_localAnchor2)};U.prototype.GetReactionForce=function(d){if(d===undefined)d= -0;return new w(d*this.m_impulse*this.m_u.x,d*this.m_impulse*this.m_u.y)};U.prototype.GetReactionTorque=function(){return 0};U.prototype.GetLength=function(){return this.m_length};U.prototype.SetLength=function(d){if(d===undefined)d=0;this.m_length=d};U.prototype.GetFrequency=function(){return this.m_frequencyHz};U.prototype.SetFrequency=function(d){if(d===undefined)d=0;this.m_frequencyHz=d};U.prototype.GetDampingRatio=function(){return this.m_dampingRatio};U.prototype.SetDampingRatio=function(d){if(d=== -undefined)d=0;this.m_dampingRatio=d};U.prototype.b2DistanceJoint=function(d){this.__super.b2Joint.call(this,d);this.m_localAnchor1.SetV(d.localAnchorA);this.m_localAnchor2.SetV(d.localAnchorB);this.m_length=d.length;this.m_frequencyHz=d.frequencyHz;this.m_dampingRatio=d.dampingRatio;this.m_bias=this.m_gamma=this.m_impulse=0};U.prototype.InitVelocityConstraints=function(d){var h,l=0,j=this.m_bodyA,o=this.m_bodyB;h=j.m_xf.R;var q=this.m_localAnchor1.x-j.m_sweep.localCenter.x,n=this.m_localAnchor1.y- -j.m_sweep.localCenter.y;l=h.col1.x*q+h.col2.x*n;n=h.col1.y*q+h.col2.y*n;q=l;h=o.m_xf.R;var a=this.m_localAnchor2.x-o.m_sweep.localCenter.x,c=this.m_localAnchor2.y-o.m_sweep.localCenter.y;l=h.col1.x*a+h.col2.x*c;c=h.col1.y*a+h.col2.y*c;a=l;this.m_u.x=o.m_sweep.c.x+a-j.m_sweep.c.x-q;this.m_u.y=o.m_sweep.c.y+c-j.m_sweep.c.y-n;l=Math.sqrt(this.m_u.x*this.m_u.x+this.m_u.y*this.m_u.y);l>F.b2_linearSlop?this.m_u.Multiply(1/l):this.m_u.SetZero();h=q*this.m_u.y-n*this.m_u.x;var g=a*this.m_u.y-c*this.m_u.x; -h=j.m_invMass+j.m_invI*h*h+o.m_invMass+o.m_invI*g*g;this.m_mass=h!=0?1/h:0;if(this.m_frequencyHz>0){l=l-this.m_length;g=2*Math.PI*this.m_frequencyHz;var b=this.m_mass*g*g;this.m_gamma=d.dt*(2*this.m_mass*this.m_dampingRatio*g+d.dt*b);this.m_gamma=this.m_gamma!=0?1/this.m_gamma:0;this.m_bias=l*d.dt*b*this.m_gamma;this.m_mass=h+this.m_gamma;this.m_mass=this.m_mass!=0?1/this.m_mass:0}if(d.warmStarting){this.m_impulse*=d.dtRatio;d=this.m_impulse*this.m_u.x;h=this.m_impulse*this.m_u.y;j.m_linearVelocity.x-= -j.m_invMass*d;j.m_linearVelocity.y-=j.m_invMass*h;j.m_angularVelocity-=j.m_invI*(q*h-n*d);o.m_linearVelocity.x+=o.m_invMass*d;o.m_linearVelocity.y+=o.m_invMass*h;o.m_angularVelocity+=o.m_invI*(a*h-c*d)}else this.m_impulse=0};U.prototype.SolveVelocityConstraints=function(){var d,h=this.m_bodyA,l=this.m_bodyB;d=h.m_xf.R;var j=this.m_localAnchor1.x-h.m_sweep.localCenter.x,o=this.m_localAnchor1.y-h.m_sweep.localCenter.y,q=d.col1.x*j+d.col2.x*o;o=d.col1.y*j+d.col2.y*o;j=q;d=l.m_xf.R;var n=this.m_localAnchor2.x- -l.m_sweep.localCenter.x,a=this.m_localAnchor2.y-l.m_sweep.localCenter.y;q=d.col1.x*n+d.col2.x*a;a=d.col1.y*n+d.col2.y*a;n=q;q=-this.m_mass*(this.m_u.x*(l.m_linearVelocity.x+-l.m_angularVelocity*a-(h.m_linearVelocity.x+-h.m_angularVelocity*o))+this.m_u.y*(l.m_linearVelocity.y+l.m_angularVelocity*n-(h.m_linearVelocity.y+h.m_angularVelocity*j))+this.m_bias+this.m_gamma*this.m_impulse);this.m_impulse+=q;d=q*this.m_u.x;q=q*this.m_u.y;h.m_linearVelocity.x-=h.m_invMass*d;h.m_linearVelocity.y-=h.m_invMass* -q;h.m_angularVelocity-=h.m_invI*(j*q-o*d);l.m_linearVelocity.x+=l.m_invMass*d;l.m_linearVelocity.y+=l.m_invMass*q;l.m_angularVelocity+=l.m_invI*(n*q-a*d)};U.prototype.SolvePositionConstraints=function(){var d;if(this.m_frequencyHz>0)return true;var h=this.m_bodyA,l=this.m_bodyB;d=h.m_xf.R;var j=this.m_localAnchor1.x-h.m_sweep.localCenter.x,o=this.m_localAnchor1.y-h.m_sweep.localCenter.y,q=d.col1.x*j+d.col2.x*o;o=d.col1.y*j+d.col2.y*o;j=q;d=l.m_xf.R;var n=this.m_localAnchor2.x-l.m_sweep.localCenter.x, -a=this.m_localAnchor2.y-l.m_sweep.localCenter.y;q=d.col1.x*n+d.col2.x*a;a=d.col1.y*n+d.col2.y*a;n=q;q=l.m_sweep.c.x+n-h.m_sweep.c.x-j;var c=l.m_sweep.c.y+a-h.m_sweep.c.y-o;d=Math.sqrt(q*q+c*c);q/=d;c/=d;d=d-this.m_length;d=y.Clamp(d,-F.b2_maxLinearCorrection,F.b2_maxLinearCorrection);var g=-this.m_mass*d;this.m_u.Set(q,c);q=g*this.m_u.x;c=g*this.m_u.y;h.m_sweep.c.x-=h.m_invMass*q;h.m_sweep.c.y-=h.m_invMass*c;h.m_sweep.a-=h.m_invI*(j*c-o*q);l.m_sweep.c.x+=l.m_invMass*q;l.m_sweep.c.y+=l.m_invMass*c; -l.m_sweep.a+=l.m_invI*(n*c-a*q);h.SynchronizeTransform();l.SynchronizeTransform();return y.Abs(d)0)this.m_angularMass=1/this.m_angularMass;if(d.warmStarting){this.m_linearImpulse.x*=d.dtRatio;this.m_linearImpulse.y*=d.dtRatio;this.m_angularImpulse*=d.dtRatio;d=this.m_linearImpulse;j.m_linearVelocity.x-=h*d.x; -j.m_linearVelocity.y-=h*d.y;j.m_angularVelocity-=g*(q*d.y-n*d.x+this.m_angularImpulse);o.m_linearVelocity.x+=l*d.x;o.m_linearVelocity.y+=l*d.y;o.m_angularVelocity+=b*(a*d.y-c*d.x+this.m_angularImpulse)}else{this.m_linearImpulse.SetZero();this.m_angularImpulse=0}};B.prototype.SolveVelocityConstraints=function(d){var h,l=0,j=this.m_bodyA,o=this.m_bodyB,q=j.m_linearVelocity,n=j.m_angularVelocity,a=o.m_linearVelocity,c=o.m_angularVelocity,g=j.m_invMass,b=o.m_invMass,e=j.m_invI,f=o.m_invI;h=j.m_xf.R;var m= -this.m_localAnchorA.x-j.m_sweep.localCenter.x,r=this.m_localAnchorA.y-j.m_sweep.localCenter.y;l=h.col1.x*m+h.col2.x*r;r=h.col1.y*m+h.col2.y*r;m=l;h=o.m_xf.R;var s=this.m_localAnchorB.x-o.m_sweep.localCenter.x,v=this.m_localAnchorB.y-o.m_sweep.localCenter.y;l=h.col1.x*s+h.col2.x*v;v=h.col1.y*s+h.col2.y*v;s=l;h=0;l=-this.m_angularMass*(c-n);var t=this.m_angularImpulse;h=d.dt*this.m_maxTorque;this.m_angularImpulse=y.Clamp(this.m_angularImpulse+l,-h,h);l=this.m_angularImpulse-t;n-=e*l;c+=f*l;h=y.MulMV(this.m_linearMass, -new w(-(a.x-c*v-q.x+n*r),-(a.y+c*s-q.y-n*m)));l=this.m_linearImpulse.Copy();this.m_linearImpulse.Add(h);h=d.dt*this.m_maxForce;if(this.m_linearImpulse.LengthSquared()>h*h){this.m_linearImpulse.Normalize();this.m_linearImpulse.Multiply(h)}h=y.SubtractVV(this.m_linearImpulse,l);q.x-=g*h.x;q.y-=g*h.y;n-=e*(m*h.y-r*h.x);a.x+=b*h.x;a.y+=b*h.y;c+=f*(s*h.y-v*h.x);j.m_angularVelocity=n;o.m_angularVelocity=c};B.prototype.SolvePositionConstraints=function(){return true};Box2D.inherit(Q,Box2D.Dynamics.Joints.b2JointDef); -Q.prototype.__super=Box2D.Dynamics.Joints.b2JointDef.prototype;Q.b2FrictionJointDef=function(){Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this,arguments);this.localAnchorA=new w;this.localAnchorB=new w};Q.prototype.b2FrictionJointDef=function(){this.__super.b2JointDef.call(this);this.type=I.e_frictionJoint;this.maxTorque=this.maxForce=0};Q.prototype.Initialize=function(d,h,l){this.bodyA=d;this.bodyB=h;this.localAnchorA.SetV(this.bodyA.GetLocalPoint(l));this.localAnchorB.SetV(this.bodyB.GetLocalPoint(l))}; -Box2D.inherit(V,Box2D.Dynamics.Joints.b2Joint);V.prototype.__super=Box2D.Dynamics.Joints.b2Joint.prototype;V.b2GearJoint=function(){Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this,arguments);this.m_groundAnchor1=new w;this.m_groundAnchor2=new w;this.m_localAnchor1=new w;this.m_localAnchor2=new w;this.m_J=new L};V.prototype.GetAnchorA=function(){return this.m_bodyA.GetWorldPoint(this.m_localAnchor1)};V.prototype.GetAnchorB=function(){return this.m_bodyB.GetWorldPoint(this.m_localAnchor2)};V.prototype.GetReactionForce= -function(d){if(d===undefined)d=0;return new w(d*this.m_impulse*this.m_J.linearB.x,d*this.m_impulse*this.m_J.linearB.y)};V.prototype.GetReactionTorque=function(d){if(d===undefined)d=0;var h=this.m_bodyB.m_xf.R,l=this.m_localAnchor1.x-this.m_bodyB.m_sweep.localCenter.x,j=this.m_localAnchor1.y-this.m_bodyB.m_sweep.localCenter.y,o=h.col1.x*l+h.col2.x*j;j=h.col1.y*l+h.col2.y*j;l=o;return d*(this.m_impulse*this.m_J.angularB-l*this.m_impulse*this.m_J.linearB.y+j*this.m_impulse*this.m_J.linearB.x)};V.prototype.GetRatio= -function(){return this.m_ratio};V.prototype.SetRatio=function(d){if(d===undefined)d=0;this.m_ratio=d};V.prototype.b2GearJoint=function(d){this.__super.b2Joint.call(this,d);var h=parseInt(d.joint1.m_type),l=parseInt(d.joint2.m_type);this.m_prismatic2=this.m_revolute2=this.m_prismatic1=this.m_revolute1=null;var j=0,o=0;this.m_ground1=d.joint1.GetBodyA();this.m_bodyA=d.joint1.GetBodyB();if(h==I.e_revoluteJoint){this.m_revolute1=d.joint1 instanceof N?d.joint1:null;this.m_groundAnchor1.SetV(this.m_revolute1.m_localAnchor1); -this.m_localAnchor1.SetV(this.m_revolute1.m_localAnchor2);j=this.m_revolute1.GetJointAngle()}else{this.m_prismatic1=d.joint1 instanceof H?d.joint1:null;this.m_groundAnchor1.SetV(this.m_prismatic1.m_localAnchor1);this.m_localAnchor1.SetV(this.m_prismatic1.m_localAnchor2);j=this.m_prismatic1.GetJointTranslation()}this.m_ground2=d.joint2.GetBodyA();this.m_bodyB=d.joint2.GetBodyB();if(l==I.e_revoluteJoint){this.m_revolute2=d.joint2 instanceof N?d.joint2:null;this.m_groundAnchor2.SetV(this.m_revolute2.m_localAnchor1); -this.m_localAnchor2.SetV(this.m_revolute2.m_localAnchor2);o=this.m_revolute2.GetJointAngle()}else{this.m_prismatic2=d.joint2 instanceof H?d.joint2:null;this.m_groundAnchor2.SetV(this.m_prismatic2.m_localAnchor1);this.m_localAnchor2.SetV(this.m_prismatic2.m_localAnchor2);o=this.m_prismatic2.GetJointTranslation()}this.m_ratio=d.ratio;this.m_constant=j+this.m_ratio*o;this.m_impulse=0};V.prototype.InitVelocityConstraints=function(d){var h=this.m_ground1,l=this.m_ground2,j=this.m_bodyA,o=this.m_bodyB, -q=0,n=0,a=0,c=0,g=a=0,b=0;this.m_J.SetZero();if(this.m_revolute1){this.m_J.angularA=-1;b+=j.m_invI}else{h=h.m_xf.R;n=this.m_prismatic1.m_localXAxis1;q=h.col1.x*n.x+h.col2.x*n.y;n=h.col1.y*n.x+h.col2.y*n.y;h=j.m_xf.R;a=this.m_localAnchor1.x-j.m_sweep.localCenter.x;c=this.m_localAnchor1.y-j.m_sweep.localCenter.y;g=h.col1.x*a+h.col2.x*c;c=h.col1.y*a+h.col2.y*c;a=g;a=a*n-c*q;this.m_J.linearA.Set(-q,-n);this.m_J.angularA=-a;b+=j.m_invMass+j.m_invI*a*a}if(this.m_revolute2){this.m_J.angularB=-this.m_ratio; -b+=this.m_ratio*this.m_ratio*o.m_invI}else{h=l.m_xf.R;n=this.m_prismatic2.m_localXAxis1;q=h.col1.x*n.x+h.col2.x*n.y;n=h.col1.y*n.x+h.col2.y*n.y;h=o.m_xf.R;a=this.m_localAnchor2.x-o.m_sweep.localCenter.x;c=this.m_localAnchor2.y-o.m_sweep.localCenter.y;g=h.col1.x*a+h.col2.x*c;c=h.col1.y*a+h.col2.y*c;a=g;a=a*n-c*q;this.m_J.linearB.Set(-this.m_ratio*q,-this.m_ratio*n);this.m_J.angularB=-this.m_ratio*a;b+=this.m_ratio*this.m_ratio*(o.m_invMass+o.m_invI*a*a)}this.m_mass=b>0?1/b:0;if(d.warmStarting){j.m_linearVelocity.x+= -j.m_invMass*this.m_impulse*this.m_J.linearA.x;j.m_linearVelocity.y+=j.m_invMass*this.m_impulse*this.m_J.linearA.y;j.m_angularVelocity+=j.m_invI*this.m_impulse*this.m_J.angularA;o.m_linearVelocity.x+=o.m_invMass*this.m_impulse*this.m_J.linearB.x;o.m_linearVelocity.y+=o.m_invMass*this.m_impulse*this.m_J.linearB.y;o.m_angularVelocity+=o.m_invI*this.m_impulse*this.m_J.angularB}else this.m_impulse=0};V.prototype.SolveVelocityConstraints=function(){var d=this.m_bodyA,h=this.m_bodyB,l=-this.m_mass*this.m_J.Compute(d.m_linearVelocity, -d.m_angularVelocity,h.m_linearVelocity,h.m_angularVelocity);this.m_impulse+=l;d.m_linearVelocity.x+=d.m_invMass*l*this.m_J.linearA.x;d.m_linearVelocity.y+=d.m_invMass*l*this.m_J.linearA.y;d.m_angularVelocity+=d.m_invI*l*this.m_J.angularA;h.m_linearVelocity.x+=h.m_invMass*l*this.m_J.linearB.x;h.m_linearVelocity.y+=h.m_invMass*l*this.m_J.linearB.y;h.m_angularVelocity+=h.m_invI*l*this.m_J.angularB};V.prototype.SolvePositionConstraints=function(){var d=this.m_bodyA,h=this.m_bodyB,l=0,j=0;l=this.m_revolute1? -this.m_revolute1.GetJointAngle():this.m_prismatic1.GetJointTranslation();j=this.m_revolute2?this.m_revolute2.GetJointAngle():this.m_prismatic2.GetJointTranslation();l=-this.m_mass*(this.m_constant-(l+this.m_ratio*j));d.m_sweep.c.x+=d.m_invMass*l*this.m_J.linearA.x;d.m_sweep.c.y+=d.m_invMass*l*this.m_J.linearA.y;d.m_sweep.a+=d.m_invI*l*this.m_J.angularA;h.m_sweep.c.x+=h.m_invMass*l*this.m_J.linearB.x;h.m_sweep.c.y+=h.m_invMass*l*this.m_J.linearB.y;h.m_sweep.a+=h.m_invI*l*this.m_J.angularB;d.SynchronizeTransform(); -h.SynchronizeTransform();return 0Number.MIN_VALUE?1/this.m_motorMass:0;this.m_perp.SetV(y.MulMV(q.R,this.m_localYAxis1));this.m_s1=(j+n)*this.m_perp.y-(o+a)*this.m_perp.x;this.m_s2=c*this.m_perp.y- -g*this.m_perp.x;q=this.m_invMassA;n=this.m_invMassB;a=this.m_invIA;c=this.m_invIB;this.m_K.col1.x=q+n+a*this.m_s1*this.m_s1+c*this.m_s2*this.m_s2;this.m_K.col1.y=a*this.m_s1*this.m_a1+c*this.m_s2*this.m_a2;this.m_K.col2.x=this.m_K.col1.y;this.m_K.col2.y=q+n+a*this.m_a1*this.m_a1+c*this.m_a2*this.m_a2;if(this.m_enableLimit){j=this.m_axis.x*j+this.m_axis.y*o;if(y.Abs(this.m_upperTranslation-this.m_lowerTranslation)<2*F.b2_linearSlop)this.m_limitState=I.e_equalLimits;else if(j<=this.m_lowerTranslation){if(this.m_limitState!= -I.e_atLowerLimit){this.m_limitState=I.e_atLowerLimit;this.m_impulse.y=0}}else if(j>=this.m_upperTranslation){if(this.m_limitState!=I.e_atUpperLimit){this.m_limitState=I.e_atUpperLimit;this.m_impulse.y=0}}else{this.m_limitState=I.e_inactiveLimit;this.m_impulse.y=0}}else this.m_limitState=I.e_inactiveLimit;if(this.m_enableMotor==false)this.m_motorImpulse=0;if(d.warmStarting){this.m_impulse.x*=d.dtRatio;this.m_impulse.y*=d.dtRatio;this.m_motorImpulse*=d.dtRatio;d=this.m_impulse.x*this.m_perp.x+(this.m_motorImpulse+ -this.m_impulse.y)*this.m_axis.x;j=this.m_impulse.x*this.m_perp.y+(this.m_motorImpulse+this.m_impulse.y)*this.m_axis.y;o=this.m_impulse.x*this.m_s1+(this.m_motorImpulse+this.m_impulse.y)*this.m_a1;q=this.m_impulse.x*this.m_s2+(this.m_motorImpulse+this.m_impulse.y)*this.m_a2;h.m_linearVelocity.x-=this.m_invMassA*d;h.m_linearVelocity.y-=this.m_invMassA*j;h.m_angularVelocity-=this.m_invIA*o;l.m_linearVelocity.x+=this.m_invMassB*d;l.m_linearVelocity.y+=this.m_invMassB*j;l.m_angularVelocity+=this.m_invIB* -q}else{this.m_impulse.SetZero();this.m_motorImpulse=0}};k.prototype.SolveVelocityConstraints=function(d){var h=this.m_bodyA,l=this.m_bodyB,j=h.m_linearVelocity,o=h.m_angularVelocity,q=l.m_linearVelocity,n=l.m_angularVelocity,a=0,c=0,g=0,b=0;if(this.m_enableMotor&&this.m_limitState!=I.e_equalLimits){b=this.m_motorMass*(this.m_motorSpeed-(this.m_axis.x*(q.x-j.x)+this.m_axis.y*(q.y-j.y)+this.m_a2*n-this.m_a1*o));a=this.m_motorImpulse;c=d.dt*this.m_maxMotorForce;this.m_motorImpulse=y.Clamp(this.m_motorImpulse+ -b,-c,c);b=this.m_motorImpulse-a;a=b*this.m_axis.x;c=b*this.m_axis.y;g=b*this.m_a1;b=b*this.m_a2;j.x-=this.m_invMassA*a;j.y-=this.m_invMassA*c;o-=this.m_invIA*g;q.x+=this.m_invMassB*a;q.y+=this.m_invMassB*c;n+=this.m_invIB*b}c=this.m_perp.x*(q.x-j.x)+this.m_perp.y*(q.y-j.y)+this.m_s2*n-this.m_s1*o;if(this.m_enableLimit&&this.m_limitState!=I.e_inactiveLimit){g=this.m_axis.x*(q.x-j.x)+this.m_axis.y*(q.y-j.y)+this.m_a2*n-this.m_a1*o;a=this.m_impulse.Copy();d=this.m_K.Solve(new w,-c,-g);this.m_impulse.Add(d); -if(this.m_limitState==I.e_atLowerLimit)this.m_impulse.y=y.Max(this.m_impulse.y,0);else if(this.m_limitState==I.e_atUpperLimit)this.m_impulse.y=y.Min(this.m_impulse.y,0);c=-c-(this.m_impulse.y-a.y)*this.m_K.col2.x;g=0;g=this.m_K.col1.x!=0?c/this.m_K.col1.x+a.x:a.x;this.m_impulse.x=g;d.x=this.m_impulse.x-a.x;d.y=this.m_impulse.y-a.y;a=d.x*this.m_perp.x+d.y*this.m_axis.x;c=d.x*this.m_perp.y+d.y*this.m_axis.y;g=d.x*this.m_s1+d.y*this.m_a1;b=d.x*this.m_s2+d.y*this.m_a2}else{d=0;d=this.m_K.col1.x!=0?-c/ -this.m_K.col1.x:0;this.m_impulse.x+=d;a=d*this.m_perp.x;c=d*this.m_perp.y;g=d*this.m_s1;b=d*this.m_s2}j.x-=this.m_invMassA*a;j.y-=this.m_invMassA*c;o-=this.m_invIA*g;q.x+=this.m_invMassB*a;q.y+=this.m_invMassB*c;n+=this.m_invIB*b;h.m_linearVelocity.SetV(j);h.m_angularVelocity=o;l.m_linearVelocity.SetV(q);l.m_angularVelocity=n};k.prototype.SolvePositionConstraints=function(){var d=this.m_bodyA,h=this.m_bodyB,l=d.m_sweep.c,j=d.m_sweep.a,o=h.m_sweep.c,q=h.m_sweep.a,n,a=0,c=0,g=0,b=0,e=n=0,f=0;c=false; -var m=0,r=G.FromAngle(j);g=G.FromAngle(q);n=r;f=this.m_localAnchor1.x-this.m_localCenterA.x;var s=this.m_localAnchor1.y-this.m_localCenterA.y;a=n.col1.x*f+n.col2.x*s;s=n.col1.y*f+n.col2.y*s;f=a;n=g;g=this.m_localAnchor2.x-this.m_localCenterB.x;b=this.m_localAnchor2.y-this.m_localCenterB.y;a=n.col1.x*g+n.col2.x*b;b=n.col1.y*g+n.col2.y*b;g=a;n=o.x+g-l.x-f;a=o.y+b-l.y-s;if(this.m_enableLimit){this.m_axis=y.MulMV(r,this.m_localXAxis1);this.m_a1=(n+f)*this.m_axis.y-(a+s)*this.m_axis.x;this.m_a2=g*this.m_axis.y- -b*this.m_axis.x;var v=this.m_axis.x*n+this.m_axis.y*a;if(y.Abs(this.m_upperTranslation-this.m_lowerTranslation)<2*F.b2_linearSlop){m=y.Clamp(v,-F.b2_maxLinearCorrection,F.b2_maxLinearCorrection);e=y.Abs(v);c=true}else if(v<=this.m_lowerTranslation){m=y.Clamp(v-this.m_lowerTranslation+F.b2_linearSlop,-F.b2_maxLinearCorrection,0);e=this.m_lowerTranslation-v;c=true}else if(v>=this.m_upperTranslation){m=y.Clamp(v-this.m_upperTranslation+F.b2_linearSlop,0,F.b2_maxLinearCorrection);e=v-this.m_upperTranslation; -c=true}}this.m_perp=y.MulMV(r,this.m_localYAxis1);this.m_s1=(n+f)*this.m_perp.y-(a+s)*this.m_perp.x;this.m_s2=g*this.m_perp.y-b*this.m_perp.x;r=new w;s=this.m_perp.x*n+this.m_perp.y*a;e=y.Max(e,y.Abs(s));f=0;if(c){c=this.m_invMassA;g=this.m_invMassB;b=this.m_invIA;n=this.m_invIB;this.m_K.col1.x=c+g+b*this.m_s1*this.m_s1+n*this.m_s2*this.m_s2;this.m_K.col1.y=b*this.m_s1*this.m_a1+n*this.m_s2*this.m_a2;this.m_K.col2.x=this.m_K.col1.y;this.m_K.col2.y=c+g+b*this.m_a1*this.m_a1+n*this.m_a2*this.m_a2;this.m_K.Solve(r, --s,-m)}else{c=this.m_invMassA;g=this.m_invMassB;b=this.m_invIA;n=this.m_invIB;m=c+g+b*this.m_s1*this.m_s1+n*this.m_s2*this.m_s2;c=0;c=m!=0?-s/m:0;r.x=c;r.y=0}m=r.x*this.m_perp.x+r.y*this.m_axis.x;c=r.x*this.m_perp.y+r.y*this.m_axis.y;s=r.x*this.m_s1+r.y*this.m_a1;r=r.x*this.m_s2+r.y*this.m_a2;l.x-=this.m_invMassA*m;l.y-=this.m_invMassA*c;j-=this.m_invIA*s;o.x+=this.m_invMassB*m;o.y+=this.m_invMassB*c;q+=this.m_invIB*r;d.m_sweep.a=j;h.m_sweep.a=q;d.SynchronizeTransform();h.SynchronizeTransform();return e<= -F.b2_linearSlop&&f<=F.b2_angularSlop};Box2D.inherit(z,Box2D.Dynamics.Joints.b2JointDef);z.prototype.__super=Box2D.Dynamics.Joints.b2JointDef.prototype;z.b2LineJointDef=function(){Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this,arguments);this.localAnchorA=new w;this.localAnchorB=new w;this.localAxisA=new w};z.prototype.b2LineJointDef=function(){this.__super.b2JointDef.call(this);this.type=I.e_lineJoint;this.localAxisA.Set(1,0);this.enableLimit=false;this.upperTranslation=this.lowerTranslation= -0;this.enableMotor=false;this.motorSpeed=this.maxMotorForce=0};z.prototype.Initialize=function(d,h,l,j){this.bodyA=d;this.bodyB=h;this.localAnchorA=this.bodyA.GetLocalPoint(l);this.localAnchorB=this.bodyB.GetLocalPoint(l);this.localAxisA=this.bodyA.GetLocalVector(j)};Box2D.inherit(u,Box2D.Dynamics.Joints.b2Joint);u.prototype.__super=Box2D.Dynamics.Joints.b2Joint.prototype;u.b2MouseJoint=function(){Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this,arguments);this.K=new G;this.K1=new G;this.K2=new G; -this.m_localAnchor=new w;this.m_target=new w;this.m_impulse=new w;this.m_mass=new G;this.m_C=new w};u.prototype.GetAnchorA=function(){return this.m_target};u.prototype.GetAnchorB=function(){return this.m_bodyB.GetWorldPoint(this.m_localAnchor)};u.prototype.GetReactionForce=function(d){if(d===undefined)d=0;return new w(d*this.m_impulse.x,d*this.m_impulse.y)};u.prototype.GetReactionTorque=function(){return 0};u.prototype.GetTarget=function(){return this.m_target};u.prototype.SetTarget=function(d){this.m_bodyB.IsAwake()== -false&&this.m_bodyB.SetAwake(true);this.m_target=d};u.prototype.GetMaxForce=function(){return this.m_maxForce};u.prototype.SetMaxForce=function(d){if(d===undefined)d=0;this.m_maxForce=d};u.prototype.GetFrequency=function(){return this.m_frequencyHz};u.prototype.SetFrequency=function(d){if(d===undefined)d=0;this.m_frequencyHz=d};u.prototype.GetDampingRatio=function(){return this.m_dampingRatio};u.prototype.SetDampingRatio=function(d){if(d===undefined)d=0;this.m_dampingRatio=d};u.prototype.b2MouseJoint= -function(d){this.__super.b2Joint.call(this,d);this.m_target.SetV(d.target);var h=this.m_target.x-this.m_bodyB.m_xf.position.x,l=this.m_target.y-this.m_bodyB.m_xf.position.y,j=this.m_bodyB.m_xf.R;this.m_localAnchor.x=h*j.col1.x+l*j.col1.y;this.m_localAnchor.y=h*j.col2.x+l*j.col2.y;this.m_maxForce=d.maxForce;this.m_impulse.SetZero();this.m_frequencyHz=d.frequencyHz;this.m_dampingRatio=d.dampingRatio;this.m_gamma=this.m_beta=0};u.prototype.InitVelocityConstraints=function(d){var h=this.m_bodyB,l=h.GetMass(), -j=2*Math.PI*this.m_frequencyHz,o=l*j*j;this.m_gamma=d.dt*(2*l*this.m_dampingRatio*j+d.dt*o);this.m_gamma=this.m_gamma!=0?1/this.m_gamma:0;this.m_beta=d.dt*o*this.m_gamma;o=h.m_xf.R;l=this.m_localAnchor.x-h.m_sweep.localCenter.x;j=this.m_localAnchor.y-h.m_sweep.localCenter.y;var q=o.col1.x*l+o.col2.x*j;j=o.col1.y*l+o.col2.y*j;l=q;o=h.m_invMass;q=h.m_invI;this.K1.col1.x=o;this.K1.col2.x=0;this.K1.col1.y=0;this.K1.col2.y=o;this.K2.col1.x=q*j*j;this.K2.col2.x=-q*l*j;this.K2.col1.y=-q*l*j;this.K2.col2.y= -q*l*l;this.K.SetM(this.K1);this.K.AddM(this.K2);this.K.col1.x+=this.m_gamma;this.K.col2.y+=this.m_gamma;this.K.GetInverse(this.m_mass);this.m_C.x=h.m_sweep.c.x+l-this.m_target.x;this.m_C.y=h.m_sweep.c.y+j-this.m_target.y;h.m_angularVelocity*=0.98;this.m_impulse.x*=d.dtRatio;this.m_impulse.y*=d.dtRatio;h.m_linearVelocity.x+=o*this.m_impulse.x;h.m_linearVelocity.y+=o*this.m_impulse.y;h.m_angularVelocity+=q*(l*this.m_impulse.y-j*this.m_impulse.x)};u.prototype.SolveVelocityConstraints=function(d){var h= -this.m_bodyB,l,j=0,o=0;l=h.m_xf.R;var q=this.m_localAnchor.x-h.m_sweep.localCenter.x,n=this.m_localAnchor.y-h.m_sweep.localCenter.y;j=l.col1.x*q+l.col2.x*n;n=l.col1.y*q+l.col2.y*n;q=j;j=h.m_linearVelocity.x+-h.m_angularVelocity*n;var a=h.m_linearVelocity.y+h.m_angularVelocity*q;l=this.m_mass;j=j+this.m_beta*this.m_C.x+this.m_gamma*this.m_impulse.x;o=a+this.m_beta*this.m_C.y+this.m_gamma*this.m_impulse.y;a=-(l.col1.x*j+l.col2.x*o);o=-(l.col1.y*j+l.col2.y*o);l=this.m_impulse.x;j=this.m_impulse.y;this.m_impulse.x+= -a;this.m_impulse.y+=o;d=d.dt*this.m_maxForce;this.m_impulse.LengthSquared()>d*d&&this.m_impulse.Multiply(d/this.m_impulse.Length());a=this.m_impulse.x-l;o=this.m_impulse.y-j;h.m_linearVelocity.x+=h.m_invMass*a;h.m_linearVelocity.y+=h.m_invMass*o;h.m_angularVelocity+=h.m_invI*(q*o-n*a)};u.prototype.SolvePositionConstraints=function(){return true};Box2D.inherit(D,Box2D.Dynamics.Joints.b2JointDef);D.prototype.__super=Box2D.Dynamics.Joints.b2JointDef.prototype;D.b2MouseJointDef=function(){Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this, -arguments);this.target=new w};D.prototype.b2MouseJointDef=function(){this.__super.b2JointDef.call(this);this.type=I.e_mouseJoint;this.maxForce=0;this.frequencyHz=5;this.dampingRatio=0.7};Box2D.inherit(H,Box2D.Dynamics.Joints.b2Joint);H.prototype.__super=Box2D.Dynamics.Joints.b2Joint.prototype;H.b2PrismaticJoint=function(){Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this,arguments);this.m_localAnchor1=new w;this.m_localAnchor2=new w;this.m_localXAxis1=new w;this.m_localYAxis1=new w;this.m_axis=new w; -this.m_perp=new w;this.m_K=new K;this.m_impulse=new A};H.prototype.GetAnchorA=function(){return this.m_bodyA.GetWorldPoint(this.m_localAnchor1)};H.prototype.GetAnchorB=function(){return this.m_bodyB.GetWorldPoint(this.m_localAnchor2)};H.prototype.GetReactionForce=function(d){if(d===undefined)d=0;return new w(d*(this.m_impulse.x*this.m_perp.x+(this.m_motorImpulse+this.m_impulse.z)*this.m_axis.x),d*(this.m_impulse.x*this.m_perp.y+(this.m_motorImpulse+this.m_impulse.z)*this.m_axis.y))};H.prototype.GetReactionTorque= -function(d){if(d===undefined)d=0;return d*this.m_impulse.y};H.prototype.GetJointTranslation=function(){var d=this.m_bodyA,h=this.m_bodyB,l=d.GetWorldPoint(this.m_localAnchor1),j=h.GetWorldPoint(this.m_localAnchor2);h=j.x-l.x;l=j.y-l.y;d=d.GetWorldVector(this.m_localXAxis1);return d.x*h+d.y*l};H.prototype.GetJointSpeed=function(){var d=this.m_bodyA,h=this.m_bodyB,l;l=d.m_xf.R;var j=this.m_localAnchor1.x-d.m_sweep.localCenter.x,o=this.m_localAnchor1.y-d.m_sweep.localCenter.y,q=l.col1.x*j+l.col2.x*o; -o=l.col1.y*j+l.col2.y*o;j=q;l=h.m_xf.R;var n=this.m_localAnchor2.x-h.m_sweep.localCenter.x,a=this.m_localAnchor2.y-h.m_sweep.localCenter.y;q=l.col1.x*n+l.col2.x*a;a=l.col1.y*n+l.col2.y*a;n=q;l=h.m_sweep.c.x+n-(d.m_sweep.c.x+j);q=h.m_sweep.c.y+a-(d.m_sweep.c.y+o);var c=d.GetWorldVector(this.m_localXAxis1),g=d.m_linearVelocity,b=h.m_linearVelocity;d=d.m_angularVelocity;h=h.m_angularVelocity;return l*-d*c.y+q*d*c.x+(c.x*(b.x+-h*a-g.x- -d*o)+c.y*(b.y+h*n-g.y-d*j))};H.prototype.IsLimitEnabled=function(){return this.m_enableLimit}; -H.prototype.EnableLimit=function(d){this.m_bodyA.SetAwake(true);this.m_bodyB.SetAwake(true);this.m_enableLimit=d};H.prototype.GetLowerLimit=function(){return this.m_lowerTranslation};H.prototype.GetUpperLimit=function(){return this.m_upperTranslation};H.prototype.SetLimits=function(d,h){if(d===undefined)d=0;if(h===undefined)h=0;this.m_bodyA.SetAwake(true);this.m_bodyB.SetAwake(true);this.m_lowerTranslation=d;this.m_upperTranslation=h};H.prototype.IsMotorEnabled=function(){return this.m_enableMotor}; -H.prototype.EnableMotor=function(d){this.m_bodyA.SetAwake(true);this.m_bodyB.SetAwake(true);this.m_enableMotor=d};H.prototype.SetMotorSpeed=function(d){if(d===undefined)d=0;this.m_bodyA.SetAwake(true);this.m_bodyB.SetAwake(true);this.m_motorSpeed=d};H.prototype.GetMotorSpeed=function(){return this.m_motorSpeed};H.prototype.SetMaxMotorForce=function(d){if(d===undefined)d=0;this.m_bodyA.SetAwake(true);this.m_bodyB.SetAwake(true);this.m_maxMotorForce=d};H.prototype.GetMotorForce=function(){return this.m_motorImpulse}; -H.prototype.b2PrismaticJoint=function(d){this.__super.b2Joint.call(this,d);this.m_localAnchor1.SetV(d.localAnchorA);this.m_localAnchor2.SetV(d.localAnchorB);this.m_localXAxis1.SetV(d.localAxisA);this.m_localYAxis1.x=-this.m_localXAxis1.y;this.m_localYAxis1.y=this.m_localXAxis1.x;this.m_refAngle=d.referenceAngle;this.m_impulse.SetZero();this.m_motorImpulse=this.m_motorMass=0;this.m_lowerTranslation=d.lowerTranslation;this.m_upperTranslation=d.upperTranslation;this.m_maxMotorForce=d.maxMotorForce;this.m_motorSpeed= -d.motorSpeed;this.m_enableLimit=d.enableLimit;this.m_enableMotor=d.enableMotor;this.m_limitState=I.e_inactiveLimit;this.m_axis.SetZero();this.m_perp.SetZero()};H.prototype.InitVelocityConstraints=function(d){var h=this.m_bodyA,l=this.m_bodyB,j,o=0;this.m_localCenterA.SetV(h.GetLocalCenter());this.m_localCenterB.SetV(l.GetLocalCenter());var q=h.GetTransform();l.GetTransform();j=h.m_xf.R;var n=this.m_localAnchor1.x-this.m_localCenterA.x,a=this.m_localAnchor1.y-this.m_localCenterA.y;o=j.col1.x*n+j.col2.x* -a;a=j.col1.y*n+j.col2.y*a;n=o;j=l.m_xf.R;var c=this.m_localAnchor2.x-this.m_localCenterB.x,g=this.m_localAnchor2.y-this.m_localCenterB.y;o=j.col1.x*c+j.col2.x*g;g=j.col1.y*c+j.col2.y*g;c=o;j=l.m_sweep.c.x+c-h.m_sweep.c.x-n;o=l.m_sweep.c.y+g-h.m_sweep.c.y-a;this.m_invMassA=h.m_invMass;this.m_invMassB=l.m_invMass;this.m_invIA=h.m_invI;this.m_invIB=l.m_invI;this.m_axis.SetV(y.MulMV(q.R,this.m_localXAxis1));this.m_a1=(j+n)*this.m_axis.y-(o+a)*this.m_axis.x;this.m_a2=c*this.m_axis.y-g*this.m_axis.x;this.m_motorMass= -this.m_invMassA+this.m_invMassB+this.m_invIA*this.m_a1*this.m_a1+this.m_invIB*this.m_a2*this.m_a2;if(this.m_motorMass>Number.MIN_VALUE)this.m_motorMass=1/this.m_motorMass;this.m_perp.SetV(y.MulMV(q.R,this.m_localYAxis1));this.m_s1=(j+n)*this.m_perp.y-(o+a)*this.m_perp.x;this.m_s2=c*this.m_perp.y-g*this.m_perp.x;q=this.m_invMassA;n=this.m_invMassB;a=this.m_invIA;c=this.m_invIB;this.m_K.col1.x=q+n+a*this.m_s1*this.m_s1+c*this.m_s2*this.m_s2;this.m_K.col1.y=a*this.m_s1+c*this.m_s2;this.m_K.col1.z=a* -this.m_s1*this.m_a1+c*this.m_s2*this.m_a2;this.m_K.col2.x=this.m_K.col1.y;this.m_K.col2.y=a+c;this.m_K.col2.z=a*this.m_a1+c*this.m_a2;this.m_K.col3.x=this.m_K.col1.z;this.m_K.col3.y=this.m_K.col2.z;this.m_K.col3.z=q+n+a*this.m_a1*this.m_a1+c*this.m_a2*this.m_a2;if(this.m_enableLimit){j=this.m_axis.x*j+this.m_axis.y*o;if(y.Abs(this.m_upperTranslation-this.m_lowerTranslation)<2*F.b2_linearSlop)this.m_limitState=I.e_equalLimits;else if(j<=this.m_lowerTranslation){if(this.m_limitState!=I.e_atLowerLimit){this.m_limitState= -I.e_atLowerLimit;this.m_impulse.z=0}}else if(j>=this.m_upperTranslation){if(this.m_limitState!=I.e_atUpperLimit){this.m_limitState=I.e_atUpperLimit;this.m_impulse.z=0}}else{this.m_limitState=I.e_inactiveLimit;this.m_impulse.z=0}}else this.m_limitState=I.e_inactiveLimit;if(this.m_enableMotor==false)this.m_motorImpulse=0;if(d.warmStarting){this.m_impulse.x*=d.dtRatio;this.m_impulse.y*=d.dtRatio;this.m_motorImpulse*=d.dtRatio;d=this.m_impulse.x*this.m_perp.x+(this.m_motorImpulse+this.m_impulse.z)*this.m_axis.x; -j=this.m_impulse.x*this.m_perp.y+(this.m_motorImpulse+this.m_impulse.z)*this.m_axis.y;o=this.m_impulse.x*this.m_s1+this.m_impulse.y+(this.m_motorImpulse+this.m_impulse.z)*this.m_a1;q=this.m_impulse.x*this.m_s2+this.m_impulse.y+(this.m_motorImpulse+this.m_impulse.z)*this.m_a2;h.m_linearVelocity.x-=this.m_invMassA*d;h.m_linearVelocity.y-=this.m_invMassA*j;h.m_angularVelocity-=this.m_invIA*o;l.m_linearVelocity.x+=this.m_invMassB*d;l.m_linearVelocity.y+=this.m_invMassB*j;l.m_angularVelocity+=this.m_invIB* -q}else{this.m_impulse.SetZero();this.m_motorImpulse=0}};H.prototype.SolveVelocityConstraints=function(d){var h=this.m_bodyA,l=this.m_bodyB,j=h.m_linearVelocity,o=h.m_angularVelocity,q=l.m_linearVelocity,n=l.m_angularVelocity,a=0,c=0,g=0,b=0;if(this.m_enableMotor&&this.m_limitState!=I.e_equalLimits){b=this.m_motorMass*(this.m_motorSpeed-(this.m_axis.x*(q.x-j.x)+this.m_axis.y*(q.y-j.y)+this.m_a2*n-this.m_a1*o));a=this.m_motorImpulse;d=d.dt*this.m_maxMotorForce;this.m_motorImpulse=y.Clamp(this.m_motorImpulse+ -b,-d,d);b=this.m_motorImpulse-a;a=b*this.m_axis.x;c=b*this.m_axis.y;g=b*this.m_a1;b=b*this.m_a2;j.x-=this.m_invMassA*a;j.y-=this.m_invMassA*c;o-=this.m_invIA*g;q.x+=this.m_invMassB*a;q.y+=this.m_invMassB*c;n+=this.m_invIB*b}g=this.m_perp.x*(q.x-j.x)+this.m_perp.y*(q.y-j.y)+this.m_s2*n-this.m_s1*o;c=n-o;if(this.m_enableLimit&&this.m_limitState!=I.e_inactiveLimit){d=this.m_axis.x*(q.x-j.x)+this.m_axis.y*(q.y-j.y)+this.m_a2*n-this.m_a1*o;a=this.m_impulse.Copy();d=this.m_K.Solve33(new A,-g,-c,-d);this.m_impulse.Add(d); -if(this.m_limitState==I.e_atLowerLimit)this.m_impulse.z=y.Max(this.m_impulse.z,0);else if(this.m_limitState==I.e_atUpperLimit)this.m_impulse.z=y.Min(this.m_impulse.z,0);g=-g-(this.m_impulse.z-a.z)*this.m_K.col3.x;c=-c-(this.m_impulse.z-a.z)*this.m_K.col3.y;c=this.m_K.Solve22(new w,g,c);c.x+=a.x;c.y+=a.y;this.m_impulse.x=c.x;this.m_impulse.y=c.y;d.x=this.m_impulse.x-a.x;d.y=this.m_impulse.y-a.y;d.z=this.m_impulse.z-a.z;a=d.x*this.m_perp.x+d.z*this.m_axis.x;c=d.x*this.m_perp.y+d.z*this.m_axis.y;g=d.x* -this.m_s1+d.y+d.z*this.m_a1;b=d.x*this.m_s2+d.y+d.z*this.m_a2}else{d=this.m_K.Solve22(new w,-g,-c);this.m_impulse.x+=d.x;this.m_impulse.y+=d.y;a=d.x*this.m_perp.x;c=d.x*this.m_perp.y;g=d.x*this.m_s1+d.y;b=d.x*this.m_s2+d.y}j.x-=this.m_invMassA*a;j.y-=this.m_invMassA*c;o-=this.m_invIA*g;q.x+=this.m_invMassB*a;q.y+=this.m_invMassB*c;n+=this.m_invIB*b;h.m_linearVelocity.SetV(j);h.m_angularVelocity=o;l.m_linearVelocity.SetV(q);l.m_angularVelocity=n};H.prototype.SolvePositionConstraints=function(){var d= -this.m_bodyA,h=this.m_bodyB,l=d.m_sweep.c,j=d.m_sweep.a,o=h.m_sweep.c,q=h.m_sweep.a,n,a=0,c=0,g=0,b=a=n=0,e=0;c=false;var f=0,m=G.FromAngle(j),r=G.FromAngle(q);n=m;e=this.m_localAnchor1.x-this.m_localCenterA.x;var s=this.m_localAnchor1.y-this.m_localCenterA.y;a=n.col1.x*e+n.col2.x*s;s=n.col1.y*e+n.col2.y*s;e=a;n=r;r=this.m_localAnchor2.x-this.m_localCenterB.x;g=this.m_localAnchor2.y-this.m_localCenterB.y;a=n.col1.x*r+n.col2.x*g;g=n.col1.y*r+n.col2.y*g;r=a;n=o.x+r-l.x-e;a=o.y+g-l.y-s;if(this.m_enableLimit){this.m_axis= -y.MulMV(m,this.m_localXAxis1);this.m_a1=(n+e)*this.m_axis.y-(a+s)*this.m_axis.x;this.m_a2=r*this.m_axis.y-g*this.m_axis.x;var v=this.m_axis.x*n+this.m_axis.y*a;if(y.Abs(this.m_upperTranslation-this.m_lowerTranslation)<2*F.b2_linearSlop){f=y.Clamp(v,-F.b2_maxLinearCorrection,F.b2_maxLinearCorrection);b=y.Abs(v);c=true}else if(v<=this.m_lowerTranslation){f=y.Clamp(v-this.m_lowerTranslation+F.b2_linearSlop,-F.b2_maxLinearCorrection,0);b=this.m_lowerTranslation-v;c=true}else if(v>=this.m_upperTranslation){f= -y.Clamp(v-this.m_upperTranslation+F.b2_linearSlop,0,F.b2_maxLinearCorrection);b=v-this.m_upperTranslation;c=true}}this.m_perp=y.MulMV(m,this.m_localYAxis1);this.m_s1=(n+e)*this.m_perp.y-(a+s)*this.m_perp.x;this.m_s2=r*this.m_perp.y-g*this.m_perp.x;m=new A;s=this.m_perp.x*n+this.m_perp.y*a;r=q-j-this.m_refAngle;b=y.Max(b,y.Abs(s));e=y.Abs(r);if(c){c=this.m_invMassA;g=this.m_invMassB;n=this.m_invIA;a=this.m_invIB;this.m_K.col1.x=c+g+n*this.m_s1*this.m_s1+a*this.m_s2*this.m_s2;this.m_K.col1.y=n*this.m_s1+ -a*this.m_s2;this.m_K.col1.z=n*this.m_s1*this.m_a1+a*this.m_s2*this.m_a2;this.m_K.col2.x=this.m_K.col1.y;this.m_K.col2.y=n+a;this.m_K.col2.z=n*this.m_a1+a*this.m_a2;this.m_K.col3.x=this.m_K.col1.z;this.m_K.col3.y=this.m_K.col2.z;this.m_K.col3.z=c+g+n*this.m_a1*this.m_a1+a*this.m_a2*this.m_a2;this.m_K.Solve33(m,-s,-r,-f)}else{c=this.m_invMassA;g=this.m_invMassB;n=this.m_invIA;a=this.m_invIB;f=n*this.m_s1+a*this.m_s2;v=n+a;this.m_K.col1.Set(c+g+n*this.m_s1*this.m_s1+a*this.m_s2*this.m_s2,f,0);this.m_K.col2.Set(f, -v,0);f=this.m_K.Solve22(new w,-s,-r);m.x=f.x;m.y=f.y;m.z=0}f=m.x*this.m_perp.x+m.z*this.m_axis.x;c=m.x*this.m_perp.y+m.z*this.m_axis.y;s=m.x*this.m_s1+m.y+m.z*this.m_a1;m=m.x*this.m_s2+m.y+m.z*this.m_a2;l.x-=this.m_invMassA*f;l.y-=this.m_invMassA*c;j-=this.m_invIA*s;o.x+=this.m_invMassB*f;o.y+=this.m_invMassB*c;q+=this.m_invIB*m;d.m_sweep.a=j;h.m_sweep.a=q;d.SynchronizeTransform();h.SynchronizeTransform();return b<=F.b2_linearSlop&&e<=F.b2_angularSlop};Box2D.inherit(O,Box2D.Dynamics.Joints.b2JointDef); -O.prototype.__super=Box2D.Dynamics.Joints.b2JointDef.prototype;O.b2PrismaticJointDef=function(){Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this,arguments);this.localAnchorA=new w;this.localAnchorB=new w;this.localAxisA=new w};O.prototype.b2PrismaticJointDef=function(){this.__super.b2JointDef.call(this);this.type=I.e_prismaticJoint;this.localAxisA.Set(1,0);this.referenceAngle=0;this.enableLimit=false;this.upperTranslation=this.lowerTranslation=0;this.enableMotor=false;this.motorSpeed=this.maxMotorForce= -0};O.prototype.Initialize=function(d,h,l,j){this.bodyA=d;this.bodyB=h;this.localAnchorA=this.bodyA.GetLocalPoint(l);this.localAnchorB=this.bodyB.GetLocalPoint(l);this.localAxisA=this.bodyA.GetLocalVector(j);this.referenceAngle=this.bodyB.GetAngle()-this.bodyA.GetAngle()};Box2D.inherit(E,Box2D.Dynamics.Joints.b2Joint);E.prototype.__super=Box2D.Dynamics.Joints.b2Joint.prototype;E.b2PulleyJoint=function(){Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this,arguments);this.m_groundAnchor1=new w;this.m_groundAnchor2= -new w;this.m_localAnchor1=new w;this.m_localAnchor2=new w;this.m_u1=new w;this.m_u2=new w};E.prototype.GetAnchorA=function(){return this.m_bodyA.GetWorldPoint(this.m_localAnchor1)};E.prototype.GetAnchorB=function(){return this.m_bodyB.GetWorldPoint(this.m_localAnchor2)};E.prototype.GetReactionForce=function(d){if(d===undefined)d=0;return new w(d*this.m_impulse*this.m_u2.x,d*this.m_impulse*this.m_u2.y)};E.prototype.GetReactionTorque=function(){return 0};E.prototype.GetGroundAnchorA=function(){var d= -this.m_ground.m_xf.position.Copy();d.Add(this.m_groundAnchor1);return d};E.prototype.GetGroundAnchorB=function(){var d=this.m_ground.m_xf.position.Copy();d.Add(this.m_groundAnchor2);return d};E.prototype.GetLength1=function(){var d=this.m_bodyA.GetWorldPoint(this.m_localAnchor1),h=d.x-(this.m_ground.m_xf.position.x+this.m_groundAnchor1.x);d=d.y-(this.m_ground.m_xf.position.y+this.m_groundAnchor1.y);return Math.sqrt(h*h+d*d)};E.prototype.GetLength2=function(){var d=this.m_bodyB.GetWorldPoint(this.m_localAnchor2), -h=d.x-(this.m_ground.m_xf.position.x+this.m_groundAnchor2.x);d=d.y-(this.m_ground.m_xf.position.y+this.m_groundAnchor2.y);return Math.sqrt(h*h+d*d)};E.prototype.GetRatio=function(){return this.m_ratio};E.prototype.b2PulleyJoint=function(d){this.__super.b2Joint.call(this,d);this.m_ground=this.m_bodyA.m_world.m_groundBody;this.m_groundAnchor1.x=d.groundAnchorA.x-this.m_ground.m_xf.position.x;this.m_groundAnchor1.y=d.groundAnchorA.y-this.m_ground.m_xf.position.y;this.m_groundAnchor2.x=d.groundAnchorB.x- -this.m_ground.m_xf.position.x;this.m_groundAnchor2.y=d.groundAnchorB.y-this.m_ground.m_xf.position.y;this.m_localAnchor1.SetV(d.localAnchorA);this.m_localAnchor2.SetV(d.localAnchorB);this.m_ratio=d.ratio;this.m_constant=d.lengthA+this.m_ratio*d.lengthB;this.m_maxLength1=y.Min(d.maxLengthA,this.m_constant-this.m_ratio*E.b2_minPulleyLength);this.m_maxLength2=y.Min(d.maxLengthB,(this.m_constant-E.b2_minPulleyLength)/this.m_ratio);this.m_limitImpulse2=this.m_limitImpulse1=this.m_impulse=0};E.prototype.InitVelocityConstraints= -function(d){var h=this.m_bodyA,l=this.m_bodyB,j;j=h.m_xf.R;var o=this.m_localAnchor1.x-h.m_sweep.localCenter.x,q=this.m_localAnchor1.y-h.m_sweep.localCenter.y,n=j.col1.x*o+j.col2.x*q;q=j.col1.y*o+j.col2.y*q;o=n;j=l.m_xf.R;var a=this.m_localAnchor2.x-l.m_sweep.localCenter.x,c=this.m_localAnchor2.y-l.m_sweep.localCenter.y;n=j.col1.x*a+j.col2.x*c;c=j.col1.y*a+j.col2.y*c;a=n;j=l.m_sweep.c.x+a;n=l.m_sweep.c.y+c;var g=this.m_ground.m_xf.position.x+this.m_groundAnchor2.x,b=this.m_ground.m_xf.position.y+ -this.m_groundAnchor2.y;this.m_u1.Set(h.m_sweep.c.x+o-(this.m_ground.m_xf.position.x+this.m_groundAnchor1.x),h.m_sweep.c.y+q-(this.m_ground.m_xf.position.y+this.m_groundAnchor1.y));this.m_u2.Set(j-g,n-b);j=this.m_u1.Length();n=this.m_u2.Length();j>F.b2_linearSlop?this.m_u1.Multiply(1/j):this.m_u1.SetZero();n>F.b2_linearSlop?this.m_u2.Multiply(1/n):this.m_u2.SetZero();if(this.m_constant-j-this.m_ratio*n>0){this.m_state=I.e_inactiveLimit;this.m_impulse=0}else this.m_state=I.e_atUpperLimit;if(jF.b2_linearSlop?this.m_u1.Multiply(1/ -l):this.m_u1.SetZero();e>F.b2_linearSlop?this.m_u2.Multiply(1/e):this.m_u2.SetZero();l=this.m_constant-l-this.m_ratio*e;r=y.Max(r,-l);l=y.Clamp(l+F.b2_linearSlop,-F.b2_maxLinearCorrection,0);m=-this.m_pulleyMass*l;l=-m*this.m_u1.x;e=-m*this.m_u1.y;f=-this.m_ratio*m*this.m_u2.x;m=-this.m_ratio*m*this.m_u2.y;d.m_sweep.c.x+=d.m_invMass*l;d.m_sweep.c.y+=d.m_invMass*e;d.m_sweep.a+=d.m_invI*(a*e-c*l);h.m_sweep.c.x+=h.m_invMass*f;h.m_sweep.c.y+=h.m_invMass*m;h.m_sweep.a+=h.m_invI*(g*m-b*f);d.SynchronizeTransform(); -h.SynchronizeTransform()}if(this.m_limitState1==I.e_atUpperLimit){l=d.m_xf.R;a=this.m_localAnchor1.x-d.m_sweep.localCenter.x;c=this.m_localAnchor1.y-d.m_sweep.localCenter.y;e=l.col1.x*a+l.col2.x*c;c=l.col1.y*a+l.col2.y*c;a=e;l=d.m_sweep.c.x+a;e=d.m_sweep.c.y+c;this.m_u1.Set(l-j,e-o);l=this.m_u1.Length();if(l>F.b2_linearSlop){this.m_u1.x*=1/l;this.m_u1.y*=1/l}else this.m_u1.SetZero();l=this.m_maxLength1-l;r=y.Max(r,-l);l=y.Clamp(l+F.b2_linearSlop,-F.b2_maxLinearCorrection,0);m=-this.m_limitMass1*l; -l=-m*this.m_u1.x;e=-m*this.m_u1.y;d.m_sweep.c.x+=d.m_invMass*l;d.m_sweep.c.y+=d.m_invMass*e;d.m_sweep.a+=d.m_invI*(a*e-c*l);d.SynchronizeTransform()}if(this.m_limitState2==I.e_atUpperLimit){l=h.m_xf.R;g=this.m_localAnchor2.x-h.m_sweep.localCenter.x;b=this.m_localAnchor2.y-h.m_sweep.localCenter.y;e=l.col1.x*g+l.col2.x*b;b=l.col1.y*g+l.col2.y*b;g=e;f=h.m_sweep.c.x+g;m=h.m_sweep.c.y+b;this.m_u2.Set(f-q,m-n);e=this.m_u2.Length();if(e>F.b2_linearSlop){this.m_u2.x*=1/e;this.m_u2.y*=1/e}else this.m_u2.SetZero(); -l=this.m_maxLength2-e;r=y.Max(r,-l);l=y.Clamp(l+F.b2_linearSlop,-F.b2_maxLinearCorrection,0);m=-this.m_limitMass2*l;f=-m*this.m_u2.x;m=-m*this.m_u2.y;h.m_sweep.c.x+=h.m_invMass*f;h.m_sweep.c.y+=h.m_invMass*m;h.m_sweep.a+=h.m_invI*(g*m-b*f);h.SynchronizeTransform()}return r=this.m_upperAngle){if(this.m_limitState!=I.e_atUpperLimit)this.m_impulse.z=0;this.m_limitState= -I.e_atUpperLimit}else{this.m_limitState=I.e_inactiveLimit;this.m_impulse.z=0}}else this.m_limitState=I.e_inactiveLimit;if(d.warmStarting){this.m_impulse.x*=d.dtRatio;this.m_impulse.y*=d.dtRatio;this.m_motorImpulse*=d.dtRatio;d=this.m_impulse.x;e=this.m_impulse.y;h.m_linearVelocity.x-=j*d;h.m_linearVelocity.y-=j*e;h.m_angularVelocity-=g*(q*e-n*d+this.m_motorImpulse+this.m_impulse.z);l.m_linearVelocity.x+=o*d;l.m_linearVelocity.y+=o*e;l.m_angularVelocity+=b*(a*e-c*d+this.m_motorImpulse+this.m_impulse.z)}else{this.m_impulse.SetZero(); -this.m_motorImpulse=0}};N.prototype.SolveVelocityConstraints=function(d){var h=this.m_bodyA,l=this.m_bodyB,j=0,o=j=0,q=0,n=0,a=0,c=h.m_linearVelocity,g=h.m_angularVelocity,b=l.m_linearVelocity,e=l.m_angularVelocity,f=h.m_invMass,m=l.m_invMass,r=h.m_invI,s=l.m_invI;if(this.m_enableMotor&&this.m_limitState!=I.e_equalLimits){o=this.m_motorMass*-(e-g-this.m_motorSpeed);q=this.m_motorImpulse;n=d.dt*this.m_maxMotorTorque;this.m_motorImpulse=y.Clamp(this.m_motorImpulse+o,-n,n);o=this.m_motorImpulse-q;g-= -r*o;e+=s*o}if(this.m_enableLimit&&this.m_limitState!=I.e_inactiveLimit){d=h.m_xf.R;o=this.m_localAnchor1.x-h.m_sweep.localCenter.x;q=this.m_localAnchor1.y-h.m_sweep.localCenter.y;j=d.col1.x*o+d.col2.x*q;q=d.col1.y*o+d.col2.y*q;o=j;d=l.m_xf.R;n=this.m_localAnchor2.x-l.m_sweep.localCenter.x;a=this.m_localAnchor2.y-l.m_sweep.localCenter.y;j=d.col1.x*n+d.col2.x*a;a=d.col1.y*n+d.col2.y*a;n=j;d=b.x+-e*a-c.x- -g*q;var v=b.y+e*n-c.y-g*o;this.m_mass.Solve33(this.impulse3,-d,-v,-(e-g));if(this.m_limitState== -I.e_equalLimits)this.m_impulse.Add(this.impulse3);else if(this.m_limitState==I.e_atLowerLimit){j=this.m_impulse.z+this.impulse3.z;if(j<0){this.m_mass.Solve22(this.reduced,-d,-v);this.impulse3.x=this.reduced.x;this.impulse3.y=this.reduced.y;this.impulse3.z=-this.m_impulse.z;this.m_impulse.x+=this.reduced.x;this.m_impulse.y+=this.reduced.y;this.m_impulse.z=0}}else if(this.m_limitState==I.e_atUpperLimit){j=this.m_impulse.z+this.impulse3.z;if(j>0){this.m_mass.Solve22(this.reduced,-d,-v);this.impulse3.x= -this.reduced.x;this.impulse3.y=this.reduced.y;this.impulse3.z=-this.m_impulse.z;this.m_impulse.x+=this.reduced.x;this.m_impulse.y+=this.reduced.y;this.m_impulse.z=0}}c.x-=f*this.impulse3.x;c.y-=f*this.impulse3.y;g-=r*(o*this.impulse3.y-q*this.impulse3.x+this.impulse3.z);b.x+=m*this.impulse3.x;b.y+=m*this.impulse3.y;e+=s*(n*this.impulse3.y-a*this.impulse3.x+this.impulse3.z)}else{d=h.m_xf.R;o=this.m_localAnchor1.x-h.m_sweep.localCenter.x;q=this.m_localAnchor1.y-h.m_sweep.localCenter.y;j=d.col1.x*o+ -d.col2.x*q;q=d.col1.y*o+d.col2.y*q;o=j;d=l.m_xf.R;n=this.m_localAnchor2.x-l.m_sweep.localCenter.x;a=this.m_localAnchor2.y-l.m_sweep.localCenter.y;j=d.col1.x*n+d.col2.x*a;a=d.col1.y*n+d.col2.y*a;n=j;this.m_mass.Solve22(this.impulse2,-(b.x+-e*a-c.x- -g*q),-(b.y+e*n-c.y-g*o));this.m_impulse.x+=this.impulse2.x;this.m_impulse.y+=this.impulse2.y;c.x-=f*this.impulse2.x;c.y-=f*this.impulse2.y;g-=r*(o*this.impulse2.y-q*this.impulse2.x);b.x+=m*this.impulse2.x;b.y+=m*this.impulse2.y;e+=s*(n*this.impulse2.y- -a*this.impulse2.x)}h.m_linearVelocity.SetV(c);h.m_angularVelocity=g;l.m_linearVelocity.SetV(b);l.m_angularVelocity=e};N.prototype.SolvePositionConstraints=function(){var d=0,h,l=this.m_bodyA,j=this.m_bodyB,o=0,q=h=0,n=0,a=0;if(this.m_enableLimit&&this.m_limitState!=I.e_inactiveLimit){d=j.m_sweep.a-l.m_sweep.a-this.m_referenceAngle;var c=0;if(this.m_limitState==I.e_equalLimits){d=y.Clamp(d-this.m_lowerAngle,-F.b2_maxAngularCorrection,F.b2_maxAngularCorrection);c=-this.m_motorMass*d;o=y.Abs(d)}else if(this.m_limitState== -I.e_atLowerLimit){d=d-this.m_lowerAngle;o=-d;d=y.Clamp(d+F.b2_angularSlop,-F.b2_maxAngularCorrection,0);c=-this.m_motorMass*d}else if(this.m_limitState==I.e_atUpperLimit){o=d=d-this.m_upperAngle;d=y.Clamp(d-F.b2_angularSlop,0,F.b2_maxAngularCorrection);c=-this.m_motorMass*d}l.m_sweep.a-=l.m_invI*c;j.m_sweep.a+=j.m_invI*c;l.SynchronizeTransform();j.SynchronizeTransform()}h=l.m_xf.R;c=this.m_localAnchor1.x-l.m_sweep.localCenter.x;d=this.m_localAnchor1.y-l.m_sweep.localCenter.y;q=h.col1.x*c+h.col2.x* -d;d=h.col1.y*c+h.col2.y*d;c=q;h=j.m_xf.R;var g=this.m_localAnchor2.x-j.m_sweep.localCenter.x,b=this.m_localAnchor2.y-j.m_sweep.localCenter.y;q=h.col1.x*g+h.col2.x*b;b=h.col1.y*g+h.col2.y*b;g=q;n=j.m_sweep.c.x+g-l.m_sweep.c.x-c;a=j.m_sweep.c.y+b-l.m_sweep.c.y-d;var e=n*n+a*a;h=Math.sqrt(e);q=l.m_invMass;var f=j.m_invMass,m=l.m_invI,r=j.m_invI,s=10*F.b2_linearSlop;if(e>s*s){e=1/(q+f);n=e*-n;a=e*-a;l.m_sweep.c.x-=0.5*q*n;l.m_sweep.c.y-=0.5*q*a;j.m_sweep.c.x+=0.5*f*n;j.m_sweep.c.y+=0.5*f*a;n=j.m_sweep.c.x+ -g-l.m_sweep.c.x-c;a=j.m_sweep.c.y+b-l.m_sweep.c.y-d}this.K1.col1.x=q+f;this.K1.col2.x=0;this.K1.col1.y=0;this.K1.col2.y=q+f;this.K2.col1.x=m*d*d;this.K2.col2.x=-m*c*d;this.K2.col1.y=-m*c*d;this.K2.col2.y=m*c*c;this.K3.col1.x=r*b*b;this.K3.col2.x=-r*g*b;this.K3.col1.y=-r*g*b;this.K3.col2.y=r*g*g;this.K.SetM(this.K1);this.K.AddM(this.K2);this.K.AddM(this.K3);this.K.Solve(N.tImpulse,-n,-a);n=N.tImpulse.x;a=N.tImpulse.y;l.m_sweep.c.x-=l.m_invMass*n;l.m_sweep.c.y-=l.m_invMass*a;l.m_sweep.a-=l.m_invI*(c* -a-d*n);j.m_sweep.c.x+=j.m_invMass*n;j.m_sweep.c.y+=j.m_invMass*a;j.m_sweep.a+=j.m_invI*(g*a-b*n);l.SynchronizeTransform();j.SynchronizeTransform();return h<=F.b2_linearSlop&&o<=F.b2_angularSlop};Box2D.postDefs.push(function(){Box2D.Dynamics.Joints.b2RevoluteJoint.tImpulse=new w});Box2D.inherit(S,Box2D.Dynamics.Joints.b2JointDef);S.prototype.__super=Box2D.Dynamics.Joints.b2JointDef.prototype;S.b2RevoluteJointDef=function(){Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this,arguments);this.localAnchorA= -new w;this.localAnchorB=new w};S.prototype.b2RevoluteJointDef=function(){this.__super.b2JointDef.call(this);this.type=I.e_revoluteJoint;this.localAnchorA.Set(0,0);this.localAnchorB.Set(0,0);this.motorSpeed=this.maxMotorTorque=this.upperAngle=this.lowerAngle=this.referenceAngle=0;this.enableMotor=this.enableLimit=false};S.prototype.Initialize=function(d,h,l){this.bodyA=d;this.bodyB=h;this.localAnchorA=this.bodyA.GetLocalPoint(l);this.localAnchorB=this.bodyB.GetLocalPoint(l);this.referenceAngle=this.bodyB.GetAngle()- -this.bodyA.GetAngle()};Box2D.inherit(aa,Box2D.Dynamics.Joints.b2Joint);aa.prototype.__super=Box2D.Dynamics.Joints.b2Joint.prototype;aa.b2WeldJoint=function(){Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this,arguments);this.m_localAnchorA=new w;this.m_localAnchorB=new w;this.m_impulse=new A;this.m_mass=new K};aa.prototype.GetAnchorA=function(){return this.m_bodyA.GetWorldPoint(this.m_localAnchorA)};aa.prototype.GetAnchorB=function(){return this.m_bodyB.GetWorldPoint(this.m_localAnchorB)};aa.prototype.GetReactionForce= -function(d){if(d===undefined)d=0;return new w(d*this.m_impulse.x,d*this.m_impulse.y)};aa.prototype.GetReactionTorque=function(d){if(d===undefined)d=0;return d*this.m_impulse.z};aa.prototype.b2WeldJoint=function(d){this.__super.b2Joint.call(this,d);this.m_localAnchorA.SetV(d.localAnchorA);this.m_localAnchorB.SetV(d.localAnchorB);this.m_referenceAngle=d.referenceAngle;this.m_impulse.SetZero();this.m_mass=new K};aa.prototype.InitVelocityConstraints=function(d){var h,l=0,j=this.m_bodyA,o=this.m_bodyB; -h=j.m_xf.R;var q=this.m_localAnchorA.x-j.m_sweep.localCenter.x,n=this.m_localAnchorA.y-j.m_sweep.localCenter.y;l=h.col1.x*q+h.col2.x*n;n=h.col1.y*q+h.col2.y*n;q=l;h=o.m_xf.R;var a=this.m_localAnchorB.x-o.m_sweep.localCenter.x,c=this.m_localAnchorB.y-o.m_sweep.localCenter.y;l=h.col1.x*a+h.col2.x*c;c=h.col1.y*a+h.col2.y*c;a=l;h=j.m_invMass;l=o.m_invMass;var g=j.m_invI,b=o.m_invI;this.m_mass.col1.x=h+l+n*n*g+c*c*b;this.m_mass.col2.x=-n*q*g-c*a*b;this.m_mass.col3.x=-n*g-c*b;this.m_mass.col1.y=this.m_mass.col2.x; -this.m_mass.col2.y=h+l+q*q*g+a*a*b;this.m_mass.col3.y=q*g+a*b;this.m_mass.col1.z=this.m_mass.col3.x;this.m_mass.col2.z=this.m_mass.col3.y;this.m_mass.col3.z=g+b;if(d.warmStarting){this.m_impulse.x*=d.dtRatio;this.m_impulse.y*=d.dtRatio;this.m_impulse.z*=d.dtRatio;j.m_linearVelocity.x-=h*this.m_impulse.x;j.m_linearVelocity.y-=h*this.m_impulse.y;j.m_angularVelocity-=g*(q*this.m_impulse.y-n*this.m_impulse.x+this.m_impulse.z);o.m_linearVelocity.x+=l*this.m_impulse.x;o.m_linearVelocity.y+=l*this.m_impulse.y; -o.m_angularVelocity+=b*(a*this.m_impulse.y-c*this.m_impulse.x+this.m_impulse.z)}else this.m_impulse.SetZero()};aa.prototype.SolveVelocityConstraints=function(){var d,h=0,l=this.m_bodyA,j=this.m_bodyB,o=l.m_linearVelocity,q=l.m_angularVelocity,n=j.m_linearVelocity,a=j.m_angularVelocity,c=l.m_invMass,g=j.m_invMass,b=l.m_invI,e=j.m_invI;d=l.m_xf.R;var f=this.m_localAnchorA.x-l.m_sweep.localCenter.x,m=this.m_localAnchorA.y-l.m_sweep.localCenter.y;h=d.col1.x*f+d.col2.x*m;m=d.col1.y*f+d.col2.y*m;f=h;d= -j.m_xf.R;var r=this.m_localAnchorB.x-j.m_sweep.localCenter.x,s=this.m_localAnchorB.y-j.m_sweep.localCenter.y;h=d.col1.x*r+d.col2.x*s;s=d.col1.y*r+d.col2.y*s;r=h;d=n.x-a*s-o.x+q*m;h=n.y+a*r-o.y-q*f;var v=a-q,t=new A;this.m_mass.Solve33(t,-d,-h,-v);this.m_impulse.Add(t);o.x-=c*t.x;o.y-=c*t.y;q-=b*(f*t.y-m*t.x+t.z);n.x+=g*t.x;n.y+=g*t.y;a+=e*(r*t.y-s*t.x+t.z);l.m_angularVelocity=q;j.m_angularVelocity=a};aa.prototype.SolvePositionConstraints=function(){var d,h=0,l=this.m_bodyA,j=this.m_bodyB;d=l.m_xf.R; -var o=this.m_localAnchorA.x-l.m_sweep.localCenter.x,q=this.m_localAnchorA.y-l.m_sweep.localCenter.y;h=d.col1.x*o+d.col2.x*q;q=d.col1.y*o+d.col2.y*q;o=h;d=j.m_xf.R;var n=this.m_localAnchorB.x-j.m_sweep.localCenter.x,a=this.m_localAnchorB.y-j.m_sweep.localCenter.y;h=d.col1.x*n+d.col2.x*a;a=d.col1.y*n+d.col2.y*a;n=h;d=l.m_invMass;h=j.m_invMass;var c=l.m_invI,g=j.m_invI,b=j.m_sweep.c.x+n-l.m_sweep.c.x-o,e=j.m_sweep.c.y+a-l.m_sweep.c.y-q,f=j.m_sweep.a-l.m_sweep.a-this.m_referenceAngle,m=10*F.b2_linearSlop, -r=Math.sqrt(b*b+e*e),s=y.Abs(f);if(r>m){c*=1;g*=1}this.m_mass.col1.x=d+h+q*q*c+a*a*g;this.m_mass.col2.x=-q*o*c-a*n*g;this.m_mass.col3.x=-q*c-a*g;this.m_mass.col1.y=this.m_mass.col2.x;this.m_mass.col2.y=d+h+o*o*c+n*n*g;this.m_mass.col3.y=o*c+n*g;this.m_mass.col1.z=this.m_mass.col3.x;this.m_mass.col2.z=this.m_mass.col3.y;this.m_mass.col3.z=c+g;m=new A;this.m_mass.Solve33(m,-b,-e,-f);l.m_sweep.c.x-=d*m.x;l.m_sweep.c.y-=d*m.y;l.m_sweep.a-=c*(o*m.y-q*m.x+m.z);j.m_sweep.c.x+=h*m.x;j.m_sweep.c.y+=h*m.y; -j.m_sweep.a+=g*(n*m.y-a*m.x+m.z);l.SynchronizeTransform();j.SynchronizeTransform();return r<=F.b2_linearSlop&&s<=F.b2_angularSlop};Box2D.inherit(Z,Box2D.Dynamics.Joints.b2JointDef);Z.prototype.__super=Box2D.Dynamics.Joints.b2JointDef.prototype;Z.b2WeldJointDef=function(){Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this,arguments);this.localAnchorA=new w;this.localAnchorB=new w};Z.prototype.b2WeldJointDef=function(){this.__super.b2JointDef.call(this);this.type=I.e_weldJoint;this.referenceAngle= -0};Z.prototype.Initialize=function(d,h,l){this.bodyA=d;this.bodyB=h;this.localAnchorA.SetV(this.bodyA.GetLocalPoint(l));this.localAnchorB.SetV(this.bodyB.GetLocalPoint(l));this.referenceAngle=this.bodyB.GetAngle()-this.bodyA.GetAngle()}})(); -(function(){var F=Box2D.Dynamics.b2DebugDraw;F.b2DebugDraw=function(){this.m_xformScale=this.m_fillAlpha=this.m_alpha=this.m_lineThickness=this.m_drawScale=1;var G=this;this.m_sprite={graphics:{clear:function(){G.m_ctx.clearRect(0,0,G.m_ctx.canvas.width,G.m_ctx.canvas.height)}}}};F.prototype._color=function(G,K){return"rgba("+((G&16711680)>>16)+","+((G&65280)>>8)+","+(G&255)+","+K+")"};F.prototype.b2DebugDraw=function(){this.m_drawFlags=0};F.prototype.SetFlags=function(G){if(G===undefined)G=0;this.m_drawFlags= -G};F.prototype.GetFlags=function(){return this.m_drawFlags};F.prototype.AppendFlags=function(G){if(G===undefined)G=0;this.m_drawFlags|=G};F.prototype.ClearFlags=function(G){if(G===undefined)G=0;this.m_drawFlags&=~G};F.prototype.SetSprite=function(G){this.m_ctx=G};F.prototype.GetSprite=function(){return this.m_ctx};F.prototype.SetDrawScale=function(G){if(G===undefined)G=0;this.m_drawScale=G};F.prototype.GetDrawScale=function(){return this.m_drawScale};F.prototype.SetLineThickness=function(G){if(G=== -undefined)G=0;this.m_lineThickness=G;this.m_ctx.strokeWidth=G};F.prototype.GetLineThickness=function(){return this.m_lineThickness};F.prototype.SetAlpha=function(G){if(G===undefined)G=0;this.m_alpha=G};F.prototype.GetAlpha=function(){return this.m_alpha};F.prototype.SetFillAlpha=function(G){if(G===undefined)G=0;this.m_fillAlpha=G};F.prototype.GetFillAlpha=function(){return this.m_fillAlpha};F.prototype.SetXFormScale=function(G){if(G===undefined)G=0;this.m_xformScale=G};F.prototype.GetXFormScale=function(){return this.m_xformScale}; -F.prototype.DrawPolygon=function(G,K,y){if(K){var w=this.m_ctx,A=this.m_drawScale;w.beginPath();w.strokeStyle=this._color(y.color,this.m_alpha);w.moveTo(G[0].x*A,G[0].y*A);for(y=1;y>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},lerpSelf:function(a,b){this.r=this.r+(a.r-this.r)*b;this.g=this.g+(a.g-this.g)*b;this.b=this.b+(a.b-this.b)*b;return this},getHex:function(){return Math.floor(this.r*255)<<16^Math.floor(this.g*255)<<8^Math.floor(this.b*255)},getContextStyle:function(){return"rgb("+Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}}; -THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0}; -THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.x=a.x;this.y=a.y;return this},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addSelf:function(a){this.x=this.x+a.x;this.y=this.y+a.y;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},subSelf:function(a){this.x=this.x-a.x;this.y=this.y-a.y;return this},multiplyScalar:function(a){this.x=this.x*a;this.y=this.y*a;return this},divideScalar:function(a){if(a){this.x= -this.x/a;this.y=this.y/a}else this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,a=this.y-a.y;return b*b+a*a},setLength:function(a){return this.normalize().multiplyScalar(a)}, -lerpSelf:function(a,b){this.x=this.x+(a.x-this.x)*b;this.y=this.y+(a.y-this.y)*b;return this},equals:function(a){return a.x===this.x&&a.y===this.y},isZero:function(){return this.lengthSq()<1.0E-4},clone:function(){return new THREE.Vector2(this.x,this.y)}};THREE.Vector3=function(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0}; -THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this},addSelf:function(a){this.x=this.x+a.x;this.y=this.y+a.y;this.z=this.z+a.z;return this},addScalar:function(a){this.x=this.x+a;this.y=this.y+ -a;this.z=this.z+a;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;return this},subSelf:function(a){this.x=this.x-a.x;this.y=this.y-a.y;this.z=this.z-a.z;return this},multiply:function(a,b){this.x=a.x*b.x;this.y=a.y*b.y;this.z=a.z*b.z;return this},multiplySelf:function(a){this.x=this.x*a.x;this.y=this.y*a.y;this.z=this.z*a.z;return this},multiplyScalar:function(a){this.x=this.x*a;this.y=this.y*a;this.z=this.z*a;return this},divideSelf:function(a){this.x=this.x/a.x;this.y= -this.y/a.y;this.z=this.z/a.z;return this},divideScalar:function(a){if(a){this.x=this.x/a;this.y=this.y/a;this.z=this.z/a}else this.z=this.y=this.x=0;return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.lengthSq())},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())}, -setLength:function(a){return this.normalize().multiplyScalar(a)},lerpSelf:function(a,b){this.x=this.x+(a.x-this.x)*b;this.y=this.y+(a.y-this.y)*b;this.z=this.z+(a.z-this.z)*b;return this},cross:function(a,b){this.x=a.y*b.z-a.z*b.y;this.y=a.z*b.x-a.x*b.z;this.z=a.x*b.y-a.y*b.x;return this},crossSelf:function(a){var b=this.x,c=this.y,d=this.z;this.x=c*a.z-d*a.y;this.y=d*a.x-b*a.z;this.z=b*a.y-c*a.x;return this},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){return(new THREE.Vector3).sub(this, -a).lengthSq()},getPositionFromMatrix:function(a){this.x=a.elements[12];this.y=a.elements[13];this.z=a.elements[14];return this},getRotationFromMatrix:function(a,b){var c=b?b.x:1,d=b?b.y:1,e=b?b.z:1,f=a.elements[0]/c,g=a.elements[4]/d,c=a.elements[1]/c,d=a.elements[5]/d,h=a.elements[9]/e,j=a.elements[10]/e;this.y=Math.asin(a.elements[8]/e);e=Math.cos(this.y);if(Math.abs(e)>1.0E-5){this.x=Math.atan2(-h/e,j/e);this.z=Math.atan2(-g/e,f/e)}else{this.x=0;this.z=Math.atan2(c,d)}return this},getScaleFromMatrix:function(a){var b= -this.set(a.elements[0],a.elements[1],a.elements[2]).length(),c=this.set(a.elements[4],a.elements[5],a.elements[6]).length(),a=this.set(a.elements[8],a.elements[9],a.elements[10]).length();this.x=b;this.y=c;this.z=a},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},isZero:function(){return this.lengthSq()<1.0E-4},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}};THREE.Vector4=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=d!==void 0?d:1}; -THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w!==void 0?a.w:1;return this},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;this.w=a.w+b.w;return this},addSelf:function(a){this.x=this.x+a.x;this.y=this.y+a.y;this.z=this.z+a.z;this.w=this.w+a.w;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;this.w=a.w-b.w;return this},subSelf:function(a){this.x= -this.x-a.x;this.y=this.y-a.y;this.z=this.z-a.z;this.w=this.w-a.w;return this},multiplyScalar:function(a){this.x=this.x*a;this.y=this.y*a;this.z=this.z*a;this.w=this.w*a;return this},divideScalar:function(a){if(a){this.x=this.x/a;this.y=this.y/a;this.z=this.z/a;this.w=this.w/a}else{this.z=this.y=this.x=0;this.w=1}return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.dot(this)},length:function(){return Math.sqrt(this.lengthSq())}, -normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.normalize().multiplyScalar(a)},lerpSelf:function(a,b){this.x=this.x+(a.x-this.x)*b;this.y=this.y+(a.y-this.y)*b;this.z=this.z+(a.z-this.z)*b;this.w=this.w+(a.w-this.w)*b;return this},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)}};THREE.Frustum=function(){this.planes=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4]}; -THREE.Frustum.prototype.setFromMatrix=function(a){var b,c=this.planes,d=a.elements,a=d[0];b=d[1];var e=d[2],f=d[3],g=d[4],h=d[5],j=d[6],l=d[7],k=d[8],p=d[9],m=d[10],o=d[11],q=d[12],n=d[13],r=d[14],d=d[15];c[0].set(f-a,l-g,o-k,d-q);c[1].set(f+a,l+g,o+k,d+q);c[2].set(f+b,l+h,o+p,d+n);c[3].set(f-b,l-h,o-p,d-n);c[4].set(f-e,l-j,o-m,d-r);c[5].set(f+e,l+j,o+m,d+r);for(a=0;a<6;a++){b=c[a];b.divideScalar(Math.sqrt(b.x*b.x+b.y*b.y+b.z*b.z))}}; -THREE.Frustum.prototype.contains=function(a){for(var b=this.planes,c=a.matrixWorld,d=c.elements,c=-a.geometry.boundingSphere.radius*c.getMaxScaleOnAxis(),e=0;e<6;e++){a=b[e].x*d[12]+b[e].y*d[13]+b[e].z*d[14]+b[e].w;if(a<=c)return false}return true};THREE.Frustum.__v1=new THREE.Vector3; -THREE.Ray=function(a,b){function c(a,b,c){q.sub(c,a);u=q.dot(b);t=n.add(a,r.copy(b).multiplyScalar(u));return y=c.distanceTo(t)}function d(a,b,c,d){q.sub(d,b);n.sub(c,b);r.sub(a,b);s=q.dot(q);w=q.dot(n);H=q.dot(r);E=n.dot(n);z=n.dot(r);v=1/(s*E-w*w);A=(E*H-w*z)*v;J=(s*z-w*H)*v;return A>=0&&J>=0&&A+J<1}this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3;var e=1.0E-4;this.setPrecision=function(a){e=a};var f=new THREE.Vector3,g=new THREE.Vector3,h=new THREE.Vector3,j=new THREE.Vector3, -l=new THREE.Vector3,k=new THREE.Vector3,p=new THREE.Vector3,m=new THREE.Vector3,o=new THREE.Vector3;this.intersectObject=function(a){var b,n=[];if(a instanceof THREE.Particle){var q=c(this.origin,this.direction,a.matrixWorld.getPosition());if(q>a.scale.x)return[];b={distance:q,point:a.position,face:null,object:a};n.push(b)}else if(a instanceof THREE.Mesh){var q=c(this.origin,this.direction,a.matrixWorld.getPosition()),r=THREE.Frustum.__v1.set(a.matrixWorld.getColumnX().length(),a.matrixWorld.getColumnY().length(), -a.matrixWorld.getColumnZ().length());if(q>a.geometry.boundingSphere.radius*Math.max(r.x,Math.max(r.y,r.z)))return n;var s,i,t=a.geometry,u=t.vertices,C;a.matrixRotationWorld.extractRotation(a.matrixWorld);q=0;for(r=t.faces.length;q0:s<0))){o.add(l,k.multiplyScalar(i));if(b instanceof THREE.Face3){f=C.multiplyVector3(f.copy(u[b.a]));g=C.multiplyVector3(g.copy(u[b.b]));h=C.multiplyVector3(h.copy(u[b.c]));if(d(o,f,g,h)){b={distance:l.distanceTo(o),point:o.clone(),face:b,object:a};n.push(b)}}else if(b instanceof THREE.Face4){f=C.multiplyVector3(f.copy(u[b.a]));g=C.multiplyVector3(g.copy(u[b.b]));h=C.multiplyVector3(h.copy(u[b.c]));j=C.multiplyVector3(j.copy(u[b.d]));if(d(o,f,g,j)||d(o,g,h,j)){b={distance:l.distanceTo(o),point:o.clone(), -face:b,object:a};n.push(b)}}}}}}return n};this.intersectObjects=function(a){for(var b=[],c=0,d=a.length;cf?d:f;e=e>g? -e:g}a()};this.add3Points=function(f,g,k,p,m,o){if(h){h=false;b=fk?f>m?f:m:k>m?k:m;e=g>p?g>o?g:o:p>o?p:o}else{b=fk?f>m?f>d?f:d:m>d?m:d:k>m?k>d?k:d:m>d?m:d;e=g>p?g>o?g>e?g:e:o>e?o:e:p>o?p>e?p:e:o>e?o:e}a()};this.addRectangle=function(f){if(h){h=false;b=f.getLeft();c=f.getTop();d=f.getRight();e=f.getBottom()}else{b=bf.getRight()?d:f.getRight();e=e>f.getBottom()?e:f.getBottom()}a()};this.inflate=function(f){b=b-f;c=c-f;d=d+f;e=e+f;a()};this.minSelf=function(f){b=b>f.getLeft()?b:f.getLeft();c=c>f.getTop()?c:f.getTop();d=da.getRight()||ea.getBottom()?false:true};this.empty=function(){h=true;e=d=c=b=0;a()};this.isEmpty=function(){return h}}; -THREE.Math={clamp:function(a,b,c){return ac?c:a},clampBottom:function(a,b){return a0?1:0}};THREE.Matrix3=function(){this.elements=new Float32Array(9)}; -THREE.Matrix3.prototype={constructor:THREE.Matrix3,getInverse:function(a){var b=a.elements,a=b[10]*b[5]-b[6]*b[9],c=-b[10]*b[1]+b[2]*b[9],d=b[6]*b[1]-b[2]*b[5],e=-b[10]*b[4]+b[6]*b[8],f=b[10]*b[0]-b[2]*b[8],g=-b[6]*b[0]+b[2]*b[4],h=b[9]*b[4]-b[5]*b[8],j=-b[9]*b[0]+b[1]*b[8],l=b[5]*b[0]-b[1]*b[4],b=b[0]*a+b[1]*e+b[2]*h;b===0&&console.warn("Matrix3.getInverse(): determinant == 0");var b=1/b,k=this.elements;k[0]=b*a;k[1]=b*c;k[2]=b*d;k[3]=b*e;k[4]=b*f;k[5]=b*g;k[6]=b*h;k[7]=b*j;k[8]=b*l;return this}, -transpose:function(){var a,b=this.elements;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},transposeIntoArray:function(a){var b=this.m;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this}};THREE.Matrix4=function(a,b,c,d,e,f,g,h,j,l,k,p,m,o,q,n){this.elements=new Float32Array(16);this.set(a!==void 0?a:1,b||0,c||0,d||0,e||0,f!==void 0?f:1,g||0,h||0,j||0,l||0,k!==void 0?k:1,p||0,m||0,o||0,q||0,n!==void 0?n:1)}; -THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,f,g,h,j,l,k,p,m,o,q,n){var r=this.elements;r[0]=a;r[4]=b;r[8]=c;r[12]=d;r[1]=e;r[5]=f;r[9]=g;r[13]=h;r[2]=j;r[6]=l;r[10]=k;r[14]=p;r[3]=m;r[7]=o;r[11]=q;r[15]=n;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){a=a.elements;this.set(a[0],a[4],a[8],a[12],a[1],a[5],a[9],a[13],a[2],a[6],a[10],a[14],a[3],a[7],a[11],a[15]);return this},lookAt:function(a,b,c){var d=this.elements, -e=THREE.Matrix4.__v1,f=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;g.sub(a,b).normalize();if(g.length()===0)g.z=1;e.cross(c,g).normalize();if(e.length()===0){g.x=g.x+1.0E-4;e.cross(c,g).normalize()}f.cross(g,e);d[0]=e.x;d[4]=f.x;d[8]=g.x;d[1]=e.y;d[5]=f.y;d[9]=g.y;d[2]=e.z;d[6]=f.z;d[10]=g.z;return this},multiply:function(a,b){var c=a.elements,d=b.elements,e=this.elements,f=c[0],g=c[4],h=c[8],j=c[12],l=c[1],k=c[5],p=c[9],m=c[13],o=c[2],q=c[6],n=c[10],r=c[14],u=c[3],t=c[7],y=c[11],c=c[15],s=d[0],w=d[4], -H=d[8],E=d[12],z=d[1],v=d[5],A=d[9],J=d[13],K=d[2],R=d[6],P=d[10],D=d[14],M=d[3],G=d[7],i=d[11],d=d[15];e[0]=f*s+g*z+h*K+j*M;e[4]=f*w+g*v+h*R+j*G;e[8]=f*H+g*A+h*P+j*i;e[12]=f*E+g*J+h*D+j*d;e[1]=l*s+k*z+p*K+m*M;e[5]=l*w+k*v+p*R+m*G;e[9]=l*H+k*A+p*P+m*i;e[13]=l*E+k*J+p*D+m*d;e[2]=o*s+q*z+n*K+r*M;e[6]=o*w+q*v+n*R+r*G;e[10]=o*H+q*A+n*P+r*i;e[14]=o*E+q*J+n*D+r*d;e[3]=u*s+t*z+y*K+c*M;e[7]=u*w+t*v+y*R+c*G;e[11]=u*H+t*A+y*P+c*i;e[15]=u*E+t*J+y*D+c*d;return this},multiplySelf:function(a){return this.multiply(this, -a)},multiplyToArray:function(a,b,c){var d=this.elements;this.multiply(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]=b[0]*a;b[4]=b[4]*a;b[8]=b[8]*a;b[12]=b[12]*a;b[1]=b[1]*a;b[5]=b[5]*a;b[9]=b[9]*a;b[13]=b[13]*a;b[2]=b[2]*a;b[6]=b[6]*a;b[10]=b[10]*a;b[14]=b[14]*a;b[3]=b[3]*a;b[7]=b[7]*a;b[11]=b[11]*a;b[15]= -b[15]*a;return this},multiplyVector3:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=1/(b[3]*c+b[7]*d+b[11]*e+b[15]);a.x=(b[0]*c+b[4]*d+b[8]*e+b[12])*f;a.y=(b[1]*c+b[5]*d+b[9]*e+b[13])*f;a.z=(b[2]*c+b[6]*d+b[10]*e+b[14])*f;return a},multiplyVector4:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w;a.x=b[0]*c+b[4]*d+b[8]*e+b[12]*f;a.y=b[1]*c+b[5]*d+b[9]*e+b[13]*f;a.z=b[2]*c+b[6]*d+b[10]*e+b[14]*f;a.w=b[3]*c+b[7]*d+b[11]*e+b[15]*f;return a},rotateAxis:function(a){var b=this.elements,c=a.x, -d=a.y,e=a.z;a.x=c*b[0]+d*b[4]+e*b[8];a.y=c*b[1]+d*b[5]+e*b[9];a.z=c*b[2]+d*b[6]+e*b[10];a.normalize();return a},crossVector:function(a){var b=this.elements,c=new THREE.Vector4;c.x=b[0]*a.x+b[4]*a.y+b[8]*a.z+b[12]*a.w;c.y=b[1]*a.x+b[5]*a.y+b[9]*a.z+b[13]*a.w;c.z=b[2]*a.x+b[6]*a.y+b[10]*a.z+b[14]*a.w;c.w=a.w?b[3]*a.x+b[7]*a.y+b[11]*a.z+b[15]*a.w:1;return c},determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],f=a[1],g=a[5],h=a[9],j=a[13],l=a[2],k=a[6],p=a[10],m=a[14],o=a[3],q=a[7], -n=a[11],a=a[15];return e*h*k*o-d*j*k*o-e*g*p*o+c*j*p*o+d*g*m*o-c*h*m*o-e*h*l*q+d*j*l*q+e*f*p*q-b*j*p*q-d*f*m*q+b*h*m*q+e*g*l*n-c*j*l*n-e*f*k*n+b*j*k*n+c*f*m*n-b*g*m*n-d*g*l*a+c*h*l*a+d*f*k*a-b*h*k*a-c*f*p*a+b*g*p*a},transpose:function(){var a=this.elements,b;b=a[1];a[1]=a[4];a[4]=b;b=a[2];a[2]=a[8];a[8]=b;b=a[6];a[6]=a[9];a[9]=b;b=a[3];a[3]=a[12];a[12]=b;b=a[7];a[7]=a[13];a[13]=b;b=a[11];a[11]=a[14];a[14]=b;return this},flattenToArray:function(a){var b=this.elements;a[0]=b[0];a[1]=b[1];a[2]=b[2]; -a[3]=b[3];a[4]=b[4];a[5]=b[5];a[6]=b[6];a[7]=b[7];a[8]=b[8];a[9]=b[9];a[10]=b[10];a[11]=b[11];a[12]=b[12];a[13]=b[13];a[14]=b[14];a[15]=b[15];return a},flattenToArrayOffset:function(a,b){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a},getPosition:function(){var a=this.elements;return THREE.Matrix4.__v1.set(a[12],a[13], -a[14])},setPosition:function(a){var b=this.elements;b[12]=a.x;b[13]=a.y;b[14]=a.z;return this},getColumnX:function(){var a=this.elements;return THREE.Matrix4.__v1.set(a[0],a[1],a[2])},getColumnY:function(){var a=this.elements;return THREE.Matrix4.__v1.set(a[4],a[5],a[6])},getColumnZ:function(){var a=this.elements;return THREE.Matrix4.__v1.set(a[8],a[9],a[10])},getInverse:function(a){var b=this.elements,c=a.elements,d=c[0],e=c[4],f=c[8],g=c[12],h=c[1],j=c[5],l=c[9],k=c[13],p=c[2],m=c[6],o=c[10],q= -c[14],n=c[3],r=c[7],u=c[11],c=c[15];b[0]=l*q*r-k*o*r+k*m*u-j*q*u-l*m*c+j*o*c;b[4]=g*o*r-f*q*r-g*m*u+e*q*u+f*m*c-e*o*c;b[8]=f*k*r-g*l*r+g*j*u-e*k*u-f*j*c+e*l*c;b[12]=g*l*m-f*k*m-g*j*o+e*k*o+f*j*q-e*l*q;b[1]=k*o*n-l*q*n-k*p*u+h*q*u+l*p*c-h*o*c;b[5]=f*q*n-g*o*n+g*p*u-d*q*u-f*p*c+d*o*c;b[9]=g*l*n-f*k*n-g*h*u+d*k*u+f*h*c-d*l*c;b[13]=f*k*p-g*l*p+g*h*o-d*k*o-f*h*q+d*l*q;b[2]=j*q*n-k*m*n+k*p*r-h*q*r-j*p*c+h*m*c;b[6]=g*m*n-e*q*n-g*p*r+d*q*r+e*p*c-d*m*c;b[10]=e*k*n-g*j*n+g*h*r-d*k*r-e*h*c+d*j*c;b[14]=g*j*p- -e*k*p-g*h*m+d*k*m+e*h*q-d*j*q;b[3]=l*m*n-j*o*n-l*p*r+h*o*r+j*p*u-h*m*u;b[7]=e*o*n-f*m*n+f*p*r-d*o*r-e*p*u+d*m*u;b[11]=f*j*n-e*l*n-f*h*r+d*l*r+e*h*u-d*j*u;b[15]=e*l*p-f*j*p+f*h*m-d*l*m-e*h*o+d*j*o;this.multiplyScalar(1/a.determinant());return this},setRotationFromEuler:function(a,b){var c=this.elements,d=a.x,e=a.y,f=a.z,g=Math.cos(d),d=Math.sin(d),h=Math.cos(e),e=Math.sin(e),j=Math.cos(f),f=Math.sin(f);switch(b){case "YXZ":var l=h*j,k=h*f,p=e*j,m=e*f;c[0]=l+m*d;c[4]=p*d-k;c[8]=g*e;c[1]=g*f;c[5]=g* -j;c[9]=-d;c[2]=k*d-p;c[6]=m+l*d;c[10]=g*h;break;case "ZXY":l=h*j;k=h*f;p=e*j;m=e*f;c[0]=l-m*d;c[4]=-g*f;c[8]=p+k*d;c[1]=k+p*d;c[5]=g*j;c[9]=m-l*d;c[2]=-g*e;c[6]=d;c[10]=g*h;break;case "ZYX":l=g*j;k=g*f;p=d*j;m=d*f;c[0]=h*j;c[4]=p*e-k;c[8]=l*e+m;c[1]=h*f;c[5]=m*e+l;c[9]=k*e-p;c[2]=-e;c[6]=d*h;c[10]=g*h;break;case "YZX":l=g*h;k=g*e;p=d*h;m=d*e;c[0]=h*j;c[4]=m-l*f;c[8]=p*f+k;c[1]=f;c[5]=g*j;c[9]=-d*j;c[2]=-e*j;c[6]=k*f+p;c[10]=l-m*f;break;case "XZY":l=g*h;k=g*e;p=d*h;m=d*e;c[0]=h*j;c[4]=-f;c[8]=e*j; -c[1]=l*f+m;c[5]=g*j;c[9]=k*f-p;c[2]=p*f-k;c[6]=d*j;c[10]=m*f+l;break;default:l=g*j;k=g*f;p=d*j;m=d*f;c[0]=h*j;c[4]=-h*f;c[8]=e;c[1]=k+p*e;c[5]=l-m*e;c[9]=-d*h;c[2]=m-l*e;c[6]=p+k*e;c[10]=g*h}return this},setRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w,g=c+c,h=d+d,j=e+e,a=c*g,l=c*h,c=c*j,k=d*h,d=d*j,e=e*j,g=f*g,h=f*h,f=f*j;b[0]=1-(k+e);b[4]=l-f;b[8]=c+h;b[1]=l+f;b[5]=1-(a+e);b[9]=d-g;b[2]=c-h;b[6]=d+g;b[10]=1-(a+k);return this},compose:function(a,b,c){var d=this.elements, -e=THREE.Matrix4.__m1,f=THREE.Matrix4.__m2;e.identity();e.setRotationFromQuaternion(b);f.makeScale(c.x,c.y,c.z);this.multiply(e,f);d[12]=a.x;d[13]=a.y;d[14]=a.z;return this},decompose:function(a,b,c){var d=this.elements,e=THREE.Matrix4.__v1,f=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;e.set(d[0],d[1],d[2]);f.set(d[4],d[5],d[6]);g.set(d[8],d[9],d[10]);a=a instanceof THREE.Vector3?a:new THREE.Vector3;b=b instanceof THREE.Quaternion?b:new THREE.Quaternion;c=c instanceof THREE.Vector3?c:new THREE.Vector3; -c.x=e.length();c.y=f.length();c.z=g.length();a.x=d[12];a.y=d[13];a.z=d[14];d=THREE.Matrix4.__m1;d.copy(this);d.elements[0]=d.elements[0]/c.x;d.elements[1]=d.elements[1]/c.x;d.elements[2]=d.elements[2]/c.x;d.elements[4]=d.elements[4]/c.y;d.elements[5]=d.elements[5]/c.y;d.elements[6]=d.elements[6]/c.y;d.elements[8]=d.elements[8]/c.z;d.elements[9]=d.elements[9]/c.z;d.elements[10]=d.elements[10]/c.z;b.setFromRotationMatrix(d);return[a,b,c]},extractPosition:function(a){var b=this.elements,a=a.elements; -b[12]=a[12];b[13]=a[13];b[14]=a[14];return this},extractRotation:function(a){var b=this.elements,a=a.elements,c=THREE.Matrix4.__v1,d=1/c.set(a[0],a[1],a[2]).length(),e=1/c.set(a[4],a[5],a[6]).length(),c=1/c.set(a[8],a[9],a[10]).length();b[0]=a[0]*d;b[1]=a[1]*d;b[2]=a[2]*d;b[4]=a[4]*e;b[5]=a[5]*e;b[6]=a[6]*e;b[8]=a[8]*c;b[9]=a[9]*c;b[10]=a[10]*c;return this},translate:function(a){var b=this.elements,c=a.x,d=a.y,a=a.z;b[12]=b[0]*c+b[4]*d+b[8]*a+b[12];b[13]=b[1]*c+b[5]*d+b[9]*a+b[13];b[14]=b[2]*c+b[6]* -d+b[10]*a+b[14];b[15]=b[3]*c+b[7]*d+b[11]*a+b[15];return this},rotateX:function(a){var b=this.elements,c=b[4],d=b[5],e=b[6],f=b[7],g=b[8],h=b[9],j=b[10],l=b[11],k=Math.cos(a),a=Math.sin(a);b[4]=k*c+a*g;b[5]=k*d+a*h;b[6]=k*e+a*j;b[7]=k*f+a*l;b[8]=k*g-a*c;b[9]=k*h-a*d;b[10]=k*j-a*e;b[11]=k*l-a*f;return this},rotateY:function(a){var b=this.elements,c=b[0],d=b[1],e=b[2],f=b[3],g=b[8],h=b[9],j=b[10],l=b[11],k=Math.cos(a),a=Math.sin(a);b[0]=k*c-a*g;b[1]=k*d-a*h;b[2]=k*e-a*j;b[3]=k*f-a*l;b[8]=k*g+a*c;b[9]= -k*h+a*d;b[10]=k*j+a*e;b[11]=k*l+a*f;return this},rotateZ:function(a){var b=this.elements,c=b[0],d=b[1],e=b[2],f=b[3],g=b[4],h=b[5],j=b[6],l=b[7],k=Math.cos(a),a=Math.sin(a);b[0]=k*c+a*g;b[1]=k*d+a*h;b[2]=k*e+a*j;b[3]=k*f+a*l;b[4]=k*g-a*c;b[5]=k*h-a*d;b[6]=k*j-a*e;b[7]=k*l-a*f;return this},rotateByAxis:function(a,b){var c=this.elements;if(a.x===1&&a.y===0&&a.z===0)return this.rotateX(b);if(a.x===0&&a.y===1&&a.z===0)return this.rotateY(b);if(a.x===0&&a.y===0&&a.z===1)return this.rotateZ(b);var d=a.x, -e=a.y,f=a.z,g=Math.sqrt(d*d+e*e+f*f),d=d/g,e=e/g,f=f/g,g=d*d,h=e*e,j=f*f,l=Math.cos(b),k=Math.sin(b),p=1-l,m=d*e*p,o=d*f*p,p=e*f*p,d=d*k,q=e*k,k=f*k,f=g+(1-g)*l,g=m+k,e=o-q,m=m-k,h=h+(1-h)*l,k=p+d,o=o+q,p=p-d,j=j+(1-j)*l,l=c[0],d=c[1],q=c[2],n=c[3],r=c[4],u=c[5],t=c[6],y=c[7],s=c[8],w=c[9],H=c[10],E=c[11];c[0]=f*l+g*r+e*s;c[1]=f*d+g*u+e*w;c[2]=f*q+g*t+e*H;c[3]=f*n+g*y+e*E;c[4]=m*l+h*r+k*s;c[5]=m*d+h*u+k*w;c[6]=m*q+h*t+k*H;c[7]=m*n+h*y+k*E;c[8]=o*l+p*r+j*s;c[9]=o*d+p*u+j*w;c[10]=o*q+p*t+j*H;c[11]= -o*n+p*y+j*E;return this},scale:function(a){var b=this.elements,c=a.x,d=a.y,a=a.z;b[0]=b[0]*c;b[4]=b[4]*d;b[8]=b[8]*a;b[1]=b[1]*c;b[5]=b[5]*d;b[9]=b[9]*a;b[2]=b[2]*c;b[6]=b[6]*d;b[10]=b[10]*a;b[3]=b[3]*c;b[7]=b[7]*d;b[11]=b[11]*a;return this},getMaxScaleOnAxis:function(){var a=this.elements;return Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1]+a[2]*a[2],Math.max(a[4]*a[4]+a[5]*a[5]+a[6]*a[6],a[8]*a[8]+a[9]*a[9]+a[10]*a[10])))},makeTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this}, -makeRotationX:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},makeRotationY:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},makeRotationZ:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,0,0,1,0,0,0,0,1);return this},makeRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,f=a.x,g=a.y,h=a.z,j=e*f,l=e*g;this.set(j*f+c,j*g-d*h,j*h+d*g,0,j*g+d*h,l*g+c,l*h-d*f,0,j*h- -d*g,l*h+d*f,e*h*h+c,0,0,0,0,1);return this},makeScale:function(a,b,c){this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},makeFrustum:function(a,b,c,d,e,f){var g=this.elements;g[0]=2*e/(b-a);g[4]=0;g[8]=(b+a)/(b-a);g[12]=0;g[1]=0;g[5]=2*e/(d-c);g[9]=(d+c)/(d-c);g[13]=0;g[2]=0;g[6]=0;g[10]=-(f+e)/(f-e);g[14]=-2*f*e/(f-e);g[3]=0;g[7]=0;g[11]=-1;g[15]=0;return this},makePerspective:function(a,b,c,d){var a=c*Math.tan(a*Math.PI/360),e=-a;return this.makeFrustum(e*b,a*b,e,a,c,d)},makeOrthographic:function(a, -b,c,d,e,f){var g=this.elements,h=b-a,j=c-d,l=f-e;g[0]=2/h;g[4]=0;g[8]=0;g[12]=-((b+a)/h);g[1]=0;g[5]=2/j;g[9]=0;g[13]=-((c+d)/j);g[2]=0;g[6]=0;g[10]=-2/l;g[14]=-((f+e)/l);g[3]=0;g[7]=0;g[11]=0;g[15]=1;return this},clone:function(){var a=this.elements;return new THREE.Matrix4(a[0],a[4],a[8],a[12],a[1],a[5],a[9],a[13],a[2],a[6],a[10],a[14],a[3],a[7],a[11],a[15])}};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4; -THREE.Matrix4.__m2=new THREE.Matrix4; -THREE.Object3D=function(){this.id=THREE.Object3DCount++;this.name="";this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=false;this.renderDepth=null;this.rotationAutoUpdate=true;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate= -true;this.quaternion=new THREE.Quaternion;this.useQuaternion=false;this.boundRadius=0;this.boundRadiusScale=1;this.visible=true;this.receiveShadow=this.castShadow=false;this.frustumCulled=true;this._vector=new THREE.Vector3}; -THREE.Object3D.prototype={constructor:THREE.Object3D,applyMatrix:function(a){this.matrix.multiply(a,this.matrix);this.scale.getScaleFromMatrix(this.matrix);this.rotation.getRotationFromMatrix(this.matrix,this.scale);this.position.getPositionFromMatrix(this.matrix)},translate:function(a,b){this.matrix.rotateAxis(b);this.position.addSelf(b.multiplyScalar(a))},translateX:function(a){this.translate(a,this._vector.set(1,0,0))},translateY:function(a){this.translate(a,this._vector.set(0,1,0))},translateZ:function(a){this.translate(a, -this._vector.set(0,0,1))},lookAt:function(a){this.matrix.lookAt(a,this.position,this.up);this.rotationAutoUpdate&&this.rotation.getRotationFromMatrix(this.matrix)},add:function(a){if(a===this)console.warn("THREE.Object3D.add: An object can't be added as a child of itself.");else if(a instanceof THREE.Object3D){a.parent!==void 0&&a.parent.remove(a);a.parent=this;this.children.push(a);for(var b=this;b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.__addObject(a)}},remove:function(a){var b= -this.children.indexOf(a);if(b!==-1){a.parent=void 0;this.children.splice(b,1);for(b=this;b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.__removeObject(a)}},getChildByName:function(a,b){var c,d,e;c=0;for(d=this.children.length;c=0&&f>=0&&g>=0&&h>=0)return true;if(e<0&&f<0||g<0&&h<0)return false;e<0?c=Math.max(c,e/(e-f)):f<0&&(d=Math.min(d,e/(e-f)));g<0?c=Math.max(c,g/(g-h)):h<0&&(d=Math.min(d,g/(g-h)));if(dg&&h.positionScreen.z0)){ea=l[j-2];J.copy(F.positionScreen);K.copy(ea.positionScreen);if(d(J,K)){J.multiplyScalar(1/J.w);K.multiplyScalar(1/K.w);$=u[r]=u[r]||new THREE.RenderableLine;r++;n=$;n.v1.positionScreen.copy(J); -n.v2.positionScreen.copy(K);n.z=Math.max(J.z,K.z);n.material=O.material;w.elements.push(n)}}}}}a=0;for(H=w.sprites.length;a0&&E.z<1){g=s[y]=s[y]||new THREE.RenderableParticle;y++;t=g;t.x=E.x/E.w;t.y=E.y/E.w;t.z=E.z;t.rotation=O.rotation.z;t.scale.x=O.scale.x*Math.abs(t.x-(E.x+e.projectionMatrix.elements[0])/(E.w+e.projectionMatrix.elements[12])); -t.scale.y=O.scale.y*Math.abs(t.y-(E.y+e.projectionMatrix.elements[5])/(E.w+e.projectionMatrix.elements[13]));t.material=O.material;w.elements.push(t)}}}f&&w.elements.sort(c);return w}};THREE.Quaternion=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=d!==void 0?d:1}; -THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},setFromEuler:function(a){var b=Math.PI/360,c=a.x*b,d=a.y*b,e=a.z*b,a=Math.cos(d),d=Math.sin(d),b=Math.cos(-e),e=Math.sin(-e),f=Math.cos(c),c=Math.sin(c),g=a*b,h=d*e;this.w=g*f-h*c;this.x=g*c+h*f;this.y=d*b*f+a*e*c;this.z=a*e*f-d*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c); -this.x=a.x*d;this.y=a.y*d;this.z=a.z*d;this.w=Math.cos(c);return this},setFromRotationMatrix:function(a){var b=Math.pow(a.determinant(),1/3);this.w=Math.sqrt(Math.max(0,b+a.elements[0]+a.elements[5]+a.elements[10]))/2;this.x=Math.sqrt(Math.max(0,b+a.elements[0]-a.elements[5]-a.elements[10]))/2;this.y=Math.sqrt(Math.max(0,b-a.elements[0]+a.elements[5]-a.elements[10]))/2;this.z=Math.sqrt(Math.max(0,b-a.elements[0]-a.elements[5]+a.elements[10]))/2;this.x=a.elements[6]-a.elements[9]<0?-Math.abs(this.x): -Math.abs(this.x);this.y=a.elements[8]-a.elements[2]<0?-Math.abs(this.y):Math.abs(this.y);this.z=a.elements[1]-a.elements[4]<0?-Math.abs(this.z):Math.abs(this.z);this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x=this.x*-1;this.y=this.y*-1;this.z=this.z*-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a= -Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);if(a===0)this.w=this.z=this.y=this.x=0;else{a=1/a;this.x=this.x*a;this.y=this.y*a;this.z=this.z*a;this.w=this.w*a}return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,f=a.x,g=a.y,h=a.z,a=a.w;this.x=b*a+e*f+c*h-d*g;this.y= -c*a+e*g+d*f-b*h;this.z=d*a+e*h+b*g-c*f;this.w=e*a-b*f-c*g-d*h;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,e=a.z,f=this.x,g=this.y,h=this.z,j=this.w,l=j*c+g*e-h*d,k=j*d+h*c-f*e,p=j*e+f*d-g*c,c=-f*c-g*d-h*e;b.x=l*j+c*-f+k*-h-p*-g;b.y=k*j+c*-g+p*-f-l*-h;b.z=p*j+c*-h+l*-g-k*-f;return b},clone:function(){return new THREE.Quaternion(this.x,this.y,this.z,this.w)}}; -THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(e<0){c.w=-b.w;c.x=-b.x;c.y=-b.y;c.z=-b.z;e=-e}else c.copy(b);if(Math.abs(e)>=1){c.w=a.w;c.x=a.x;c.y=a.y;c.z=a.z;return c}var f=Math.acos(e),e=Math.sqrt(1-e*e);if(Math.abs(e)<0.001){c.w=0.5*(a.w+b.w);c.x=0.5*(a.x+b.x);c.y=0.5*(a.y+b.y);c.z=0.5*(a.z+b.z);return c}b=Math.sin((1-d)*f)/e;d=Math.sin(d*f)/e;c.w=a.w*b+c.w*d;c.x=a.x*b+c.x*d;c.y=a.y*b+c.y*d;c.z=a.z*b+c.z*d;return c};THREE.Vertex=function(){console.warn("THREE.Vertex has been DEPRECATED. Use THREE.Vector3 instead.")}; -THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=f;this.centroid=new THREE.Vector3}; -THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);a.centroid.copy(this.centroid);a.materialIndex=this.materialIndex;var b,c;b=0;for(c=this.vertexNormals.length;b0){var a;a=this.vertices[0];this.boundingBox.min.copy(a);this.boundingBox.max.copy(a);for(var b=this.boundingBox.min,c=this.boundingBox.max,d=1,e=this.vertices.length;dc.x)c.x= -a.x;if(a.yc.y)c.y=a.y;if(a.zc.z)c.z=a.z}}else{this.boundingBox.min.set(0,0,0);this.boundingBox.max.set(0,0,0)}},computeBoundingSphere:function(){if(!this.boundingSphere)this.boundingSphere={radius:0};for(var a,b=0,c=0,d=this.vertices.length;cb&&(b=a)}this.boundingSphere.radius=b},mergeVertices:function(){var a={},b=[],c=[],d,e=Math.pow(10,4),f,g,h;f=0;for(g=this.vertices.length;f0;a--)if(d.indexOf(e["abcd"[a]])!=a){d.splice(a,1);this.faces[f]=new THREE.Face3(d[0],d[1],d[2]);e=0;for(d=this.faceVertexUvs.length;ethis.points.length-2?this.points.length-1:f+1;c[3]=f>this.points.length-3?this.points.length-1: -f+2;l=this.points[c[0]];k=this.points[c[1]];p=this.points[c[2]];m=this.points[c[3]];h=g*g;j=g*h;d.x=b(l.x,k.x,p.x,m.x,g,h,j);d.y=b(l.y,k.y,p.y,m.y,g,h,j);d.z=b(l.z,k.z,p.z,m.z,g,h,j);return d};this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a1&&(K=new THREE.MeshFaceMaterial); -a=new THREE.Mesh(J,K);a.name=m;if(t){a.matrixAutoUpdate=false;a.matrix.set(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}else{a.position.set(w[0],w[1],w[2]);if(E){a.quaternion.set(E[0],E[1],E[2],E[3]);a.useQuaternion=true}else a.rotation.set(H[0],H[1],H[2]);a.scale.set(z[0],z[1],z[2])}a.visible=u.visible;a.doubleSided=u.doubleSided;a.castShadow=u.castShadow;a.receiveShadow=u.receiveShadow;C.scene.add(a);C.objects[m]=a}}else{w=u.position;H=u.rotation;E=u.quaternion; -z=u.scale;E=0;a=new THREE.Object3D;a.name=m;a.position.set(w[0],w[1],w[2]);if(E){a.quaternion.set(E[0],E[1],E[2],E[3]);a.useQuaternion=true}else a.rotation.set(H[0],H[1],H[2]);a.scale.set(z[0],z[1],z[2]);a.visible=u.visible!==void 0?u.visible:false;C.scene.add(a);C.objects[m]=a;C.empties[m]=a}}}function f(a){return function(b){C.geometries[a]=b;e();G=G-1;j.onLoadComplete();h()}}function g(a){return function(b){C.geometries[a]=b}}function h(){j.callbackProgress({totalModels:T,totalTextures:U,loadedModels:T- -G,loadedTextures:U-i},C);j.onLoadProgress();G==0&&i==0&&b(C)}var j=this,l=THREE.Loader.prototype.extractUrlBase(c),k,p,m,o,q,n,r,u,t,y,s,w,H,E,z,v,A,J,K,R,P,D,M,G,i,T,U,C;D=a;c=new THREE.BinaryLoader;M=new THREE.JSONLoader;i=G=0;C={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},empties:{}};if(D.transform){a=D.transform.position;y=D.transform.rotation;v=D.transform.scale;a&&C.scene.position.set(a[0],a[1],a[2]);y&&C.scene.rotation.set(y[0],y[1], -y[2]);v&&C.scene.scale.set(v[0],v[1],v[2]);if(a||y||v){C.scene.updateMatrix();C.scene.updateMatrixWorld()}}a=function(){i=i-1;h();j.onLoadComplete()};for(q in D.cameras){v=D.cameras[q];v.type=="perspective"?R=new THREE.PerspectiveCamera(v.fov,v.aspect,v.near,v.far):v.type=="ortho"&&(R=new THREE.OrthographicCamera(v.left,v.right,v.top,v.bottom,v.near,v.far));w=v.position;y=v.target;v=v.up;R.position.set(w[0],w[1],w[2]);R.target=new THREE.Vector3(y[0],y[1],y[2]);v&&R.up.set(v[0],v[1],v[2]);C.cameras[q]= -R}for(o in D.lights){y=D.lights[o];q=y.color!==void 0?y.color:16777215;R=y.intensity!==void 0?y.intensity:1;if(y.type=="directional"){w=y.direction;s=new THREE.DirectionalLight(q,R);s.position.set(w[0],w[1],w[2]);s.position.normalize()}else if(y.type=="point"){w=y.position;s=y.distance;s=new THREE.PointLight(q,R,s);s.position.set(w[0],w[1],w[2])}else y.type=="ambient"&&(s=new THREE.AmbientLight(q));C.scene.add(s);C.lights[o]=s}for(n in D.fogs){o=D.fogs[n];o.type=="linear"?P=new THREE.Fog(0,o.near, -o.far):o.type=="exp2"&&(P=new THREE.FogExp2(0,o.density));v=o.color;P.color.setRGB(v[0],v[1],v[2]);C.fogs[n]=P}if(C.cameras&&D.defaults.camera)C.currentCamera=C.cameras[D.defaults.camera];if(C.fogs&&D.defaults.fog)C.scene.fog=C.fogs[D.defaults.fog];v=D.defaults.bgcolor;C.bgColor=new THREE.Color;C.bgColor.setRGB(v[0],v[1],v[2]);C.bgColorAlpha=D.defaults.bgalpha;for(k in D.geometries){n=D.geometries[k];if(n.type=="bin_mesh"||n.type=="ascii_mesh"){G=G+1;j.onLoadStart()}}T=G;for(k in D.geometries){n= -D.geometries[k];if(n.type=="cube"){J=new THREE.CubeGeometry(n.width,n.height,n.depth,n.segmentsWidth,n.segmentsHeight,n.segmentsDepth,null,n.flipped,n.sides);C.geometries[k]=J}else if(n.type=="plane"){J=new THREE.PlaneGeometry(n.width,n.height,n.segmentsWidth,n.segmentsHeight);C.geometries[k]=J}else if(n.type=="sphere"){J=new THREE.SphereGeometry(n.radius,n.segmentsWidth,n.segmentsHeight);C.geometries[k]=J}else if(n.type=="cylinder"){J=new THREE.CylinderGeometry(n.topRad,n.botRad,n.height,n.radSegs, -n.heightSegs);C.geometries[k]=J}else if(n.type=="torus"){J=new THREE.TorusGeometry(n.radius,n.tube,n.segmentsR,n.segmentsT);C.geometries[k]=J}else if(n.type=="icosahedron"){J=new THREE.IcosahedronGeometry(n.radius,n.subdivisions);C.geometries[k]=J}else if(n.type=="bin_mesh")c.load(d(n.url,D.urlBaseType),f(k));else if(n.type=="ascii_mesh")M.load(d(n.url,D.urlBaseType),f(k));else if(n.type=="embedded_mesh"){n=D.embeds[n.id];n.metadata=D.metadata;n&&M.createModel(n,g(k),"")}}for(r in D.textures){k=D.textures[r]; -if(k.url instanceof Array){i=i+k.url.length;for(n=0;n1){g=g[1];c[g]||(c[g]={start:Infinity,end:-Infinity});var h=c[g];if(eh.end)h.end=e;b||(b=g)}}a.firstAnimation=b}; -THREE.MorphAnimMesh.prototype.setAnimationLabel=function(a,b,c){if(!this.geometry.animations)this.geometry.animations={};this.geometry.animations[a]={start:b,end:c}};THREE.MorphAnimMesh.prototype.playAnimation=function(a,b){var c=this.geometry.animations[a];if(c){this.setFrameRange(c.start,c.end);this.duration=1E3*((c.end-c.start)/b);this.time=0}else console.warn("animation["+a+"] undefined")}; -THREE.MorphAnimMesh.prototype.updateAnimation=function(a){var b=this.duration/this.length;this.time=this.time+this.direction*a;if(this.mirroredLoop){if(this.time>this.duration||this.time<0){this.direction=this.direction*-1;if(this.time>this.duration){this.time=this.duration;this.directionBackwards=true}if(this.time<0){this.time=0;this.directionBackwards=false}}}else{this.time=this.time%this.duration;if(this.time<0)this.time=this.time+this.duration}a=this.startKeyframe+THREE.Math.clamp(Math.floor(this.time/ -b),0,this.length-1);if(a!==this.currentKeyframe){this.morphTargetInfluences[this.lastKeyframe]=0;this.morphTargetInfluences[this.currentKeyframe]=1;this.morphTargetInfluences[a]=0;this.lastKeyframe=this.currentKeyframe;this.currentKeyframe=a}b=this.time%b/b;this.directionBackwards&&(b=1-b);this.morphTargetInfluences[this.currentKeyframe]=b;this.morphTargetInfluences[this.lastKeyframe]=1-b};THREE.Ribbon=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b}; -THREE.Ribbon.prototype=new THREE.Object3D;THREE.Ribbon.prototype.constructor=THREE.Ribbon;THREE.LOD=function(){THREE.Object3D.call(this);this.LODs=[]};THREE.LOD.prototype=new THREE.Object3D;THREE.LOD.prototype.constructor=THREE.LOD;THREE.LOD.prototype.supr=THREE.Object3D.prototype;THREE.LOD.prototype.addLevel=function(a,b){b===void 0&&(b=0);for(var b=Math.abs(b),c=0;c1){a.matrixWorldInverse.getInverse(a.matrixWorld);a=a.matrixWorldInverse;a=-(a.elements[2]*this.matrixWorld.elements[12]+a.elements[6]*this.matrixWorld.elements[13]+a.elements[10]*this.matrixWorld.elements[14]+a.elements[14]);this.LODs[0].object3D.visible=true;for(var b=1;b=this.LODs[b].visibleAtDistance){this.LODs[b-1].object3D.visible=false;this.LODs[b].object3D.visible=true}else break;for(;b>1);n=m.y*f+f-(o.offsetHeight>>1);o.style.left=q+"px";o.style.top=n+"px";o.style.zIndex=Math.abs(Math.floor((1-m.z)*d.far/d.near));g&&(o.style[g]="scale("+m.scale.x*e+","+m.scale.y*f+")")}}}}; -THREE.CanvasRenderer=function(a){function b(a){if(t!=a)n.globalAlpha=t=a}function c(a){if(y!=a){switch(a){case THREE.NormalBlending:n.globalCompositeOperation="source-over";break;case THREE.AdditiveBlending:n.globalCompositeOperation="lighter"}y=a}}function d(a){if(s!=a)n.strokeStyle=s=a}function e(a){if(w!=a)n.fillStyle=w=a}console.log("THREE.CanvasRenderer",THREE.REVISION);var a=a||{},f=this,g,h,j,l=new THREE.Projector,k=a.canvas!==void 0?a.canvas:document.createElement("canvas"),p,m,o,q,n=k.getContext("2d"), -r=new THREE.Color(0),u=0,t=1,y=0,s=null,w=null,H=null,E=null,z=null,v,A,J,K,R=new THREE.RenderableVertex,P=new THREE.RenderableVertex,D,M,G,i,T,U,C,Y,F,ea,fa,ia,O=new THREE.Color,Q=new THREE.Color,Z=new THREE.Color,$=new THREE.Color,ha=new THREE.Color,Ma=[],Ka=[],Ra,La,Sa,Na,Kb,lb,gb,Lb,hb,Cb,Wa=new THREE.Rectangle,Ba=new THREE.Rectangle,xa=new THREE.Rectangle,$a=false,aa=new THREE.Color,Ta=new THREE.Color,Qa=new THREE.Color,oa=new THREE.Vector3,ib,Db,Sc,ab,pc,Bc,a=16;ib=document.createElement("canvas"); -ib.width=ib.height=2;Db=ib.getContext("2d");Db.fillStyle="rgba(0,0,0,1)";Db.fillRect(0,0,2,2);Sc=Db.getImageData(0,0,2,2);ab=Sc.data;pc=document.createElement("canvas");pc.width=pc.height=a;Bc=pc.getContext("2d");Bc.translate(-a/2,-a/2);Bc.scale(a,a);a--;this.domElement=k;this.sortElements=this.sortObjects=this.autoClear=true;this.info={render:{vertices:0,faces:0}};this.setSize=function(a,b){p=a;m=b;o=Math.floor(p/2);q=Math.floor(m/2);k.width=p;k.height=m;Wa.set(-o,-q,o,q);Ba.set(-o,-q,o,q);t=1;y= -0;z=E=H=w=s=null};this.setClearColor=function(a,b){r.copy(a);u=b!==void 0?b:1;Ba.set(-o,-q,o,q)};this.setClearColorHex=function(a,b){r.setHex(a);u=b!==void 0?b:1;Ba.set(-o,-q,o,q)};this.clear=function(){n.setTransform(1,0,0,-1,o,q);if(!Ba.isEmpty()){Ba.minSelf(Wa);Ba.inflate(2);u<1&&n.clearRect(Math.floor(Ba.getX()),Math.floor(Ba.getY()),Math.floor(Ba.getWidth()),Math.floor(Ba.getHeight()));if(u>0){c(THREE.NormalBlending);b(1);e("rgba("+Math.floor(r.r*255)+","+Math.floor(r.g*255)+","+Math.floor(r.b* -255)+","+u+")");n.fillRect(Math.floor(Ba.getX()),Math.floor(Ba.getY()),Math.floor(Ba.getWidth()),Math.floor(Ba.getHeight()))}Ba.empty()}};this.render=function(a,k){function m(a){var b,c,d,e;aa.setRGB(0,0,0);Ta.setRGB(0,0,0);Qa.setRGB(0,0,0);b=0;for(c=a.length;b>1;m=k.height>>1;g=f.scale.x*o;j=f.scale.y*q;i=g*l;h=j*m;xa.set(a.x-i,a.y-h,a.x+i,a.y+h);if(Wa.intersects(xa)){n.save();n.translate(a.x,a.y);n.rotate(-f.rotation);n.scale(g,-j);n.translate(-l,-m);n.drawImage(k,0,0);n.restore()}}}else if(g instanceof THREE.ParticleCanvasMaterial){i=f.scale.x*o;h=f.scale.y*q;xa.set(a.x-i,a.y-h,a.x+i,a.y+h);if(Wa.intersects(xa)){d(g.color.getContextStyle()); -e(g.color.getContextStyle());n.save();n.translate(a.x,a.y);n.rotate(-f.rotation);n.scale(i,h);g.program(n);n.restore()}}}function s(a,e,f,g){b(g.opacity);c(g.blending);n.beginPath();n.moveTo(a.positionScreen.x,a.positionScreen.y);n.lineTo(e.positionScreen.x,e.positionScreen.y);n.closePath();if(g instanceof THREE.LineBasicMaterial){a=g.linewidth;if(H!=a)n.lineWidth=H=a;a=g.linecap;if(E!=a)n.lineCap=E=a;a=g.linejoin;if(z!=a)n.lineJoin=z=a;d(g.color.getContextStyle());n.stroke();xa.inflate(g.linewidth* -2)}}function t(a,d,e,g,h,l,m,n){f.info.render.vertices=f.info.render.vertices+3;f.info.render.faces++;b(n.opacity);c(n.blending);D=a.positionScreen.x;M=a.positionScreen.y;G=d.positionScreen.x;i=d.positionScreen.y;T=e.positionScreen.x;U=e.positionScreen.y;w(D,M,G,i,T,U);if(n instanceof THREE.MeshBasicMaterial)if(n.map){if(n.map.mapping instanceof THREE.UVMapping){Na=m.uvs[0];ad(D,M,G,i,T,U,Na[g].u,Na[g].v,Na[h].u,Na[h].v,Na[l].u,Na[l].v,n.map)}}else if(n.envMap){if(n.envMap.mapping instanceof THREE.SphericalReflectionMapping){a= -k.matrixWorldInverse;oa.copy(m.vertexNormalsWorld[g]);Kb=(oa.x*a.elements[0]+oa.y*a.elements[4]+oa.z*a.elements[8])*0.5+0.5;lb=-(oa.x*a.elements[1]+oa.y*a.elements[5]+oa.z*a.elements[9])*0.5+0.5;oa.copy(m.vertexNormalsWorld[h]);gb=(oa.x*a.elements[0]+oa.y*a.elements[4]+oa.z*a.elements[8])*0.5+0.5;Lb=-(oa.x*a.elements[1]+oa.y*a.elements[5]+oa.z*a.elements[9])*0.5+0.5;oa.copy(m.vertexNormalsWorld[l]);hb=(oa.x*a.elements[0]+oa.y*a.elements[4]+oa.z*a.elements[8])*0.5+0.5;Cb=-(oa.x*a.elements[1]+oa.y* -a.elements[5]+oa.z*a.elements[9])*0.5+0.5;ad(D,M,G,i,T,U,Kb,lb,gb,Lb,hb,Cb,n.envMap)}}else n.wireframe?Mb(n.color,n.wireframeLinewidth,n.wireframeLinecap,n.wireframeLinejoin):Eb(n.color);else if(n instanceof THREE.MeshLambertMaterial)if($a)if(!n.wireframe&&n.shading==THREE.SmoothShading&&m.vertexNormalsWorld.length==3){Q.r=Z.r=$.r=aa.r;Q.g=Z.g=$.g=aa.g;Q.b=Z.b=$.b=aa.b;p(j,m.v1.positionWorld,m.vertexNormalsWorld[0],Q);p(j,m.v2.positionWorld,m.vertexNormalsWorld[1],Z);p(j,m.v3.positionWorld,m.vertexNormalsWorld[2], -$);Q.r=Math.max(0,Math.min(n.color.r*Q.r,1));Q.g=Math.max(0,Math.min(n.color.g*Q.g,1));Q.b=Math.max(0,Math.min(n.color.b*Q.b,1));Z.r=Math.max(0,Math.min(n.color.r*Z.r,1));Z.g=Math.max(0,Math.min(n.color.g*Z.g,1));Z.b=Math.max(0,Math.min(n.color.b*Z.b,1));$.r=Math.max(0,Math.min(n.color.r*$.r,1));$.g=Math.max(0,Math.min(n.color.g*$.g,1));$.b=Math.max(0,Math.min(n.color.b*$.b,1));ha.r=(Z.r+$.r)*0.5;ha.g=(Z.g+$.g)*0.5;ha.b=(Z.b+$.b)*0.5;Sa=Cc(Q,Z,$,ha);gc(D,M,G,i,T,U,0,0,1,0,0,1,Sa)}else{O.r=aa.r;O.g= -aa.g;O.b=aa.b;p(j,m.centroidWorld,m.normalWorld,O);O.r=Math.max(0,Math.min(n.color.r*O.r,1));O.g=Math.max(0,Math.min(n.color.g*O.g,1));O.b=Math.max(0,Math.min(n.color.b*O.b,1));n.wireframe?Mb(O,n.wireframeLinewidth,n.wireframeLinecap,n.wireframeLinejoin):Eb(O)}else n.wireframe?Mb(n.color,n.wireframeLinewidth,n.wireframeLinecap,n.wireframeLinejoin):Eb(n.color);else if(n instanceof THREE.MeshDepthMaterial){Ra=k.near;La=k.far;Q.r=Q.g=Q.b=1-ac(a.positionScreen.z,Ra,La);Z.r=Z.g=Z.b=1-ac(d.positionScreen.z, -Ra,La);$.r=$.g=$.b=1-ac(e.positionScreen.z,Ra,La);ha.r=(Z.r+$.r)*0.5;ha.g=(Z.g+$.g)*0.5;ha.b=(Z.b+$.b)*0.5;Sa=Cc(Q,Z,$,ha);gc(D,M,G,i,T,U,0,0,1,0,0,1,Sa)}else if(n instanceof THREE.MeshNormalMaterial){O.r=hc(m.normalWorld.x);O.g=hc(m.normalWorld.y);O.b=hc(m.normalWorld.z);n.wireframe?Mb(O,n.wireframeLinewidth,n.wireframeLinecap,n.wireframeLinejoin):Eb(O)}}function u(a,d,e,g,h,l,n,m,o){f.info.render.vertices=f.info.render.vertices+4;f.info.render.faces++;b(m.opacity);c(m.blending);if(m.map||m.envMap){t(a, -d,g,0,1,3,n,m,o);t(h,e,l,1,2,3,n,m,o)}else{D=a.positionScreen.x;M=a.positionScreen.y;G=d.positionScreen.x;i=d.positionScreen.y;T=e.positionScreen.x;U=e.positionScreen.y;C=g.positionScreen.x;Y=g.positionScreen.y;F=h.positionScreen.x;ea=h.positionScreen.y;fa=l.positionScreen.x;ia=l.positionScreen.y;if(m instanceof THREE.MeshBasicMaterial){y(D,M,G,i,T,U,C,Y);m.wireframe?Mb(m.color,m.wireframeLinewidth,m.wireframeLinecap,m.wireframeLinejoin):Eb(m.color)}else if(m instanceof THREE.MeshLambertMaterial)if($a)if(!m.wireframe&& -m.shading==THREE.SmoothShading&&n.vertexNormalsWorld.length==4){Q.r=Z.r=$.r=ha.r=aa.r;Q.g=Z.g=$.g=ha.g=aa.g;Q.b=Z.b=$.b=ha.b=aa.b;p(j,n.v1.positionWorld,n.vertexNormalsWorld[0],Q);p(j,n.v2.positionWorld,n.vertexNormalsWorld[1],Z);p(j,n.v4.positionWorld,n.vertexNormalsWorld[3],$);p(j,n.v3.positionWorld,n.vertexNormalsWorld[2],ha);Q.r=Math.max(0,Math.min(m.color.r*Q.r,1));Q.g=Math.max(0,Math.min(m.color.g*Q.g,1));Q.b=Math.max(0,Math.min(m.color.b*Q.b,1));Z.r=Math.max(0,Math.min(m.color.r*Z.r,1));Z.g= -Math.max(0,Math.min(m.color.g*Z.g,1));Z.b=Math.max(0,Math.min(m.color.b*Z.b,1));$.r=Math.max(0,Math.min(m.color.r*$.r,1));$.g=Math.max(0,Math.min(m.color.g*$.g,1));$.b=Math.max(0,Math.min(m.color.b*$.b,1));ha.r=Math.max(0,Math.min(m.color.r*ha.r,1));ha.g=Math.max(0,Math.min(m.color.g*ha.g,1));ha.b=Math.max(0,Math.min(m.color.b*ha.b,1));Sa=Cc(Q,Z,$,ha);w(D,M,G,i,C,Y);gc(D,M,G,i,C,Y,0,0,1,0,0,1,Sa);w(F,ea,T,U,fa,ia);gc(F,ea,T,U,fa,ia,1,0,1,1,0,1,Sa)}else{O.r=aa.r;O.g=aa.g;O.b=aa.b;p(j,n.centroidWorld, -n.normalWorld,O);O.r=Math.max(0,Math.min(m.color.r*O.r,1));O.g=Math.max(0,Math.min(m.color.g*O.g,1));O.b=Math.max(0,Math.min(m.color.b*O.b,1));y(D,M,G,i,T,U,C,Y);m.wireframe?Mb(O,m.wireframeLinewidth,m.wireframeLinecap,m.wireframeLinejoin):Eb(O)}else{y(D,M,G,i,T,U,C,Y);m.wireframe?Mb(m.color,m.wireframeLinewidth,m.wireframeLinecap,m.wireframeLinejoin):Eb(m.color)}else if(m instanceof THREE.MeshNormalMaterial){O.r=hc(n.normalWorld.x);O.g=hc(n.normalWorld.y);O.b=hc(n.normalWorld.z);y(D,M,G,i,T,U,C, -Y);m.wireframe?Mb(O,m.wireframeLinewidth,m.wireframeLinecap,m.wireframeLinejoin):Eb(O)}else if(m instanceof THREE.MeshDepthMaterial){Ra=k.near;La=k.far;Q.r=Q.g=Q.b=1-ac(a.positionScreen.z,Ra,La);Z.r=Z.g=Z.b=1-ac(d.positionScreen.z,Ra,La);$.r=$.g=$.b=1-ac(g.positionScreen.z,Ra,La);ha.r=ha.g=ha.b=1-ac(e.positionScreen.z,Ra,La);Sa=Cc(Q,Z,$,ha);w(D,M,G,i,C,Y);gc(D,M,G,i,C,Y,0,0,1,0,0,1,Sa);w(F,ea,T,U,fa,ia);gc(F,ea,T,U,fa,ia,1,0,1,1,0,1,Sa)}}}function w(a,b,c,d,e,f){n.beginPath();n.moveTo(a,b);n.lineTo(c, -d);n.lineTo(e,f);n.lineTo(a,b);n.closePath()}function y(a,b,c,d,e,f,g,i){n.beginPath();n.moveTo(a,b);n.lineTo(c,d);n.lineTo(e,f);n.lineTo(g,i);n.lineTo(a,b);n.closePath()}function Mb(a,b,c,e){if(H!=b)n.lineWidth=H=b;if(E!=c)n.lineCap=E=c;if(z!=e)n.lineJoin=z=e;d(a.getContextStyle());n.stroke();xa.inflate(b*2)}function Eb(a){e(a.getContextStyle());n.fill()}function ad(a,b,c,d,f,g,i,h,j,k,l,m,p){if(p.image.width!=0){if(p.needsUpdate==true||Ma[p.id]==void 0){var o=p.wrapS==THREE.RepeatWrapping,q=p.wrapT== -THREE.RepeatWrapping;Ma[p.id]=n.createPattern(p.image,o&&q?"repeat":o&&!q?"repeat-x":!o&&q?"repeat-y":"no-repeat");p.needsUpdate=false}e(Ma[p.id]);var o=p.offset.x/p.repeat.x,q=p.offset.y/p.repeat.y,Db=p.image.width*p.repeat.x,r=p.image.height*p.repeat.y,i=(i+o)*Db,h=(h+q)*r,c=c-a,d=d-b,f=f-a,g=g-b,j=(j+o)*Db-i,k=(k+q)*r-h,l=(l+o)*Db-i,m=(m+q)*r-h,o=j*m-l*k;if(o==0){if(Ka[p.id]===void 0){b=document.createElement("canvas");b.width=p.image.width;b.height=p.image.height;b=b.getContext("2d");b.drawImage(p.image, -0,0);Ka[p.id]=b.getImageData(0,0,p.image.width,p.image.height).data}b=Ka[p.id];i=(Math.floor(i)+Math.floor(h)*p.image.width)*4;O.setRGB(b[i]/255,b[i+1]/255,b[i+2]/255);Eb(O)}else{o=1/o;p=(m*c-k*f)*o;k=(m*d-k*g)*o;c=(j*f-l*c)*o;d=(j*g-l*d)*o;a=a-p*i-c*h;i=b-k*i-d*h;n.save();n.transform(p,k,c,d,a,i);n.fill();n.restore()}}}function gc(a,b,c,d,e,f,g,i,h,j,k,l,m){var p,o;p=m.width-1;o=m.height-1;g=g*p;i=i*o;c=c-a;d=d-b;e=e-a;f=f-b;h=h*p-g;j=j*o-i;k=k*p-g;l=l*o-i;o=1/(h*l-k*j);p=(l*c-j*e)*o;j=(l*d-j*f)* -o;c=(h*e-k*c)*o;d=(h*f-k*d)*o;a=a-p*g-c*i;b=b-j*g-d*i;n.save();n.transform(p,j,c,d,a,b);n.clip();n.drawImage(m,0,0);n.restore()}function Cc(a,b,c,d){var e=~~(a.r*255),f=~~(a.g*255),a=~~(a.b*255),g=~~(b.r*255),i=~~(b.g*255),b=~~(b.b*255),h=~~(c.r*255),j=~~(c.g*255),c=~~(c.b*255),k=~~(d.r*255),l=~~(d.g*255),d=~~(d.b*255);ab[0]=e<0?0:e>255?255:e;ab[1]=f<0?0:f>255?255:f;ab[2]=a<0?0:a>255?255:a;ab[4]=g<0?0:g>255?255:g;ab[5]=i<0?0:i>255?255:i;ab[6]=b<0?0:b>255?255:b;ab[8]=h<0?0:h>255?255:h;ab[9]=j<0?0: -j>255?255:j;ab[10]=c<0?0:c>255?255:c;ab[12]=k<0?0:k>255?255:k;ab[13]=l<0?0:l>255?255:l;ab[14]=d<0?0:d>255?255:d;Db.putImageData(Sc,0,0);Bc.drawImage(ib,0,0);return pc}function ac(a,b,c){a=(a-b)/(c-b);return a*a*(3-2*a)}function hc(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}function Nb(a,b){var c=b.x-a.x,d=b.y-a.y,e=c*c+d*d;if(e!=0){e=1/Math.sqrt(e);c=c*e;d=d*e;b.x=b.x+c;b.y=b.y+d;a.x=a.x-c;a.y=a.y-d}}var Dc,bd,Ha,eb;this.autoClear?this.clear():n.setTransform(1,0,0,-1,o,q);f.info.render.vertices=0;f.info.render.faces= -0;g=l.projectScene(a,k,this.sortElements);h=g.elements;j=g.lights;($a=j.length>0)&&m(j);Dc=0;for(bd=h.length;Dc1?1:a}console.log("THREE.SVGRenderer",THREE.REVISION);var d=this,e,f,g,h=new THREE.Projector,j=document.createElementNS("http://www.w3.org/2000/svg","svg"),l,k,p,m,o,q,n,r,u=new THREE.Rectangle,t=new THREE.Rectangle,y=false,s=new THREE.Color,w=new THREE.Color,H=new THREE.Color,E=new THREE.Color, -z,v=new THREE.Vector3,A=[],J=[],K,R,P,D=1;this.domElement=j;this.sortElements=this.sortObjects=this.autoClear=true;this.info={render:{vertices:0,faces:0}};this.setQuality=function(a){switch(a){case "high":D=1;break;case "low":D=0}};this.setSize=function(a,b){l=a;k=b;p=l/2;m=k/2;j.setAttribute("viewBox",-p+" "+-m+" "+l+" "+k);j.setAttribute("width",l);j.setAttribute("height",k);u.set(-p,-m,p,m)};this.clear=function(){for(;j.childNodes.length>0;)j.removeChild(j.childNodes[0])};this.render=function(k, -l){var i,v,A,C;this.autoClear&&this.clear();d.info.render.vertices=0;d.info.render.faces=0;e=h.projectScene(k,l,this.sortElements);f=e.elements;g=e.lights;P=R=0;if(y=g.length>0){w.setRGB(0,0,0);H.setRGB(0,0,0);E.setRGB(0,0,0);i=0;for(v=g.length;i 0\nuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\nuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n#endif\n#if MAX_POINT_LIGHTS > 0\nuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\nuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\nuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n#endif\n#if MAX_SPOT_LIGHTS > 0\nuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\nuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\nuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\nuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\nuniform float spotLightAngle[ MAX_SPOT_LIGHTS ];\nuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n#endif\n#ifdef WRAP_AROUND\nuniform vec3 wrapRGB;\n#endif", -lights_lambert_vertex:"vLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\nvLightBack = vec3( 0.0 );\n#endif\ntransformedNormal = normalize( transformedNormal );\n#if MAX_DIR_LIGHTS > 0\nfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\nvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\nvec3 dirVector = normalize( lDirection.xyz );\nfloat dotProduct = dot( transformedNormal, dirVector );\nvec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );\n#ifdef DOUBLE_SIDED\nvec3 directionalLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n#ifdef WRAP_AROUND\nvec3 directionalLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n#endif\n#endif\n#ifdef WRAP_AROUND\nvec3 directionalLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\ndirectionalLightWeighting = mix( directionalLightWeighting, directionalLightWeightingHalf, wrapRGB );\n#ifdef DOUBLE_SIDED\ndirectionalLightWeightingBack = mix( directionalLightWeightingBack, directionalLightWeightingHalfBack, wrapRGB );\n#endif\n#endif\nvLightFront += directionalLightColor[ i ] * directionalLightWeighting;\n#ifdef DOUBLE_SIDED\nvLightBack += directionalLightColor[ i ] * directionalLightWeightingBack;\n#endif\n}\n#endif\n#if MAX_POINT_LIGHTS > 0\nfor( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\nvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\nvec3 lVector = lPosition.xyz - mvPosition.xyz;\nfloat lDistance = 1.0;\nif ( pointLightDistance[ i ] > 0.0 )\nlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\nlVector = normalize( lVector );\nfloat dotProduct = dot( transformedNormal, lVector );\nvec3 pointLightWeighting = vec3( max( dotProduct, 0.0 ) );\n#ifdef DOUBLE_SIDED\nvec3 pointLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n#ifdef WRAP_AROUND\nvec3 pointLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n#endif\n#endif\n#ifdef WRAP_AROUND\nvec3 pointLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\npointLightWeighting = mix( pointLightWeighting, pointLightWeightingHalf, wrapRGB );\n#ifdef DOUBLE_SIDED\npointLightWeightingBack = mix( pointLightWeightingBack, pointLightWeightingHalfBack, wrapRGB );\n#endif\n#endif\nvLightFront += pointLightColor[ i ] * pointLightWeighting * lDistance;\n#ifdef DOUBLE_SIDED\nvLightBack += pointLightColor[ i ] * pointLightWeightingBack * lDistance;\n#endif\n}\n#endif\n#if MAX_SPOT_LIGHTS > 0\nfor( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\nvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\nvec3 lVector = lPosition.xyz - mvPosition.xyz;\nlVector = normalize( lVector );\nfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - mPosition.xyz ) );\nif ( spotEffect > spotLightAngle[ i ] ) {\nspotEffect = pow( spotEffect, spotLightExponent[ i ] );\nfloat lDistance = 1.0;\nif ( spotLightDistance[ i ] > 0.0 )\nlDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );\nfloat dotProduct = dot( transformedNormal, lVector );\nvec3 spotLightWeighting = vec3( max( dotProduct, 0.0 ) );\n#ifdef DOUBLE_SIDED\nvec3 spotLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n#ifdef WRAP_AROUND\nvec3 spotLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n#endif\n#endif\n#ifdef WRAP_AROUND\nvec3 spotLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\nspotLightWeighting = mix( spotLightWeighting, spotLightWeightingHalf, wrapRGB );\n#ifdef DOUBLE_SIDED\nspotLightWeightingBack = mix( spotLightWeightingBack, spotLightWeightingHalfBack, wrapRGB );\n#endif\n#endif\nvLightFront += spotLightColor[ i ] * spotLightWeighting * lDistance * spotEffect;\n#ifdef DOUBLE_SIDED\nvLightBack += spotLightColor[ i ] * spotLightWeightingBack * lDistance * spotEffect;\n#endif\n}\n}\n#endif\nvLightFront = vLightFront * diffuse + ambient * ambientLightColor + emissive;\n#ifdef DOUBLE_SIDED\nvLightBack = vLightBack * diffuse + ambient * ambientLightColor + emissive;\n#endif", -lights_phong_pars_vertex:"#ifndef PHONG_PER_PIXEL\n#if MAX_POINT_LIGHTS > 0\nuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\nuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\nvarying vec4 vPointLight[ MAX_POINT_LIGHTS ];\n#endif\n#if MAX_SPOT_LIGHTS > 0\nuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\nuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\nvarying vec4 vSpotLight[ MAX_SPOT_LIGHTS ];\n#endif\n#endif\n#if MAX_SPOT_LIGHTS > 0\nvarying vec3 vWorldPosition;\n#endif",lights_phong_vertex:"#ifndef PHONG_PER_PIXEL\n#if MAX_POINT_LIGHTS > 0\nfor( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\nvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\nvec3 lVector = lPosition.xyz - mvPosition.xyz;\nfloat lDistance = 1.0;\nif ( pointLightDistance[ i ] > 0.0 )\nlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\nvPointLight[ i ] = vec4( lVector, lDistance );\n}\n#endif\n#if MAX_SPOT_LIGHTS > 0\nfor( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\nvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\nvec3 lVector = lPosition.xyz - mvPosition.xyz;\nfloat lDistance = 1.0;\nif ( spotLightDistance[ i ] > 0.0 )\nlDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );\nvSpotLight[ i ] = vec4( lVector, lDistance );\n}\n#endif\n#endif\n#if MAX_SPOT_LIGHTS > 0\nvWorldPosition = mPosition.xyz;\n#endif", -lights_phong_pars_fragment:"uniform vec3 ambientLightColor;\n#if MAX_DIR_LIGHTS > 0\nuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\nuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n#endif\n#if MAX_POINT_LIGHTS > 0\nuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n#ifdef PHONG_PER_PIXEL\nuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\nuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n#else\nvarying vec4 vPointLight[ MAX_POINT_LIGHTS ];\n#endif\n#endif\n#if MAX_SPOT_LIGHTS > 0\nuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\nuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\nuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\nuniform float spotLightAngle[ MAX_SPOT_LIGHTS ];\nuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n#ifdef PHONG_PER_PIXEL\nuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n#else\nvarying vec4 vSpotLight[ MAX_SPOT_LIGHTS ];\n#endif\nvarying vec3 vWorldPosition;\n#endif\n#ifdef WRAP_AROUND\nuniform vec3 wrapRGB;\n#endif\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;", -lights_phong_fragment:"vec3 normal = normalize( vNormal );\nvec3 viewPosition = normalize( vViewPosition );\n#ifdef DOUBLE_SIDED\nnormal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n#endif\n#if MAX_POINT_LIGHTS > 0\nvec3 pointDiffuse = vec3( 0.0 );\nvec3 pointSpecular = vec3( 0.0 );\nfor ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n#ifdef PHONG_PER_PIXEL\nvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\nvec3 lVector = lPosition.xyz + vViewPosition.xyz;\nfloat lDistance = 1.0;\nif ( pointLightDistance[ i ] > 0.0 )\nlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\nlVector = normalize( lVector );\n#else\nvec3 lVector = normalize( vPointLight[ i ].xyz );\nfloat lDistance = vPointLight[ i ].w;\n#endif\nfloat dotProduct = dot( normal, lVector );\n#ifdef WRAP_AROUND\nfloat pointDiffuseWeightFull = max( dotProduct, 0.0 );\nfloat pointDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\nvec3 pointDiffuseWeight = mix( vec3 ( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), wrapRGB );\n#else\nfloat pointDiffuseWeight = max( dotProduct, 0.0 );\n#endif\npointDiffuse += diffuse * pointLightColor[ i ] * pointDiffuseWeight * lDistance;\nvec3 pointHalfVector = normalize( lVector + viewPosition );\nfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\nfloat pointSpecularWeight = max( pow( pointDotNormalHalf, shininess ), 0.0 );\n#ifdef PHYSICALLY_BASED_SHADING\nfloat specularNormalization = ( shininess + 2.0001 ) / 8.0;\nvec3 schlick = specular + vec3( 1.0 - specular ) * pow( 1.0 - dot( lVector, pointHalfVector ), 5.0 );\npointSpecular += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * lDistance * specularNormalization;\n#else\npointSpecular += specular * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * lDistance;\n#endif\n}\n#endif\n#if MAX_SPOT_LIGHTS > 0\nvec3 spotDiffuse = vec3( 0.0 );\nvec3 spotSpecular = vec3( 0.0 );\nfor ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n#ifdef PHONG_PER_PIXEL\nvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\nvec3 lVector = lPosition.xyz + vViewPosition.xyz;\nfloat lDistance = 1.0;\nif ( spotLightDistance[ i ] > 0.0 )\nlDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );\nlVector = normalize( lVector );\n#else\nvec3 lVector = normalize( vSpotLight[ i ].xyz );\nfloat lDistance = vSpotLight[ i ].w;\n#endif\nfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - vWorldPosition ) );\nif ( spotEffect > spotLightAngle[ i ] ) {\nspotEffect = pow( spotEffect, spotLightExponent[ i ] );\nfloat dotProduct = dot( normal, lVector );\n#ifdef WRAP_AROUND\nfloat spotDiffuseWeightFull = max( dotProduct, 0.0 );\nfloat spotDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\nvec3 spotDiffuseWeight = mix( vec3 ( spotDiffuseWeightFull ), vec3( spotDiffuseWeightHalf ), wrapRGB );\n#else\nfloat spotDiffuseWeight = max( dotProduct, 0.0 );\n#endif\nspotDiffuse += diffuse * spotLightColor[ i ] * spotDiffuseWeight * lDistance * spotEffect;\nvec3 spotHalfVector = normalize( lVector + viewPosition );\nfloat spotDotNormalHalf = max( dot( normal, spotHalfVector ), 0.0 );\nfloat spotSpecularWeight = max( pow( spotDotNormalHalf, shininess ), 0.0 );\n#ifdef PHYSICALLY_BASED_SHADING\nfloat specularNormalization = ( shininess + 2.0001 ) / 8.0;\nvec3 schlick = specular + vec3( 1.0 - specular ) * pow( 1.0 - dot( lVector, spotHalfVector ), 5.0 );\nspotSpecular += schlick * spotLightColor[ i ] * spotSpecularWeight * spotDiffuseWeight * lDistance * specularNormalization * spotEffect;\n#else\nspotSpecular += specular * spotLightColor[ i ] * spotSpecularWeight * spotDiffuseWeight * lDistance * spotEffect;\n#endif\n}\n}\n#endif\n#if MAX_DIR_LIGHTS > 0\nvec3 dirDiffuse = vec3( 0.0 );\nvec3 dirSpecular = vec3( 0.0 );\nfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\nvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\nvec3 dirVector = normalize( lDirection.xyz );\nfloat dotProduct = dot( normal, dirVector );\n#ifdef WRAP_AROUND\nfloat dirDiffuseWeightFull = max( dotProduct, 0.0 );\nfloat dirDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\nvec3 dirDiffuseWeight = mix( vec3( dirDiffuseWeightFull ), vec3( dirDiffuseWeightHalf ), wrapRGB );\n#else\nfloat dirDiffuseWeight = max( dotProduct, 0.0 );\n#endif\ndirDiffuse += diffuse * directionalLightColor[ i ] * dirDiffuseWeight;\nvec3 dirHalfVector = normalize( dirVector + viewPosition );\nfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\nfloat dirSpecularWeight = max( pow( dirDotNormalHalf, shininess ), 0.0 );\n#ifdef PHYSICALLY_BASED_SHADING\nfloat specularNormalization = ( shininess + 2.0001 ) / 8.0;\nvec3 schlick = specular + vec3( 1.0 - specular ) * pow( 1.0 - dot( dirVector, dirHalfVector ), 5.0 );\ndirSpecular += schlick * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization;\n#else\ndirSpecular += specular * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight;\n#endif\n}\n#endif\nvec3 totalDiffuse = vec3( 0.0 );\nvec3 totalSpecular = vec3( 0.0 );\n#if MAX_DIR_LIGHTS > 0\ntotalDiffuse += dirDiffuse;\ntotalSpecular += dirSpecular;\n#endif\n#if MAX_POINT_LIGHTS > 0\ntotalDiffuse += pointDiffuse;\ntotalSpecular += pointSpecular;\n#endif\n#if MAX_SPOT_LIGHTS > 0\ntotalDiffuse += spotDiffuse;\ntotalSpecular += spotSpecular;\n#endif\n#ifdef METAL\ngl_FragColor.xyz = gl_FragColor.xyz * ( emissive + totalDiffuse + ambientLightColor * ambient + totalSpecular );\n#else\ngl_FragColor.xyz = gl_FragColor.xyz * ( emissive + totalDiffuse + ambientLightColor * ambient ) + totalSpecular;\n#endif", -color_pars_fragment:"#ifdef USE_COLOR\nvarying vec3 vColor;\n#endif",color_fragment:"#ifdef USE_COLOR\ngl_FragColor = gl_FragColor * vec4( vColor, opacity );\n#endif",color_pars_vertex:"#ifdef USE_COLOR\nvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n#ifdef GAMMA_INPUT\nvColor = color * color;\n#else\nvColor = color;\n#endif\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\nuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n#endif",skinning_vertex:"#ifdef USE_SKINNING\ngl_Position = ( boneGlobalMatrices[ int( skinIndex.x ) ] * skinVertexA ) * skinWeight.x;\ngl_Position += ( boneGlobalMatrices[ int( skinIndex.y ) ] * skinVertexB ) * skinWeight.y;\ngl_Position = projectionMatrix * modelViewMatrix * gl_Position;\n#endif", -morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n#ifndef USE_MORPHNORMALS\nuniform float morphTargetInfluences[ 8 ];\n#else\nuniform float morphTargetInfluences[ 4 ];\n#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\nvec3 morphed = vec3( 0.0 );\nmorphed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\nmorphed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\nmorphed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\nmorphed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n#ifndef USE_MORPHNORMALS\nmorphed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\nmorphed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\nmorphed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\nmorphed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n#endif\nmorphed += position;\ngl_Position = projectionMatrix * modelViewMatrix * vec4( morphed, 1.0 );\n#endif", -default_vertex:"#ifndef USE_MORPHTARGETS\n#ifndef USE_SKINNING\ngl_Position = projectionMatrix * mvPosition;\n#endif\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\nvec3 morphedNormal = vec3( 0.0 );\nmorphedNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\nmorphedNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\nmorphedNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\nmorphedNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\nmorphedNormal += normal;\nvec3 transformedNormal = normalMatrix * morphedNormal;\n#else\nvec3 transformedNormal = normalMatrix * normal;\n#endif", -shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\nuniform sampler2D shadowMap[ MAX_SHADOWS ];\nuniform vec2 shadowMapSize[ MAX_SHADOWS ];\nuniform float shadowDarkness[ MAX_SHADOWS ];\nuniform float shadowBias[ MAX_SHADOWS ];\nvarying vec4 vShadowCoord[ MAX_SHADOWS ];\nfloat unpackDepth( const in vec4 rgba_depth ) {\nconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\nfloat depth = dot( rgba_depth, bit_shift );\nreturn depth;\n}\n#endif",shadowmap_fragment:"#ifdef USE_SHADOWMAP\n#ifdef SHADOWMAP_DEBUG\nvec3 frustumColors[3];\nfrustumColors[0] = vec3( 1.0, 0.5, 0.0 );\nfrustumColors[1] = vec3( 0.0, 1.0, 0.8 );\nfrustumColors[2] = vec3( 0.0, 0.5, 1.0 );\n#endif\n#ifdef SHADOWMAP_CASCADE\nint inFrustumCount = 0;\n#endif\nfloat fDepth;\nvec3 shadowColor = vec3( 1.0 );\nfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\nvec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\nbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\nbool inFrustum = all( inFrustumVec );\n#ifdef SHADOWMAP_CASCADE\ninFrustumCount += int( inFrustum );\nbvec3 frustumTestVec = bvec3( inFrustum, inFrustumCount == 1, shadowCoord.z <= 1.0 );\n#else\nbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n#endif\nbool frustumTest = all( frustumTestVec );\nif ( frustumTest ) {\nshadowCoord.z += shadowBias[ i ];\n#ifdef SHADOWMAP_SOFT\nfloat shadow = 0.0;\nconst float shadowDelta = 1.0 / 9.0;\nfloat xPixelOffset = 1.0 / shadowMapSize[ i ].x;\nfloat yPixelOffset = 1.0 / shadowMapSize[ i ].y;\nfloat dx0 = -1.25 * xPixelOffset;\nfloat dy0 = -1.25 * yPixelOffset;\nfloat dx1 = 1.25 * xPixelOffset;\nfloat dy1 = 1.25 * yPixelOffset;\nfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\nif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\nfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\nif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\nfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\nif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\nfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\nif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\nfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\nif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\nfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\nif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\nfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\nif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\nfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\nif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\nfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\nif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\nshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\n#else\nvec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\nfloat fDepth = unpackDepth( rgbaDepth );\nif ( fDepth < shadowCoord.z )\nshadowColor = shadowColor * vec3( 1.0 - shadowDarkness[ i ] );\n#endif\n}\n#ifdef SHADOWMAP_DEBUG\n#ifdef SHADOWMAP_CASCADE\nif ( inFrustum && inFrustumCount == 1 ) gl_FragColor.xyz *= frustumColors[ i ];\n#else\nif ( inFrustum ) gl_FragColor.xyz *= frustumColors[ i ];\n#endif\n#endif\n}\n#ifdef GAMMA_OUTPUT\nshadowColor *= shadowColor;\n#endif\ngl_FragColor.xyz = gl_FragColor.xyz * shadowColor;\n#endif", -shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\nvarying vec4 vShadowCoord[ MAX_SHADOWS ];\nuniform mat4 shadowMatrix[ MAX_SHADOWS ];\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\nfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\n#ifdef USE_MORPHTARGETS\nvShadowCoord[ i ] = shadowMatrix[ i ] * objectMatrix * vec4( morphed, 1.0 );\n#else\nvShadowCoord[ i ] = shadowMatrix[ i ] * objectMatrix * vec4( position, 1.0 );\n#endif\n}\n#endif",alphatest_fragment:"#ifdef ALPHATEST\nif ( gl_FragColor.a < ALPHATEST ) discard;\n#endif", -linear_to_gamma_fragment:"#ifdef GAMMA_OUTPUT\ngl_FragColor.xyz = sqrt( gl_FragColor.xyz );\n#endif"}; -THREE.UniformsUtils={merge:function(a){var b,c,d,e={};for(b=0;b=0)return a.geometry.materials[b.materialIndex]}function d(a){return a instanceof THREE.MeshBasicMaterial&&!a.envMap||a instanceof THREE.MeshDepthMaterial?false:a&&a.shading!==void 0&&a.shading===THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading}function e(a){return a.map||a.lightMap||a instanceof THREE.ShaderMaterial?true:false}function f(a,b,c){var d,e,f,g,h=a.vertices;g=h.length; -var j=a.colors,k=j.length,l=a.__vertexArray,m=a.__colorArray,n=a.__sortArray,p=a.verticesNeedUpdate,o=a.colorsNeedUpdate,q=a.__webglCustomAttributesList;if(c.sortParticles){xa.copy(Ba);xa.multiplySelf(c.matrixWorld);for(d=0;d=0;c--)a[c].object=== -b&&a.splice(c,1)}function q(a,b){for(var c=a.length-1;c>=0;c--)a[c]===b&&a.splice(c,1)}function n(a,b,c,d,e){if(!d.program||d.needsUpdate){G.initMaterial(d,b,c,e);d.needsUpdate=false}if(d.morphTargets&&!e.__webglMorphTargetInfluences){e.__webglMorphTargetInfluences=new Float32Array(G.maxMorphTargets);for(var f=0,g=G.maxMorphTargets;f0};this.setSize=function(a,b){E.width=a;E.height=b;this.setViewport(0,0,E.width,E.height)};this.setViewport=function(a,b,c,d){Kb=a;lb=b;gb=c;Lb=d;i.viewport(Kb,lb,gb,Lb)};this.setScissor=function(a,b,c,d){i.scissor(a,b,c,d)};this.enableScissorTest=function(a){a?i.enable(i.SCISSOR_TEST):i.disable(i.SCISSOR_TEST)};this.setClearColorHex=function(a,b){P.setHex(a);D=b;i.clearColor(P.r,P.g,P.b,D)};this.setClearColor=function(a, -b){P.copy(a);D=b;i.clearColor(P.r,P.g,P.b,D)};this.getClearColor=function(){return P};this.getClearAlpha=function(){return D};this.clear=function(a,b,c){var d=0;if(a===void 0||a)d=d|i.COLOR_BUFFER_BIT;if(b===void 0||b)d=d|i.DEPTH_BUFFER_BIT;if(c===void 0||c)d=d|i.STENCIL_BUFFER_BIT;i.clear(d)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.addPostPlugin=function(a){a.init(this);this.renderPluginsPost.push(a)};this.addPrePlugin=function(a){a.init(this);this.renderPluginsPre.push(a)}; -this.deallocateObject=function(a){if(a.__webglInit){a.__webglInit=false;delete a._modelViewMatrix;delete a._normalMatrix;delete a._normalMatrixArray;delete a._modelViewMatrixArray;delete a._objectMatrixArray;if(a instanceof THREE.Mesh)for(var b in a.geometry.geometryGroups){var c=a.geometry.geometryGroups[b];i.deleteBuffer(c.__webglVertexBuffer);i.deleteBuffer(c.__webglNormalBuffer);i.deleteBuffer(c.__webglTangentBuffer);i.deleteBuffer(c.__webglColorBuffer);i.deleteBuffer(c.__webglUVBuffer);i.deleteBuffer(c.__webglUV2Buffer); -i.deleteBuffer(c.__webglSkinVertexABuffer);i.deleteBuffer(c.__webglSkinVertexBBuffer);i.deleteBuffer(c.__webglSkinIndicesBuffer);i.deleteBuffer(c.__webglSkinWeightsBuffer);i.deleteBuffer(c.__webglFaceBuffer);i.deleteBuffer(c.__webglLineBuffer);var d=void 0,e=void 0;if(c.numMorphTargets){d=0;for(e=c.numMorphTargets;d=0&&e.vertexNormalBuffer){i.bindBuffer(i.ARRAY_BUFFER, -e.vertexNormalBuffer);i.vertexAttribPointer(a.normal,e.vertexNormalBuffer.itemSize,i.FLOAT,false,0,f[d].index*12)}if(a.uv>=0&&e.vertexUvBuffer)if(e.vertexUvBuffer){i.bindBuffer(i.ARRAY_BUFFER,e.vertexUvBuffer);i.vertexAttribPointer(a.uv,e.vertexUvBuffer.itemSize,i.FLOAT,false,0,f[d].index*8);i.enableVertexAttribArray(a.uv)}else i.disableVertexAttribArray(a.uv);if(a.color>=0&&e.vertexColorBuffer){i.bindBuffer(i.ARRAY_BUFFER,e.vertexColorBuffer);i.vertexAttribPointer(a.color,e.vertexColorBuffer.itemSize, -i.FLOAT,false,0,f[d].index*16)}i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,e.vertexIndexBuffer)}i.drawElements(i.TRIANGLES,f[d].count,i.UNSIGNED_SHORT,f[d].start*2);G.info.render.calls++;G.info.render.vertices=G.info.render.vertices+f[d].count;G.info.render.faces=G.info.render.faces+f[d].count/3}}}};this.renderBuffer=function(a,b,c,d,e,f){if(d.visible!==false){var g,h,c=n(a,b,c,d,f),b=c.attributes,a=false,c=e.id*16777215+c.id*2+(d.wireframe?1:0);if(c!==F){F=c;a=true}if(!d.morphTargets&&b.position>=0){if(a){i.bindBuffer(i.ARRAY_BUFFER, -e.__webglVertexBuffer);i.vertexAttribPointer(b.position,3,i.FLOAT,false,0,0)}}else if(f.morphTargetBase){c=d.program.attributes;if(f.morphTargetBase!==-1){i.bindBuffer(i.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[f.morphTargetBase]);i.vertexAttribPointer(c.position,3,i.FLOAT,false,0,0)}else if(c.position>=0){i.bindBuffer(i.ARRAY_BUFFER,e.__webglVertexBuffer);i.vertexAttribPointer(c.position,3,i.FLOAT,false,0,0)}if(f.morphTargetForcedOrder.length){g=0;var j=f.morphTargetForcedOrder;for(h=f.morphTargetInfluences;g< -d.numSupportedMorphTargets&&gk){l=m;k=h[l]}i.bindBuffer(i.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[l]);i.vertexAttribPointer(c["morphTarget"+g],3,i.FLOAT,false,0,0);if(d.morphNormals){i.bindBuffer(i.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[l]);i.vertexAttribPointer(c["morphNormal"+g],3,i.FLOAT,false,0,0)}f.__webglMorphTargetInfluences[g]=k;j[l]=1;k=-1;g++}}d.program.uniforms.morphTargetInfluences!==null&&i.uniform1fv(d.program.uniforms.morphTargetInfluences,f.__webglMorphTargetInfluences)}if(a){if(e.__webglCustomAttributesList){g= -0;for(h=e.__webglCustomAttributesList.length;g=0){i.bindBuffer(i.ARRAY_BUFFER,c.buffer);i.vertexAttribPointer(b[c.buffer.belongsToAttribute],c.size,i.FLOAT,false,0,0)}}}if(b.color>=0){i.bindBuffer(i.ARRAY_BUFFER,e.__webglColorBuffer);i.vertexAttribPointer(b.color,3,i.FLOAT,false,0,0)}if(b.normal>=0){i.bindBuffer(i.ARRAY_BUFFER,e.__webglNormalBuffer);i.vertexAttribPointer(b.normal,3,i.FLOAT,false,0,0)}if(b.tangent>=0){i.bindBuffer(i.ARRAY_BUFFER, -e.__webglTangentBuffer);i.vertexAttribPointer(b.tangent,4,i.FLOAT,false,0,0)}if(b.uv>=0)if(e.__webglUVBuffer){i.bindBuffer(i.ARRAY_BUFFER,e.__webglUVBuffer);i.vertexAttribPointer(b.uv,2,i.FLOAT,false,0,0);i.enableVertexAttribArray(b.uv)}else i.disableVertexAttribArray(b.uv);if(b.uv2>=0)if(e.__webglUV2Buffer){i.bindBuffer(i.ARRAY_BUFFER,e.__webglUV2Buffer);i.vertexAttribPointer(b.uv2,2,i.FLOAT,false,0,0);i.enableVertexAttribArray(b.uv2)}else i.disableVertexAttribArray(b.uv2);if(d.skinning&&b.skinVertexA>= -0&&b.skinVertexB>=0&&b.skinIndex>=0&&b.skinWeight>=0){i.bindBuffer(i.ARRAY_BUFFER,e.__webglSkinVertexABuffer);i.vertexAttribPointer(b.skinVertexA,4,i.FLOAT,false,0,0);i.bindBuffer(i.ARRAY_BUFFER,e.__webglSkinVertexBBuffer);i.vertexAttribPointer(b.skinVertexB,4,i.FLOAT,false,0,0);i.bindBuffer(i.ARRAY_BUFFER,e.__webglSkinIndicesBuffer);i.vertexAttribPointer(b.skinIndex,4,i.FLOAT,false,0,0);i.bindBuffer(i.ARRAY_BUFFER,e.__webglSkinWeightsBuffer);i.vertexAttribPointer(b.skinWeight,4,i.FLOAT,false,0,0)}}if(f instanceof -THREE.Mesh){if(d.wireframe){d=d.wireframeLinewidth;if(d!==Na){i.lineWidth(d);Na=d}a&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer);i.drawElements(i.LINES,e.__webglLineCount,i.UNSIGNED_SHORT,0)}else{a&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer);i.drawElements(i.TRIANGLES,e.__webglFaceCount,i.UNSIGNED_SHORT,0)}G.info.render.calls++;G.info.render.vertices=G.info.render.vertices+e.__webglFaceCount;G.info.render.faces=G.info.render.faces+e.__webglFaceCount/3}else if(f instanceof -THREE.Line){f=f.type===THREE.LineStrip?i.LINE_STRIP:i.LINES;d=d.linewidth;if(d!==Na){i.lineWidth(d);Na=d}i.drawArrays(f,0,e.__webglLineCount);G.info.render.calls++}else if(f instanceof THREE.ParticleSystem){i.drawArrays(i.POINTS,0,e.__webglParticleCount);G.info.render.calls++;G.info.render.points=G.info.render.points+e.__webglParticleCount}else if(f instanceof THREE.Ribbon){i.drawArrays(i.TRIANGLE_STRIP,0,e.__webglVertexCount);G.info.render.calls++}}};this.render=function(a,b,c,d){var e,f,k,m,n=a.__lights, -p=a.fog;Y=-1;Ta=true;if(b.parent===void 0){console.warn("DEPRECATED: Camera hasn't been added to a Scene. Adding it...");a.add(b)}this.autoUpdateScene&&a.updateMatrixWorld();if(!b._viewMatrixArray)b._viewMatrixArray=new Float32Array(16);if(!b._projectionMatrixArray)b._projectionMatrixArray=new Float32Array(16);b.matrixWorldInverse.getInverse(b.matrixWorld);b.matrixWorldInverse.flattenToArray(b._viewMatrixArray);b.projectionMatrix.flattenToArray(b._projectionMatrixArray);Ba.multiply(b.projectionMatrix, -b.matrixWorldInverse);Wa.setFromMatrix(Ba);this.autoUpdateObjects&&this.initWebGLObjects(a);h(this.renderPluginsPre,a,b);G.info.render.calls=0;G.info.render.vertices=0;G.info.render.faces=0;G.info.render.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);m=a.__webglObjects;d=0;for(e=m.length;d=0){t=q.geometry.materials[t];if(t.transparent){o.transparent=t;o.opaque=null}else{o.opaque=t;o.transparent=null}}}else if(t)if(t.transparent){o.transparent=t;o.opaque=null}else{o.opaque=t;o.transparent=null}f.render=true;if(this.sortObjects)if(k.renderDepth)f.z=k.renderDepth;else{$a.copy(k.matrixWorld.getPosition());Ba.multiplyVector3($a);f.z=$a.z}}}this.sortObjects&& -m.sort(g);m=a.__webglObjectsImmediate;d=0;for(e=m.length;d65535){A[z].counter=A[z].counter+1;y=A[z].hash+"_"+A[z].counter;r.geometryGroups[y]===void 0&&(r.geometryGroups[y]={faces3:[],faces4:[],materialIndex:v,vertices:0,numMorphTargets:C, -numMorphNormals:D})}u instanceof THREE.Face3?r.geometryGroups[y].faces3.push(s):r.geometryGroups[y].faces4.push(s);r.geometryGroups[y].vertices=r.geometryGroups[y].vertices+w}r.geometryGroupsList=[];var E=void 0;for(E in r.geometryGroups){r.geometryGroups[E].id=fa++;r.geometryGroupsList.push(r.geometryGroups[E])}}for(j in l.geometryGroups){n=l.geometryGroups[j];if(!n.__webglVertexBuffer){var F=n;F.__webglVertexBuffer=i.createBuffer();F.__webglNormalBuffer=i.createBuffer();F.__webglTangentBuffer=i.createBuffer(); -F.__webglColorBuffer=i.createBuffer();F.__webglUVBuffer=i.createBuffer();F.__webglUV2Buffer=i.createBuffer();F.__webglSkinVertexABuffer=i.createBuffer();F.__webglSkinVertexBBuffer=i.createBuffer();F.__webglSkinIndicesBuffer=i.createBuffer();F.__webglSkinWeightsBuffer=i.createBuffer();F.__webglFaceBuffer=i.createBuffer();F.__webglLineBuffer=i.createBuffer();var H=void 0,K=void 0;if(F.numMorphTargets){F.__webglMorphTargetsBuffers=[];H=0;for(K=F.numMorphTargets;H -0||O.faceVertexUvs.length>0)Q.__uvArray=new Float32Array(P*2);if(O.faceUvs.length>1||O.faceVertexUvs.length>1)Q.__uv2Array=new Float32Array(P*2)}if(J.geometry.skinWeights.length&&J.geometry.skinIndices.length){Q.__skinVertexAArray=new Float32Array(P*4);Q.__skinVertexBArray=new Float32Array(P*4);Q.__skinIndexArray=new Float32Array(P*4);Q.__skinWeightArray=new Float32Array(P*4)}Q.__faceArray=new Uint16Array(Z*3);Q.__lineArray=new Uint16Array(Y*2);var U=void 0,ha=void 0;if(Q.numMorphTargets){Q.__morphTargetsArrays= -[];U=0;for(ha=Q.numMorphTargets;U0){i.bindBuffer(i.ARRAY_BUFFER,ca.__webglSkinVertexABuffer);i.bufferData(i.ARRAY_BUFFER,ra,Xa);i.bindBuffer(i.ARRAY_BUFFER,ca.__webglSkinVertexBBuffer);i.bufferData(i.ARRAY_BUFFER,sa,Xa);i.bindBuffer(i.ARRAY_BUFFER,ca.__webglSkinIndicesBuffer);i.bufferData(i.ARRAY_BUFFER,ta,Xa);i.bindBuffer(i.ARRAY_BUFFER,ca.__webglSkinWeightsBuffer);i.bufferData(i.ARRAY_BUFFER,ua,Xa)}}if(td&&Tc){I=0;for(S=ka.length;I0){i.bindBuffer(i.ARRAY_BUFFER,ca.__webglColorBuffer);i.bufferData(i.ARRAY_BUFFER,Ga,Xa)}}if(sd&&Pa.hasTangents){I=0;for(S=ka.length;I0){i.bindBuffer(i.ARRAY_BUFFER,ca.__webglUVBuffer);i.bufferData(i.ARRAY_BUFFER,vc,Xa)}}if(gd&&Yc&&dd){I=0;for(S=ka.length;I0){i.bindBuffer(i.ARRAY_BUFFER,ca.__webglUV2Buffer);i.bufferData(i.ARRAY_BUFFER,wc,Xa)}}if(qd){I=0;for(S=ka.length;I0?"#define VERTEX_TEXTURES":"",G.gammaInput?"#define GAMMA_INPUT":"",G.gammaOutput?"#define GAMMA_OUTPUT":"",G.physicallyBasedShading?"#define PHYSICALLY_BASED_SHADING":"","#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SPOT_LIGHTS "+c.maxSpotLights,"#define MAX_SHADOWS "+c.maxShadows,"#define MAX_BONES "+ -c.maxBones,c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.vertexColors?"#define USE_COLOR":"",c.skinning?"#define USE_SKINNING":"",c.morphTargets?"#define USE_MORPHTARGETS":"",c.morphNormals?"#define USE_MORPHNORMALS":"",c.perPixel?"#define PHONG_PER_PIXEL":"",c.wrapAround?"#define WRAP_AROUND":"",c.doubleSided?"#define DOUBLE_SIDED":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapSoft?"#define SHADOWMAP_SOFT":"",c.shadowMapDebug?"#define SHADOWMAP_DEBUG": -"",c.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",c.sizeAttenuation?"#define USE_SIZEATTENUATION":"","uniform mat4 objectMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\nattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\nattribute vec3 morphTarget0;\nattribute vec3 morphTarget1;\nattribute vec3 morphTarget2;\nattribute vec3 morphTarget3;\n#ifdef USE_MORPHNORMALS\nattribute vec3 morphNormal0;\nattribute vec3 morphNormal1;\nattribute vec3 morphNormal2;\nattribute vec3 morphNormal3;\n#else\nattribute vec3 morphTarget4;\nattribute vec3 morphTarget5;\nattribute vec3 morphTarget6;\nattribute vec3 morphTarget7;\n#endif\n#endif\n#ifdef USE_SKINNING\nattribute vec4 skinVertexA;\nattribute vec4 skinVertexB;\nattribute vec4 skinIndex;\nattribute vec4 skinWeight;\n#endif\n"].join("\n"); -k=["precision "+z+" float;","#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SPOT_LIGHTS "+c.maxSpotLights,"#define MAX_SHADOWS "+c.maxShadows,c.alphaTest?"#define ALPHATEST "+c.alphaTest:"",G.gammaInput?"#define GAMMA_INPUT":"",G.gammaOutput?"#define GAMMA_OUTPUT":"",G.physicallyBasedShading?"#define PHYSICALLY_BASED_SHADING":"",c.useFog&&c.fog?"#define USE_FOG":"",c.useFog&&c.fog instanceof THREE.FogExp2?"#define FOG_EXP2":"",c.map?"#define USE_MAP": -"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.vertexColors?"#define USE_COLOR":"",c.metal?"#define METAL":"",c.perPixel?"#define PHONG_PER_PIXEL":"",c.wrapAround?"#define WRAP_AROUND":"",c.doubleSided?"#define DOUBLE_SIDED":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapSoft?"#define SHADOWMAP_SOFT":"",c.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",c.shadowMapCascade?"#define SHADOWMAP_CASCADE":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n"); -i.attachShader(r,t("fragment",k+n));i.attachShader(r,t("vertex",d+j));i.linkProgram(r);i.getProgramParameter(r,i.LINK_STATUS)||console.error("Could not initialise shader\nVALIDATE_STATUS: "+i.getProgramParameter(r,i.VALIDATE_STATUS)+", gl error ["+i.getError()+"]");r.uniforms={};r.attributes={};var s,d=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","objectMatrix","cameraPosition","boneGlobalMatrices","morphTargetInfluences"];for(s in h)d.push(s);s=d;d=0;for(h=s.length;d=0&&i.enableVertexAttribArray(q.position); -q.color>=0&&i.enableVertexAttribArray(q.color);q.normal>=0&&i.enableVertexAttribArray(q.normal);q.tangent>=0&&i.enableVertexAttribArray(q.tangent);if(a.skinning&&q.skinVertexA>=0&&q.skinVertexB>=0&&q.skinIndex>=0&&q.skinWeight>=0){i.enableVertexAttribArray(q.skinVertexA);i.enableVertexAttribArray(q.skinVertexB);i.enableVertexAttribArray(q.skinIndex);i.enableVertexAttribArray(q.skinWeight)}if(a.attributes)for(f in a.attributes)q[f]!==void 0&&q[f]>=0&&i.enableVertexAttribArray(q[f]);if(a.morphTargets){a.numSupportedMorphTargets= -0;r="morphTarget";for(f=0;f=0){i.enableVertexAttribArray(q[s]);a.numSupportedMorphTargets++}}}if(a.morphNormals){a.numSupportedMorphNormals=0;r="morphNormal";for(f=0;f=0){i.enableVertexAttribArray(q[s]);a.numSupportedMorphNormals++}}}a.uniformsList=[];for(e in a.uniforms)a.uniformsList.push([a.uniforms[e],e])};this.setFaceCulling=function(a,b){if(a){!b||b==="ccw"?i.frontFace(i.CCW):i.frontFace(i.CW);a==="back"?i.cullFace(i.BACK): -a==="front"?i.cullFace(i.FRONT):i.cullFace(i.FRONT_AND_BACK);i.enable(i.CULL_FACE)}else i.disable(i.CULL_FACE)};this.setObjectFaces=function(a){if(ia!==a.doubleSided){a.doubleSided?i.disable(i.CULL_FACE):i.enable(i.CULL_FACE);ia=a.doubleSided}if(O!==a.flipSided){a.flipSided?i.frontFace(i.CW):i.frontFace(i.CCW);O=a.flipSided}};this.setDepthTest=function(a){if(Ma!==a){a?i.enable(i.DEPTH_TEST):i.disable(i.DEPTH_TEST);Ma=a}};this.setDepthWrite=function(a){if(Ka!==a){i.depthMask(a);Ka=a}};this.setBlending= -function(a,b,c,d){if(a!==Q){switch(a){case THREE.NoBlending:i.disable(i.BLEND);break;case THREE.AdditiveBlending:i.enable(i.BLEND);i.blendEquation(i.FUNC_ADD);i.blendFunc(i.SRC_ALPHA,i.ONE);break;case THREE.SubtractiveBlending:i.enable(i.BLEND);i.blendEquation(i.FUNC_ADD);i.blendFunc(i.ZERO,i.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:i.enable(i.BLEND);i.blendEquation(i.FUNC_ADD);i.blendFunc(i.ZERO,i.SRC_COLOR);break;case THREE.CustomBlending:i.enable(i.BLEND);break;default:i.enable(i.BLEND); -i.blendEquationSeparate(i.FUNC_ADD,i.FUNC_ADD);i.blendFuncSeparate(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA)}Q=a}if(a===THREE.CustomBlending){if(b!==Z){i.blendEquation(H(b));Z=b}if(c!==$||d!==ha){i.blendFunc(H(c),H(d));$=c;ha=d}}else ha=$=Z=null};this.setTexture=function(a,b){if(a.needsUpdate){if(!a.__webglInit){a.__webglInit=true;a.__webglTexture=i.createTexture();G.info.memory.textures++}i.activeTexture(i.TEXTURE0+b);i.bindTexture(i.TEXTURE_2D,a.__webglTexture);i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL, -a.premultiplyAlpha);var c=a.image,d=(c.width&c.width-1)===0&&(c.height&c.height-1)===0,e=H(a.format),f=H(a.type);y(i.TEXTURE_2D,a,d);a instanceof THREE.DataTexture?i.texImage2D(i.TEXTURE_2D,0,e,c.width,c.height,0,e,f,c.data):i.texImage2D(i.TEXTURE_2D,0,e,e,f,a.image);a.generateMipmaps&&d&&i.generateMipmap(i.TEXTURE_2D);a.needsUpdate=false;if(a.onUpdate)a.onUpdate()}else{i.activeTexture(i.TEXTURE0+b);i.bindTexture(i.TEXTURE_2D,a.__webglTexture)}};this.setRenderTarget=function(a){var b=a instanceof -THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){if(a.depthBuffer===void 0)a.depthBuffer=true;if(a.stencilBuffer===void 0)a.stencilBuffer=true;a.__webglTexture=i.createTexture();var c=(a.width&a.width-1)===0&&(a.height&a.height-1)===0,d=H(a.format),e=H(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];i.bindTexture(i.TEXTURE_CUBE_MAP,a.__webglTexture);y(i.TEXTURE_CUBE_MAP,a,c);for(var f=0;f<6;f++){a.__webglFramebuffer[f]=i.createFramebuffer();a.__webglRenderbuffer[f]=i.createRenderbuffer(); -i.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=i.TEXTURE_CUBE_MAP_POSITIVE_X+f;i.bindFramebuffer(i.FRAMEBUFFER,a.__webglFramebuffer[f]);i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,h,g.__webglTexture,0);s(a.__webglRenderbuffer[f],a)}c&&i.generateMipmap(i.TEXTURE_CUBE_MAP)}else{a.__webglFramebuffer=i.createFramebuffer();a.__webglRenderbuffer=i.createRenderbuffer();i.bindTexture(i.TEXTURE_2D,a.__webglTexture);y(i.TEXTURE_2D,a,c);i.texImage2D(i.TEXTURE_2D, -0,d,a.width,a.height,0,d,e,null);d=i.TEXTURE_2D;i.bindFramebuffer(i.FRAMEBUFFER,a.__webglFramebuffer);i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,d,a.__webglTexture,0);s(a.__webglRenderbuffer,a);c&&i.generateMipmap(i.TEXTURE_2D)}b?i.bindTexture(i.TEXTURE_CUBE_MAP,null):i.bindTexture(i.TEXTURE_2D,null);i.bindRenderbuffer(i.RENDERBUFFER,null);i.bindFramebuffer(i.FRAMEBUFFER,null)}if(a){b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer;c=a.width;a=a.height;e=d=0}else{b=null; -c=gb;a=Lb;d=Kb;e=lb}if(b!==C){i.bindFramebuffer(i.FRAMEBUFFER,b);i.viewport(d,e,c,a);C=b}hb=c;Cb=a};this.shadowMapPlugin=new THREE.ShadowMapPlugin;this.addPrePlugin(this.shadowMapPlugin);this.addPostPlugin(new THREE.SpritePlugin);this.addPostPlugin(new THREE.LensFlarePlugin)}; -THREE.WebGLRenderTarget=function(a,b,c){this.width=a;this.height=b;c=c||{};this.wrapS=c.wrapS!==void 0?c.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=c.wrapT!==void 0?c.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=c.magFilter!==void 0?c.magFilter:THREE.LinearFilter;this.minFilter=c.minFilter!==void 0?c.minFilter:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=c.format!==void 0?c.format:THREE.RGBAFormat;this.type=c.type!==void 0?c.type: -THREE.UnsignedByteType;this.depthBuffer=c.depthBuffer!==void 0?c.depthBuffer:true;this.stencilBuffer=c.stencilBuffer!==void 0?c.stencilBuffer:true;this.generateMipmaps=true}; -THREE.WebGLRenderTarget.prototype.clone=function(){var a=new THREE.WebGLRenderTarget(this.width,this.height);a.wrapS=this.wrapS;a.wrapT=this.wrapT;a.magFilter=this.magFilter;a.minFilter=this.minFilter;a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.format=this.format;a.type=this.type;a.depthBuffer=this.depthBuffer;a.stencilBuffer=this.stencilBuffer;return a};THREE.WebGLRenderTargetCube=function(a,b,c){THREE.WebGLRenderTarget.call(this,a,b,c);this.activeCubeFace=0}; -THREE.WebGLRenderTargetCube.prototype=new THREE.WebGLRenderTarget;THREE.WebGLRenderTargetCube.prototype.constructor=THREE.WebGLRenderTargetCube;THREE.RenderableVertex=function(){this.positionWorld=new THREE.Vector3;this.positionScreen=new THREE.Vector4;this.visible=true};THREE.RenderableVertex.prototype.copy=function(a){this.positionWorld.copy(a.positionWorld);this.positionScreen.copy(a.positionScreen)}; -THREE.RenderableFace3=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterial=this.material=null;this.uvs=[[]];this.z=null}; -THREE.RenderableFace4=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.v4=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterial=this.material=null;this.uvs=[[]];this.z=null};THREE.RenderableObject=function(){this.z=this.object=null}; -THREE.RenderableParticle=function(){this.rotation=this.z=this.y=this.x=null;this.scale=new THREE.Vector2;this.material=null};THREE.RenderableLine=function(){this.z=null;this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.material=null}; -THREE.ColorUtils={adjustHSV:function(a,b,c,d){var e=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(a,e);e.h=THREE.Math.clamp(e.h+b,0,1);e.s=THREE.Math.clamp(e.s+c,0,1);e.v=THREE.Math.clamp(e.v+d,0,1);a.setHSV(e.h,e.s,e.v)},rgbToHsv:function(a,b){var c=a.r,d=a.g,e=a.b,f=Math.max(Math.max(c,d),e),g=Math.min(Math.min(c,d),e);if(g===f)g=c=0;else{var h=f-g,g=h/f,c=(c===f?(d-e)/h:d===f?2+(e-c)/h:4+(c-d)/h)/6;c<0&&(c=c+1);c>1&&(c=c-1)}b===void 0&&(b={h:0,s:0,v:0});b.h=c;b.s=g;b.v=f;return b}}; -THREE.ColorUtils.__hsv={h:0,s:0,v:0}; -THREE.GeometryUtils={merge:function(a,b){for(var c,d,e=a.vertices.length,f=b instanceof THREE.Mesh?b.geometry:b,g=a.vertices,h=f.vertices,j=a.faces,l=f.faces,k=a.faceVertexUvs[0],p=f.faceVertexUvs[0],m={},o=0;o1){d=1-d;e=1-e}f=1-d-e;g.copy(a);g.multiplyScalar(d);h.copy(b);h.multiplyScalar(e);g.addSelf(h);h.copy(c);h.multiplyScalar(f);g.addSelf(h);return g},randomPointInFace:function(a,b,c){var d,e,f;if(a instanceof -THREE.Face3){d=b.vertices[a.a];e=b.vertices[a.b];f=b.vertices[a.c];return THREE.GeometryUtils.randomPointInTriangle(d,e,f)}if(a instanceof THREE.Face4){d=b.vertices[a.a];e=b.vertices[a.b];f=b.vertices[a.c];var b=b.vertices[a.d],g;if(c)if(a._area1&&a._area2){c=a._area1;g=a._area2}else{c=THREE.GeometryUtils.triangleArea(d,e,b);g=THREE.GeometryUtils.triangleArea(e,f,b);a._area1=c;a._area2=g}else{c=THREE.GeometryUtils.triangleArea(d,e,b);g=THREE.GeometryUtils.triangleArea(e,f,b)}return THREE.GeometryUtils.random()* -(c+g)a?b(c,e-1):l[e] -b||q>b||m>b){j=a.vertices.length;y=e.clone();s=e.clone();if(o>=q&&o>=m){l=l.clone();l.lerpSelf(k,0.5);y.a=f;y.b=j;y.c=h;s.a=j;s.b=g;s.c=h;if(e.vertexNormals.length===3){f=e.vertexNormals[0].clone();f.lerpSelf(e.vertexNormals[1],0.5);y.vertexNormals[1].copy(f);s.vertexNormals[0].copy(f)}if(e.vertexColors.length===3){f=e.vertexColors[0].clone();f.lerpSelf(e.vertexColors[1],0.5);y.vertexColors[1].copy(f);s.vertexColors[0].copy(f)}e=0}else if(q>=o&&q>=m){l=k.clone();l.lerpSelf(p,0.5);y.a=f;y.b=g;y.c= -j;s.a=j;s.b=h;s.c=f;if(e.vertexNormals.length===3){f=e.vertexNormals[1].clone();f.lerpSelf(e.vertexNormals[2],0.5);y.vertexNormals[2].copy(f);s.vertexNormals[0].copy(f);s.vertexNormals[1].copy(e.vertexNormals[2]);s.vertexNormals[2].copy(e.vertexNormals[0])}if(e.vertexColors.length===3){f=e.vertexColors[1].clone();f.lerpSelf(e.vertexColors[2],0.5);y.vertexColors[2].copy(f);s.vertexColors[0].copy(f);s.vertexColors[1].copy(e.vertexColors[2]);s.vertexColors[2].copy(e.vertexColors[0])}e=1}else{l=l.clone(); -l.lerpSelf(p,0.5);y.a=f;y.b=g;y.c=j;s.a=j;s.b=g;s.c=h;if(e.vertexNormals.length===3){f=e.vertexNormals[0].clone();f.lerpSelf(e.vertexNormals[2],0.5);y.vertexNormals[2].copy(f);s.vertexNormals[0].copy(f)}if(e.vertexColors.length===3){f=e.vertexColors[0].clone();f.lerpSelf(e.vertexColors[2],0.5);y.vertexColors[2].copy(f);s.vertexColors[0].copy(f)}e=2}w.push(y,s);a.vertices.push(l);f=0;for(g=a.faceVertexUvs.length;fb||q>b||n>b||r>b){u=a.vertices.length;t=a.vertices.length+1;y=e.clone();s=e.clone();if(o>=q&&o>=n&&o>=r||n>=q&&n>=o&&n>=r){o=l.clone();o.lerpSelf(k,0.5);k=p.clone();k.lerpSelf(m,0.5);y.a=f;y.b=u;y.c=t;y.d=j;s.a=u;s.b=g;s.c=h;s.d=t;if(e.vertexNormals.length===4){f=e.vertexNormals[0].clone();f.lerpSelf(e.vertexNormals[1],0.5);g=e.vertexNormals[2].clone();g.lerpSelf(e.vertexNormals[3],0.5);y.vertexNormals[1].copy(f); -y.vertexNormals[2].copy(g);s.vertexNormals[0].copy(f);s.vertexNormals[3].copy(g)}if(e.vertexColors.length===4){f=e.vertexColors[0].clone();f.lerpSelf(e.vertexColors[1],0.5);g=e.vertexColors[2].clone();g.lerpSelf(e.vertexColors[3],0.5);y.vertexColors[1].copy(f);y.vertexColors[2].copy(g);s.vertexColors[0].copy(f);s.vertexColors[3].copy(g)}e=0}else{o=k.clone();o.lerpSelf(p,0.5);k=m.clone();k.lerpSelf(l,0.5);y.a=f;y.b=g;y.c=u;y.d=t;s.a=t;s.b=u;s.c=h;s.d=j;if(e.vertexNormals.length===4){f=e.vertexNormals[1].clone(); -f.lerpSelf(e.vertexNormals[2],0.5);g=e.vertexNormals[3].clone();g.lerpSelf(e.vertexNormals[0],0.5);y.vertexNormals[2].copy(f);y.vertexNormals[3].copy(g);s.vertexNormals[0].copy(g);s.vertexNormals[1].copy(f)}if(e.vertexColors.length===4){f=e.vertexColors[1].clone();f.lerpSelf(e.vertexColors[2],0.5);g=e.vertexColors[3].clone();g.lerpSelf(e.vertexColors[0],0.5);y.vertexColors[2].copy(f);y.vertexColors[3].copy(g);s.vertexColors[0].copy(g);s.vertexColors[1].copy(f)}e=1}w.push(y,s);a.vertices.push(o,k); -f=0;for(g=a.faceVertexUvs.length;fe-1?e-1:p+1,q=k-1<0?0:k-1,n=k+1>d-1?d-1:k+1,r=[],u=[0,0,h[(p*d+k)*4]/255*b];r.push([-1,0,h[(p*d+q)*4]/255*b]);r.push([-1,-1,h[(m*d+q)*4]/255*b]);r.push([0, --1,h[(m*d+k)*4]/255*b]);r.push([1,-1,h[(m*d+n)*4]/255*b]);r.push([1,0,h[(p*d+n)*4]/255*b]);r.push([1,1,h[(o*d+n)*4]/255*b]);r.push([0,1,h[(o*d+k)*4]/255*b]);r.push([-1,1,h[(o*d+q)*4]/255*b]);m=[];q=r.length;for(o=0;o 0\nuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\nuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n#endif\n#if MAX_POINT_LIGHTS > 0\nuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\nvarying vec4 vPointLight[ MAX_POINT_LIGHTS ];\n#endif\n#ifdef WRAP_AROUND\nuniform vec3 wrapRGB;\n#endif\nvarying vec3 vViewPosition;", -THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,"void main() {\ngl_FragColor = vec4( vec3( 1.0 ), uOpacity );\nvec3 specularTex = vec3( 1.0 );\nvec3 normalTex = texture2D( tNormal, vUv ).xyz * 2.0 - 1.0;\nnormalTex.xy *= uNormalScale;\nnormalTex = normalize( normalTex );\nif( enableDiffuse ) {\n#ifdef GAMMA_INPUT\nvec4 texelColor = texture2D( tDiffuse, vUv );\ntexelColor.xyz *= texelColor.xyz;\ngl_FragColor = gl_FragColor * texelColor;\n#else\ngl_FragColor = gl_FragColor * texture2D( tDiffuse, vUv );\n#endif\n}\nif( enableAO ) {\n#ifdef GAMMA_INPUT\nvec4 aoColor = texture2D( tAO, vUv );\naoColor.xyz *= aoColor.xyz;\ngl_FragColor.xyz = gl_FragColor.xyz * aoColor.xyz;\n#else\ngl_FragColor.xyz = gl_FragColor.xyz * texture2D( tAO, vUv ).xyz;\n#endif\n}\nif( enableSpecular )\nspecularTex = texture2D( tSpecular, vUv ).xyz;\nmat3 tsb = mat3( normalize( vTangent ), normalize( vBinormal ), normalize( vNormal ) );\nvec3 finalNormal = tsb * normalTex;\nvec3 normal = normalize( finalNormal );\nvec3 viewPosition = normalize( vViewPosition );\n#if MAX_POINT_LIGHTS > 0\nvec3 pointDiffuse = vec3( 0.0 );\nvec3 pointSpecular = vec3( 0.0 );\nfor ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\nvec3 pointVector = normalize( vPointLight[ i ].xyz );\nfloat pointDistance = vPointLight[ i ].w;\n#ifdef WRAP_AROUND\nfloat pointDiffuseWeightFull = max( dot( normal, pointVector ), 0.0 );\nfloat pointDiffuseWeightHalf = max( 0.5 * dot( normal, pointVector ) + 0.5, 0.0 );\nvec3 pointDiffuseWeight = mix( vec3 ( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), wrapRGB );\n#else\nfloat pointDiffuseWeight = max( dot( normal, pointVector ), 0.0 );\n#endif\npointDiffuse += pointDistance * pointLightColor[ i ] * uDiffuseColor * pointDiffuseWeight;\nvec3 pointHalfVector = normalize( pointVector + viewPosition );\nfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\nfloat pointSpecularWeight = specularTex.r * max( pow( pointDotNormalHalf, uShininess ), 0.0 );\n#ifdef PHYSICALLY_BASED_SHADING\nfloat specularNormalization = ( uShininess + 2.0001 ) / 8.0;\nvec3 schlick = uSpecularColor + vec3( 1.0 - uSpecularColor ) * pow( 1.0 - dot( pointVector, pointHalfVector ), 5.0 );\npointSpecular += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * pointDistance * specularNormalization;\n#else\npointSpecular += pointDistance * pointLightColor[ i ] * uSpecularColor * pointSpecularWeight * pointDiffuseWeight;\n#endif\n}\n#endif\n#if MAX_DIR_LIGHTS > 0\nvec3 dirDiffuse = vec3( 0.0 );\nvec3 dirSpecular = vec3( 0.0 );\nfor( int i = 0; i < MAX_DIR_LIGHTS; i++ ) {\nvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\nvec3 dirVector = normalize( lDirection.xyz );\n#ifdef WRAP_AROUND\nfloat directionalLightWeightingFull = max( dot( normal, dirVector ), 0.0 );\nfloat directionalLightWeightingHalf = max( 0.5 * dot( normal, dirVector ) + 0.5, 0.0 );\nvec3 dirDiffuseWeight = mix( vec3( directionalLightWeightingFull ), vec3( directionalLightWeightingHalf ), wrapRGB );\n#else\nfloat dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );\n#endif\ndirDiffuse += directionalLightColor[ i ] * uDiffuseColor * dirDiffuseWeight;\nvec3 dirHalfVector = normalize( dirVector + viewPosition );\nfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\nfloat dirSpecularWeight = specularTex.r * max( pow( dirDotNormalHalf, uShininess ), 0.0 );\n#ifdef PHYSICALLY_BASED_SHADING\nfloat specularNormalization = ( uShininess + 2.0001 ) / 8.0;\nvec3 schlick = uSpecularColor + vec3( 1.0 - uSpecularColor ) * pow( 1.0 - dot( dirVector, dirHalfVector ), 5.0 );\ndirSpecular += schlick * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization;\n#else\ndirSpecular += directionalLightColor[ i ] * uSpecularColor * dirSpecularWeight * dirDiffuseWeight;\n#endif\n}\n#endif\nvec3 totalDiffuse = vec3( 0.0 );\nvec3 totalSpecular = vec3( 0.0 );\n#if MAX_DIR_LIGHTS > 0\ntotalDiffuse += dirDiffuse;\ntotalSpecular += dirSpecular;\n#endif\n#if MAX_POINT_LIGHTS > 0\ntotalDiffuse += pointDiffuse;\ntotalSpecular += pointSpecular;\n#endif\ngl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * uAmbientColor) + totalSpecular;\nif ( enableReflection ) {\nvec3 wPos = cameraPosition - vViewPosition;\nvec3 vReflect = reflect( normalize( wPos ), normal );\nvec4 cubeColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );\n#ifdef GAMMA_INPUT\ncubeColor.xyz *= cubeColor.xyz;\n#endif\ngl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularTex.r * uReflectivity );\n}", -THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n"),vertexShader:["attribute vec4 tangent;\nuniform vec2 uOffset;\nuniform vec2 uRepeat;\n#ifdef VERTEX_TEXTURES\nuniform sampler2D tDisplacement;\nuniform float uDisplacementScale;\nuniform float uDisplacementBias;\n#endif\nvarying vec3 vTangent;\nvarying vec3 vBinormal;\nvarying vec3 vNormal;\nvarying vec2 vUv;\n#if MAX_POINT_LIGHTS > 0\nuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\nuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\nvarying vec4 vPointLight[ MAX_POINT_LIGHTS ];\n#endif\nvarying vec3 vViewPosition;", -THREE.ShaderChunk.shadowmap_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\nvViewPosition = -mvPosition.xyz;\nvNormal = normalMatrix * normal;\nvTangent = normalMatrix * tangent.xyz;\nvBinormal = cross( vNormal, vTangent ) * tangent.w;\nvUv = uv * uRepeat + uOffset;\n#if MAX_POINT_LIGHTS > 0\nfor( int i = 0; i < MAX_POINT_LIGHTS; i++ ) {\nvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\nvec3 lVector = lPosition.xyz - mvPosition.xyz;\nfloat lDistance = 1.0;\nif ( pointLightDistance[ i ] > 0.0 )\nlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\nlVector = normalize( lVector );\nvPointLight[ i ] = vec4( lVector, lDistance );\n}\n#endif\n#ifdef VERTEX_TEXTURES\nvec3 dv = texture2D( tDisplacement, uv ).xyz;\nfloat df = uDisplacementScale * dv.x + uDisplacementBias;\nvec4 displacedPosition = vec4( normalize( vNormal.xyz ) * df, 0.0 ) + mvPosition;\ngl_Position = projectionMatrix * displacedPosition;\n#else\ngl_Position = projectionMatrix * mvPosition;\n#endif", -THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n")},cube:{uniforms:{tCube:{type:"t",value:1,texture:null},tFlip:{type:"f",value:-1}},vertexShader:"varying vec3 vViewPosition;\nvoid main() {\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvViewPosition = cameraPosition - mPosition.xyz;\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vViewPosition;\nvoid main() {\nvec3 wPos = cameraPosition - vViewPosition;\ngl_FragColor = textureCube( tCube, vec3( tFlip * wPos.x, wPos.yz ) );\n}"}}}); -THREE.BufferGeometry=function(){this.id=THREE.GeometryCount++;this.vertexColorArray=this.vertexUvArray=this.vertexNormalArray=this.vertexPositionArray=this.vertexIndexArray=this.vertexColorBuffer=this.vertexUvBuffer=this.vertexNormalBuffer=this.vertexPositionBuffer=this.vertexIndexBuffer=null;this.dynamic=false;this.boundingSphere=this.boundingBox=null;this.morphTargets=[]};THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,computeBoundingBox:function(){},computeBoundingSphere:function(){}}; -THREE.Curve=function(){};THREE.Curve.prototype.getPoint=function(){console.log("Warning, getPoint() not implemented!");return null};THREE.Curve.prototype.getPointAt=function(a){return this.getPoint(this.getUtoTmapping(a))};THREE.Curve.prototype.getPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPoint(b/a));return c};THREE.Curve.prototype.getSpacedPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPointAt(b/a));return c}; -THREE.Curve.prototype.getLength=function(){var a=this.getLengths();return a[a.length-1]};THREE.Curve.prototype.getLengths=function(a){a||(a=this.__arcLengthDivisions?this.__arcLengthDivisions:200);if(this.cacheArcLengths&&this.cacheArcLengths.length==a+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=false;var b=[],c,d=this.getPoint(0),e,f=0;b.push(0);for(e=1;e<=a;e++){c=this.getPoint(e/a);f=f+c.distanceTo(d);b.push(f);d=c}return this.cacheArcLengths=b}; -THREE.Curve.prototype.updateArcLengths=function(){this.needsUpdate=true;this.getLengths()};THREE.Curve.prototype.getUtoTmapping=function(a,b){var c=this.getLengths(),d=0,e=c.length,f;f=b?b:a*c[e-1];for(var g=0,h=e-1,j;g<=h;){d=Math.floor(g+(h-g)/2);j=c[d]-f;if(j<0)g=d+1;else if(j>0)h=d-1;else{h=d;break}}d=h;if(c[d]==f)return d/(e-1);g=c[d];return c=(d+(f-g)/(c[d+1]-g))/(e-1)};THREE.Curve.prototype.getNormalVector=function(a){a=this.getTangent(a);return new THREE.Vector2(-a.y,a.x)}; -THREE.Curve.prototype.getTangent=function(a){var b=a-1.0E-4,a=a+1.0E-4;b<0&&(b=0);a>1&&(a=1);b=this.getPoint(b);return this.getPoint(a).clone().subSelf(b).normalize()};THREE.Curve.prototype.getTangentAt=function(a){return this.getTangent(this.getUtoTmapping(a))};THREE.LineCurve=function(a,b){this.v1=a;this.v2=b};THREE.LineCurve.prototype=new THREE.Curve;THREE.LineCurve.prototype.constructor=THREE.LineCurve; -THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().subSelf(this.v1);b.multiplyScalar(a).addSelf(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)};THREE.LineCurve.prototype.getTangent=function(){return this.v2.clone().subSelf(this.v1).normalize()};THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=new THREE.Curve;THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve; -THREE.QuadraticBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);return new THREE.Vector2(b,a)};THREE.QuadraticBezierCurve.prototype.getTangent=function(a){var b;b=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.y,this.v1.y,this.v2.y);b=new THREE.Vector2(b,a);b.normalize();return b}; -THREE.CubicBezierCurve=function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d};THREE.CubicBezierCurve.prototype=new THREE.Curve;THREE.CubicBezierCurve.prototype.constructor=THREE.CubicBezierCurve;THREE.CubicBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);return new THREE.Vector2(b,a)}; -THREE.CubicBezierCurve.prototype.getTangent=function(a){var b;b=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);b=new THREE.Vector2(b,a);b.normalize();return b};THREE.SplineCurve=function(a){this.points=a==void 0?[]:a};THREE.SplineCurve.prototype=new THREE.Curve;THREE.SplineCurve.prototype.constructor=THREE.SplineCurve; -THREE.SplineCurve.prototype.getPoint=function(a){var b=new THREE.Vector2,c=[],d=this.points,e;e=(d.length-1)*a;a=Math.floor(e);e=e-a;c[0]=a==0?a:a-1;c[1]=a;c[2]=a>d.length-2?d.length-1:a+1;c[3]=a>d.length-3?d.length-1:a+2;b.x=THREE.Curve.Utils.interpolate(d[c[0]].x,d[c[1]].x,d[c[2]].x,d[c[3]].x,e);b.y=THREE.Curve.Utils.interpolate(d[c[0]].y,d[c[1]].y,d[c[2]].y,d[c[3]].y,e);return b}; -THREE.ArcCurve=function(a,b,c,d,e,f){this.aX=a;this.aY=b;this.aRadius=c;this.aStartAngle=d;this.aEndAngle=e;this.aClockwise=f};THREE.ArcCurve.prototype=new THREE.Curve;THREE.ArcCurve.prototype.constructor=THREE.ArcCurve;THREE.ArcCurve.prototype.getPoint=function(a){var b=this.aEndAngle-this.aStartAngle;this.aClockwise||(a=1-a);b=this.aStartAngle+a*b;a=this.aX+this.aRadius*Math.cos(b);b=this.aY+this.aRadius*Math.sin(b);return new THREE.Vector2(a,b)}; -THREE.Curve.Utils={tangentQuadraticBezier:function(a,b,c,d){return 2*(1-a)*(c-b)+2*a*(d-c)},tangentCubicBezier:function(a,b,c,d,e){return-3*b*(1-a)*(1-a)+3*c*(1-a)*(1-a)-6*a*c*(1-a)+6*a*d*(1-a)-3*a*a*d+3*a*a*e},tangentSpline:function(a){return 6*a*a-6*a+(3*a*a-4*a+1)+(-6*a*a+6*a)+(3*a*a-2*a)},interpolate:function(a,b,c,d,e){var a=(c-a)*0.5,d=(d-b)*0.5,f=e*e;return(2*b-2*c+a+d)*e*f+(-3*b+3*c-2*a-d)*f+a*e+b}}; -THREE.Curve.create=function(a,b){a.prototype=new THREE.Curve;a.prototype.constructor=a;a.prototype.getPoint=b;return a};THREE.LineCurve3=THREE.Curve.create(function(a,b){this.v1=a;this.v2=b},function(a){var b=new THREE.Vector3;b.sub(this.v2,this.v1);b.multiplyScalar(a);b.addSelf(this.v1);return b}); -THREE.QuadraticBezierCurve3=THREE.Curve.create(function(a,b,c){this.v0=a;this.v1=b;this.v2=c},function(a){var b,c;b=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);c=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);a=THREE.Shape.Utils.b2(a,this.v0.z,this.v1.z,this.v2.z);return new THREE.Vector3(b,c,a)}); -THREE.CubicBezierCurve3=THREE.Curve.create(function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d},function(a){var b,c;b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);c=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);a=THREE.Shape.Utils.b3(a,this.v0.z,this.v1.z,this.v2.z,this.v3.z);return new THREE.Vector3(b,c,a)}); -THREE.SplineCurve3=THREE.Curve.create(function(a){this.points=a==void 0?[]:a},function(a){var b=new THREE.Vector3,c=[],d=this.points,e,a=(d.length-1)*a;e=Math.floor(a);a=a-e;c[0]=e==0?e:e-1;c[1]=e;c[2]=e>d.length-2?d.length-1:e+1;c[3]=e>d.length-3?d.length-1:e+2;e=d[c[0]];var f=d[c[1]],g=d[c[2]],c=d[c[3]];b.x=THREE.Curve.Utils.interpolate(e.x,f.x,g.x,c.x,a);b.y=THREE.Curve.Utils.interpolate(e.y,f.y,g.y,c.y,a);b.z=THREE.Curve.Utils.interpolate(e.z,f.z,g.z,c.z,a);return b}); -THREE.ClosedSplineCurve3=THREE.Curve.create(function(a){this.points=a==void 0?[]:a},function(a){var b=new THREE.Vector3,c=[],d=this.points,e;e=(d.length-0)*a;a=Math.floor(e);e=e-a;a=a+(a>0?0:(Math.floor(Math.abs(a)/d.length)+1)*d.length);c[0]=(a-1)%d.length;c[1]=a%d.length;c[2]=(a+1)%d.length;c[3]=(a+2)%d.length;b.x=THREE.Curve.Utils.interpolate(d[c[0]].x,d[c[1]].x,d[c[2]].x,d[c[3]].x,e);b.y=THREE.Curve.Utils.interpolate(d[c[0]].y,d[c[1]].y,d[c[2]].y,d[c[3]].y,e);b.z=THREE.Curve.Utils.interpolate(d[c[0]].z, -d[c[1]].z,d[c[2]].z,d[c[3]].z,e);return b});THREE.CurvePath=function(){this.curves=[];this.bends=[];this.autoClose=false};THREE.CurvePath.prototype=new THREE.Curve;THREE.CurvePath.prototype.constructor=THREE.CurvePath;THREE.CurvePath.prototype.add=function(a){this.curves.push(a)};THREE.CurvePath.prototype.checkConnection=function(){}; -THREE.CurvePath.prototype.closePath=function(){var a=this.curves[0].getPoint(0),b=this.curves[this.curves.length-1].getPoint(1);a.equals(b)||this.curves.push(new THREE.LineCurve(b,a))};THREE.CurvePath.prototype.getPoint=function(a){for(var b=a*this.getLength(),c=this.getCurveLengths(),a=0;a=b){b=c[a]-b;a=this.curves[a];b=1-b/a.getLength();return a.getPointAt(b)}a++}return null};THREE.CurvePath.prototype.getLength=function(){var a=this.getCurveLengths();return a[a.length-1]}; -THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var a=[],b=0,c,d=this.curves.length;for(c=0;cb)b=f.x;else if(f.xc)c=f.y;else if(f.y0){g=c[c.length-1]; -o=g.x;q=g.y}else{g=this.actions[d-1].args;o=g[g.length-2];q=g[g.length-1]}for(f=1;f<=a;f++){n=f/a;g=THREE.Shape.Utils.b2(n,o,p,h);n=THREE.Shape.Utils.b2(n,q,m,j);c.push(new THREE.Vector2(g,n))}break;case THREE.PathActions.BEZIER_CURVE_TO:h=f[4];j=f[5];p=f[0];m=f[1];l=f[2];k=f[3];if(c.length>0){g=c[c.length-1];o=g.x;q=g.y}else{g=this.actions[d-1].args;o=g[g.length-2];q=g[g.length-1]}for(f=1;f<=a;f++){n=f/a;g=THREE.Shape.Utils.b3(n,o,p,l,h);n=THREE.Shape.Utils.b3(n,q,m,k,j);c.push(new THREE.Vector2(g, -n))}break;case THREE.PathActions.CSPLINE_THRU:g=this.actions[d-1].args;n=[new THREE.Vector2(g[g.length-2],g[g.length-1])];g=a*f[0].length;n=n.concat(f[0]);n=new THREE.SplineCurve(n);for(f=1;f<=g;f++)c.push(n.getPointAt(f/g));break;case THREE.PathActions.ARC:h=f[0];j=f[1];l=f[2];p=f[3];m=!!f[5];k=f[4]-p;o=a*2;for(f=1;f<=o;f++){n=f/o;m||(n=1-n);n=p+n*k;g=h+l*Math.cos(n);n=j+l*Math.sin(n);c.push(new THREE.Vector2(g,n))}}}d=c[c.length-1];Math.abs(d.x-c[0].x)<1.0E-10&&Math.abs(d.y-c[0].y)<1.0E-10&&c.splice(c.length- -1,1);b&&c.push(c[0]);return c};THREE.Path.prototype.transform=function(a,b){this.getBoundingBox();return this.getWrapPoints(this.getPoints(b),a)};THREE.Path.prototype.nltransform=function(a,b,c,d,e,f){var g=this.getPoints(),h,j,l,k,p;h=0;for(j=g.length;h=0?h-1:c.length-1;f=g-1>=0?g-1:l.length-1;var n=[l[g],c[h],c[e]];p=THREE.FontUtils.Triangulate.area(n);var r=[l[g],l[f],c[h]];m=THREE.FontUtils.Triangulate.area(r);o=h;k=g;h=h+1;g=g+ --1;h<0&&(h=h+c.length);h=h%c.length;g<0&&(g=g+l.length);g=g%l.length;e=h-1>=0?h-1:c.length-1;f=g-1>=0?g-1:l.length-1;n=[l[g],c[h],c[e]];n=THREE.FontUtils.Triangulate.area(n);r=[l[g],l[f],c[h]];r=THREE.FontUtils.Triangulate.area(r);if(p+m>n+r){h=o;g=k;h<0&&(h=h+c.length);h=h%c.length;g<0&&(g=g+l.length);g=g%l.length;e=h-1>=0?h-1:c.length-1;f=g-1>=0?g-1:l.length-1}p=c.slice(0,h);m=c.slice(h);o=l.slice(g);k=l.slice(0,g);f=[l[g],l[f],c[h]];q.push([l[g],c[h],c[e]]);q.push(f);c=p.concat(o).concat(k).concat(m)}return{shape:c, -isolatedPts:q,allpoints:d}},triangulateShape:function(a,b){var c=THREE.Shape.Utils.removeHoles(a,b),d=c.allpoints,e=c.isolatedPts,c=THREE.FontUtils.Triangulate(c.shape,false),f,g,h,j,l={};f=0;for(g=d.length;f1){console.log("THREE.Animation.update: Warning! Scale out of bounds:"+d+" on bone "+o);d=d<0?0:1}if(c==="pos"){c=a.position;if(this.interpolationType===THREE.AnimationHandler.LINEAR){c.x=e[0]+(f[0]-e[0])*d;c.y=e[1]+(f[1]-e[1])*d;c.z=e[2]+(f[2]-e[2])*d}else if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType=== -THREE.AnimationHandler.CATMULLROM_FORWARD){this.points[0]=this.getPrevKeyWith("pos",o,g.index-1).pos;this.points[1]=e;this.points[2]=f;this.points[3]=this.getNextKeyWith("pos",o,h.index+1).pos;d=d*0.33+0.33;e=this.interpolateCatmullRom(this.points,d);c.x=e[0];c.y=e[1];c.z=e[2];if(this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD){d=this.interpolateCatmullRom(this.points,d*1.01);this.target.set(d[0],d[1],d[2]);this.target.subSelf(c);this.target.y=0;this.target.normalize();d=Math.atan2(this.target.x, -this.target.z);a.rotation.set(0,d,0)}}}else if(c==="rot")THREE.Quaternion.slerp(e,f,a.quaternion,d);else if(c==="scl"){c=a.scale;c.x=e[0]+(f[0]-e[0])*d;c.y=e[1]+(f[1]-e[1])*d;c.z=e[2]+(f[2]-e[2])*d}}}}if(this.JITCompile&&k[0][l]===void 0){this.hierarchy[0].updateMatrixWorld(true);for(o=0;oa.length-2?f:f+1;c[3]=f>a.length-3?f:f+2;f=a[c[0]];h=a[c[1]];j=a[c[2]];l=a[c[3]];c=e*e;g=e*c;d[0]=this.interpolate(f[0],h[0],j[0],l[0],e,c,g);d[1]=this.interpolate(f[1],h[1],j[1],l[1],e,c,g);d[2]=this.interpolate(f[2],h[2],j[2],l[2],e,c,g);return d}; -THREE.Animation.prototype.interpolate=function(a,b,c,d,e,f,g){a=(c-a)*0.5;d=(d-b)*0.5;return(2*(b-c)+a+d)*g+(-3*(b-c)-2*a-d)*f+a*e+b};THREE.Animation.prototype.getNextKeyWith=function(a,b,c){for(var d=this.data.hierarchy[b].keys,c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c0?c:0:c>=0?c:c+d.length;c>=0;c--)if(d[c][a]!==void 0)return d[c];return this.data.hierarchy[b].keys[d.length-1]}; -THREE.KeyFrameAnimation=function(a,b,c){this.root=a;this.data=THREE.AnimationHandler.get(b);this.hierarchy=THREE.AnimationHandler.parse(a);this.currentTime=0;this.timeScale=0.001;this.isPlaying=false;this.loop=this.isPaused=true;this.JITCompile=c!==void 0?c:true;a=0;for(b=this.hierarchy.length;a=g?b.interpolate(c,g):b.interpolate(c,c.time)}this.data.hierarchy[a].node.updateMatrix();d.matrixWorldNeedsUpdate=true}}if(this.JITCompile&&f[0][e]===void 0){this.hierarchy[0].updateMatrixWorld(true); -for(a=0;a=0?c:c+b.length;c>=0;c--)if(b[c].hasTarget(a))return b[c];return b[b.length-1]}; -THREE.CubeCamera=function(a,b,c){THREE.Object3D.call(this);var d=new THREE.PerspectiveCamera(90,1,a,b);d.up.set(0,-1,0);d.lookAt(new THREE.Vector3(1,0,0));this.add(d);var e=new THREE.PerspectiveCamera(90,1,a,b);e.up.set(0,-1,0);e.lookAt(new THREE.Vector3(-1,0,0));this.add(e);var f=new THREE.PerspectiveCamera(90,1,a,b);f.up.set(0,0,1);f.lookAt(new THREE.Vector3(0,1,0));this.add(f);var g=new THREE.PerspectiveCamera(90,1,a,b);g.up.set(0,0,-1);g.lookAt(new THREE.Vector3(0,-1,0));this.add(g);var h=new THREE.PerspectiveCamera(90, -1,a,b);h.up.set(0,-1,0);h.lookAt(new THREE.Vector3(0,0,1));this.add(h);var j=new THREE.PerspectiveCamera(90,1,a,b);j.up.set(0,-1,0);j.lookAt(new THREE.Vector3(0,0,-1));this.add(j);this.renderTarget=new THREE.WebGLRenderTargetCube(c,c,{format:THREE.RGBFormat,magFilter:THREE.LinearFilter,minFilter:THREE.LinearFilter});this.updateCubeMap=function(a,b){var c=this.renderTarget,m=c.generateMipmaps;c.generateMipmaps=false;c.activeCubeFace=0;a.render(b,d,c);c.activeCubeFace=1;a.render(b,e,c);c.activeCubeFace= -2;a.render(b,f,c);c.activeCubeFace=3;a.render(b,g,c);c.activeCubeFace=4;a.render(b,h,c);c.generateMipmaps=m;c.activeCubeFace=5;a.render(b,j,c)}};THREE.CubeCamera.prototype=new THREE.Object3D;THREE.CubeCamera.prototype.constructor=THREE.CubeCamera; -THREE.CombinedCamera=function(a,b,c,d,e,f,g){THREE.Camera.call(this);this.fov=c;this.left=-a/2;this.right=a/2;this.top=b/2;this.bottom=-b/2;this.cameraO=new THREE.OrthographicCamera(a/-2,a/2,b/2,b/-2,f,g);this.cameraP=new THREE.PerspectiveCamera(c,a/b,d,e);this.zoom=1;this.toPerspective()};THREE.CombinedCamera.prototype=new THREE.Camera;THREE.CombinedCamera.prototype.constructor=THREE.CombinedCamera; -THREE.CombinedCamera.prototype.toPerspective=function(){this.near=this.cameraP.near;this.far=this.cameraP.far;this.cameraP.fov=this.fov/this.zoom;this.cameraP.updateProjectionMatrix();this.projectionMatrix=this.cameraP.projectionMatrix;this.inPersepectiveMode=true;this.inOrthographicMode=false}; -THREE.CombinedCamera.prototype.toOrthographic=function(){var a=this.cameraP.aspect,b=(this.cameraP.near+this.cameraP.far)/2,b=Math.tan(this.fov/2)*b,a=2*b*a/2,b=b/this.zoom,a=a/this.zoom;this.cameraO.left=-a;this.cameraO.right=a;this.cameraO.top=b;this.cameraO.bottom=-b;this.cameraO.updateProjectionMatrix();this.near=this.cameraO.near;this.far=this.cameraO.far;this.projectionMatrix=this.cameraO.projectionMatrix;this.inPersepectiveMode=false;this.inOrthographicMode=true}; -THREE.CombinedCamera.prototype.setSize=function(a,b){this.cameraP.aspect=a/b;this.left=-a/2;this.right=a/2;this.top=b/2;this.bottom=-b/2};THREE.CombinedCamera.prototype.setFov=function(a){this.fov=a;this.inPersepectiveMode?this.toPerspective():this.toOrthographic()};THREE.CombinedCamera.prototype.updateProjectionMatrix=function(){if(this.inPersepectiveMode)this.toPerspective();else{this.toPerspective();this.toOrthographic()}}; -THREE.CombinedCamera.prototype.setLens=function(a,b){var c=2*Math.atan((b!==void 0?b:24)/(a*2))*(180/Math.PI);this.setFov(c);return c};THREE.CombinedCamera.prototype.setZoom=function(a){this.zoom=a;this.inPersepectiveMode?this.toPerspective():this.toOrthographic()};THREE.CombinedCamera.prototype.toFrontView=function(){this.rotation.x=0;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=false}; -THREE.CombinedCamera.prototype.toBackView=function(){this.rotation.x=0;this.rotation.y=Math.PI;this.rotation.z=0;this.rotationAutoUpdate=false};THREE.CombinedCamera.prototype.toLeftView=function(){this.rotation.x=0;this.rotation.y=-Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=false};THREE.CombinedCamera.prototype.toRightView=function(){this.rotation.x=0;this.rotation.y=Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=false}; -THREE.CombinedCamera.prototype.toTopView=function(){this.rotation.x=-Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=false};THREE.CombinedCamera.prototype.toBottomView=function(){this.rotation.x=Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=false}; -THREE.FirstPersonControls=function(a,b){function c(a,b){return function(){b.apply(a,arguments)}}this.object=a;this.target=new THREE.Vector3(0,0,0);this.domElement=b!==void 0?b:document;this.movementSpeed=1;this.lookSpeed=0.005;this.noFly=false;this.lookVertical=true;this.autoForward=false;this.activeLook=true;this.heightSpeed=false;this.heightCoef=1;this.heightMin=0;this.constrainVertical=false;this.verticalMin=0;this.verticalMax=Math.PI;this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX= -this.autoSpeedFactor=0;this.mouseDragOn=this.freeze=this.moveRight=this.moveLeft=this.moveBackward=this.moveForward=false;if(this.domElement===document){this.viewHalfX=window.innerWidth/2;this.viewHalfY=window.innerHeight/2}else{this.viewHalfX=this.domElement.offsetWidth/2;this.viewHalfY=this.domElement.offsetHeight/2;this.domElement.setAttribute("tabindex",-1)}this.onMouseDown=function(a){this.domElement!==document&&this.domElement.focus();a.preventDefault();a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward= -true;break;case 2:this.moveBackward=true}this.mouseDragOn=true};this.onMouseUp=function(a){a.preventDefault();a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward=false;break;case 2:this.moveBackward=false}this.mouseDragOn=false};this.onMouseMove=function(a){if(this.domElement===document){this.mouseX=a.pageX-this.viewHalfX;this.mouseY=a.pageY-this.viewHalfY}else{this.mouseX=a.pageX-this.domElement.offsetLeft-this.viewHalfX;this.mouseY=a.pageY-this.domElement.offsetTop-this.viewHalfY}}; -this.onKeyDown=function(a){switch(a.keyCode){case 38:case 87:this.moveForward=true;break;case 37:case 65:this.moveLeft=true;break;case 40:case 83:this.moveBackward=true;break;case 39:case 68:this.moveRight=true;break;case 82:this.moveUp=true;break;case 70:this.moveDown=true;break;case 81:this.freeze=!this.freeze}};this.onKeyUp=function(a){switch(a.keyCode){case 38:case 87:this.moveForward=false;break;case 37:case 65:this.moveLeft=false;break;case 40:case 83:this.moveBackward=false;break;case 39:case 68:this.moveRight= -false;break;case 82:this.moveUp=false;break;case 70:this.moveDown=false}};this.update=function(a){var b=0;if(!this.freeze){if(this.heightSpeed){b=THREE.Math.clamp(this.object.position.y,this.heightMin,this.heightMax)-this.heightMin;this.autoSpeedFactor=a*b*this.heightCoef}else this.autoSpeedFactor=0;b=a*this.movementSpeed;(this.moveForward||this.autoForward&&!this.moveBackward)&&this.object.translateZ(-(b+this.autoSpeedFactor));this.moveBackward&&this.object.translateZ(b);this.moveLeft&&this.object.translateX(-b); -this.moveRight&&this.object.translateX(b);this.moveUp&&this.object.translateY(b);this.moveDown&&this.object.translateY(-b);a=a*this.lookSpeed;this.activeLook||(a=0);this.lon=this.lon+this.mouseX*a;if(this.lookVertical)this.lat=this.lat-this.mouseY*a;this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;var b=this.target,c=this.object.position;b.x=c.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=c.y+100*Math.cos(this.phi);b.z=c.z+100*Math.sin(this.phi)* -Math.sin(this.theta);b=1;this.constrainVertical&&(b=Math.PI/(this.verticalMax-this.verticalMin));this.lon=this.lon+this.mouseX*a;if(this.lookVertical)this.lat=this.lat-this.mouseY*a*b;this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;if(this.constrainVertical)this.phi=THREE.Math.mapLinear(this.phi,0,Math.PI,this.verticalMin,this.verticalMax);b=this.target;c=this.object.position;b.x=c.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=c.y+ -100*Math.cos(this.phi);b.z=c.z+100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(b)}};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},false);this.domElement.addEventListener("mousemove",c(this,this.onMouseMove),false);this.domElement.addEventListener("mousedown",c(this,this.onMouseDown),false);this.domElement.addEventListener("mouseup",c(this,this.onMouseUp),false);this.domElement.addEventListener("keydown",c(this,this.onKeyDown),false);this.domElement.addEventListener("keyup", -c(this,this.onKeyUp),false)}; -THREE.PathControls=function(a,b){function c(a){return(a=a*2)<1?0.5*a*a:-0.5*(--a*(a-2)-1)}function d(a,b){return function(){b.apply(a,arguments)}}function e(a,b,c,d){var e={name:c,fps:0.6,length:d,hierarchy:[]},f,g=b.getControlPointsArray(),h=b.getLength(),r=g.length,u=0;f=r-1;b={parent:-1,keys:[]};b.keys[0]={time:0,pos:g[0],rot:[0,0,0,1],scl:[1,1,1]};b.keys[f]={time:d,pos:g[f],rot:[0,0,0,1],scl:[1,1,1]};for(f=1;f=0?a:a+g;b=this.verticalAngleMap.srcRange;a=this.verticalAngleMap.dstRange; -b=THREE.Math.mapLinear(this.phi,b[0],b[1],a[0],a[1]);var d=a[1]-a[0];this.phi=c((b-a[0])/d)*d+a[0];b=this.horizontalAngleMap.srcRange;a=this.horizontalAngleMap.dstRange;b=THREE.Math.mapLinear(this.theta,b[0],b[1],a[0],a[1]);d=a[1]-a[0];this.theta=c((b-a[0])/d)*d+a[0];a=this.target.position;a.x=100*Math.sin(this.phi)*Math.cos(this.theta);a.y=100*Math.cos(this.phi);a.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(this.target.position)};this.onMouseMove=function(a){if(this.domElement=== -document){this.mouseX=a.pageX-this.viewHalfX;this.mouseY=a.pageY-this.viewHalfY}else{this.mouseX=a.pageX-this.domElement.offsetLeft-this.viewHalfX;this.mouseY=a.pageY-this.domElement.offsetTop-this.viewHalfY}};this.init=function(){this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var a=new THREE.MeshLambertMaterial({color:30719}),b=new THREE.MeshLambertMaterial({color:65280}), -c=new THREE.CubeGeometry(10,10,20),g=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(c,a);a=new THREE.Mesh(g,b);a.position.set(0,10,0);this.animation=e(this.animationParent,this.spline,this.id,this.duration);this.animationParent.add(this.object);this.animationParent.add(this.target);this.animationParent.add(a)}else{this.animation=e(this.animationParent,this.spline,this.id,this.duration);this.animationParent.add(this.target);this.animationParent.add(this.object)}if(this.createDebugPath){var a= -this.debugPath,b=this.spline,g=f(b,10),c=f(b,10),h=new THREE.LineBasicMaterial({color:16711680,linewidth:3}),g=new THREE.Line(g,h),c=new THREE.ParticleSystem(c,new THREE.ParticleBasicMaterial({color:16755200,size:3}));g.scale.set(1,1,1);a.add(g);c.scale.set(1,1,1);a.add(c);for(var g=new THREE.SphereGeometry(1,16,8),h=new THREE.MeshBasicMaterial({color:65280}),o=0;o0){var b=this.getContainerDimensions(),c=b.size[0]/2,g=b.size[1]/2;this.moveState.yawLeft=-(a.pageX-b.offset[0]-c)/c;this.moveState.pitchDown=(a.pageY-b.offset[1]-g)/g;this.updateRotationVector()}};this.mouseup=function(a){a.preventDefault();a.stopPropagation();if(this.dragToLook){this.mouseStatus--;this.moveState.yawLeft=this.moveState.pitchDown=0}else switch(a.button){case 0:this.moveForward= -false;break;case 2:this.moveBackward=false}this.updateRotationVector()};this.update=function(a){var b=a*this.movementSpeed,a=a*this.rollSpeed;this.object.translateX(this.moveVector.x*b);this.object.translateY(this.moveVector.y*b);this.object.translateZ(this.moveVector.z*b);this.tmpQuaternion.set(this.rotationVector.x*a,this.rotationVector.y*a,this.rotationVector.z*a,1).normalize();this.object.quaternion.multiplySelf(this.tmpQuaternion);this.object.matrix.setPosition(this.object.position);this.object.matrix.setRotationFromQuaternion(this.object.quaternion); -this.object.matrixWorldNeedsUpdate=true};this.updateMovementVector=function(){var a=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right;this.moveVector.y=-this.moveState.down+this.moveState.up;this.moveVector.z=-a+this.moveState.back};this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp;this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft;this.rotationVector.z= --this.moveState.rollRight+this.moveState.rollLeft};this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}};this.domElement.addEventListener("mousemove",c(this,this.mousemove),false);this.domElement.addEventListener("mousedown",c(this,this.mousedown),false);this.domElement.addEventListener("mouseup", -c(this,this.mouseup),false);this.domElement.addEventListener("keydown",c(this,this.keydown),false);this.domElement.addEventListener("keyup",c(this,this.keyup),false);this.updateMovementVector();this.updateRotationVector()}; -THREE.RollControls=function(a,b){this.object=a;this.domElement=b!==void 0?b:document;this.mouseLook=true;this.autoForward=false;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.object.matrixAutoUpdate=false;this.forward=new THREE.Vector3(0,0,1);this.roll=0;var c=new THREE.Vector3,d=new THREE.Vector3,e=new THREE.Vector3,f=new THREE.Matrix4,g=false,h=1,j=0,l=0,k=0,p=0,m=0,o=window.innerWidth/2,q=window.innerHeight/2;this.update=function(a){if(this.mouseLook){var b= -a*this.lookSpeed;this.rotateHorizontally(b*p);this.rotateVertically(b*m)}b=a*this.movementSpeed;this.object.translateZ(-b*(j>0||this.autoForward&&!(j<0)?1:j));this.object.translateX(b*l);this.object.translateY(b*k);if(g)this.roll=this.roll+this.rollSpeed*a*h;if(this.forward.y>this.constrainVertical[1]){this.forward.y=this.constrainVertical[1];this.forward.normalize()}else if(this.forward.y1?d.normalize():d.z=Math.sqrt(1-e*e);g.copy(c.object.position).subSelf(c.target);e=c.object.up.clone().setLength(d.y);e.addSelf(c.object.up.clone().crossSelf(g).setLength(d.x));e.addSelf(g.setLength(d.z));return e};this.rotateCamera=function(){var a=Math.acos(h.dot(j)/h.length()/j.length());if(a){var b=(new THREE.Vector3).cross(h,j).normalize(),d=new THREE.Quaternion,a=a*c.rotateSpeed; -d.setFromAxisAngle(b,-a);d.multiplyVector3(g);d.multiplyVector3(c.object.up);d.multiplyVector3(j);if(c.staticMoving)h=j;else{d.setFromAxisAngle(b,a*(c.dynamicDampingFactor-1));d.multiplyVector3(h)}}};this.zoomCamera=function(){var a=1+(k.y-l.y)*c.zoomSpeed;if(a!==1&&a>0){g.multiplyScalar(a);c.staticMoving?l=k:l.y=l.y+(k.y-l.y)*this.dynamicDampingFactor}};this.panCamera=function(){var a=m.clone().subSelf(p);if(a.lengthSq()){a.multiplyScalar(g.length()*c.panSpeed);var b=g.clone().crossSelf(c.object.up).setLength(a.x); -b.addSelf(c.object.up.clone().setLength(a.y));c.object.position.addSelf(b);c.target.addSelf(b);c.staticMoving?p=m:p.addSelf(a.sub(m,p).multiplyScalar(c.dynamicDampingFactor))}};this.checkDistances=function(){if(!c.noZoom||!c.noPan){c.object.position.lengthSq()>c.maxDistance*c.maxDistance&&c.object.position.setLength(c.maxDistance);g.lengthSq()0){c.dispatchEvent(o);d.copy(c.object.position)}};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},false);this.domElement.addEventListener("mousemove",function(a){if(c.enabled){if(e){h=j=c.getMouseProjectionOnBall(a.clientX,a.clientY);l=k=c.getMouseOnScreen(a.clientX,a.clientY);p= -m=c.getMouseOnScreen(a.clientX,a.clientY);e=false}f!==-1&&(f===0&&!c.noRotate?j=c.getMouseProjectionOnBall(a.clientX,a.clientY):f===1&&!c.noZoom?k=c.getMouseOnScreen(a.clientX,a.clientY):f===2&&!c.noPan&&(m=c.getMouseOnScreen(a.clientX,a.clientY)))}},false);this.domElement.addEventListener("mousedown",function(a){if(c.enabled){a.preventDefault();a.stopPropagation();if(f===-1){f=a.button;f===0&&!c.noRotate?h=j=c.getMouseProjectionOnBall(a.clientX,a.clientY):f===1&&!c.noZoom?l=k=c.getMouseOnScreen(a.clientX, -a.clientY):this.noPan||(p=m=c.getMouseOnScreen(a.clientX,a.clientY))}}},false);this.domElement.addEventListener("mouseup",function(a){if(c.enabled){a.preventDefault();a.stopPropagation();f=-1}},false);window.addEventListener("keydown",function(a){if(c.enabled&&f===-1){a.keyCode===c.keys[0]&&!c.noRotate?f=0:a.keyCode===c.keys[1]&&!c.noZoom?f=1:a.keyCode===c.keys[2]&&!c.noPan&&(f=2);f!==-1&&(e=true)}},false);window.addEventListener("keyup",function(){c.enabled&&f!==-1&&(f=-1)},false)}; -THREE.CubeGeometry=function(a,b,c,d,e,f,g,h){function j(a,b,c,g,h,j,k,m){var n,p=d||1,o=e||1,q=h/2,r=j/2,t=l.vertices.length;if(a==="x"&&b==="y"||a==="y"&&b==="x")n="z";else if(a==="x"&&b==="z"||a==="z"&&b==="x"){n="y";o=f||1}else if(a==="z"&&b==="y"||a==="y"&&b==="z"){n="x";p=f||1}var i=p+1,u=o+1,y=h/p,C=j/o,Y=new THREE.Vector3;Y[n]=k>0?1:-1;for(h=0;h0){this.vertices.push(new THREE.Vector3(0, -g,0));for(h=0;h0){this.vertices.push(new THREE.Vector3(0,-g,0));for(h=0;ha&&(a=a+Math.PI*2);c=(b+a)/2;a=-Math.cos(c);c=-Math.sin(c);return new THREE.Vector2(a,c)}return d.multiplyScalar(g).addSelf(h).subSelf(a).clone()}function e(c,d){var e,f;for(F=c.length;--F>=0;){e=F;f=F-1;f<0&&(f= -c.length-1);for(var g=0,h=m+k*2,g=0;g=0;D--){G=D/k;i=j*(1-G);M=l*Math.sin(G*Math.PI/2);F=0;for(G=P.length;F0)for(l=0;l2;){if(p--<=0){console.log("Warning, unable to triangulate polygon!");break}j=l;e<=j&&(j=0);l=j+1;e<=l&&(l=0);k=l+1;e<=k&&(k=0);var m;a:{m=a;var o=j,q=l,n=k,r=e,u=g,t=void 0,y=void 0,s=void 0,w=void 0,H=void 0, -E=void 0,z=void 0,v=void 0,A=void 0,y=m[u[o]].x,s=m[u[o]].y,w=m[u[q]].x,H=m[u[q]].y,E=m[u[n]].x,z=m[u[n]].y;if(1.0E-10>(w-y)*(z-s)-(H-s)*(E-y))m=false;else{for(t=0;t=0&&R>=0&&D>=0){m=false;break a}}m=true}}if(m){f.push([a[g[j]], -a[g[l]],a[g[k]]]);h.push([g[j],g[l],g[k]]);j=l;for(k=l+1;k1.0E-4){h.normalize();d=Math.acos(e[l-1].dot(e[l]));j.makeRotationAxis(h,d).multiplyVector3(f[l])}g[l].cross(e[l],f[l])}if(c){d=Math.acos(f[0].dot(f[b-1]));d=d/(b-1);e[0].dot(h.cross(f[0],f[b-1]))>0&&(d=-d);for(l=1;l0;)this.smooth(a)}; -THREE.SubdivisionModifier.prototype.smooth=function(a){function b(){m.debug&&console.log.apply(console,arguments)}function c(){console&&console.log.apply(console,arguments)}function d(a,c,d,e,g,h,i){var j=new THREE.Face4(a,c,d,e,null,g.color,g.material);if(m.useOldVertexColors){j.vertexColors=[];for(var l,n,o,q=0;q<4;q++){o=h[q];l=new THREE.Color;l.setRGB(0,0,0);for(var r=0;r=y&&a1){var j=h[1];d[j]||(d[j]={start:Infinity,end:-Infinity});h=d[j];if(fh.end)h.end=f;c||(c=j)}}for(j in d){h=d[j];this.createAnimation(j,h.start,h.end,a)}this.firstAnimation=c}; -THREE.MorphBlendMesh.prototype.setAnimationDirectionForward=function(a){if(a=this.animationsMap[a]){a.direction=1;a.directionBackwards=false}};THREE.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(a){if(a=this.animationsMap[a]){a.direction=-1;a.directionBackwards=true}};THREE.MorphBlendMesh.prototype.setAnimationFPS=function(a,b){var c=this.animationsMap[a];if(c){c.fps=b;c.duration=(c.end-c.start)/c.fps}}; -THREE.MorphBlendMesh.prototype.setAnimationDuration=function(a,b){var c=this.animationsMap[a];if(c){c.duration=b;c.fps=(c.end-c.start)/c.duration}};THREE.MorphBlendMesh.prototype.setAnimationWeight=function(a,b){var c=this.animationsMap[a];if(c)c.weight=b};THREE.MorphBlendMesh.prototype.setAnimationTime=function(a,b){var c=this.animationsMap[a];if(c)c.time=b};THREE.MorphBlendMesh.prototype.getAnimationTime=function(a){var b=0;if(a=this.animationsMap[a])b=a.time;return b}; -THREE.MorphBlendMesh.prototype.getAnimationDuration=function(a){var b=-1;if(a=this.animationsMap[a])b=a.duration;return b};THREE.MorphBlendMesh.prototype.playAnimation=function(a){var b=this.animationsMap[a];if(b){b.time=0;b.active=true}else console.warn("animation["+a+"] undefined")};THREE.MorphBlendMesh.prototype.stopAnimation=function(a){if(a=this.animationsMap[a])a.active=false}; -THREE.MorphBlendMesh.prototype.update=function(a){for(var b=0,c=this.animationsList.length;bd.duration||d.time<0){d.direction=d.direction*-1;if(d.time>d.duration){d.time=d.duration;d.directionBackwards=true}if(d.time<0){d.time=0;d.directionBackwards=false}}}else{d.time=d.time%d.duration;if(d.time<0)d.time=d.time+d.duration}var f=d.startFrame+THREE.Math.clamp(Math.floor(d.time/ -e),0,d.length-1),g=d.weight;if(f!==d.currentFrame){this.morphTargetInfluences[d.lastFrame]=0;this.morphTargetInfluences[d.currentFrame]=1*g;this.morphTargetInfluences[f]=0;d.lastFrame=d.currentFrame;d.currentFrame=f}e=d.time%e/e;d.directionBackwards&&(e=1-e);this.morphTargetInfluences[d.currentFrame]=e*g;this.morphTargetInfluences[d.lastFrame]=(1-e)*g}}}; -THREE.LensFlarePlugin=function(){function a(a){var c=b.createProgram(),d=b.createShader(b.FRAGMENT_SHADER),e=b.createShader(b.VERTEX_SHADER);b.shaderSource(d,a.fragmentShader);b.shaderSource(e,a.vertexShader);b.compileShader(d);b.compileShader(e);b.attachShader(c,d);b.attachShader(c,e);b.linkProgram(c);return c}var b,c,d,e,f,g,h,j,l,k,p,m,o;this.init=function(q){b=q.context;c=q;d=new Float32Array(16);e=new Uint16Array(6);q=0;d[q++]=-1;d[q++]=-1;d[q++]=0;d[q++]=0;d[q++]=1;d[q++]=-1;d[q++]=1;d[q++]= -0;d[q++]=1;d[q++]=1;d[q++]=1;d[q++]=1;d[q++]=-1;d[q++]=1;d[q++]=0;d[q++]=1;q=0;e[q++]=0;e[q++]=1;e[q++]=2;e[q++]=0;e[q++]=2;e[q++]=3;f=b.createBuffer();g=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,f);b.bufferData(b.ARRAY_BUFFER,d,b.STATIC_DRAW);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,g);b.bufferData(b.ELEMENT_ARRAY_BUFFER,e,b.STATIC_DRAW);h=b.createTexture();j=b.createTexture();b.bindTexture(b.TEXTURE_2D,h);b.texImage2D(b.TEXTURE_2D,0,b.RGB,16,16,0,b.RGB,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D, -b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);b.bindTexture(b.TEXTURE_2D,j);b.texImage2D(b.TEXTURE_2D,0,b.RGBA,16,16,0,b.RGBA,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST); -b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);if(b.getParameter(b.MAX_VERTEX_TEXTURE_IMAGE_UNITS)<=0){l=false;k=a(THREE.ShaderFlares.lensFlare)}else{l=true;k=a(THREE.ShaderFlares.lensFlareVertexTexture)}p={};m={};p.vertex=b.getAttribLocation(k,"position");p.uv=b.getAttribLocation(k,"uv");m.renderType=b.getUniformLocation(k,"renderType");m.map=b.getUniformLocation(k,"map");m.occlusionMap=b.getUniformLocation(k,"occlusionMap");m.opacity=b.getUniformLocation(k,"opacity");m.color=b.getUniformLocation(k, -"color");m.scale=b.getUniformLocation(k,"scale");m.rotation=b.getUniformLocation(k,"rotation");m.screenPosition=b.getUniformLocation(k,"screenPosition");o=false};this.render=function(a,d,e,u){var a=a.__webglFlares,t=a.length;if(t){var y=new THREE.Vector3,s=u/e,w=e*0.5,H=u*0.5,E=16/u,z=new THREE.Vector2(E*s,E),v=new THREE.Vector3(1,1,0),A=new THREE.Vector2(1,1),J=m,E=p;b.useProgram(k);if(!o){b.enableVertexAttribArray(p.vertex);b.enableVertexAttribArray(p.uv);o=true}b.uniform1i(J.occlusionMap,0);b.uniform1i(J.map, -1);b.bindBuffer(b.ARRAY_BUFFER,f);b.vertexAttribPointer(E.vertex,2,b.FLOAT,false,16,0);b.vertexAttribPointer(E.uv,2,b.FLOAT,false,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,g);b.disable(b.CULL_FACE);b.depthMask(false);var K,R,P,D,M;for(K=0;K0&&A.x0&& -A.y0.001&&M.scale>0.001){v.x=M.x;v.y=M.y;v.z=M.z;E=M.size*M.scale/u;z.x=E*s;z.y=E;b.uniform3f(J.screenPosition,v.x,v.y,v.z);b.uniform2f(J.scale,z.x,z.y);b.uniform1f(J.rotation,M.rotation);b.uniform1f(J.opacity,M.opacity); -b.uniform3f(J.color,M.color.r,M.color.g,M.color.b);c.setBlending(M.blending,M.blendEquation,M.blendSrc,M.blendDst);c.setTexture(M.texture,1);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0)}}}}b.enable(b.CULL_FACE);b.enable(b.DEPTH_TEST);b.depthMask(true)}}}; -THREE.ShadowMapPlugin=function(){var a,b,c,d,e=new THREE.Frustum,f=new THREE.Matrix4,g=new THREE.Vector3,h=new THREE.Vector3;this.init=function(e){a=e.context;b=e;var e=THREE.ShaderLib.depthRGBA,f=THREE.UniformsUtils.clone(e.uniforms);c=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:f});d=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:f,morphTargets:true});c._shadowPass=true;d._shadowPass=true};this.render= -function(a,c){b.shadowMapEnabled&&b.shadowMapAutoUpdate&&this.update(a,c)};this.update=function(j,l){var k,p,m,o,q,n,r,u,t,y=[];o=0;a.clearColor(1,1,1,1);a.disable(a.BLEND);a.enable(a.CULL_FACE);b.shadowMapCullFrontFaces?a.cullFace(a.FRONT):a.cullFace(a.BACK);b.setDepthTest(true);k=0;for(p=j.__lights.length;kh.x)h.x=u.x;if(u.yh.y)h.y=u.y;if(u.zh.z)h.z=u.z}o.left=g.x;o.right=h.x;o.top=h.y;o.bottom=g.y;o.updateProjectionMatrix()}o=m.shadowMap;n=m.shadowMatrix;q=m.shadowCamera;q.position.copy(m.matrixWorld.getPosition());q.lookAt(m.target.matrixWorld.getPosition());q.updateMatrixWorld();q.matrixWorldInverse.getInverse(q.matrixWorld); -if(m.cameraHelper)m.cameraHelper.lines.visible=m.shadowCameraVisible;m.shadowCameraVisible&&m.cameraHelper.update();n.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);n.multiplySelf(q.projectionMatrix);n.multiplySelf(q.matrixWorldInverse);if(!q._viewMatrixArray)q._viewMatrixArray=new Float32Array(16);if(!q._projectionMatrixArray)q._projectionMatrixArray=new Float32Array(16);q.matrixWorldInverse.flattenToArray(q._viewMatrixArray);q.projectionMatrix.flattenToArray(q._projectionMatrixArray);f.multiply(q.projectionMatrix, -q.matrixWorldInverse);e.setFromMatrix(f);b.setRenderTarget(o);b.clear();t=j.__webglObjects;m=0;for(o=t.length;m - - - - - - - - - - - - - - - - - -
- How to play Astray: -

- Use the arrow keys to move the ball and find the exit to the maze. -

- Vim trainees: h, j, k, l -
- -
- Hold down the 'I' key for instructions. -
- -
- Level 1 -
- - - - - diff --git a/tools/astray/jquery.js b/tools/astray/jquery.js deleted file mode 100644 index 16ad06c..0000000 --- a/tools/astray/jquery.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v1.7.2 jquery.com | jquery.org/license */ -(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"":"")+""),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;e=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="
"+""+"
",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="
t
",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="
",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function( -a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&j.push({elem:this,matches:d.slice(e)});for(k=0;k0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f -.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(;d1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]===""&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/tools/astray/keyboard.js b/tools/astray/keyboard.js deleted file mode 100644 index b4112f2..0000000 --- a/tools/astray/keyboard.js +++ /dev/null @@ -1,491 +0,0 @@ -/*! - * KeyboardJS - * - * Copyright 2011, Robert William Hurst - * Licenced under the BSD License. - * See https://raw.github.com/RobertWHurst/KeyboardJS/master/license.txt - */ -(function (context, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(factory); - } else { - // Browser globals - context.k = context.KeyboardJS = factory(); - } -}(this, function() { - - //polyfills for ms's peice o' shit browsers - function bind(target, type, handler) { if (target.addEventListener) { target.addEventListener(type, handler, false); } else { target.attachEvent("on" + type, function(event) { return handler.call(target, event); }); } } - [].indexOf||(Array.prototype.indexOf=function(a,b,c){for(c=this.length,b=(c+~~b)%c;b -1) { - activeKeys.splice(iAK, 1); - } - } - } - - //execute the end callback on the active key binding - return pruneActiveKeyBindings(event); - - }); - - //bind to the window blur event and clear all pressed keys - bind(window, "blur", function() { - activeKeys = []; - - //execute the end callback on the active key binding - return pruneActiveKeyBindings(event); - }); - - /** - * Generates an array of active key bindings - */ - function queryActiveBindings() { - var bindingStack = []; - - //loop through the key binding groups by number of keys. - for(var keyCount = keyBindingGroups.length; keyCount > -1; keyCount -= 1) { - if(keyBindingGroups[keyCount]) { - var KeyBindingGroup = keyBindingGroups[keyCount]; - - //loop through the key bindings of the same key length. - for(var bindingIndex = 0; bindingIndex < KeyBindingGroup.length; bindingIndex += 1) { - var binding = KeyBindingGroup[bindingIndex], - - //assume the binding is active till a required key is found to be unsatisfied - keyBindingActive = true; - - //loop through each key required by the binding. - for(var keyIndex = 0; keyIndex < binding.keys.length; keyIndex += 1) { - var key = binding.keys[keyIndex]; - - //if the current key is not in the active keys array the mark the binding as inactive - if(activeKeys.indexOf(key) < 0) { - keyBindingActive = false; - } - } - - //if the key combo is still active then push it into the binding stack - if(keyBindingActive) { - bindingStack.push(binding); - } - } - } - } - - return bindingStack; - } - - /** - * Collects active keys, sets active binds and fires on key down callbacks - * @param event - */ - function executeActiveKeyBindings(event) { - - if(activeKeys < 1) { - return true; - } - - var bindingStack = queryActiveBindings(), - spentKeys = [], - output; - - //loop through each active binding - for (var bindingIndex = 0; bindingIndex < bindingStack.length; bindingIndex += 1) { - var binding = bindingStack[bindingIndex], - usesSpentKey = false; - - //check each of the required keys. Make sure they have not been used by another binding - for(var keyIndex = 0; keyIndex < binding.keys.length; keyIndex += 1) { - var key = binding.keys[keyIndex]; - if(spentKeys.indexOf(key) > -1) { - usesSpentKey = true; - break; - } - } - - //if the binding does not use a key that has been spent then execute it - if(!usesSpentKey) { - - //fire the callback - if(typeof binding.callback === "function") { - if(!binding.callback(event, binding.keys, binding.keyCombo)) { - output = false - } - } - - //add the binding's combo to the active bindings array - if(!activeBindings[binding.keyCombo]) { - activeBindings[binding.keyCombo] = binding; - } - - //add the current key binding's keys to the spent keys array - for(var keyIndex = 0; keyIndex < binding.keys.length; keyIndex += 1) { - var key = binding.keys[keyIndex]; - if(spentKeys.indexOf(key) < 0) { - spentKeys.push(key); - } - } - } - } - - //if there are spent keys then we know a binding was fired - // and that we need to tell jQuery to prevent event bubbling. - if(spentKeys.length) { - return false; - } - - return output; - } - - /** - * Removes no longer active keys and fires the on key up callbacks for associated active bindings. - * @param event - */ - function pruneActiveKeyBindings(event) { - var bindingStack = queryActiveBindings(); - var output; - - //loop through the active combos - for(var bindingCombo in activeBindings) { - if(activeBindings.hasOwnProperty(bindingCombo)) { - var binding = activeBindings[bindingCombo], - active = false; - - //loop thorugh the active bindings - for(var bindingIndex = 0; bindingIndex < bindingStack.length; bindingIndex += 1) { - var activeCombo = bindingStack[bindingIndex].keyCombo; - - //check to see if the combo is still active - if(activeCombo === bindingCombo) { - active = true; - break; - } - } - - //if the combo is no longer active then fire its end callback and remove it - if(!active) { - - if(typeof binding.endCallback === "function") { - if(!binding.endCallback(event, binding.keys, binding.keyCombo)) { - output = false - } - } - - delete activeBindings[bindingCombo]; - } - } - } - - return output; - } - - /** - * Binds a on key down and on key up callback to a key or key combo. Accepts a string containing the name of each - * key you want to bind to comma separated. If you want to bind a combo the use the plus sign to link keys together. - * Example: 'ctrl + x, ctrl + c' Will fire if Control and x or y are pressed at the same time. - * @param keyCombo - * @param callback - * @param endCallback - */ - function bindKey(keyCombo, callback, endCallback) { - - function clear() { - if(keys && keys.length) { - var keyBindingGroup = keyBindingGroups[keys.length]; - - if(keyBindingGroup.indexOf(keyBinding) > -1) { - var index = keyBindingGroups[keys.length].indexOf(keyBinding); - keyBindingGroups[keys.length].splice(index, 1); - } - } - } - - //create an array of combos from the first argument - var bindSets = keyCombo.toLowerCase().replace(/\s/g, '').split(','); - - //create a binding for each key combo - for(var i = 0; i < bindSets.length; i += 1) { - - //split up the keys - var keys = bindSets[i].split('+'); - - //if there are keys in the current combo - if(keys.length) { - if(!keyBindingGroups[keys.length]) { keyBindingGroups[keys.length] = []; } - - //define the - var keyBinding = { - "callback": callback, - "endCallback": endCallback, - "keyCombo": bindSets[i], - "keys": keys - }; - - //save the binding sorted by length - keyBindingGroups[keys.length].push(keyBinding); - } - } - - return { - "clear": clear - } - } - - /** - * Binds keys or key combos to an axis. The keys should be in the following order; up, down, left, right. If any - * of the the binded key or key combos are active the callback will fire. The callback will be passed an array - * containing two numbers. The first represents x and the second represents y. Both have a possible range of -1, - * 0, or 1 depending on the axis direction. - * @param up - * @param down - * @param left - * @param right - * @param callback - */ - function bindAxis(up, down, left, right, callback) { - - function clear() { - if(typeof clearUp === 'function') { clearUp(); } - if(typeof clearDown === 'function') { clearDown(); } - if(typeof clearLeft === 'function') { clearLeft(); } - if(typeof clearRight === 'function') { clearRight(); } - if(typeof timer === 'function') { clearInterval(timer); } - } - - var axis = [0, 0]; - - if(typeof callback !== 'function') { - return false; - } - - //up - var clearUp = bindKey(up, function () { - if(axis[0] === 0) { - axis[0] = -1; - } - }, function() { - axis[0] = 0; - }).clear; - - //down - var clearDown = bindKey(down, function () { - if(axis[0] === 0) { - axis[0] = 1; - } - }, function() { - axis[0] = 0; - }).clear; - - //left - var clearLeft = bindKey(left, function () { - if(axis[1] === 0) { - axis[1] = -1; - } - }, function() { - axis[1] = 0; - }).clear; - - //right - var clearRight = bindKey(right, function () { - if(axis[1] === 0) { - axis[1] = 1; - } - }, function() { - axis[1] = 0; - }).clear; - - var timer = setInterval(function(){ - - //NO CHANGE - if(axis[0] === 0 && axis[1] === 0) { - return; - } - - //run the callback - callback(axis); - - }, 1); - - return { - "clear": clear - } - } - - /** - * Clears all key and key combo binds containing a given key or keys. - * @param keys - */ - function unbindKey(keys) { - - if(keys === 'all') { - keyBindingGroups = []; - return; - } - - keys = keys.replace(/\s/g, '').split(','); - - //loop through the key binding groups. - for(var iKCL = keyBindingGroups.length; iKCL > -1; iKCL -= 1) { - if(keyBindingGroups[iKCL]) { - var KeyBindingGroup = keyBindingGroups[iKCL]; - - //loop through the key bindings. - for(var iB = 0; iB < KeyBindingGroup.length; iB += 1) { - var keyBinding = KeyBindingGroup[iB], - remove = false; - - //loop through the current key binding keys. - for(var iKB = 0; iKB < keyBinding.keys.length; iKB += 1) { - var key = keyBinding.keys[iKB]; - - //loop through the keys to be removed - for(var iKR = 0; iKR < keys.length; iKR += 1) { - var keyToRemove = keys[iKR]; - if(keyToRemove === key) { - remove = true; - break; - } - } - if(remove) { break; } - } - if(remove) { - keyBindingGroups[iKCL].splice(iB, 1); iB -= 1; - if(keyBindingGroups[iKCL].length < 1) { - delete keyBindingGroups[iKCL]; - } - } - } - } - } - } - - /** - * Gets an array of active keys - */ - function getActiveKeys() { - return activeKeys; - } - - /** - * Adds a new keyboard local not supported by keyboard JS - * @param local - * @param keys - */ - function addLocale(local, keys) { - locals[local] = keys; - } - - /** - * Changes the keyboard local - * @param local - */ - function setLocale(local) { - if(locals[local]) { - keys = locals[local]; - } - - } - - return { - "bind": { - "key": bindKey, - "axis": bindAxis - }, - "activeKeys": getActiveKeys, - "unbind": { - "key": unbindKey - }, - "locale": { - "add": addLocale, - "set": setLocale - } - } -})); \ No newline at end of file diff --git a/tools/astray/maze.js b/tools/astray/maze.js deleted file mode 100644 index f804ca1..0000000 --- a/tools/astray/maze.js +++ /dev/null @@ -1,45 +0,0 @@ -function generateSquareMaze(dimension) { - - function iterate(field, x, y) { - field[x][y] = false; - while(true) { - directions = []; - if(x > 1 && field[x-2][y] == true) { - directions.push([-1, 0]); - } - if(x < field.dimension - 2 && field[x+2][y] == true) { - directions.push([1, 0]); - } - if(y > 1 && field[x][y-2] == true) { - directions.push([0, -1]); - } - if(y < field.dimension - 2 && field[x][y+2] == true) { - directions.push([0, 1]); - } - if(directions.length == 0) { - return field; - } - dir = directions[Math.floor(Math.random()*directions.length)]; - field[x+dir[0]][y+dir[1]] = false; - field = iterate(field, x+dir[0]*2, y+dir[1]*2); - } - } - - // Initialize the field. - var field = new Array(dimension); - field.dimension = dimension; - for(var i = 0; i < dimension; i++) { - field[i] = new Array(dimension); - for (var j = 0; j < dimension; j++) { - field[i][j] = true; - } - } - - // Gnerate the maze recursively. - field = iterate(field, 1, 1); - - return field; - -} - - diff --git a/tools/flappybird/404993.json b/tools/flappybird/404993.json deleted file mode 100644 index 4f11071..0000000 --- a/tools/flappybird/404993.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"Game","created":"2016-02-01T17:42:38.341Z","settings":{"physics":{"gravity":[0,-9.8,0]},"render":{"fog_end":1000,"tonemapping":0,"skybox":null,"fog_density":0.01,"gamma_correction":1,"exposure":1,"fog_start":1,"global_ambient":[0.2,0.2,0.2],"skyboxIntensity":1,"fog_color":[0,0,0],"fog":"none","skyboxMip":0,"lightmapSizeMultiplier":16,"lightmapMaxResolution":2048,"lightmapMode":0},"priority_scripts":[]},"entities":{"2f804bc6-c90b-11e5-811e-22000ac52f27":{"template":null,"parent":null,"resource_id":"2f804bc6-c90b-11e5-811e-22000ac52f27","labels":[],"rotation":[0,0,0],"children":["2f804dd8-c90b-11e5-811e-22000ac52f27","002977f4-7d1e-4f91-8093-28b78a2fca32","d5fd6efa-cde6-437a-984d-f9c9d1701cca","453b78e6-cacf-4aa3-a664-2ce250139624"],"scale":[1,1,1],"name":"Root","enabled":true,"components":{},"position":[0,0,0],"tags":[]},"2f804dd8-c90b-11e5-811e-22000ac52f27":{"template":null,"parent":"2f804bc6-c90b-11e5-811e-22000ac52f27","resource_id":"2f804dd8-c90b-11e5-811e-22000ac52f27","labels":[],"rotation":[0,0,0],"children":[],"scale":[1,1,1],"name":"Camera","enabled":true,"components":{"camera":{"projection":1,"farClip":2,"rect":[0,0,1,1],"priority":0,"fov":45,"clearDepthBuffer":true,"clearColor":[0,0,0,1],"enabled":true,"orthoHeight":1.28,"nearClip":0,"clearColorBuffer":true,"frustumCulling":false,"layers":[1,2,3,4,0]},"script":{"enabled":true,"order":["cameraAspect"],"scripts":{"cameraAspect":{"enabled":true,"attributes":{}}}}},"position":[0,0,1],"tags":[]},"911387f0-03b9-4ce7-9a8f-54c0a572279a":{"name":"Background","enabled":true,"resource_id":"911387f0-03b9-4ce7-9a8f-54c0a572279a","parent":"002977f4-7d1e-4f91-8093-28b78a2fca32","children":[],"position":[0,0,0],"rotation":[90,0,0],"scale":[1.44,1,2.56],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3324897,"castShadows":false,"receiveShadows":true,"lightMapCast":true,"lightMapReceive":false,"lightMapSizeMultiplier":1,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"002977f4-7d1e-4f91-8093-28b78a2fca32":{"name":"Game","enabled":true,"resource_id":"002977f4-7d1e-4f91-8093-28b78a2fca32","parent":"2f804bc6-c90b-11e5-811e-22000ac52f27","children":["911387f0-03b9-4ce7-9a8f-54c0a572279a","ed40d44f-26d3-42a6-b32d-8e12fed9c368","1c2cf9bd-da2e-4ce8-ab85-2f5d667c7225"],"position":[0,0,0],"rotation":[0,0,0],"scale":[1,1,1],"components":{"sound":{"enabled":true,"volume":1,"pitch":1,"positional":false,"refDistance":1,"maxDistance":10000,"rollOffFactor":1,"distanceModel":"linear","slots":{"1":{"name":"Point","loop":false,"autoPlay":false,"overlap":false,"asset":3371288,"startTime":0,"duration":null,"volume":1,"pitch":1},"2":{"name":"Swoosh","loop":false,"autoPlay":false,"overlap":false,"asset":3371289,"startTime":0,"duration":null,"volume":1,"pitch":1},"3":{"name":"Flap","loop":false,"autoPlay":false,"overlap":false,"asset":3371286,"startTime":0,"duration":null,"volume":1,"pitch":1},"4":{"name":"Hit","loop":false,"autoPlay":false,"overlap":false,"asset":3371285,"startTime":0,"duration":null,"volume":1,"pitch":1},"5":{"name":"Die","loop":false,"autoPlay":false,"overlap":false,"asset":3371287,"startTime":0,"duration":null,"volume":1,"pitch":1}}},"script":{"enabled":true,"order":["game"],"scripts":{"game":{"enabled":true,"attributes":{}}}}},"tags":[]},"c55f14fb-81ad-4ab9-8bf4-3edcb48c214d":{"name":"Flappy Bird","enabled":true,"resource_id":"c55f14fb-81ad-4ab9-8bf4-3edcb48c214d","parent":"5edfc1d2-4db5-450d-9674-66954e9fc079","children":[],"position":[-0.1,0.35,0.10000000149011612],"rotation":[90,0,0],"scale":[0.96,1.1457535028457642,0.22],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3324918,"castShadows":false,"receiveShadows":true,"lightMapCast":true,"lightMapReceive":false,"lightMapSizeMultiplier":1,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"2eaf713e-8138-4c07-8926-14fd26ee68ac":{"name":"Bird","enabled":true,"resource_id":"2eaf713e-8138-4c07-8926-14fd26ee68ac","parent":"5edfc1d2-4db5-450d-9674-66954e9fc079","children":["50cbf168-e8b1-4eea-9ba7-029399c4e9fc","c7d64ab0-e3db-4e65-b293-ba42b8817c8c","09036c86-19bc-4554-ba04-f04f2058863d","4bbd46ce-4e3d-4ab7-8de3-62d1aedb60f6"],"position":[0.5253366827964783,0.365,0],"rotation":[0,0,0],"scale":[1,1,1],"components":{"script":{"enabled":true,"order":["spriteAnim"],"scripts":{"spriteAnim":{"enabled":true,"attributes":{"speed":6,"startEvent":"ui:flapstart","stopEvent":"ui:flapstop","finishEvent":"finish"}}}}},"tags":[]},"50cbf168-e8b1-4eea-9ba7-029399c4e9fc":{"name":"Bird 1","enabled":true,"resource_id":"50cbf168-e8b1-4eea-9ba7-029399c4e9fc","parent":"2eaf713e-8138-4c07-8926-14fd26ee68ac","children":[],"position":[0,0,0.02],"rotation":[90,0,0],"scale":[0.17,1,0.12],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3325227,"castShadows":false,"receiveShadows":true,"lightMapCast":true,"lightMapReceive":false,"lightMapSizeMultiplier":1,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"c7d64ab0-e3db-4e65-b293-ba42b8817c8c":{"name":"Bird 2","enabled":true,"resource_id":"c7d64ab0-e3db-4e65-b293-ba42b8817c8c","parent":"2eaf713e-8138-4c07-8926-14fd26ee68ac","children":[],"position":[0,0,0.03],"rotation":[90,0,0],"scale":[0.17,1,0.12],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3325540,"castShadows":false,"receiveShadows":true,"lightMapCast":true,"lightMapReceive":false,"lightMapSizeMultiplier":1,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"09036c86-19bc-4554-ba04-f04f2058863d":{"name":"Bird 3","enabled":true,"resource_id":"09036c86-19bc-4554-ba04-f04f2058863d","parent":"2eaf713e-8138-4c07-8926-14fd26ee68ac","children":[],"position":[0,0,0.04],"rotation":[90,0,0],"scale":[0.17,1,0.12],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3325558,"castShadows":false,"receiveShadows":true,"lightMapCast":true,"lightMapReceive":false,"lightMapSizeMultiplier":1,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"4bbd46ce-4e3d-4ab7-8de3-62d1aedb60f6":{"name":"Bird 4","enabled":true,"resource_id":"4bbd46ce-4e3d-4ab7-8de3-62d1aedb60f6","parent":"2eaf713e-8138-4c07-8926-14fd26ee68ac","children":[],"position":[0,0,0.05],"rotation":[90,0,0],"scale":[0.17,1,0.12],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3325540,"castShadows":false,"receiveShadows":true,"lightMapCast":true,"lightMapReceive":false,"lightMapSizeMultiplier":1,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"ed40d44f-26d3-42a6-b32d-8e12fed9c368":{"name":"Ground","enabled":true,"resource_id":"ed40d44f-26d3-42a6-b32d-8e12fed9c368","parent":"002977f4-7d1e-4f91-8093-28b78a2fca32","children":[],"position":[0.06,-1,0.05],"rotation":[90,0,0],"scale":[1.54,1,0.56],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3328228,"castShadows":false,"receiveShadows":true,"lightMapCast":true,"lightMapReceive":false,"lightMapSizeMultiplier":1,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]},"script":{"enabled":true,"order":["scroll"],"scripts":{"scroll":{"enabled":true,"attributes":{"startEvent":"ground:start","stopEvent":"ground:stop","resetEvent":"ground:reset","cycleEvent":"ground:cycle","startX":0.035,"endX":-0.035,"speed":-0.01,"frozen":false}}}}},"tags":[]},"d5fd6efa-cde6-437a-984d-f9c9d1701cca":{"name":"UI","enabled":true,"resource_id":"d5fd6efa-cde6-437a-984d-f9c9d1701cca","parent":"2f804bc6-c90b-11e5-811e-22000ac52f27","children":["f38130e0-6e69-4bf4-8c44-8e3f90728e62","6e68814d-c483-4d06-a3d9-fd7a047305ba","35961cb1-5ebb-48ea-8b75-ff60b0f0b11b"],"position":[0,0,0],"rotation":[0,0,0],"scale":[1,1,1],"components":{},"tags":[]},"afc5c0fb-0e63-46e7-b89c-44e53e40a604":{"name":"Menu Button","enabled":false,"resource_id":"afc5c0fb-0e63-46e7-b89c-44e53e40a604","parent":"35961cb1-5ebb-48ea-8b75-ff60b0f0b11b","children":[],"position":[0,-0.583,0.1],"rotation":[90,0,0],"scale":[0.4,0.15910130739212036,0.14],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3370525,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"04d7b6d8-2aeb-4545-b508-fc657a4f0e07":{"name":"OK Button","enabled":true,"resource_id":"04d7b6d8-2aeb-4545-b508-fc657a4f0e07","parent":"35961cb1-5ebb-48ea-8b75-ff60b0f0b11b","children":[],"position":[-0.31,-0.583,0.1],"rotation":[90,0,0],"scale":[0.4,0.15910130739212036,0.14],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3370701,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]},"script":{"enabled":true,"order":["button"],"scripts":{"button":{"enabled":true,"attributes":{"diplacement":0.00390625,"event":"game:menu"}}}}},"tags":[]},"abbf1649-457c-44ef-8754-7ba463f53c45":{"name":"Rate Button","enabled":false,"resource_id":"abbf1649-457c-44ef-8754-7ba463f53c45","parent":"f38130e0-6e69-4bf4-8c44-8e3f90728e62","children":[],"position":[0.3100000023841858,-0.4111523926258087,0.1],"rotation":[90,0,0],"scale":[0.4,1,0.14],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3370764,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"f38130e0-6e69-4bf4-8c44-8e3f90728e62":{"name":"Menu Screen","enabled":true,"resource_id":"f38130e0-6e69-4bf4-8c44-8e3f90728e62","parent":"d5fd6efa-cde6-437a-984d-f9c9d1701cca","children":["5edfc1d2-4db5-450d-9674-66954e9fc079","abbf1649-457c-44ef-8754-7ba463f53c45","83142483-278d-40a4-afa2-1ea911d734a2","6d28d773-99ee-4a15-b29c-7358f6a84455","a438f7db-f3dc-40b0-a70b-6e5b3833af44"],"position":[0,0,0],"rotation":[0,0,0],"scale":[1,1,1],"components":{},"tags":[]},"83142483-278d-40a4-afa2-1ea911d734a2":{"name":"Score Button","enabled":false,"resource_id":"83142483-278d-40a4-afa2-1ea911d734a2","parent":"f38130e0-6e69-4bf4-8c44-8e3f90728e62","children":[],"position":[0.31,-0.583,0.1],"rotation":[90,0,0],"scale":[0.4,1,0.14],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3371742,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"c196185b-8b7e-484d-bfac-00ec8eda2d07":{"name":"Share Button","enabled":true,"resource_id":"c196185b-8b7e-484d-bfac-00ec8eda2d07","parent":"35961cb1-5ebb-48ea-8b75-ff60b0f0b11b","children":[],"position":[0.31,-0.583,0.1],"rotation":[90,0,0],"scale":[0.4,0.15910130739212036,0.14],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3371771,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]},"script":{"enabled":true,"order":["button"],"scripts":{"button":{"enabled":true,"attributes":{"diplacement":0.00390625,"event":"game:share"}}}}},"tags":[]},"6d28d773-99ee-4a15-b29c-7358f6a84455":{"name":"Start Button","enabled":true,"resource_id":"6d28d773-99ee-4a15-b29c-7358f6a84455","parent":"f38130e0-6e69-4bf4-8c44-8e3f90728e62","children":[],"position":[0,-0.5825550556182861,0.1],"rotation":[90,0,0],"scale":[0.4,1,0.14],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3371786,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]},"script":{"enabled":true,"order":["button"],"scripts":{"button":{"enabled":true,"attributes":{"diplacement":0.00390625,"event":"game:getready"}}}}},"tags":[]},"6e68814d-c483-4d06-a3d9-fd7a047305ba":{"name":"Game Screen","enabled":false,"resource_id":"6e68814d-c483-4d06-a3d9-fd7a047305ba","parent":"d5fd6efa-cde6-437a-984d-f9c9d1701cca","children":["bf0761f8-4efc-4b2a-8543-8a634a6a7c51","47d474fd-f14c-4bb7-8199-7796034f2564","801036c8-de96-4945-a3d9-a6f53ed604e5","132ccffa-58fc-4c92-b998-9dcecdcdcd53","c5754ff4-c27e-435f-9d76-a643ce203590"],"position":[0,0,0],"rotation":[0,0,0],"scale":[1,1,1],"components":{},"tags":[]},"801036c8-de96-4945-a3d9-a6f53ed604e5":{"name":"Get Ready","enabled":true,"resource_id":"801036c8-de96-4945-a3d9-a6f53ed604e5","parent":"6e68814d-c483-4d06-a3d9-fd7a047305ba","children":[],"position":[0,0.4784635901451111,0.1],"rotation":[90,0,0],"scale":[0.87,1.1457535028457642,0.22],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3376987,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]},"script":{"enabled":true,"order":["fade"],"scripts":{"fade":{"enabled":true,"attributes":{"event":"ui:fadegetready","type":1,"duration":0.25}}}}},"tags":[]},"35961cb1-5ebb-48ea-8b75-ff60b0f0b11b":{"name":"Game Over Screen","enabled":false,"resource_id":"35961cb1-5ebb-48ea-8b75-ff60b0f0b11b","parent":"d5fd6efa-cde6-437a-984d-f9c9d1701cca","children":["b0d416c3-d78d-473a-b2cd-45e4d9657502","04d7b6d8-2aeb-4545-b508-fc657a4f0e07","afc5c0fb-0e63-46e7-b89c-44e53e40a604","c196185b-8b7e-484d-bfac-00ec8eda2d07","2680d345-4105-420e-93de-8f9bddf33a49"],"position":[0,0,0],"rotation":[0,0,0],"scale":[1,1,1],"components":{},"tags":[]},"132ccffa-58fc-4c92-b998-9dcecdcdcd53":{"name":"Tap","enabled":true,"resource_id":"132ccffa-58fc-4c92-b998-9dcecdcdcd53","parent":"6e68814d-c483-4d06-a3d9-fd7a047305ba","children":[],"position":[0,-0.100791797041893,0.1],"rotation":[90,0,0],"scale":[0.56,0.9425767414364543,0.49],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3377057,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]},"script":{"enabled":true,"order":["fade"],"scripts":{"fade":{"enabled":true,"attributes":{"event":"ui:fadegetready","type":1,"duration":0.25}}}}},"tags":[]},"5edfc1d2-4db5-450d-9674-66954e9fc079":{"name":"Logo","enabled":true,"resource_id":"5edfc1d2-4db5-450d-9674-66954e9fc079","parent":"f38130e0-6e69-4bf4-8c44-8e3f90728e62","children":["c55f14fb-81ad-4ab9-8bf4-3edcb48c214d","2eaf713e-8138-4c07-8926-14fd26ee68ac"],"position":[0,0,0.1],"rotation":[0,0,0],"scale":[1,1,1],"components":{"script":{"enabled":true,"order":["sine"],"scripts":{"sine":{"enabled":true,"attributes":{"amplitudeScale":0.02,"frequencyScale":7}}}}},"tags":[]},"45f0cc23-352f-4f1f-bb59-b8bfec164148":{"name":"Plane","enabled":true,"resource_id":"45f0cc23-352f-4f1f-bb59-b8bfec164148","parent":"0a182549-248b-426f-94ea-3f1461c6e183","children":[],"position":[-1,0,0],"rotation":[90,0,0],"scale":[2,1,2.56],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3386417,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"453b78e6-cacf-4aa3-a664-2ce250139624":{"name":"Frame","enabled":true,"resource_id":"453b78e6-cacf-4aa3-a664-2ce250139624","parent":"2f804bc6-c90b-11e5-811e-22000ac52f27","children":["0a182549-248b-426f-94ea-3f1461c6e183","c598d47f-34c5-45b7-9a7c-ac50c16ab761","c6ec7db4-a993-4d9d-8ecd-e2d145c230cb"],"position":[0,0,1],"rotation":[0,0,0],"scale":[1,1,1],"components":{},"tags":[]},"9866669b-31a2-4786-a198-daa8e74f5fdd":{"name":"Bird 1","enabled":true,"resource_id":"9866669b-31a2-4786-a198-daa8e74f5fdd","parent":"d76ff52f-7754-40e3-a442-44679c228522","children":[],"position":[0,0,0.02],"rotation":[90,0,0],"scale":[0.17,1,0.12],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3325227,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"dcaf8fc8-0f88-409e-aae6-dff5b3b6ac32":{"name":"Bird 2","enabled":true,"resource_id":"dcaf8fc8-0f88-409e-aae6-dff5b3b6ac32","parent":"d76ff52f-7754-40e3-a442-44679c228522","children":[],"position":[0,0,0.03],"rotation":[90,0,0],"scale":[0.17,1,0.12],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3325540,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"9ef1720e-d004-4ba8-9107-17b2ec068e6a":{"name":"Bird 3","enabled":true,"resource_id":"9ef1720e-d004-4ba8-9107-17b2ec068e6a","parent":"d76ff52f-7754-40e3-a442-44679c228522","children":[],"position":[0,0,0.04],"rotation":[90,0,0],"scale":[0.17,1,0.12],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3325558,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"dcce1363-40ed-4c00-98e0-06e30bba7bc8":{"name":"Bird 4","enabled":true,"resource_id":"dcce1363-40ed-4c00-98e0-06e30bba7bc8","parent":"d76ff52f-7754-40e3-a442-44679c228522","children":[],"position":[0,0,0.05],"rotation":[90,0,0],"scale":[0.17,1,0.12],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3325540,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"d76ff52f-7754-40e3-a442-44679c228522":{"name":"Bird","enabled":false,"resource_id":"d76ff52f-7754-40e3-a442-44679c228522","parent":"1c2cf9bd-da2e-4ce8-ab85-2f5d667c7225","children":["9866669b-31a2-4786-a198-daa8e74f5fdd","dcaf8fc8-0f88-409e-aae6-dff5b3b6ac32","9ef1720e-d004-4ba8-9107-17b2ec068e6a","dcce1363-40ed-4c00-98e0-06e30bba7bc8"],"position":[0,0.16030630469322205,0],"rotation":[0,0,0],"scale":[1,1,1],"components":{"script":{"enabled":true,"order":["spriteAnim","bird"],"scripts":{"spriteAnim":{"enabled":true,"attributes":{"speed":20,"startEvent":"bird:flapstart","stopEvent":"bird:flapstop","finishEvent":"finish"}},"bird":{"enabled":true,"attributes":{"flapVelocity":1.55,"gravity":5,"lowestHeight":-0.65,"radius":0.068}}}}},"tags":[]},"bf0761f8-4efc-4b2a-8543-8a634a6a7c51":{"name":"Pause Button","enabled":true,"resource_id":"bf0761f8-4efc-4b2a-8543-8a634a6a7c51","parent":"6e68814d-c483-4d06-a3d9-fd7a047305ba","children":[],"position":[-0.53,0.84,0.1],"rotation":[90,0,0],"scale":[0.13,0.15910130739212036,0.14],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3388975,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]},"script":{"enabled":true,"order":["button"],"scripts":{"button":{"enabled":true,"attributes":{"diplacement":0.00390625,"event":"game:pause"}}}}},"tags":[]},"47d474fd-f14c-4bb7-8199-7796034f2564":{"name":"Play Button","enabled":false,"resource_id":"47d474fd-f14c-4bb7-8199-7796034f2564","parent":"6e68814d-c483-4d06-a3d9-fd7a047305ba","children":[],"position":[-0.53,0.84,0.1],"rotation":[90,0,0],"scale":[0.13,0.15910130739212036,0.14],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3389018,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]},"script":{"enabled":true,"order":["button"],"scripts":{"button":{"enabled":true,"attributes":{"diplacement":0.00390625,"event":"game:unpause"}}}}},"tags":[]},"b0d416c3-d78d-473a-b2cd-45e4d9657502":{"name":"Game Over","enabled":true,"resource_id":"b0d416c3-d78d-473a-b2cd-45e4d9657502","parent":"35961cb1-5ebb-48ea-8b75-ff60b0f0b11b","children":[],"position":[0,0.5219414234161377,0.10000000149011612],"rotation":[90,0,0],"scale":[0.93,1.1457535028457642,0.22],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3389068,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]},"script":{"enabled":true,"order":["fade"],"scripts":{"fade":{"enabled":true,"attributes":{"event":"ui:fade","type":0,"duration":0.5}}}}},"tags":[]},"0a182549-248b-426f-94ea-3f1461c6e183":{"name":"Left","enabled":true,"resource_id":"0a182549-248b-426f-94ea-3f1461c6e183","parent":"453b78e6-cacf-4aa3-a664-2ce250139624","children":["45f0cc23-352f-4f1f-bb59-b8bfec164148"],"position":[-0.72,0,0],"rotation":[0,0,0],"scale":[1,1,1],"components":{},"tags":[]},"c6ec7db4-a993-4d9d-8ecd-e2d145c230cb":{"name":"Right","enabled":true,"resource_id":"c6ec7db4-a993-4d9d-8ecd-e2d145c230cb","parent":"453b78e6-cacf-4aa3-a664-2ce250139624","children":["8c14898d-2e77-4ac5-8a34-18e0f99fe7c5"],"position":[0.72,0,0],"rotation":[0,0,0],"scale":[1,1,1],"components":{},"tags":[]},"8c14898d-2e77-4ac5-8a34-18e0f99fe7c5":{"name":"Plane","enabled":true,"resource_id":"8c14898d-2e77-4ac5-8a34-18e0f99fe7c5","parent":"c6ec7db4-a993-4d9d-8ecd-e2d145c230cb","children":[],"position":[1,0,0],"rotation":[90,0,0],"scale":[2,1,2.56],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3386417,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"98758923-0ef7-47c4-b353-933ac002dfc1":{"name":"Pipe Down","enabled":true,"resource_id":"98758923-0ef7-47c4-b353-933ac002dfc1","parent":"6bd7ab25-b460-4a76-8f49-9c42f6fd5be3","children":[],"position":[0,0.9,0.009999999776482582],"rotation":[90,0,0],"scale":[0.25,1,1.35],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3406638,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"bb217582-4dbe-4fda-9ba9-64a40ecaca91":{"name":"Pipe Up","enabled":true,"resource_id":"bb217582-4dbe-4fda-9ba9-64a40ecaca91","parent":"6bd7ab25-b460-4a76-8f49-9c42f6fd5be3","children":[],"position":[0,-0.9,0.009999999776482582],"rotation":[90,0,0],"scale":[0.25,1,1.35],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3407410,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"d046ca55-2dbf-4da9-8e02-2a539dde7993":{"name":"Pipes","enabled":true,"resource_id":"d046ca55-2dbf-4da9-8e02-2a539dde7993","parent":"1c2cf9bd-da2e-4ce8-ab85-2f5d667c7225","children":["6bd7ab25-b460-4a76-8f49-9c42f6fd5be3","982bc7ff-6294-43b0-809f-39492a51c027","7aee7f77-8ce9-4093-9a9f-70d51bff2691"],"position":[2,0.1,0],"rotation":[0,0,0],"scale":[1,1,1],"components":{"script":{"enabled":true,"order":["scroll","pipeHeight"],"scripts":{"scroll":{"enabled":true,"attributes":{"startEvent":"pipes:start","stopEvent":"pipes:stop","resetEvent":"pipes:reset","cycleEvent":"pipes:cycle","startX":0.4,"endX":-0.4,"speed":-0.01,"frozen":true}},"pipeHeight":{"enabled":true,"attributes":{}}}}},"tags":[]},"6bd7ab25-b460-4a76-8f49-9c42f6fd5be3":{"name":"Pipe 1","enabled":true,"resource_id":"6bd7ab25-b460-4a76-8f49-9c42f6fd5be3","parent":"d046ca55-2dbf-4da9-8e02-2a539dde7993","children":["bb217582-4dbe-4fda-9ba9-64a40ecaca91","98758923-0ef7-47c4-b353-933ac002dfc1"],"position":[-0.8,0,0],"rotation":[0,0,0],"scale":[1,1,1],"components":{"script":{"enabled":true,"order":["addToScore"],"scripts":{"addToScore":{"enabled":true,"attributes":{"bird":"d76ff52f-7754-40e3-a442-44679c228522"}}}}},"tags":[]},"982bc7ff-6294-43b0-809f-39492a51c027":{"name":"Pipe 2","enabled":true,"resource_id":"982bc7ff-6294-43b0-809f-39492a51c027","parent":"d046ca55-2dbf-4da9-8e02-2a539dde7993","children":["97427277-9358-4e04-b4ae-30fc3947f55a","e24f784d-afb3-47f4-8660-e48139457615"],"position":[0,0,0],"rotation":[0,0,0],"scale":[1,1,1],"components":{"script":{"enabled":true,"order":["addToScore"],"scripts":{"addToScore":{"enabled":true,"attributes":{"bird":"d76ff52f-7754-40e3-a442-44679c228522"}}}}},"tags":[]},"97427277-9358-4e04-b4ae-30fc3947f55a":{"name":"Pipe Up","enabled":true,"resource_id":"97427277-9358-4e04-b4ae-30fc3947f55a","parent":"982bc7ff-6294-43b0-809f-39492a51c027","children":[],"position":[0,-0.9,0.009999999776482582],"rotation":[90,0,0],"scale":[0.25,1,1.35],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3407410,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"e24f784d-afb3-47f4-8660-e48139457615":{"name":"Pipe Down","enabled":true,"resource_id":"e24f784d-afb3-47f4-8660-e48139457615","parent":"982bc7ff-6294-43b0-809f-39492a51c027","children":[],"position":[0,0.9,0.009999999776482582],"rotation":[90,0,0],"scale":[0.25,1,1.35],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3406638,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"7aee7f77-8ce9-4093-9a9f-70d51bff2691":{"name":"Pipe 3","enabled":true,"resource_id":"7aee7f77-8ce9-4093-9a9f-70d51bff2691","parent":"d046ca55-2dbf-4da9-8e02-2a539dde7993","children":["0720ea00-14ce-4898-9197-ae5f5d4a1d1e","677067bb-61ed-4ad8-8b40-798f4b3fcfab"],"position":[0.8,0,0],"rotation":[0,0,0],"scale":[1,1,1],"components":{},"tags":[]},"0720ea00-14ce-4898-9197-ae5f5d4a1d1e":{"name":"Pipe Up","enabled":true,"resource_id":"0720ea00-14ce-4898-9197-ae5f5d4a1d1e","parent":"7aee7f77-8ce9-4093-9a9f-70d51bff2691","children":[],"position":[0,-0.9,0.009999999776482582],"rotation":[90,0,0],"scale":[0.25,1,1.35],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3407410,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"677067bb-61ed-4ad8-8b40-798f4b3fcfab":{"name":"Pipe Down","enabled":true,"resource_id":"677067bb-61ed-4ad8-8b40-798f4b3fcfab","parent":"7aee7f77-8ce9-4093-9a9f-70d51bff2691","children":[],"position":[0,0.9,0.009999999776482582],"rotation":[90,0,0],"scale":[0.25,1,1.35],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3406638,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"c9778a91-e13b-4b9e-88d6-40d5f646dafb":{"name":"Frame","enabled":true,"resource_id":"c9778a91-e13b-4b9e-88d6-40d5f646dafb","parent":"2680d345-4105-420e-93de-8f9bddf33a49","children":[],"position":[0,-0.00022116303443908691,0.10000000149011612],"rotation":[90,0,0],"scale":[1.13,1.1457535028457642,0.58],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3428665,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"1c2cf9bd-da2e-4ce8-ab85-2f5d667c7225":{"name":"Foreground","enabled":true,"resource_id":"1c2cf9bd-da2e-4ce8-ab85-2f5d667c7225","parent":"002977f4-7d1e-4f91-8093-28b78a2fca32","children":["d76ff52f-7754-40e3-a442-44679c228522","d046ca55-2dbf-4da9-8e02-2a539dde7993"],"position":[-0.3,0,0],"rotation":[0,0,0],"scale":[1,1,1],"components":{},"tags":[]},"c5754ff4-c27e-435f-9d76-a643ce203590":{"name":"Score","enabled":true,"resource_id":"c5754ff4-c27e-435f-9d76-a643ce203590","parent":"6e68814d-c483-4d06-a3d9-fd7a047305ba","children":["e86a9b9e-c67d-4c9d-8815-9465e538ae90","099e5f60-bb8d-4e92-b2ba-23dc33f4bc68","20a4994c-ff5b-40c8-862b-8bc4b18a383f"],"position":[0,0.8600000143051147,0.1],"rotation":[0,0,0],"scale":[1,1,1],"components":{"script":{"enabled":true,"order":["score"],"scripts":{"score":{"enabled":true,"attributes":{"center":true,"name":"score","zero":3460239,"one":3460296,"two":3460297,"three":3460298,"four":3460299,"five":3460314,"six":3460315,"seven":3460316,"eight":3460331,"nine":3460332,"blank":3462035}}}}},"tags":[]},"e86a9b9e-c67d-4c9d-8815-9465e538ae90":{"name":"Digit 0","enabled":true,"resource_id":"e86a9b9e-c67d-4c9d-8815-9465e538ae90","parent":"c5754ff4-c27e-435f-9d76-a643ce203590","children":[],"position":[-0.16,0,0],"rotation":[90,0,0],"scale":[0.07,0.15910130739212036,0.1],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3462035,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"099e5f60-bb8d-4e92-b2ba-23dc33f4bc68":{"name":"Digit 1","enabled":true,"resource_id":"099e5f60-bb8d-4e92-b2ba-23dc33f4bc68","parent":"c5754ff4-c27e-435f-9d76-a643ce203590","children":[],"position":[-0.08,0,0],"rotation":[90,0,0],"scale":[0.07,0.15910130739212036,0.1],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3462035,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"20a4994c-ff5b-40c8-862b-8bc4b18a383f":{"name":"Digit 2","enabled":true,"resource_id":"20a4994c-ff5b-40c8-862b-8bc4b18a383f","parent":"c5754ff4-c27e-435f-9d76-a643ce203590","children":[],"position":[0,0,0],"rotation":[90,0,0],"scale":[0.07,0.15910130739212036,0.1],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3460239,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"3e958394-11f9-4044-b1a7-3108582dbbc3":{"name":"Best Score","enabled":true,"resource_id":"3e958394-11f9-4044-b1a7-3108582dbbc3","parent":"2680d345-4105-420e-93de-8f9bddf33a49","children":["40f01e7b-93dc-4852-a8e7-4c0ccd4a10b2","03432fa0-adca-427d-bc22-08036db4ad54","24551cc2-3b0a-450d-8ce7-4a5ea5df65f3"],"position":[0.41999998688697815,-0.14,0.30000001192092896],"rotation":[0,0,0],"scale":[1,1,1],"components":{"script":{"enabled":true,"order":["score"],"scripts":{"score":{"enabled":true,"attributes":{"center":true,"name":"best","zero":3460239,"one":3460296,"two":3460297,"three":3460298,"four":3460299,"five":3460314,"six":3460315,"seven":3460316,"eight":3460331,"nine":3460332,"blank":3462035}}}}},"tags":[]},"40f01e7b-93dc-4852-a8e7-4c0ccd4a10b2":{"name":"Digit 0","enabled":true,"resource_id":"40f01e7b-93dc-4852-a8e7-4c0ccd4a10b2","parent":"3e958394-11f9-4044-b1a7-3108582dbbc3","children":[],"position":[-0.16,0,0],"rotation":[90,0,0],"scale":[0.07,0.15910130739212036,0.1],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3462035,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"03432fa0-adca-427d-bc22-08036db4ad54":{"name":"Digit 1","enabled":true,"resource_id":"03432fa0-adca-427d-bc22-08036db4ad54","parent":"3e958394-11f9-4044-b1a7-3108582dbbc3","children":[],"position":[-0.08,0,0],"rotation":[90,0,0],"scale":[0.07,0.15910130739212036,0.1],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3462035,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"24551cc2-3b0a-450d-8ce7-4a5ea5df65f3":{"name":"Digit 2","enabled":true,"resource_id":"24551cc2-3b0a-450d-8ce7-4a5ea5df65f3","parent":"3e958394-11f9-4044-b1a7-3108582dbbc3","children":[],"position":[0,0,0],"rotation":[90,0,0],"scale":[0.07,0.15910130739212036,0.1],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3460239,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"0e46574f-97b1-4a21-a7e6-63468ad006ab":{"name":"Current Score","enabled":true,"resource_id":"0e46574f-97b1-4a21-a7e6-63468ad006ab","parent":"2680d345-4105-420e-93de-8f9bddf33a49","children":["d873c576-d21b-4853-b576-d47a57a07bb2","30ccedf9-5ba6-49fd-9033-0dd4724e12c4","cf03210a-4e81-48e9-817e-7654ae0e9eee"],"position":[0.42,0.07,0.3],"rotation":[0,0,0],"scale":[1,1,1],"components":{"script":{"enabled":true,"order":["score"],"scripts":{"score":{"enabled":true,"attributes":{"center":true,"name":"current","zero":3460239,"one":3460296,"two":3460297,"three":3460298,"four":3460299,"five":3460314,"six":3460315,"seven":3460316,"eight":3460331,"nine":3460332,"blank":3462035}}}}},"tags":[]},"d873c576-d21b-4853-b576-d47a57a07bb2":{"name":"Digit 0","enabled":true,"resource_id":"d873c576-d21b-4853-b576-d47a57a07bb2","parent":"0e46574f-97b1-4a21-a7e6-63468ad006ab","children":[],"position":[-0.16,0,0],"rotation":[90,0,0],"scale":[0.07,0.15910130739212036,0.1],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3462035,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"30ccedf9-5ba6-49fd-9033-0dd4724e12c4":{"name":"Digit 1","enabled":true,"resource_id":"30ccedf9-5ba6-49fd-9033-0dd4724e12c4","parent":"0e46574f-97b1-4a21-a7e6-63468ad006ab","children":[],"position":[-0.08,0,0],"rotation":[90,0,0],"scale":[0.07,0.15910130739212036,0.1],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3462035,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"cf03210a-4e81-48e9-817e-7654ae0e9eee":{"name":"Digit 2","enabled":true,"resource_id":"cf03210a-4e81-48e9-817e-7654ae0e9eee","parent":"0e46574f-97b1-4a21-a7e6-63468ad006ab","children":[],"position":[0,0,0],"rotation":[90,0,0],"scale":[0.07,0.15910130739212036,0.1],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3460239,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"2680d345-4105-420e-93de-8f9bddf33a49":{"name":"Scoreboard","enabled":true,"resource_id":"2680d345-4105-420e-93de-8f9bddf33a49","parent":"35961cb1-5ebb-48ea-8b75-ff60b0f0b11b","children":["0e46574f-97b1-4a21-a7e6-63468ad006ab","3e958394-11f9-4044-b1a7-3108582dbbc3","c9778a91-e13b-4b9e-88d6-40d5f646dafb","26cdcbf9-2cf3-4783-8bef-cf96b358740b","ad11eeda-1101-4629-b70a-04b159ab7018","ad9a8f6e-6cd7-44f2-958e-1f76f2960342"],"position":[0,-1.7,0],"rotation":[0,0,0],"scale":[1,1,1],"components":{"script":{"enabled":true,"order":["tween"],"scripts":{"tween":{"enabled":true,"attributes":{"event":"ui:showscoreboard","duration":0.5,"startPos":[0,-1.6,0],"endPos":[0,0,0],"startScale":[1,1,1],"endScale":[1,1,1],"easing":4,"inOut":1}}}}},"tags":[]},"26cdcbf9-2cf3-4783-8bef-cf96b358740b":{"name":"Medal","enabled":true,"resource_id":"26cdcbf9-2cf3-4783-8bef-cf96b358740b","parent":"2680d345-4105-420e-93de-8f9bddf33a49","children":[],"position":[-0.33,-0.03,0.20000000298023224],"rotation":[90,0,0],"scale":[0.22,1.1457535028457642,0.22],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3470035,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]},"script":{"enabled":true,"order":["medal"],"scripts":{"medal":{"enabled":true,"attributes":{"blank":3462035,"bronze":3469949,"silver":3469967,"gold":3470034,"platinum":3470035}}}}},"tags":[]},"a438f7db-f3dc-40b0-a70b-6e5b3833af44":{"name":"Copyright","enabled":true,"resource_id":"a438f7db-f3dc-40b0-a70b-6e5b3833af44","parent":"f38130e0-6e69-4bf4-8c44-8e3f90728e62","children":[],"position":[0,-0.84,0.10000000149011612],"rotation":[90,0,0],"scale":[0.95,1.1457535028457642,0.06],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3486265,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"ad9a8f6e-6cd7-44f2-958e-1f76f2960342":{"name":"Sparkle","enabled":true,"resource_id":"ad9a8f6e-6cd7-44f2-958e-1f76f2960342","parent":"2680d345-4105-420e-93de-8f9bddf33a49","children":["a2e78136-70aa-41f3-8da2-151b38d34678","1ad668a2-1404-4eb4-b881-c8c92df642c3","f1657f73-b005-4692-a788-982a1e339e56","46cd1278-0f9b-43d5-a561-283ec8410769","94665c65-e75e-43c6-bba9-ab8d2681c9b3","bc2a0bb1-6b71-40b0-9524-ba20ca46fe6a"],"position":[-0.33,-0.03,0],"rotation":[0,0,0],"scale":[1,1,1],"components":{"script":{"enabled":true,"order":["spriteAnim","sparkle"],"scripts":{"spriteAnim":{"enabled":true,"attributes":{"speed":10,"startEvent":"start","stopEvent":"stop","finishEvent":"ui:sparkle"}},"sparkle":{"enabled":true,"attributes":{"radius":0.1}}}}},"tags":[]},"1ad668a2-1404-4eb4-b881-c8c92df642c3":{"name":"Sparkle 2","enabled":true,"resource_id":"1ad668a2-1404-4eb4-b881-c8c92df642c3","parent":"ad9a8f6e-6cd7-44f2-958e-1f76f2960342","children":[],"position":[0,0,0.3],"rotation":[90,0,0],"scale":[0.05,1,0.05],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3520267,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"f1657f73-b005-4692-a788-982a1e339e56":{"name":"Sparkle 3","enabled":true,"resource_id":"f1657f73-b005-4692-a788-982a1e339e56","parent":"ad9a8f6e-6cd7-44f2-958e-1f76f2960342","children":[],"position":[0,0,0.4],"rotation":[90,0,0],"scale":[0.05,1,0.05],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3520282,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"46cd1278-0f9b-43d5-a561-283ec8410769":{"name":"Sparkle 4","enabled":true,"resource_id":"46cd1278-0f9b-43d5-a561-283ec8410769","parent":"ad9a8f6e-6cd7-44f2-958e-1f76f2960342","children":[],"position":[0,0,0.5],"rotation":[90,0,0],"scale":[0.05,1,0.05],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3520283,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"94665c65-e75e-43c6-bba9-ab8d2681c9b3":{"name":"Sparkle 5","enabled":true,"resource_id":"94665c65-e75e-43c6-bba9-ab8d2681c9b3","parent":"ad9a8f6e-6cd7-44f2-958e-1f76f2960342","children":[],"position":[0,0,0.6],"rotation":[90,0,0],"scale":[0.05,1,0.05],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3520282,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"bc2a0bb1-6b71-40b0-9524-ba20ca46fe6a":{"name":"Sparkle 6","enabled":true,"resource_id":"bc2a0bb1-6b71-40b0-9524-ba20ca46fe6a","parent":"ad9a8f6e-6cd7-44f2-958e-1f76f2960342","children":[],"position":[0,0,0.7],"rotation":[90,0,0],"scale":[0.05,1,0.05],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3520267,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"a2e78136-70aa-41f3-8da2-151b38d34678":{"name":"Sparkle 1","enabled":true,"resource_id":"a2e78136-70aa-41f3-8da2-151b38d34678","parent":"ad9a8f6e-6cd7-44f2-958e-1f76f2960342","children":[],"position":[0,0,0.7],"rotation":[90,0,0],"scale":[0.05,1,0.05],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3462035,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"ad11eeda-1101-4629-b70a-04b159ab7018":{"name":"New","enabled":true,"resource_id":"ad11eeda-1101-4629-b70a-04b159ab7018","parent":"2680d345-4105-420e-93de-8f9bddf33a49","children":[],"position":[0.19,-0.035,0.20000000298023224],"rotation":[90,0,0],"scale":[0.16,1.1457535028457642,0.07],"components":{"model":{"enabled":true,"type":"plane","asset":null,"materialAsset":3652807,"castShadows":false,"receiveShadows":true,"lightmapped":false,"castShadowsLightmap":true,"lightmapSizeMultiplier":1,"isStatic":false,"batchGroupId":null,"layers":[0]}},"tags":[]},"c598d47f-34c5-45b7-9a7c-ac50c16ab761":{"name":"Screen","tags":[],"enabled":true,"resource_id":"c598d47f-34c5-45b7-9a7c-ac50c16ab761","parent":"453b78e6-cacf-4aa3-a664-2ce250139624","children":[],"position":[0,0,0],"rotation":[90,0,0],"scale":[1.44,1,2.56],"components":{"model":{"enabled":false,"isStatic":false,"type":"plane","asset":null,"materialAsset":4831174,"castShadows":false,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"batchGroupId":null,"layers":[0]},"script":{"enabled":true,"order":["fade"],"scripts":{"fade":{"enabled":true,"attributes":{"event":"screen:fade","type":2,"duration":0.5}}}}}}},"id":404993} \ No newline at end of file diff --git a/tools/flappybird/__game-scripts.js b/tools/flappybird/__game-scripts.js deleted file mode 100644 index 583ad0d..0000000 --- a/tools/flappybird/__game-scripts.js +++ /dev/null @@ -1 +0,0 @@ -!function(){if("performance"in window==!1&&(window.performance={}),Date.now=Date.now||function(){return(new Date).getTime()},"now"in window.performance==!1){var n=window.performance.timing&&window.performance.timing.navigationStart?window.performance.timing.navigationStart:Date.now();window.performance.now=function(){return Date.now()-n}}}();var TWEEN=TWEEN||function(){var n=[];return{getAll:function(){return n},removeAll:function(){n=[]},add:function(t){n.push(t)},remove:function(t){var r=n.indexOf(t);-1!==r&&n.splice(r,1)},update:function(t){if(0===n.length)return!1;var r=0;for(t=void 0!==t?t:window.performance.now();r1?1:M),i)if(void 0!==r[f]){var T=r[f]||0,g=i[f];g instanceof Array?t[f]=p(g,m):("string"==typeof g&&(g=g.startsWith("+")||g.startsWith("-")?T+parseFloat(g,10):parseFloat(g,10)),"number"==typeof g&&(t[f]=T+(g-T)*m))}if(null!==I&&I.call(t,m),1===M){if(e>0){for(f in isFinite(e)&&e--,o){if("string"==typeof i[f]&&(o[f]=o[f]+parseFloat(i[f],10)),a){var O=o[f];o[f]=i[f],i[f]=O}r[f]=o[f]}return a&&(c=!c),h=n+s,!0}null!==v&&v.call(t);for(var N=0,W=E.length;N1?u(n[r],n[r-1],r-i):u(n[o],n[o+1>r?r:o+1],i-o)},Bezier:function(n,t){for(var r=0,i=n.length-1,o=Math.pow,u=TWEEN.Interpolation.Utils.Bernstein,e=0;e<=i;e++)r+=o(1-t,i-e)*o(t,e)*n[e]*u(i,e);return r},CatmullRom:function(n,t){var r=n.length-1,i=r*t,o=Math.floor(i),u=TWEEN.Interpolation.Utils.CatmullRom;return n[0]===n[r]?(t<0&&(o=Math.floor(i=r*(1+t))),u(n[(o-1+r)%r],n[o],n[(o+1)%r],n[(o+2)%r],i-o)):t<0?n[0]-(u(n[0],n[0],n[1],n[1],-i)-n[0]):t>1?n[r]-(u(n[r],n[r],n[r-1],n[r-1],i-r)-n[r]):u(n[o?o-1:0],n[o],n[r1;i--)r*=i;return n[t]=r,r}}(),CatmullRom:function(n,t,r,i,o){var u=.5*(r-n),e=.5*(i-t),a=o*o;return(2*t-2*r+u+e)*(o*a)+(-3*t+3*r-2*u-e)*a+u*o+t}}},function(n){"function"==typeof define&&define.amd?define([],function(){return TWEEN}):"undefined"!=typeof module&&"object"==typeof exports?module.exports=TWEEN:void 0!==n&&(n.TWEEN=TWEEN)}(this);var AddToScore=pc.createScript("addToScore");AddToScore.attributes.add("bird",{type:"entity"}),AddToScore.prototype.initialize=function(){this.lastX=this.entity.getPosition().x},AddToScore.prototype.update=function(t){var i=this.app,o=this.bird.getPosition().x,e=this.entity.getPosition().x;e<=o&&this.lastX>o&&i.fire("game:addscore"),this.lastX=e};var Medal=pc.createScript("medal");Medal.attributes.add("blank",{type:"asset",assetType:"material",array:!1}),Medal.attributes.add("bronze",{type:"asset",assetType:"material",array:!1}),Medal.attributes.add("silver",{type:"asset",assetType:"material",array:!1}),Medal.attributes.add("gold",{type:"asset",assetType:"material",array:!1}),Medal.attributes.add("platinum",{type:"asset",assetType:"material",array:!1}),Medal.prototype.initialize=function(){var a=this.app;this.materials={},this.materials.platinum=this.platinum.resource,this.materials.gold=this.gold.resource,this.materials.silver=this.silver.resource,this.materials.bronze=this.bronze.resource,this.materials.blank=this.blank.resource,a.root.findByName("Sparkle").enabled=!1,this.entity.model.material=this.materials.blank,a.on("ui:setmedal",function(e){this.entity.model.material=e>=40?this.materials.platinum:e>=30?this.materials.gold:e>=20?this.materials.silver:e>=10?this.materials.bronze:this.materials.blank,a.root.findByName("Sparkle").enabled=e>=10},this),this.on("enable",function(){a.root.findByName("Sparkle").enabled=!1,this.entity.model.material=this.materials.blank})};function storageAvailable(e){try{var t=window[e],o="__storage_test__";return t.setItem(o,o),t.removeItem(o),!0}catch(e){return!1}}var Game=pc.createScript("game");Game.prototype.initialize=function(){var e=this.app;this.score=0,this.bestScore=0,storageAvailable("localStorage")&&(this.bestScore=localStorage.getItem("Flappy Bird Best Score"),null===this.bestScore&&(this.bestScore=0)),e.on("game:menu",function(){e.fire("screen:fade"),setTimeout(function(){e.root.findByName("Game").findByName("Bird").enabled=!1,e.fire("pipes:reset"),e.fire("ground:start"),e.root.findByName("Game Over Screen").enabled=!1,e.root.findByName("Menu Screen").enabled=!0},250)},this),e.on("game:getready",function(){this.score=0,e.fire("ui:score",this.score),e.fire("screen:fade"),setTimeout(function(){e.root.findByName("Menu Screen").enabled=!1,e.root.findByName("Game Screen").enabled=!0,e.root.findByName("Get Ready").model.enabled=!0,e.root.findByName("Tap").model.enabled=!0;var t=e.root.findByName("Game").findByName("Bird");t.enabled=!0,t.script.bird.reset()},250)},this),e.on("game:play",function(){e.fire("pipes:start"),e.fire("ui:fadegetready")},this),e.on("game:pause",function(){e.root.findByName("Pause Button").enabled=!1,e.root.findByName("Play Button").enabled=!0},this),e.on("game:unpause",function(){e.root.findByName("Pause Button").enabled=!0,e.root.findByName("Play Button").enabled=!1},this),e.on("game:gameover",function(){e.root.findByName("Game Screen").enabled=!1,e.root.findByName("Game Over Screen").enabled=!0,e.root.findByName("New").enabled=this.score>this.bestScore,this.bestScore=Math.max(this.score,this.bestScore),storageAvailable("localStorage")&&localStorage.setItem("Flappy Bird Best Score",this.bestScore.toString()),e.fire("pipes:stop"),e.fire("ground:stop"),e.fire("ui:fade"),e.fire("game:audio","Swoosh"),setTimeout(function(){e.fire("ui:showscoreboard",this.score),e.fire("ui:current",this.score),e.fire("ui:best",this.bestScore),e.fire("game:audio","Swoosh")}.bind(this),500),setTimeout(function(){e.fire("ui:setmedal",this.score)}.bind(this),1e3)},this),e.on("game:addscore",function(){this.score++,e.fire("game:audio","Point"),e.fire("ui:score",this.score)},this),e.on("game:share",function(){var e=screen.width/2-320,t=screen.height/2-190,o="https://twitter.com/intent/tweet?text="+encodeURIComponent("I scored "+this.score+" in Flappy Bird! Beat that! http://flappybird.playcanvas.com/ Powered by @playcanvas #webgl #html5"),i=window.open(o,"name","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=640, height=380, top="+t+", left="+e);window.focus&&i&&i.focus()},this),e.on("game:audio",function(e){this.entity.sound.play(e)},this)},Game.prototype.update=function(e){TWEEN.update()};var Button=pc.createScript("button");Button.attributes.add("diplacement",{type:"number",default:.00390625}),Button.attributes.add("event",{type:"string"}),Button.prototype.initialize=function(){this.pressed=!1,this.min=new pc.Vec3,this.max=new pc.Vec3,this.mouseDownListener=function(e){this.press(e.clientX,e.clientY)}.bind(this),this.mouseUpListener=function(e){this.release()}.bind(this),this.touchStartListener=function(e){var t=e.changedTouches[0];this.press(t.clientX,t.clientY)}.bind(this),this.touchEndListener=function(e){this.release()}.bind(this),window.addEventListener("mousedown",this.mouseDownListener,{passive:!1}),window.addEventListener("mouseup",this.mouseUpListener,{passive:!1}),window.addEventListener("touchstart",this.touchStartListener,{passive:!1}),window.addEventListener("touchend",this.touchEndListener,{passive:!1}),this.on("enable",function(){window.addEventListener("mousedown",this.mouseDownListener,{passive:!1}),window.addEventListener("mouseup",this.mouseUpListener,{passive:!1}),window.addEventListener("touchstart",this.touchStartListener,{passive:!1}),window.addEventListener("touchend",this.touchEndListener,{passive:!1})}),this.on("disable",function(){this.pressed=!1,window.removeEventListener("mousedown",this.mouseDownListener,{passive:!1}),window.removeEventListener("mouseup",this.mouseUpListener,{passive:!1}),window.removeEventListener("touchstart",this.touchStartListener,{passive:!1}),window.removeEventListener("touchend",this.touchEndListener,{passive:!1})})},Button.prototype.checkForClick=function(e,t){var s=this.app.root.findByName("Camera"),i=this.entity.model.model.meshInstances[0].aabb;return s.camera.worldToScreen(i.getMin(),this.min),s.camera.worldToScreen(i.getMax(),this.max),e>=this.min.x&&e<=this.max.x&&t>=this.max.y&&t<=this.min.y},Button.prototype.press=function(e,t){this.checkForClick(e,t)&&(this.pressed=!0,this.entity.translate(0,-this.diplacement,0))},Button.prototype.release=function(){var e=this.app;this.pressed&&(this.pressed=!1,this.entity.translate(0,this.diplacement,0),e.fire(this.event),e.fire("game:audio","Swoosh"))};var Sparkle=pc.createScript("sparkle");Sparkle.attributes.add("radius",{type:"number",default:1}),Sparkle.prototype.initialize=function(){var i=this.app;this.initialPos=this.entity.getLocalPosition().clone(),i.on("ui:sparkle",function(){var i=Math.random()*Math.PI*2,t=Math.cos(i)*this.radius*Math.random(),a=Math.sin(i)*this.radius*Math.random();this.entity.setLocalPosition(this.initialPos.x+t,this.initialPos.y+a,this.initialPos.z)},this)};var Tween=pc.createScript("tween");Tween.attributes.add("event",{type:"string"}),Tween.attributes.add("duration",{type:"number",default:1}),Tween.attributes.add("startPos",{type:"vec3",default:[0,0,0]}),Tween.attributes.add("endPos",{type:"vec3",default:[0,0,0]}),Tween.attributes.add("startScale",{type:"vec3",default:[1,1,1]}),Tween.attributes.add("endScale",{type:"vec3",default:[1,1,1]}),Tween.attributes.add("easing",{type:"number",enum:[{Linear:0},{Quadratic:1},{Cubic:2},{Quartic:3},{Quintic:4},{Sinusoidal:5},{Exponential:6},{Circular:7},{Elastic:8},{Back:9},{Bounce:10}]}),Tween.attributes.add("inOut",{type:"number",enum:[{In:0},{Out:1},{InOut:2}]});var easingFuncs=[[TWEEN.Easing.Linear.None,TWEEN.Easing.Linear.None,TWEEN.Easing.Linear.None],[TWEEN.Easing.Quadratic.In,TWEEN.Easing.Quadratic.Out,TWEEN.Easing.Quadratic.InOut],[TWEEN.Easing.Cubic.In,TWEEN.Easing.Cubic.Out,TWEEN.Easing.Cubic.InOut],[TWEEN.Easing.Quartic.In,TWEEN.Easing.Quartic.Out,TWEEN.Easing.Quartic.InOut],[TWEEN.Easing.Quintic.In,TWEEN.Easing.Quintic.Out,TWEEN.Easing.Quintic.InOut],[TWEEN.Easing.Sinusoidal.In,TWEEN.Easing.Sinusoidal.Out,TWEEN.Easing.Sinusoidal.InOut],[TWEEN.Easing.Exponential.In,TWEEN.Easing.Exponential.Out,TWEEN.Easing.Exponential.InOut],[TWEEN.Easing.Circular.In,TWEEN.Easing.Circular.Out,TWEEN.Easing.Circular.InOut],[TWEEN.Easing.Elastic.In,TWEEN.Easing.Elastic.Out,TWEEN.Easing.Elastic.InOut],[TWEEN.Easing.Back.In,TWEEN.Easing.Back.Out,TWEEN.Easing.Back.InOut],[TWEEN.Easing.Bounce.In,TWEEN.Easing.Bounce.Out,TWEEN.Easing.Bounce.InOut]];Tween.prototype.initialize=function(){var t=this.app,i=this.entity;this.initialPos=this.entity.getPosition().clone(),this.initialScl=this.entity.getLocalScale().clone(),t.on(this.event,function(){var t={px:this.startPos.x,py:this.startPos.y,pz:this.startPos.z,sx:this.startScale.x,sy:this.startScale.y,sz:this.startScale.z},n={px:this.endPos.x,py:this.endPos.y,pz:this.endPos.z,sx:this.endScale.x,sy:this.endScale.y,sz:this.endScale.z};this.tween=new TWEEN.Tween(t).to(n,Math.floor(1e3*this.duration)).easing(easingFuncs[this.easing][this.inOut]).onUpdate(function(){i.setPosition(this.px,this.py,this.pz),i.setLocalScale(this.sx,this.sy,this.sz)}),this.tween.start()},this),this.on("enable",function(){this.entity.setPosition(this.initialPos),this.entity.setLocalScale(this.initialScl)}),this.on("attr",function(i,n,a){t.fire(this.event)})},Tween.prototype.update=function(t){},Tween.prototype.swap=function(t){};var Bird=pc.createScript("bird");Bird.attributes.add("flapVelocity",{type:"number",default:1}),Bird.attributes.add("gravity",{type:"number",default:5}),Bird.attributes.add("lowestHeight",{type:"number",default:-.25}),Bird.attributes.add("radius",{type:"number",default:.068}),Bird.prototype.initialize=function(){var t=this.app;this.velocity=0,this.state="ready",this.pipes=[],this.circle={x:0,y:0,r:0},this.rect={x:0,y:0,w:0,h:0},this.initialPos=this.entity.getPosition().clone(),this.initialRot=this.entity.getRotation().clone();var i=t.root.findByName("Pipes").findByName("Pipe 1");this.pipes.push(i.findByName("Pipe Up")),this.pipes.push(i.findByName("Pipe Down")),i=t.root.findByName("Pipes").findByName("Pipe 2"),this.pipes.push(i.findByName("Pipe Up")),this.pipes.push(i.findByName("Pipe Down")),t.on("game:pause",function(){this.state="paused"},this),t.on("game:unpause",function(){this.state="play"},this),this.flapListener=this.flap.bind(this),window.addEventListener("mousedown",this.flapListener,{passive:!1}),window.addEventListener("touchstart",this.flapListener,{passive:!1}),this.on("enable",function(){window.addEventListener("mousedown",this.flapListener,{passive:!1}),window.addEventListener("touchstart",this.flapListener,{passive:!1}),this.state="getready"}),this.on("disable",function(){window.removeEventListener("mousedown",this.flapListener,{passive:!1}),window.removeEventListener("touchstart",this.flapListener,{passive:!1})})},Bird.prototype.reset=function(){var t=this.app;this.velocity=0,this.state="getready",this.entity.setPosition(this.initialPos),this.entity.setRotation(this.initialRot),t.fire("bird:flapstart")},Bird.prototype.flap=function(t){var i=this.app;t&&t.preventDefault(),"getready"===this.state&&(i.fire("game:play"),this.state="play"),"play"===this.state&&(i.fire("game:audio","Flap"),this.velocity=this.flapVelocity)},Bird.prototype.die=function(t){var i=this.app;this.state="dead",i.fire("game:audio","Hit"),i.fire("bird:flapstop"),i.fire("game:gameover"),t&&setTimeout(function(){i.fire("game:audio","Die")},500)},Bird.prototype.circleRectangleIntersect=function(t,i){var e=t.x,s=t.y,a=t.r,r=i.x,n=i.y,p=i.w,o=i.h,h=Math.abs(e-r-p/2),d=Math.abs(s-n-o/2);if(h>p/2+a)return!1;if(d>o/2+a)return!1;if(h<=p/2)return!0;if(d<=o/2)return!0;var l=h-p/2,y=d-o/2;return l*l+y*y<=a*a},Bird.prototype.update=function(t){var i=this.app,e="play"===this.state,s="dead"===this.state;e&&i.keyboard.wasPressed(pc.KEY_SPACE)&&this.flap();var a=this.entity.getPosition();if((e||s)&&a.y>=this.lowestHeight){this.velocity-=this.gravity*t,this.entity.translate(0,this.velocity*t,0);var r=pc.math.clamp(this.velocity,-2,-.75);r+=1,this.entity.setLocalEulerAngles(0,0,90*r)}if(e){a.y0){this.timer=Math.max(this.timer-t,0);var e,a=(this.duration-this.timer)/this.duration;switch(this.type){case 0:e=a;break;case 1:e=1-a;break;case 2:e=4*Math.abs((a/2+.25)%.5-.25)}var i=this.entity.model,r=i.enabled;r&&0===e?(i.enabled=!1,e=1):!r&&e>0&&(i.enabled=!0);var d=i.material;d.opacity=e,d.update()}}; \ No newline at end of file diff --git a/tools/flappybird/__loading__.js b/tools/flappybird/__loading__.js deleted file mode 100644 index 627a013..0000000 --- a/tools/flappybird/__loading__.js +++ /dev/null @@ -1,112 +0,0 @@ -pc.script.createLoadingScreen(function (app) { - var showSplash = function () { - // splash wrapper - var wrapper = document.createElement('div'); - wrapper.id = 'application-splash-wrapper'; - document.body.appendChild(wrapper); - - // splash - var splash = document.createElement('div'); - splash.id = 'application-splash'; - wrapper.appendChild(splash); - splash.style.display = 'none'; - - var logo = document.createElement('img'); - logo.src = ASSET_PREFIX + 'logo.png'; - splash.appendChild(logo); - logo.onload = function () { - splash.style.display = 'block'; - }; - - var container = document.createElement('div'); - container.id = 'progress-bar-container'; - splash.appendChild(container); - - var bar = document.createElement('div'); - bar.id = 'progress-bar'; - container.appendChild(bar); - - }; - - var hideSplash = function () { - var splash = document.getElementById('application-splash-wrapper'); - splash.parentElement.removeChild(splash); - }; - - var setProgress = function (value) { - var bar = document.getElementById('progress-bar'); - if (bar) { - value = Math.min(1, Math.max(0, value)); - bar.style.width = value * 100 + '%'; - } - }; - - var createCss = function () { - var css = [ - 'body {', - ' background-color: #283538;', - '}', - - '#application-splash-wrapper {', - ' position: absolute;', - ' top: 0;', - ' left: 0;', - ' height: 100%;', - ' width: 100%;', - ' background-color: #283538;', - '}', - - '#application-splash {', - ' position: absolute;', - ' top: calc(50% - 28px);', - ' width: 264px;', - ' left: calc(50% - 132px);', - '}', - - '#application-splash img {', - ' width: 100%;', - '}', - - '#progress-bar-container {', - ' margin: 20px auto 0 auto;', - ' height: 2px;', - ' width: 100%;', - ' background-color: #1d292c;', - '}', - - '#progress-bar {', - ' width: 0%;', - ' height: 100%;', - ' background-color: #f60;', - '}', - '@media (max-width: 480px) {', - ' #application-splash {', - ' width: 170px;', - ' left: calc(50% - 85px);', - ' }', - '}' - - ].join('\n'); - - var style = document.createElement('style'); - style.type = 'text/css'; - if (style.styleSheet) { - style.styleSheet.cssText = css; - } else { - style.appendChild(document.createTextNode(css)); - } - - document.head.appendChild(style); - }; - - - createCss(); - - showSplash(); - - app.on('preload:end', function () { - app.off('preload:progress'); - }); - app.on('preload:progress', setProgress); - app.on('start', hideSplash); -}); diff --git a/tools/flappybird/__start__.js b/tools/flappybird/__start__.js deleted file mode 100644 index c83f1e7..0000000 --- a/tools/flappybird/__start__.js +++ /dev/null @@ -1,144 +0,0 @@ -(function () { - var CANVAS_ID = 'application-canvas'; - - var canvas, devices, app; - - var createCanvas = function () { - canvas = document.createElement('canvas'); - canvas.setAttribute('id', CANVAS_ID); - canvas.setAttribute('tabindex', 0); - // canvas.style.visibility = 'hidden'; - - // Disable I-bar cursor on click+drag - canvas.onselectstart = function () { return false; }; - - document.body.appendChild(canvas); - - return canvas; - }; - - var createInputDevices = function (canvas) { - var devices = { - elementInput: new pc.ElementInput(canvas, { - useMouse: INPUT_SETTINGS.useMouse, - useTouch: INPUT_SETTINGS.useTouch - }), - keyboard: INPUT_SETTINGS.useKeyboard ? new pc.Keyboard(window) : null, - mouse: INPUT_SETTINGS.useMouse ? new pc.Mouse(canvas) : null, - gamepads: INPUT_SETTINGS.useGamepads ? new pc.GamePads() : null, - touch: INPUT_SETTINGS.useTouch && pc.platform.touch ? new pc.TouchDevice(canvas) : null - }; - - return devices; - }; - - var configureCss = function (fillMode, width, height) { - // Configure resolution and resize event - if (canvas.classList) { - canvas.classList.add('fill-mode-' + fillMode); - } - - // css media query for aspect ratio changes - var css = "@media screen and (min-aspect-ratio: " + width + "/" + height + ") {"; - css += " #application-canvas.fill-mode-KEEP_ASPECT {"; - css += " width: auto;"; - css += " height: 100%;"; - css += " margin: 0 auto;"; - css += " }"; - css += "}"; - - // append css to style - if (document.head.querySelector) { - document.head.querySelector('style').innerHTML += css; - } - }; - - var reflow = function () { - app.resizeCanvas(canvas.width, canvas.height); - canvas.style.width = ''; - canvas.style.height = ''; - - var fillMode = app._fillMode; - - if (fillMode == pc.FILLMODE_NONE || fillMode == pc.FILLMODE_KEEP_ASPECT) { - if ((fillMode == pc.FILLMODE_NONE && canvas.clientHeight < window.innerHeight) || (canvas.clientWidth / canvas.clientHeight >= window.innerWidth / window.innerHeight)) { - canvas.style.marginTop = Math.floor((window.innerHeight - canvas.clientHeight) / 2) + 'px'; - } else { - canvas.style.marginTop = ''; - } - } - }; - - var displayError = function (html) { - var div = document.createElement('div'); - - div.innerHTML = [ - '
', - ' ', - ' ', - ' ', - '
', - '
', - '
' + html + '
', - '
', - '
' - ].join('\n'); - - document.body.appendChild(div); - }; - - canvas = createCanvas(); - devices = createInputDevices(canvas); - - try { - app = new pc.Application(canvas, { - elementInput: devices.elementInput, - keyboard: devices.keyboard, - mouse: devices.mouse, - gamepads: devices.gamepads, - touch: devices.touch, - graphicsDeviceOptions: window.CONTEXT_OPTIONS, - assetPrefix: window.ASSET_PREFIX || "", - scriptPrefix: window.SCRIPT_PREFIX || "", - scriptsOrder: window.SCRIPTS || [] - }); - } catch (e) { - if (e instanceof pc.UnsupportedBrowserError) { - displayError('This page requires a browser that supports WebGL.
' + - 'Click here to find out more.'); - } else if (e instanceof pc.ContextCreationError) { - displayError("It doesn't appear your computer can support WebGL.
" + - 'Click here for more information.'); - } else { - displayError('Could not initialize application. Error: ' + e); - } - - return; - } - - app.configure(CONFIG_FILENAME, function (err) { - if (err) { - console.error(err); - } - - configureCss(app._fillMode, app._width, app._height); - reflow(); - - window.addEventListener('resize', reflow, false); - window.addEventListener('orientationchange', reflow, false); - - app.preload(function (err) { - if (err) { - console.error(err); - } - - app.loadScene(SCENE_PATH, function (err, scene) { - if (err) { - console.error(err); - } - - app.start(); - }); - }); - }); -}()); diff --git a/tools/flappybird/config.json b/tools/flappybird/config.json deleted file mode 100644 index 917a706..0000000 --- a/tools/flappybird/config.json +++ /dev/null @@ -1 +0,0 @@ -{"application_properties":{"antiAlias":true,"fillMode":"FILL_WINDOW","resolutionMode":"AUTO","height":720,"width":1280,"use3dPhysics":false,"preferWebGl2":true,"preserveDrawingBuffer":false,"scripts":[4554272,4554207,4554209,4554213,4554214,4554217,4554219,4554270,4554271,4554273,4554276,4554277,4554279,4554281,4831197],"transparentCanvas":false,"useDevicePixelRatio":false,"useLegacyScripts":false,"vr":false,"loadingScreenScript":null,"batchGroups":[],"layers":{"0":{"name":"World","opaqueSortMode":2,"transparentSortMode":3},"1":{"name":"Depth","opaqueSortMode":2,"transparentSortMode":3},"2":{"name":"Skybox","opaqueSortMode":0,"transparentSortMode":3},"3":{"name":"Immediate","opaqueSortMode":0,"transparentSortMode":3},"4":{"name":"UI","opaqueSortMode":1,"transparentSortMode":1}},"layerOrder":[{"layer":0,"transparent":false,"enabled":true},{"layer":1,"transparent":false,"enabled":true},{"layer":2,"transparent":false,"enabled":true},{"layer":0,"transparent":true,"enabled":true},{"layer":3,"transparent":false,"enabled":true},{"layer":3,"transparent":true,"enabled":true},{"layer":4,"transparent":true,"enabled":true}],"useKeyboard":true,"useMouse":true,"useTouch":true,"useGamepads":false,"i18nAssets":[],"libraries":[]},"scenes":[{"name":"Game","url":"404993.json"}],"assets":{"3324896":{"data":{"addressu":"clamp","addressv":"clamp","minfilter":"nearest_mip_nearest","magfilter":"nearest","anisotropy":1,"rgbm":false,"mipmaps":true},"file":{"filename":"spritesheet.png","hash":"7beb41056e82fe0227883519c78a6e89","size":5030,"url":"files/assets/3324896/1/spritesheet.png"},"meta":{"format":"png","type":"PaletteAlpha","width":453,"height":256,"alpha":true,"depth":8,"srgb":true,"interlaced":false,"compress":{"alpha":true,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false}},"name":"spritesheet.png","preload":true,"region":"eu-west-1","revision":1,"tags":[],"type":"texture","id":"3324896"},"3324897":{"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.3175,1],"aoMapOffset":[0,0],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.3175,1],"diffuseMapOffset":[0,0],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.3175,1],"specularMapOffset":[0,0],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.3175,1],"metalnessMapOffset":[0,0],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.3175,1],"glossMapOffset":[0,0],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.3175,1],"emissiveMapOffset":[0,0],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.3175,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.3175,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":null,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.3175,1],"opacityMapOffset":[0,0],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.3175,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"file":null,"meta":null,"name":"Background","preload":true,"revision":1,"tags":[],"type":"material","id":"3324897"},"3324918":{"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.2119205298013245,0.0859375],"aoMapOffset":[0.32229580573951433,0.23828125],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.2119205298013245,0.0859375],"diffuseMapOffset":[0.32229580573951433,0.23828125],"diffuseMapTint":true,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.2119205298013245,0.0859375],"specularMapOffset":[0.32229580573951433,0.23828125],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.2119205298013245,0.0859375],"metalnessMapOffset":[0.32229580573951433,0.23828125],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.2119205298013245,0.0859375],"glossMapOffset":[0.32229580573951433,0.23828125],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.2119205298013245,0.0859375],"emissiveMapOffset":[0.32229580573951433,0.23828125],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.2119205298013245,0.0859375],"normalMapOffset":[0.32229580573951433,0.23828125],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.2119205298013245,0.0859375],"heightMapOffset":[0.32229580573951433,0.23828125],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":3324896,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.2119205298013245,0.0859375],"opacityMapOffset":[0.32229580573951433,0.23828125],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.2119205298013245,0.0859375],"lightMapOffset":[0.32229580573951433,0.23828125],"depthTest":true,"depthWrite":true,"cull":1,"blendType":2,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"file":null,"meta":null,"name":"Title","preload":true,"revision":1,"tags":[],"type":"material","id":"3324918"},"3325227":{"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.0375275938189845,0.046875],"aoMapOffset":[0.4922737306843267,0.46875],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.0375275938189845,0.046875],"diffuseMapOffset":[0.4922737306843267,0.46875],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.0375275938189845,0.046875],"specularMapOffset":[0.4922737306843267,0.46875],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.0375275938189845,0.046875],"metalnessMapOffset":[0.4922737306843267,0.46875],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.0375275938189845,0.046875],"glossMapOffset":[0.4922737306843267,0.46875],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.0375275938189845,0.046875],"emissiveMapOffset":[0.4922737306843267,0.46875],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.0375275938189845,0.046875],"normalMapOffset":[0.4922737306843267,0.46875],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.0375275938189845,0.046875],"heightMapOffset":[0.4922737306843267,0.46875],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":3324896,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.0375275938189845,0.046875],"opacityMapOffset":[0.4922737306843267,0.46875],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.0375275938189845,0.046875],"lightMapOffset":[0.4922737306843267,0.46875],"depthTest":true,"depthWrite":true,"cull":1,"blendType":2,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"file":null,"meta":null,"name":"Bird 1","preload":true,"revision":1,"tags":[],"type":"material","id":"3325227"},"3325540":{"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.0375275938189845,0.046875],"aoMapOffset":[0.5827814569536424,0.6015625],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.0375275938189845,0.046875],"diffuseMapOffset":[0.5827814569536424,0.6015625],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.0375275938189845,0.046875],"specularMapOffset":[0.5827814569536424,0.6015625],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.0375275938189845,0.046875],"metalnessMapOffset":[0.5827814569536424,0.6015625],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.0375275938189845,0.046875],"glossMapOffset":[0.5827814569536424,0.6015625],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.0375275938189845,0.046875],"emissiveMapOffset":[0.5827814569536424,0.6015625],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.0375275938189845,0.046875],"normalMapOffset":[0.5827814569536424,0.6015625],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.0375275938189845,0.046875],"heightMapOffset":[0.5827814569536424,0.6015625],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":3324896,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.0375275938189845,0.046875],"opacityMapOffset":[0.5827814569536424,0.6015625],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.0375275938189845,0.046875],"lightMapOffset":[0.5827814569536424,0.6015625],"depthTest":true,"depthWrite":true,"cull":1,"blendType":2,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"file":null,"meta":null,"name":"Bird 2","preload":true,"revision":1,"tags":[],"type":"material","id":"3325540"},"3325558":{"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.0375275938189845,0.046875],"aoMapOffset":[0.5827814569536424,0.703125],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.0375275938189845,0.046875],"diffuseMapOffset":[0.5827814569536424,0.703125],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.0375275938189845,0.046875],"specularMapOffset":[0.5827814569536424,0.703125],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.0375275938189845,0.046875],"metalnessMapOffset":[0.5827814569536424,0.703125],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.0375275938189845,0.046875],"glossMapOffset":[0.5827814569536424,0.703125],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.0375275938189845,0.046875],"emissiveMapOffset":[0.5827814569536424,0.703125],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.0375275938189845,0.046875],"normalMapOffset":[0.5827814569536424,0.703125],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.0375275938189845,0.046875],"heightMapOffset":[0.5827814569536424,0.703125],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":3324896,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.0375275938189845,0.046875],"opacityMapOffset":[0.5827814569536424,0.703125],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.0375275938189845,0.046875],"lightMapOffset":[0.5827814569536424,0.703125],"depthTest":true,"depthWrite":true,"cull":1,"blendType":2,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"file":null,"meta":null,"name":"Bird 3","preload":true,"revision":1,"tags":[],"type":"material","id":"3325558"},"3328228":{"tags":[],"name":"Ground","revision":1,"preload":true,"meta":null,"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.3175,0.21875],"aoMapOffset":[0.32229580573951433,0.78125],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.3175,0.21875],"diffuseMapOffset":[0.32229580573951433,0.78125],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.3175,0.21875],"specularMapOffset":[0.32229580573951433,0.78125],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.3175,0.21875],"metalnessMapOffset":[0.32229580573951433,0.78125],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.3175,0.21875],"glossMapOffset":[0.32229580573951433,0.78125],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.3175,0.21875],"emissiveMapOffset":[0.32229580573951433,0.78125],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.3175,0.21875],"normalMapOffset":[0.32229580573951433,0.78125],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.3175,0.21875],"heightMapOffset":[0.32229580573951433,0.78125],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":null,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.3175,0.21875],"opacityMapOffset":[0.32229580573951433,0.78125],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.3175,0.21875],"lightMapOffset":[0.32229580573951433,0.78125],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"type":"material","file":null,"id":"3328228"},"3370525":{"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.088300220750552,0.0546875],"aoMapOffset":[0.543046357615894,0.484375],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.088300220750552,0.0546875],"diffuseMapOffset":[0.543046357615894,0.484375],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.088300220750552,0.0546875],"specularMapOffset":[0.543046357615894,0.484375],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.088300220750552,0.0546875],"metalnessMapOffset":[0.543046357615894,0.484375],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.088300220750552,0.0546875],"glossMapOffset":[0.543046357615894,0.484375],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.088300220750552,0.0546875],"emissiveMapOffset":[0.543046357615894,0.484375],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.088300220750552,0.0546875],"normalMapOffset":[0.543046357615894,0.484375],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.088300220750552,0.0546875],"heightMapOffset":[0.543046357615894,0.484375],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":0,"opacityMapVertexColor":false,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[0.088300220750552,0.0546875],"opacityMapOffset":[0.543046357615894,0.484375],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.088300220750552,0.0546875],"lightMapOffset":[0.543046357615894,0.484375],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"file":null,"meta":null,"name":"Menu","preload":true,"revision":1,"tags":[],"type":"material","id":"3370525"},"3370701":{"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.088300220750552,0.0546875],"aoMapOffset":[0.543046357615894,0.421875],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.088300220750552,0.0546875],"diffuseMapOffset":[0.543046357615894,0.421875],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.088300220750552,0.0546875],"specularMapOffset":[0.543046357615894,0.421875],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.088300220750552,0.0546875],"metalnessMapOffset":[0.543046357615894,0.421875],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.088300220750552,0.0546875],"glossMapOffset":[0.543046357615894,0.421875],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.088300220750552,0.0546875],"emissiveMapOffset":[0.543046357615894,0.421875],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.088300220750552,0.0546875],"normalMapOffset":[0.543046357615894,0.421875],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.088300220750552,0.0546875],"heightMapOffset":[0.543046357615894,0.421875],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":0,"opacityMapVertexColor":false,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[0.088300220750552,0.0546875],"opacityMapOffset":[0.543046357615894,0.421875],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.088300220750552,0.0546875],"lightMapOffset":[0.543046357615894,0.421875],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"file":null,"meta":null,"name":"OK","preload":true,"revision":1,"tags":[],"type":"material","id":"3370701"},"3370764":{"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.088300220750552,0.0546875],"aoMapOffset":[0.543046357615894,0.359375],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.088300220750552,0.0546875],"diffuseMapOffset":[0.543046357615894,0.359375],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.088300220750552,0.0546875],"specularMapOffset":[0.543046357615894,0.359375],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.088300220750552,0.0546875],"metalnessMapOffset":[0.543046357615894,0.359375],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.088300220750552,0.0546875],"glossMapOffset":[0.543046357615894,0.359375],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.088300220750552,0.0546875],"emissiveMapOffset":[0.543046357615894,0.359375],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.088300220750552,0.0546875],"normalMapOffset":[0.543046357615894,0.359375],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.088300220750552,0.0546875],"heightMapOffset":[0.543046357615894,0.359375],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":0,"opacityMapVertexColor":false,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[0.088300220750552,0.0546875],"opacityMapOffset":[0.543046357615894,0.359375],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.088300220750552,0.0546875],"lightMapOffset":[0.543046357615894,0.359375],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"file":null,"meta":null,"name":"Rate","preload":true,"revision":1,"tags":[],"type":"material","id":"3370764"},"3371285":{"data":null,"file":{"filename":"sfx_hit.mp3","size":9448,"hash":"530f102ee30743cd62720544290064ae","url":"files/assets/3371285/1/sfx_hit.mp3"},"meta":null,"name":"sfx_hit.mp3","preload":false,"region":"eu-west-1","revision":1,"tags":[],"type":"audio","id":"3371285"},"3371286":{"data":null,"file":{"filename":"sfx_wing.mp3","size":3152,"hash":"de4d3092adc2a810239855aef89a66a9","url":"files/assets/3371286/1/sfx_wing.mp3"},"meta":null,"name":"sfx_wing.mp3","preload":false,"region":"eu-west-1","revision":1,"tags":[],"type":"audio","id":"3371286"},"3371287":{"data":null,"file":{"filename":"sfx_die.mp3","size":12791,"hash":"5f81410a16b3a26fbd1aa71966fc9bf2","url":"files/assets/3371287/1/sfx_die.mp3"},"meta":null,"name":"sfx_die.mp3","preload":false,"region":"eu-west-1","revision":1,"tags":[],"type":"audio","id":"3371287"},"3371288":{"data":null,"file":{"filename":"sfx_point.mp3","size":9344,"hash":"b8f4767af8ebab5f55470ab1b8591c8d","url":"files/assets/3371288/1/sfx_point.mp3"},"meta":null,"name":"sfx_point.mp3","preload":false,"region":"eu-west-1","revision":1,"tags":[],"type":"audio","id":"3371288"},"3371289":{"data":null,"file":{"filename":"sfx_swooshing.mp3","size":13440,"hash":"ea4d4908664ac5f8c0a9f23a20351d85","url":"files/assets/3371289/1/sfx_swooshing.mp3"},"meta":null,"name":"sfx_swooshing.mp3","preload":false,"region":"eu-west-1","revision":1,"tags":[],"type":"audio","id":"3371289"},"3371742":{"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.088300220750552,0.0546875],"aoMapOffset":[0.5386313465783664,0.26953125],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.088300220750552,0.0546875],"diffuseMapOffset":[0.5386313465783664,0.26953125],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.088300220750552,0.0546875],"specularMapOffset":[0.5386313465783664,0.26953125],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.088300220750552,0.0546875],"metalnessMapOffset":[0.5386313465783664,0.26953125],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.088300220750552,0.0546875],"glossMapOffset":[0.5386313465783664,0.26953125],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.088300220750552,0.0546875],"emissiveMapOffset":[0.5386313465783664,0.26953125],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.088300220750552,0.0546875],"normalMapOffset":[0.5386313465783664,0.26953125],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.088300220750552,0.0546875],"heightMapOffset":[0.5386313465783664,0.26953125],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":0,"opacityMapVertexColor":false,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[0.088300220750552,0.0546875],"opacityMapOffset":[0.5386313465783664,0.26953125],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.088300220750552,0.0546875],"lightMapOffset":[0.5386313465783664,0.26953125],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"file":null,"meta":null,"name":"Score","preload":true,"revision":1,"tags":[],"type":"material","id":"3371742"},"3371771":{"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.088300220750552,0.0546875],"aoMapOffset":[0.5342163355408389,0.17578125],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.088300220750552,0.0546875],"diffuseMapOffset":[0.5342163355408389,0.17578125],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.088300220750552,0.0546875],"specularMapOffset":[0.5342163355408389,0.17578125],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.088300220750552,0.0546875],"metalnessMapOffset":[0.5342163355408389,0.17578125],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.088300220750552,0.0546875],"glossMapOffset":[0.5342163355408389,0.17578125],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.088300220750552,0.0546875],"emissiveMapOffset":[0.5342163355408389,0.17578125],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.088300220750552,0.0546875],"normalMapOffset":[0.5342163355408389,0.17578125],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.088300220750552,0.0546875],"heightMapOffset":[0.5342163355408389,0.17578125],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":0,"opacityMapVertexColor":false,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[0.088300220750552,0.0546875],"opacityMapOffset":[0.5342163355408389,0.17578125],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.088300220750552,0.0546875],"lightMapOffset":[0.5342163355408389,0.17578125],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"file":null,"meta":null,"name":"Share","preload":true,"revision":1,"tags":[],"type":"material","id":"3371771"},"3371786":{"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.088300220750552,0.0546875],"aoMapOffset":[0.5342163355408389,0.11328125],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.088300220750552,0.0546875],"diffuseMapOffset":[0.5342163355408389,0.11328125],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.088300220750552,0.0546875],"specularMapOffset":[0.5342163355408389,0.11328125],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.088300220750552,0.0546875],"metalnessMapOffset":[0.5342163355408389,0.11328125],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.088300220750552,0.0546875],"glossMapOffset":[0.5342163355408389,0.11328125],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.088300220750552,0.0546875],"emissiveMapOffset":[0.5342163355408389,0.11328125],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.088300220750552,0.0546875],"normalMapOffset":[0.5342163355408389,0.11328125],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.088300220750552,0.0546875],"heightMapOffset":[0.5342163355408389,0.11328125],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":0,"opacityMapVertexColor":false,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[0.088300220750552,0.0546875],"opacityMapOffset":[0.5342163355408389,0.11328125],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.088300220750552,0.0546875],"lightMapOffset":[0.5342163355408389,0.11328125],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"file":null,"meta":null,"name":"Start","preload":true,"revision":1,"tags":[],"type":"material","id":"3371786"},"3376987":{"tags":[],"name":"Get Ready","revision":1,"preload":true,"meta":null,"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.1920529801324503,0.0859375],"aoMapOffset":[0.3222958057395143,0.05078125],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.1920529801324503,0.0859375],"diffuseMapOffset":[0.3222958057395143,0.05078125],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.1920529801324503,0.0859375],"specularMapOffset":[0.3222958057395143,0.05078125],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.1920529801324503,0.0859375],"metalnessMapOffset":[0.3222958057395143,0.05078125],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.1920529801324503,0.0859375],"glossMapOffset":[0.3222958057395143,0.05078125],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.1920529801324503,0.0859375],"emissiveMapOffset":[0.3222958057395143,0.05078125],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.1920529801324503,0.0859375],"normalMapOffset":[0.3222958057395143,0.05078125],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.1920529801324503,0.0859375],"heightMapOffset":[0.3222958057395143,0.05078125],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":3324896,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.1920529801324503,0.0859375],"opacityMapOffset":[0.3222958057395143,0.05078125],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.1920529801324503,0.0859375],"lightMapOffset":[0.3222958057395143,0.05078125],"depthTest":true,"depthWrite":true,"cull":1,"blendType":2,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"type":"material","file":null,"id":"3376987"},"3377057":{"tags":[],"name":"Tap","revision":1,"preload":true,"meta":null,"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.130242825607064,0.19140625],"aoMapOffset":[0.3377483443708609,0.33203125],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.130242825607064,0.19140625],"diffuseMapOffset":[0.3377483443708609,0.33203125],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.130242825607064,0.19140625],"specularMapOffset":[0.3377483443708609,0.33203125],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.130242825607064,0.19140625],"metalnessMapOffset":[0.3377483443708609,0.33203125],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.130242825607064,0.19140625],"glossMapOffset":[0.3377483443708609,0.33203125],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.130242825607064,0.19140625],"emissiveMapOffset":[0.3377483443708609,0.33203125],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.130242825607064,0.19140625],"normalMapOffset":[0.3377483443708609,0.33203125],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.130242825607064,0.19140625],"heightMapOffset":[0.3377483443708609,0.33203125],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":3324896,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.130242825607064,0.19140625],"opacityMapOffset":[0.3377483443708609,0.33203125],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.130242825607064,0.19140625],"lightMapOffset":[0.3377483443708609,0.33203125],"depthTest":true,"depthWrite":true,"cull":1,"blendType":2,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"type":"material","file":null,"id":"3377057"},"3386417":{"tags":[],"name":"Black","revision":1,"preload":true,"meta":null,"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.0353200883002208,0.0625],"aoMapOffset":[0.6666666666666667,0.30859375],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.0353200883002208,0.0625],"diffuseMapOffset":[0.6666666666666667,0.30859375],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.0353200883002208,0.0625],"specularMapOffset":[0.6666666666666667,0.30859375],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.0353200883002208,0.0625],"metalnessMapOffset":[0.6666666666666667,0.30859375],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.0353200883002208,0.0625],"glossMapOffset":[0.6666666666666667,0.30859375],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.0353200883002208,0.0625],"emissiveMapOffset":[0.6666666666666667,0.30859375],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.0353200883002208,0.0625],"normalMapOffset":[0.6666666666666667,0.30859375],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.0353200883002208,0.0625],"heightMapOffset":[0.6666666666666667,0.30859375],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":0,"opacityMapVertexColor":false,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[0.0353200883002208,0.0625],"opacityMapOffset":[0.6666666666666667,0.30859375],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.0353200883002208,0.0625],"lightMapOffset":[0.6666666666666667,0.30859375],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"type":"material","file":null,"id":"3386417"},"3388975":{"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.0286975717439294,0.0546875],"aoMapOffset":[0.6335540838852097,0.71875],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.0286975717439294,0.0546875],"diffuseMapOffset":[0.6335540838852097,0.71875],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.0286975717439294,0.0546875],"specularMapOffset":[0.6335540838852097,0.71875],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.0286975717439294,0.0546875],"metalnessMapOffset":[0.6335540838852097,0.71875],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.0286975717439294,0.0546875],"glossMapOffset":[0.6335540838852097,0.71875],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.0286975717439294,0.0546875],"emissiveMapOffset":[0.6335540838852097,0.71875],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.0286975717439294,0.0546875],"normalMapOffset":[0.6335540838852097,0.71875],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.0286975717439294,0.0546875],"heightMapOffset":[0.6335540838852097,0.71875],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":3324896,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.0286975717439294,0.0546875],"opacityMapOffset":[0.6335540838852097,0.71875],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.0286975717439294,0.0546875],"lightMapOffset":[0.6335540838852097,0.71875],"depthTest":true,"depthWrite":true,"cull":1,"blendType":2,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"file":null,"meta":null,"name":"Pause","preload":true,"revision":1,"tags":[],"type":"material","id":"3388975"},"3389018":{"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.0286975717439294,0.0546875],"aoMapOffset":[0.6335540838852097,0.6171875],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.0286975717439294,0.0546875],"diffuseMapOffset":[0.6335540838852097,0.6171875],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.0286975717439294,0.0546875],"specularMapOffset":[0.6335540838852097,0.6171875],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.0286975717439294,0.0546875],"metalnessMapOffset":[0.6335540838852097,0.6171875],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.0286975717439294,0.0546875],"glossMapOffset":[0.6335540838852097,0.6171875],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.0286975717439294,0.0546875],"emissiveMapOffset":[0.6335540838852097,0.6171875],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.0286975717439294,0.0546875],"normalMapOffset":[0.6335540838852097,0.6171875],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.0286975717439294,0.0546875],"heightMapOffset":[0.6335540838852097,0.6171875],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":3324896,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.0286975717439294,0.0546875],"opacityMapOffset":[0.6335540838852097,0.6171875],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.0286975717439294,0.0546875],"lightMapOffset":[0.6335540838852097,0.6171875],"depthTest":true,"depthWrite":true,"cull":1,"blendType":2,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"file":null,"meta":null,"name":"Play","preload":true,"revision":1,"tags":[],"type":"material","id":"3389018"},"3389068":{"tags":[],"name":"Game Over","revision":1,"preload":true,"meta":null,"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.2119205298013245,0.0859375],"aoMapOffset":[0.32229580573951433,0.1484375],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.2119205298013245,0.0859375],"diffuseMapOffset":[0.32229580573951433,0.1484375],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.2119205298013245,0.0859375],"specularMapOffset":[0.32229580573951433,0.1484375],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.2119205298013245,0.0859375],"metalnessMapOffset":[0.32229580573951433,0.1484375],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.2119205298013245,0.0859375],"glossMapOffset":[0.32229580573951433,0.1484375],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.2119205298013245,0.0859375],"emissiveMapOffset":[0.32229580573951433,0.1484375],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.2119205298013245,0.0859375],"normalMapOffset":[0.32229580573951433,0.1484375],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.2119205298013245,0.0859375],"heightMapOffset":[0.32229580573951433,0.1484375],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":3324896,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.2119205298013245,0.0859375],"opacityMapOffset":[0.32229580573951433,0.1484375],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.2119205298013245,0.0859375],"lightMapOffset":[0.32229580573951433,0.1484375],"depthTest":true,"depthWrite":true,"cull":1,"blendType":2,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"type":"material","file":null,"id":"3389068"},"3406638":{"tags":[],"name":"Pipe Down","revision":1,"preload":true,"meta":null,"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.0573951434878587,0.52734375],"aoMapOffset":[0.6666666666666667,0.47265625],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.0573951434878587,0.52734375],"diffuseMapOffset":[0.6666666666666667,0.47265625],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.0573951434878587,0.52734375],"specularMapOffset":[0.6666666666666667,0.47265625],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.0573951434878587,0.52734375],"metalnessMapOffset":[0.6666666666666667,0.47265625],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.0573951434878587,0.52734375],"glossMapOffset":[0.6666666666666667,0.47265625],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.0573951434878587,0.52734375],"emissiveMapOffset":[0.6666666666666667,0.47265625],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.0573951434878587,0.52734375],"normalMapOffset":[0.6666666666666667,0.47265625],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.0573951434878587,0.52734375],"heightMapOffset":[0.6666666666666667,0.47265625],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":3324896,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.0573951434878587,0.52734375],"opacityMapOffset":[0.6666666666666667,0.47265625],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.0573951434878587,0.52734375],"lightMapOffset":[0.6666666666666667,0.47265625],"depthTest":true,"depthWrite":true,"cull":1,"blendType":2,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"type":"material","file":null,"id":"3406638"},"3407410":{"tags":[],"name":"Pipe Up","revision":1,"preload":true,"meta":null,"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.0573951434878587,0.47265625],"aoMapOffset":[0.728476821192053,0.52734375],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.0573951434878587,0.47265625],"diffuseMapOffset":[0.728476821192053,0.52734375],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.0573951434878587,0.47265625],"specularMapOffset":[0.728476821192053,0.52734375],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.0573951434878587,0.47265625],"metalnessMapOffset":[0.728476821192053,0.52734375],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.0573951434878587,0.47265625],"glossMapOffset":[0.728476821192053,0.52734375],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.0573951434878587,0.47265625],"emissiveMapOffset":[0.728476821192053,0.52734375],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.0573951434878587,0.47265625],"normalMapOffset":[0.728476821192053,0.52734375],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.0573951434878587,0.47265625],"heightMapOffset":[0.728476821192053,0.52734375],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":3324896,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.0573951434878587,0.47265625],"opacityMapOffset":[0.728476821192053,0.52734375],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.0573951434878587,0.47265625],"lightMapOffset":[0.728476821192053,0.52734375],"depthTest":true,"depthWrite":true,"cull":1,"blendType":2,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"type":"material","file":null,"id":"3407410"},"3428665":{"tags":[],"name":"Scoreboard","revision":1,"preload":true,"meta":null,"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.2494481236203091,0.2265625],"aoMapOffset":[0.32229580573951433,0.546875],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.2494481236203091,0.2265625],"diffuseMapOffset":[0.32229580573951433,0.546875],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.2494481236203091,0.2265625],"specularMapOffset":[0.32229580573951433,0.546875],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.2494481236203091,0.2265625],"metalnessMapOffset":[0.32229580573951433,0.546875],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.2494481236203091,0.2265625],"glossMapOffset":[0.32229580573951433,0.546875],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.2494481236203091,0.2265625],"emissiveMapOffset":[0.32229580573951433,0.546875],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.2494481236203091,0.2265625],"normalMapOffset":[0.32229580573951433,0.546875],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.2494481236203091,0.2265625],"heightMapOffset":[0.32229580573951433,0.546875],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":null,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.2494481236203091,0.2265625],"opacityMapOffset":[0.32229580573951433,0.546875],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.2494481236203091,0.2265625],"lightMapOffset":[0.32229580573951433,0.546875],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"type":"material","file":null,"id":"3428665"},"3446318":{"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.0132450331125828,0.02734375],"aoMapOffset":[0.6335540838852097,0.68359375],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.0132450331125828,0.02734375],"diffuseMapOffset":[0.6335540838852097,0.68359375],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.0132450331125828,0.02734375],"specularMapOffset":[0.6335540838852097,0.68359375],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.0132450331125828,0.02734375],"metalnessMapOffset":[0.6335540838852097,0.68359375],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.0132450331125828,0.02734375],"glossMapOffset":[0.6335540838852097,0.68359375],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.0132450331125828,0.02734375],"emissiveMapOffset":[0.6335540838852097,0.68359375],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.0132450331125828,0.02734375],"normalMapOffset":[0.6335540838852097,0.68359375],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.0132450331125828,0.02734375],"heightMapOffset":[0.6335540838852097,0.68359375],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":0,"opacityMapVertexColor":false,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[0.0132450331125828,0.02734375],"opacityMapOffset":[0.6335540838852097,0.68359375],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.0132450331125828,0.02734375],"lightMapOffset":[0.6335540838852097,0.68359375],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"file":null,"meta":null,"name":"0","preload":true,"revision":1,"tags":[],"type":"material","id":"3446318"},"3460239":{"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.0154525386313466,0.0390625],"aoMapOffset":[0.6357615894039735,0.5703125],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.0154525386313466,0.0390625],"diffuseMapOffset":[0.6357615894039735,0.5703125],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.0154525386313466,0.0390625],"specularMapOffset":[0.6357615894039735,0.5703125],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.0154525386313466,0.0390625],"metalnessMapOffset":[0.6357615894039735,0.5703125],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.0154525386313466,0.0390625],"glossMapOffset":[0.6357615894039735,0.5703125],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.0154525386313466,0.0390625],"emissiveMapOffset":[0.6357615894039735,0.5703125],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.0154525386313466,0.0390625],"normalMapOffset":[0.6357615894039735,0.5703125],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.0154525386313466,0.0390625],"heightMapOffset":[0.6357615894039735,0.5703125],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":3324896,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.0154525386313466,0.0390625],"opacityMapOffset":[0.6357615894039735,0.5703125],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.0154525386313466,0.0390625],"lightMapOffset":[0.6357615894039735,0.5703125],"depthTest":true,"depthWrite":true,"cull":1,"blendType":2,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"file":null,"meta":null,"name":"0","preload":true,"revision":1,"tags":[],"type":"material","id":"3460239"},"3460296":{"tags":[],"name":"1","revision":1,"preload":true,"meta":null,"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.0154525386313466,0.0390625],"aoMapOffset":[0.6401766004415012,0.5],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.0154525386313466,0.0390625],"diffuseMapOffset":[0.6401766004415012,0.5],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.0154525386313466,0.0390625],"specularMapOffset":[0.6401766004415012,0.5],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.0154525386313466,0.0390625],"metalnessMapOffset":[0.6401766004415012,0.5],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.0154525386313466,0.0390625],"glossMapOffset":[0.6401766004415012,0.5],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.0154525386313466,0.0390625],"emissiveMapOffset":[0.6401766004415012,0.5],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.0154525386313466,0.0390625],"normalMapOffset":[0.6401766004415012,0.5],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.0154525386313466,0.0390625],"heightMapOffset":[0.6401766004415012,0.5],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":3324896,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.0154525386313466,0.0390625],"opacityMapOffset":[0.6401766004415012,0.5],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.0154525386313466,0.0390625],"lightMapOffset":[0.6401766004415012,0.5],"depthTest":true,"depthWrite":true,"cull":1,"blendType":2,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"type":"material","file":null,"id":"3460296"},"3460297":{"tags":[],"name":"2","revision":1,"preload":true,"meta":null,"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.0154525386313466,0.0390625],"aoMapOffset":[0.6379690949227373,0.4375],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.0154525386313466,0.0390625],"diffuseMapOffset":[0.6379690949227373,0.4375],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.0154525386313466,0.0390625],"specularMapOffset":[0.6379690949227373,0.4375],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.0154525386313466,0.0390625],"metalnessMapOffset":[0.6379690949227373,0.4375],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.0154525386313466,0.0390625],"glossMapOffset":[0.6379690949227373,0.4375],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.0154525386313466,0.0390625],"emissiveMapOffset":[0.6379690949227373,0.4375],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.0154525386313466,0.0390625],"normalMapOffset":[0.6379690949227373,0.4375],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.0154525386313466,0.0390625],"heightMapOffset":[0.6379690949227373,0.4375],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":3324896,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.0154525386313466,0.0390625],"opacityMapOffset":[0.6379690949227373,0.4375],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.0154525386313466,0.0390625],"lightMapOffset":[0.6379690949227373,0.4375],"depthTest":true,"depthWrite":true,"cull":1,"blendType":2,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"type":"material","file":null,"id":"3460297"},"3460298":{"tags":[],"name":"3","revision":1,"preload":true,"meta":null,"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.0154525386313466,0.0390625],"aoMapOffset":[0.6379690949227373,0.375],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.0154525386313466,0.0390625],"diffuseMapOffset":[0.6379690949227373,0.375],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.0154525386313466,0.0390625],"specularMapOffset":[0.6379690949227373,0.375],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.0154525386313466,0.0390625],"metalnessMapOffset":[0.6379690949227373,0.375],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.0154525386313466,0.0390625],"glossMapOffset":[0.6379690949227373,0.375],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.0154525386313466,0.0390625],"emissiveMapOffset":[0.6379690949227373,0.375],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.0154525386313466,0.0390625],"normalMapOffset":[0.6379690949227373,0.375],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.0154525386313466,0.0390625],"heightMapOffset":[0.6379690949227373,0.375],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":3324896,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.0154525386313466,0.0390625],"opacityMapOffset":[0.6379690949227373,0.375],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.0154525386313466,0.0390625],"lightMapOffset":[0.6379690949227373,0.375],"depthTest":true,"depthWrite":true,"cull":1,"blendType":2,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"type":"material","file":null,"id":"3460298"},"3460299":{"tags":[],"name":"4","revision":1,"preload":true,"meta":null,"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.0154525386313466,0.0390625],"aoMapOffset":[0.6335540838852097,0.28515625],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.0154525386313466,0.0390625],"diffuseMapOffset":[0.6335540838852097,0.28515625],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.0154525386313466,0.0390625],"specularMapOffset":[0.6335540838852097,0.28515625],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.0154525386313466,0.0390625],"metalnessMapOffset":[0.6335540838852097,0.28515625],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.0154525386313466,0.0390625],"glossMapOffset":[0.6335540838852097,0.28515625],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.0154525386313466,0.0390625],"emissiveMapOffset":[0.6335540838852097,0.28515625],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.0154525386313466,0.0390625],"normalMapOffset":[0.6335540838852097,0.28515625],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.0154525386313466,0.0390625],"heightMapOffset":[0.6335540838852097,0.28515625],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":3324896,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.0154525386313466,0.0390625],"opacityMapOffset":[0.6335540838852097,0.28515625],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.0154525386313466,0.0390625],"lightMapOffset":[0.6335540838852097,0.28515625],"depthTest":true,"depthWrite":true,"cull":1,"blendType":2,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"type":"material","file":null,"id":"3460299"},"3460314":{"tags":[],"name":"5","revision":1,"preload":true,"meta":null,"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.0154525386313466,0.0390625],"aoMapOffset":[0.6335540838852097,0.23828125],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.0154525386313466,0.0390625],"diffuseMapOffset":[0.6335540838852097,0.23828125],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.0154525386313466,0.0390625],"specularMapOffset":[0.6335540838852097,0.23828125],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.0154525386313466,0.0390625],"metalnessMapOffset":[0.6335540838852097,0.23828125],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.0154525386313466,0.0390625],"glossMapOffset":[0.6335540838852097,0.23828125],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.0154525386313466,0.0390625],"emissiveMapOffset":[0.6335540838852097,0.23828125],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.0154525386313466,0.0390625],"normalMapOffset":[0.6335540838852097,0.23828125],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.0154525386313466,0.0390625],"heightMapOffset":[0.6335540838852097,0.23828125],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":3324896,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.0154525386313466,0.0390625],"opacityMapOffset":[0.6335540838852097,0.23828125],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.0154525386313466,0.0390625],"lightMapOffset":[0.6335540838852097,0.23828125],"depthTest":true,"depthWrite":true,"cull":1,"blendType":2,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"type":"material","file":null,"id":"3460314"},"3460315":{"tags":[],"name":"6","revision":1,"preload":true,"meta":null,"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.0154525386313466,0.0390625],"aoMapOffset":[0.3642384105960265,0.00390625],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.0154525386313466,0.0390625],"diffuseMapOffset":[0.3642384105960265,0.00390625],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.0154525386313466,0.0390625],"specularMapOffset":[0.3642384105960265,0.00390625],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.0154525386313466,0.0390625],"metalnessMapOffset":[0.3642384105960265,0.00390625],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.0154525386313466,0.0390625],"glossMapOffset":[0.3642384105960265,0.00390625],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.0154525386313466,0.0390625],"emissiveMapOffset":[0.3642384105960265,0.00390625],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.0154525386313466,0.0390625],"normalMapOffset":[0.3642384105960265,0.00390625],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.0154525386313466,0.0390625],"heightMapOffset":[0.3642384105960265,0.00390625],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":3324896,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.0154525386313466,0.0390625],"opacityMapOffset":[0.3642384105960265,0.00390625],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.0154525386313466,0.0390625],"lightMapOffset":[0.3642384105960265,0.00390625],"depthTest":true,"depthWrite":true,"cull":1,"blendType":2,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"type":"material","file":null,"id":"3460315"},"3460316":{"tags":[],"name":"7","revision":1,"preload":true,"meta":null,"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.0154525386313466,0.0390625],"aoMapOffset":[0.3863134657836645,0.00390625],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.0154525386313466,0.0390625],"diffuseMapOffset":[0.3863134657836645,0.00390625],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.0154525386313466,0.0390625],"specularMapOffset":[0.3863134657836645,0.00390625],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.0154525386313466,0.0390625],"metalnessMapOffset":[0.3863134657836645,0.00390625],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.0154525386313466,0.0390625],"glossMapOffset":[0.3863134657836645,0.00390625],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.0154525386313466,0.0390625],"emissiveMapOffset":[0.3863134657836645,0.00390625],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.0154525386313466,0.0390625],"normalMapOffset":[0.3863134657836645,0.00390625],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.0154525386313466,0.0390625],"heightMapOffset":[0.3863134657836645,0.00390625],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":3324896,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.0154525386313466,0.0390625],"opacityMapOffset":[0.3863134657836645,0.00390625],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.0154525386313466,0.0390625],"lightMapOffset":[0.3863134657836645,0.00390625],"depthTest":true,"depthWrite":true,"cull":1,"blendType":2,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"type":"material","file":null,"id":"3460316"},"3460331":{"tags":[],"name":"8","revision":1,"preload":true,"meta":null,"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.0154525386313466,0.0390625],"aoMapOffset":[0.4083885209713024,0.00390625],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.0154525386313466,0.0390625],"diffuseMapOffset":[0.4083885209713024,0.00390625],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.0154525386313466,0.0390625],"specularMapOffset":[0.4083885209713024,0.00390625],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.0154525386313466,0.0390625],"metalnessMapOffset":[0.4083885209713024,0.00390625],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.0154525386313466,0.0390625],"glossMapOffset":[0.4083885209713024,0.00390625],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.0154525386313466,0.0390625],"emissiveMapOffset":[0.4083885209713024,0.00390625],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.0154525386313466,0.0390625],"normalMapOffset":[0.4083885209713024,0.00390625],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.0154525386313466,0.0390625],"heightMapOffset":[0.4083885209713024,0.00390625],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":3324896,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.0154525386313466,0.0390625],"opacityMapOffset":[0.4083885209713024,0.00390625],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.0154525386313466,0.0390625],"lightMapOffset":[0.4083885209713024,0.00390625],"depthTest":true,"depthWrite":true,"cull":1,"blendType":2,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"type":"material","file":null,"id":"3460331"},"3460332":{"tags":[],"name":"9","revision":1,"preload":true,"meta":null,"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.0154525386313466,0.0390625],"aoMapOffset":[0.4304635761589404,0.00390625],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.0154525386313466,0.0390625],"diffuseMapOffset":[0.4304635761589404,0.00390625],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.0154525386313466,0.0390625],"specularMapOffset":[0.4304635761589404,0.00390625],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.0154525386313466,0.0390625],"metalnessMapOffset":[0.4304635761589404,0.00390625],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.0154525386313466,0.0390625],"glossMapOffset":[0.4304635761589404,0.00390625],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.0154525386313466,0.0390625],"emissiveMapOffset":[0.4304635761589404,0.00390625],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.0154525386313466,0.0390625],"normalMapOffset":[0.4304635761589404,0.00390625],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.0154525386313466,0.0390625],"heightMapOffset":[0.4304635761589404,0.00390625],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":3324896,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.0154525386313466,0.0390625],"opacityMapOffset":[0.4304635761589404,0.00390625],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.0154525386313466,0.0390625],"lightMapOffset":[0.4304635761589404,0.00390625],"depthTest":true,"depthWrite":true,"cull":1,"blendType":2,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"type":"material","file":null,"id":"3460332"},"3462035":{"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.0154525386313466,0.0390625],"aoMapOffset":[0.32229580573951433,0.4375],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.0154525386313466,0.0390625],"diffuseMapOffset":[0.32229580573951433,0.4375],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.0154525386313466,0.0390625],"specularMapOffset":[0.32229580573951433,0.4375],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.0154525386313466,0.0390625],"metalnessMapOffset":[0.32229580573951433,0.4375],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.0154525386313466,0.0390625],"glossMapOffset":[0.32229580573951433,0.4375],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.0154525386313466,0.0390625],"emissiveMapOffset":[0.32229580573951433,0.4375],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.0154525386313466,0.0390625],"normalMapOffset":[0.32229580573951433,0.4375],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.0154525386313466,0.0390625],"heightMapOffset":[0.32229580573951433,0.4375],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":3324896,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.0154525386313466,0.0390625],"opacityMapOffset":[0.32229580573951433,0.4375],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.0154525386313466,0.0390625],"lightMapOffset":[0.32229580573951433,0.4375],"depthTest":true,"depthWrite":true,"cull":1,"blendType":2,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"file":null,"meta":null,"name":"Blank","preload":true,"revision":1,"tags":[],"type":"material","id":"3462035"},"3469949":{"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.0485651214128035,0.0859375],"aoMapOffset":[0.6666666666666667,0.37890625],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.0485651214128035,0.0859375],"diffuseMapOffset":[0.6666666666666667,0.37890625],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.0485651214128035,0.0859375],"specularMapOffset":[0.6666666666666667,0.37890625],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.0485651214128035,0.0859375],"metalnessMapOffset":[0.6666666666666667,0.37890625],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.0485651214128035,0.0859375],"glossMapOffset":[0.6666666666666667,0.37890625],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.0485651214128035,0.0859375],"emissiveMapOffset":[0.6666666666666667,0.37890625],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.0485651214128035,0.0859375],"normalMapOffset":[0.6666666666666667,0.37890625],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.0485651214128035,0.0859375],"heightMapOffset":[0.6666666666666667,0.37890625],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":3324896,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.0485651214128035,0.0859375],"opacityMapOffset":[0.6666666666666667,0.37890625],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.0485651214128035,0.0859375],"lightMapOffset":[0.6666666666666667,0.37890625],"depthTest":true,"depthWrite":true,"cull":1,"blendType":2,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"file":null,"meta":null,"name":"Bronze","preload":true,"revision":1,"tags":[],"type":"material","id":"3469949"},"3469967":{"tags":[],"name":"Silver","revision":1,"preload":true,"meta":null,"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.0485651214128035,0.0859375],"aoMapOffset":[0.58719646799117,0.01953125],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.0485651214128035,0.0859375],"diffuseMapOffset":[0.58719646799117,0.01953125],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.0485651214128035,0.0859375],"specularMapOffset":[0.58719646799117,0.01953125],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.0485651214128035,0.0859375],"metalnessMapOffset":[0.58719646799117,0.01953125],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.0485651214128035,0.0859375],"glossMapOffset":[0.58719646799117,0.01953125],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.0485651214128035,0.0859375],"emissiveMapOffset":[0.58719646799117,0.01953125],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.0485651214128035,0.0859375],"normalMapOffset":[0.58719646799117,0.01953125],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.0485651214128035,0.0859375],"heightMapOffset":[0.58719646799117,0.01953125],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":3324896,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.0485651214128035,0.0859375],"opacityMapOffset":[0.58719646799117,0.01953125],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.0485651214128035,0.0859375],"lightMapOffset":[0.58719646799117,0.01953125],"depthTest":true,"depthWrite":true,"cull":1,"blendType":2,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"type":"material","file":null,"id":"3469967"},"3470034":{"tags":[],"name":"Gold","revision":1,"preload":true,"meta":null,"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.0485651214128035,0.0859375],"aoMapOffset":[0.5342163355408389,0.01953125],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.0485651214128035,0.0859375],"diffuseMapOffset":[0.5342163355408389,0.01953125],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.0485651214128035,0.0859375],"specularMapOffset":[0.5342163355408389,0.01953125],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.0485651214128035,0.0859375],"metalnessMapOffset":[0.5342163355408389,0.01953125],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.0485651214128035,0.0859375],"glossMapOffset":[0.5342163355408389,0.01953125],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.0485651214128035,0.0859375],"emissiveMapOffset":[0.5342163355408389,0.01953125],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.0485651214128035,0.0859375],"normalMapOffset":[0.5342163355408389,0.01953125],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.0485651214128035,0.0859375],"heightMapOffset":[0.5342163355408389,0.01953125],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":3324896,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.0485651214128035,0.0859375],"opacityMapOffset":[0.5342163355408389,0.01953125],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.0485651214128035,0.0859375],"lightMapOffset":[0.5342163355408389,0.01953125],"depthTest":true,"depthWrite":true,"cull":1,"blendType":2,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"type":"material","file":null,"id":"3470034"},"3470035":{"tags":[],"name":"Platinum","revision":1,"preload":true,"meta":null,"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.0485651214128035,0.0859375],"aoMapOffset":[0.4856512141280353,0.3515625],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.0485651214128035,0.0859375],"diffuseMapOffset":[0.4856512141280353,0.3515625],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.0485651214128035,0.0859375],"specularMapOffset":[0.4856512141280353,0.3515625],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.0485651214128035,0.0859375],"metalnessMapOffset":[0.4856512141280353,0.3515625],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.0485651214128035,0.0859375],"glossMapOffset":[0.4856512141280353,0.3515625],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.0485651214128035,0.0859375],"emissiveMapOffset":[0.4856512141280353,0.3515625],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.0485651214128035,0.0859375],"normalMapOffset":[0.4856512141280353,0.3515625],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.0485651214128035,0.0859375],"heightMapOffset":[0.4856512141280353,0.3515625],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":3324896,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.0485651214128035,0.0859375],"opacityMapOffset":[0.4856512141280353,0.3515625],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.0485651214128035,0.0859375],"lightMapOffset":[0.4856512141280353,0.3515625],"depthTest":true,"depthWrite":true,"cull":1,"blendType":2,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"type":"material","file":null,"id":"3470035"},"3486265":{"tags":[],"name":"Copyright","revision":1,"preload":true,"meta":null,"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.2097130242825607,0.02734375],"aoMapOffset":[0.7902869757174393,0.97265625],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.2097130242825607,0.02734375],"diffuseMapOffset":[0.7902869757174393,0.97265625],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.2097130242825607,0.02734375],"specularMapOffset":[0.7902869757174393,0.97265625],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.2097130242825607,0.02734375],"metalnessMapOffset":[0.7902869757174393,0.97265625],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.2097130242825607,0.02734375],"glossMapOffset":[0.7902869757174393,0.97265625],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.2097130242825607,0.02734375],"emissiveMapOffset":[0.7902869757174393,0.97265625],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.2097130242825607,0.02734375],"normalMapOffset":[0.7902869757174393,0.97265625],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.2097130242825607,0.02734375],"heightMapOffset":[0.7902869757174393,0.97265625],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":3324896,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.2097130242825607,0.02734375],"opacityMapOffset":[0.7902869757174393,0.97265625],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.2097130242825607,0.02734375],"lightMapOffset":[0.7902869757174393,0.97265625],"depthTest":true,"depthWrite":true,"cull":1,"blendType":2,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"type":"material","file":null,"id":"3486265"},"3520267":{"tags":[],"name":"Sparkle 1","revision":1,"preload":true,"meta":null,"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.011037527593819,0.01953125],"aoMapOffset":[0.6512141280353201,0.69140625],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.011037527593819,0.01953125],"diffuseMapOffset":[0.6512141280353201,0.69140625],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.011037527593819,0.01953125],"specularMapOffset":[0.6512141280353201,0.69140625],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.011037527593819,0.01953125],"metalnessMapOffset":[0.6512141280353201,0.69140625],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.011037527593819,0.01953125],"glossMapOffset":[0.6512141280353201,0.69140625],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.011037527593819,0.01953125],"emissiveMapOffset":[0.6512141280353201,0.69140625],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.011037527593819,0.01953125],"normalMapOffset":[0.6512141280353201,0.69140625],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.011037527593819,0.01953125],"heightMapOffset":[0.6512141280353201,0.69140625],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":3324896,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.011037527593819,0.01953125],"opacityMapOffset":[0.6512141280353201,0.69140625],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.011037527593819,0.01953125],"lightMapOffset":[0.6512141280353201,0.69140625],"depthTest":true,"depthWrite":true,"cull":1,"blendType":2,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"type":"material","file":null,"id":"3520267"},"3520282":{"tags":[],"name":"Sparkle 2","revision":1,"preload":true,"meta":null,"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.011037527593819,0.01953125],"aoMapOffset":[0.576158940397351,0.55078125],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.011037527593819,0.01953125],"diffuseMapOffset":[0.576158940397351,0.55078125],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.011037527593819,0.01953125],"specularMapOffset":[0.576158940397351,0.55078125],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.011037527593819,0.01953125],"metalnessMapOffset":[0.576158940397351,0.55078125],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.011037527593819,0.01953125],"glossMapOffset":[0.576158940397351,0.55078125],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.011037527593819,0.01953125],"emissiveMapOffset":[0.576158940397351,0.55078125],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.011037527593819,0.01953125],"normalMapOffset":[0.576158940397351,0.55078125],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.011037527593819,0.01953125],"heightMapOffset":[0.576158940397351,0.55078125],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":3324896,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.011037527593819,0.01953125],"opacityMapOffset":[0.576158940397351,0.55078125],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.011037527593819,0.01953125],"lightMapOffset":[0.576158940397351,0.55078125],"depthTest":true,"depthWrite":true,"cull":1,"blendType":2,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"type":"material","file":null,"id":"3520282"},"3520283":{"tags":[],"name":"Sparkle 3","revision":1,"preload":true,"meta":null,"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.011037527593819,0.01953125],"aoMapOffset":[0.5916114790286976,0.55078125],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.011037527593819,0.01953125],"diffuseMapOffset":[0.5916114790286976,0.55078125],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.011037527593819,0.01953125],"specularMapOffset":[0.5916114790286976,0.55078125],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.011037527593819,0.01953125],"metalnessMapOffset":[0.5916114790286976,0.55078125],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.011037527593819,0.01953125],"glossMapOffset":[0.5916114790286976,0.55078125],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.011037527593819,0.01953125],"emissiveMapOffset":[0.5916114790286976,0.55078125],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.011037527593819,0.01953125],"normalMapOffset":[0.5916114790286976,0.55078125],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.011037527593819,0.01953125],"heightMapOffset":[0.5916114790286976,0.55078125],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":3324896,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.011037527593819,0.01953125],"opacityMapOffset":[0.5916114790286976,0.55078125],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.011037527593819,0.01953125],"lightMapOffset":[0.5916114790286976,0.55078125],"depthTest":true,"depthWrite":true,"cull":1,"blendType":2,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"type":"material","file":null,"id":"3520283"},"3652807":{"tags":[],"name":"New","revision":1,"preload":true,"meta":null,"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.0353200883002208,0.02734375],"aoMapOffset":[0.3222958057395143,0.015625],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.0353200883002208,0.02734375],"diffuseMapOffset":[0.3222958057395143,0.015625],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.0353200883002208,0.02734375],"specularMapOffset":[0.3222958057395143,0.015625],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.0353200883002208,0.02734375],"metalnessMapOffset":[0.3222958057395143,0.015625],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.0353200883002208,0.02734375],"glossMapOffset":[0.3222958057395143,0.015625],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.0353200883002208,0.02734375],"emissiveMapOffset":[0.3222958057395143,0.015625],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.0353200883002208,0.02734375],"normalMapOffset":[0.3222958057395143,0.015625],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.0353200883002208,0.02734375],"heightMapOffset":[0.3222958057395143,0.015625],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":3324896,"opacityMapVertexColor":false,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[0.0353200883002208,0.02734375],"opacityMapOffset":[0.3222958057395143,0.015625],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.0353200883002208,0.02734375],"lightMapOffset":[0.3222958057395143,0.015625],"depthTest":true,"depthWrite":true,"cull":1,"blendType":2,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useGammaTonemap":false,"useSkybox":false,"useFog":false,"useLighting":false},"type":"material","file":null,"id":"3652807"},"4554207":{"data":{"scripts":{"addToScore":{"attributesOrder":["bird"],"attributes":{"bird":{"type":"entity"}}}},"loading":false},"file":{"filename":"__game-scripts.js","size":24332,"hash":"44fb80b9bc84ab906ee40474c2d50d4f","url":"__game-scripts.js"},"meta":null,"name":"add-to-score.js","preload":true,"region":"eu-west-1","revision":1,"tags":[],"type":"script","id":"4554207"},"4554209":{"tags":[],"name":"medal.js","revision":1,"preload":true,"meta":null,"data":{"scripts":{"medal":{"attributesOrder":["blank","bronze","silver","gold","platinum"],"attributes":{"blank":{"type":"asset","assetType":"material","array":false},"bronze":{"type":"asset","assetType":"material","array":false},"silver":{"type":"asset","assetType":"material","array":false},"gold":{"type":"asset","assetType":"material","array":false},"platinum":{"type":"asset","assetType":"material","array":false}}}},"loading":false},"type":"script","file":{"filename":"__game-scripts.js","size":24332,"hash":"44fb80b9bc84ab906ee40474c2d50d4f","url":"__game-scripts.js"},"region":"eu-west-1","id":"4554209"},"4554213":{"tags":[],"name":"game.js","revision":1,"preload":true,"meta":null,"data":{"scripts":{"game":{"attributesOrder":[],"attributes":{}}},"loading":false},"type":"script","file":{"filename":"__game-scripts.js","size":24332,"hash":"44fb80b9bc84ab906ee40474c2d50d4f","url":"__game-scripts.js"},"region":"eu-west-1","id":"4554213"},"4554214":{"tags":[],"name":"button.js","revision":1,"preload":true,"meta":null,"data":{"scripts":{"button":{"attributesOrder":["diplacement","event"],"attributes":{"diplacement":{"type":"number","default":0.00390625},"event":{"type":"string"}}}},"loading":false},"type":"script","file":{"filename":"__game-scripts.js","size":24332,"hash":"44fb80b9bc84ab906ee40474c2d50d4f","url":"__game-scripts.js"},"region":"eu-west-1","id":"4554214"},"4554217":{"tags":[],"name":"sparkle.js","revision":1,"preload":true,"meta":null,"data":{"scripts":{"sparkle":{"attributesOrder":["radius"],"attributes":{"radius":{"type":"number","default":1}}}},"loading":false},"type":"script","file":{"filename":"__game-scripts.js","size":24332,"hash":"44fb80b9bc84ab906ee40474c2d50d4f","url":"__game-scripts.js"},"region":"eu-west-1","id":"4554217"},"4554219":{"tags":[],"name":"tween.js","revision":1,"preload":true,"meta":null,"data":{"scripts":{"tween":{"attributesOrder":["event","duration","startPos","endPos","startScale","endScale","easing","inOut"],"attributes":{"event":{"type":"string"},"duration":{"type":"number","default":1},"startPos":{"type":"vec3","default":[0,0,0]},"endPos":{"type":"vec3","default":[0,0,0]},"startScale":{"type":"vec3","default":[1,1,1]},"endScale":{"type":"vec3","default":[1,1,1]},"easing":{"type":"number","enum":{"order":["Linear","Quadratic","Cubic","Quartic","Quintic","Sinusoidal","Exponential","Circular","Elastic","Back","Bounce"],"options":{"Linear":0,"Quadratic":1,"Cubic":2,"Quartic":3,"Quintic":4,"Sinusoidal":5,"Exponential":6,"Circular":7,"Elastic":8,"Back":9,"Bounce":10}}},"inOut":{"type":"number","enum":{"order":["In","Out","InOut"],"options":{"In":0,"Out":1,"InOut":2}}}}}},"loading":false},"type":"script","file":{"filename":"__game-scripts.js","size":24332,"hash":"44fb80b9bc84ab906ee40474c2d50d4f","url":"__game-scripts.js"},"region":"eu-west-1","id":"4554219"},"4554270":{"tags":[],"name":"bird.js","revision":1,"preload":true,"meta":null,"data":{"scripts":{"bird":{"attributesOrder":["flapVelocity","gravity","lowestHeight","radius"],"attributes":{"flapVelocity":{"type":"number","default":1},"gravity":{"type":"number","default":5},"lowestHeight":{"type":"number","default":-0.25},"radius":{"type":"number","default":0.068}}}},"loading":false},"type":"script","file":{"filename":"__game-scripts.js","size":24332,"hash":"44fb80b9bc84ab906ee40474c2d50d4f","url":"__game-scripts.js"},"region":"eu-west-1","id":"4554270"},"4554271":{"tags":[],"name":"camera-aspect.js","revision":1,"preload":true,"meta":null,"data":{"scripts":{"cameraAspect":{"attributesOrder":[],"attributes":{}}},"loading":false},"type":"script","file":{"filename":"__game-scripts.js","size":24332,"hash":"44fb80b9bc84ab906ee40474c2d50d4f","url":"__game-scripts.js"},"region":"eu-west-1","id":"4554271"},"4554272":{"tags":[],"name":"tweenlib.js","revision":1,"preload":true,"meta":null,"data":{"scripts":{"tweenlib":{"attributesOrder":[],"attributes":{}}},"loading":false},"type":"script","file":{"filename":"__game-scripts.js","size":24332,"hash":"44fb80b9bc84ab906ee40474c2d50d4f","url":"__game-scripts.js"},"region":"eu-west-1","id":"4554272"},"4554273":{"tags":[],"name":"score.js","revision":1,"preload":true,"meta":null,"data":{"scripts":{"score":{"attributesOrder":["center","name","zero","one","two","three","four","five","six","seven","eight","nine","blank"],"attributes":{"center":{"type":"boolean","default":false},"name":{"type":"string","default":"score"},"zero":{"type":"asset","assetType":"material","array":false},"one":{"type":"asset","assetType":"material","array":false},"two":{"type":"asset","assetType":"material","array":false},"three":{"type":"asset","assetType":"material","array":false},"four":{"type":"asset","assetType":"material","array":false},"five":{"type":"asset","assetType":"material","array":false},"six":{"type":"asset","assetType":"material","array":false},"seven":{"type":"asset","assetType":"material","array":false},"eight":{"type":"asset","assetType":"material","array":false},"nine":{"type":"asset","assetType":"material","array":false},"blank":{"type":"asset","assetType":"material","array":false}}}},"loading":false},"type":"script","file":{"filename":"__game-scripts.js","size":24332,"hash":"44fb80b9bc84ab906ee40474c2d50d4f","url":"__game-scripts.js"},"region":"eu-west-1","id":"4554273"},"4554276":{"tags":[],"name":"pipe-height.js","revision":1,"preload":true,"meta":null,"data":{"scripts":{"pipeHeight":{"attributesOrder":[],"attributes":{}}},"loading":false},"type":"script","file":{"filename":"__game-scripts.js","size":24332,"hash":"44fb80b9bc84ab906ee40474c2d50d4f","url":"__game-scripts.js"},"region":"eu-west-1","id":"4554276"},"4554277":{"tags":[],"name":"sine.js","revision":1,"preload":true,"meta":null,"data":{"scripts":{"sine":{"attributesOrder":["amplitudeScale","frequencyScale"],"attributes":{"amplitudeScale":{"type":"number","default":1},"frequencyScale":{"type":"number","default":1}}}},"loading":false},"type":"script","file":{"filename":"__game-scripts.js","size":24332,"hash":"44fb80b9bc84ab906ee40474c2d50d4f","url":"__game-scripts.js"},"region":"eu-west-1","id":"4554277"},"4554279":{"tags":[],"name":"scroll.js","revision":1,"preload":true,"meta":null,"data":{"scripts":{"scroll":{"attributesOrder":["startEvent","stopEvent","resetEvent","cycleEvent","startX","endX","speed","frozen"],"attributes":{"startEvent":{"type":"string","default":"start"},"stopEvent":{"type":"string","default":"stop"},"resetEvent":{"type":"string","default":"reset"},"cycleEvent":{"type":"string","default":"cycle"},"startX":{"type":"number","default":1},"endX":{"type":"number","default":-1},"speed":{"type":"number","default":1},"frozen":{"type":"boolean","default":false}}}},"loading":false},"type":"script","file":{"filename":"__game-scripts.js","size":24332,"hash":"44fb80b9bc84ab906ee40474c2d50d4f","url":"__game-scripts.js"},"region":"eu-west-1","id":"4554279"},"4554281":{"tags":[],"name":"sprite-anim.js","revision":1,"preload":true,"meta":null,"data":{"scripts":{"spriteAnim":{"attributesOrder":["speed","startEvent","stopEvent","finishEvent"],"attributes":{"speed":{"type":"number","default":1},"startEvent":{"type":"string","default":"start"},"stopEvent":{"type":"string","default":"stop"},"finishEvent":{"type":"string","default":"finish"}}}},"loading":false},"type":"script","file":{"filename":"__game-scripts.js","size":24332,"hash":"44fb80b9bc84ab906ee40474c2d50d4f","url":"__game-scripts.js"},"region":"eu-west-1","id":"4554281"},"4831174":{"tags":[],"name":"Screen","revision":1,"preload":true,"meta":null,"data":{"shader":"blinn","ambient":[0,0,0],"ambientTint":false,"aoMap":0,"aoMapVertexColor":false,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[0.0353200883002208,0.0625],"aoMapOffset":[0.6666666666666667,0.30859375],"occludeSpecular":1,"diffuse":[0,0,0],"diffuseMap":0,"diffuseMapVertexColor":false,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[0.0353200883002208,0.0625],"diffuseMapOffset":[0.6666666666666667,0.30859375],"diffuseMapTint":false,"specular":[0,0,0],"specularMapVertexColor":false,"specularMapChannel":"rgb","specularMapUv":0,"specularMap":0,"specularMapTiling":[0.0353200883002208,0.0625],"specularMapOffset":[0.6666666666666667,0.30859375],"specularMapTint":false,"specularAntialias":true,"useMetalness":false,"metalnessMap":0,"metalnessMapVertexColor":false,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[0.0353200883002208,0.0625],"metalnessMapOffset":[0.6666666666666667,0.30859375],"metalnessMapTint":false,"metalness":1,"conserveEnergy":true,"shininess":32,"glossMap":0,"glossMapVertexColor":false,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[0.0353200883002208,0.0625],"glossMapOffset":[0.6666666666666667,0.30859375],"fresnelModel":0,"fresnelFactor":0,"emissive":[0,0,0],"emissiveMap":3324896,"emissiveMapVertexColor":false,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[0.0353200883002208,0.0625],"emissiveMapOffset":[0.6666666666666667,0.30859375],"emissiveMapTint":false,"emissiveIntensity":1,"normalMap":0,"normalMapTiling":[0.0353200883002208,0.0625],"normalMapOffset":[0.6666666666666667,0.30859375],"normalMapUv":0,"bumpMapFactor":1,"heightMap":0,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[0.0353200883002208,0.0625],"heightMapOffset":[0.6666666666666667,0.30859375],"heightMapFactor":1,"alphaTest":0,"opacity":1,"opacityMap":0,"opacityMapVertexColor":false,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[0.0353200883002208,0.0625],"opacityMapOffset":[0.6666666666666667,0.30859375],"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":0,"cubeMap":0,"cubeMapProjection":0,"lightMap":0,"lightMapVertexColor":false,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[0.0353200883002208,0.0625],"lightMapOffset":[0.6666666666666667,0.30859375],"depthTest":true,"depthWrite":true,"cull":1,"blendType":2,"shadowSampleType":1,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"useFog":false,"useLighting":false,"useSkybox":false,"useGammaTonemap":false},"type":"material","file":null,"region":"eu-west-1","id":"4831174"},"4831197":{"data":{"scripts":{"fade":{"attributesOrder":["event","type","duration"],"attributes":{"event":{"type":"string"},"type":{"type":"number","enum":{"order":["In","Out","InOut"],"options":{"In":0,"Out":1,"InOut":2}}},"duration":{"type":"number","default":0.25}}}},"loading":false},"file":{"filename":"__game-scripts.js","size":24332,"hash":"44fb80b9bc84ab906ee40474c2d50d4f","url":"__game-scripts.js"},"meta":null,"name":"fade.js","preload":true,"region":"eu-west-1","revision":1,"tags":[],"type":"script","id":"4831197"}}} \ No newline at end of file diff --git a/tools/flappybird/files/assets/3324896/1/spritesheet.png b/tools/flappybird/files/assets/3324896/1/spritesheet.png deleted file mode 100644 index de4462b..0000000 Binary files a/tools/flappybird/files/assets/3324896/1/spritesheet.png and /dev/null differ diff --git a/tools/flappybird/files/assets/3371285/1/sfx_hit.mp3 b/tools/flappybird/files/assets/3371285/1/sfx_hit.mp3 deleted file mode 100644 index 3b9130b..0000000 Binary files a/tools/flappybird/files/assets/3371285/1/sfx_hit.mp3 and /dev/null differ diff --git a/tools/flappybird/files/assets/3371286/1/sfx_wing.mp3 b/tools/flappybird/files/assets/3371286/1/sfx_wing.mp3 deleted file mode 100644 index 26bd415..0000000 Binary files a/tools/flappybird/files/assets/3371286/1/sfx_wing.mp3 and /dev/null differ diff --git a/tools/flappybird/files/assets/3371287/1/sfx_die.mp3 b/tools/flappybird/files/assets/3371287/1/sfx_die.mp3 deleted file mode 100644 index 77965a0..0000000 Binary files a/tools/flappybird/files/assets/3371287/1/sfx_die.mp3 and /dev/null differ diff --git a/tools/flappybird/files/assets/3371288/1/sfx_point.mp3 b/tools/flappybird/files/assets/3371288/1/sfx_point.mp3 deleted file mode 100644 index f1a48bd..0000000 Binary files a/tools/flappybird/files/assets/3371288/1/sfx_point.mp3 and /dev/null differ diff --git a/tools/flappybird/files/assets/3371289/1/sfx_swooshing.mp3 b/tools/flappybird/files/assets/3371289/1/sfx_swooshing.mp3 deleted file mode 100644 index 9488d27..0000000 Binary files a/tools/flappybird/files/assets/3371289/1/sfx_swooshing.mp3 and /dev/null differ diff --git a/tools/flappybird/index.html b/tools/flappybird/index.html deleted file mode 100644 index 2bc2c01..0000000 --- a/tools/flappybird/index.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - Flappy Bird - - - - - - - - diff --git a/tools/flappybird/logo.png b/tools/flappybird/logo.png deleted file mode 100644 index bb25c22..0000000 Binary files a/tools/flappybird/logo.png and /dev/null differ diff --git a/tools/flappybird/manifest.json b/tools/flappybird/manifest.json deleted file mode 100644 index e3472a4..0000000 --- a/tools/flappybird/manifest.json +++ /dev/null @@ -1 +0,0 @@ -{"short_name":"Flappy Bird","name":"Flappy Bird","start_url":"","display":"fullscreen","icons":[{"src":"thumbs/180.jpg","sizes":"180x180","type":"image/jpeg"},{"src":"thumbs/360.jpg","sizes":"360x360","type":"image/jpeg"},{"src":"thumbs/540.jpg","sizes":"540x540","type":"image/jpeg"},{"src":"thumbs/720.jpg","sizes":"720x720","type":"image/jpeg"}]} \ No newline at end of file diff --git a/tools/flappybird/playcanvas-stable.min.js b/tools/flappybird/playcanvas-stable.min.js deleted file mode 100644 index 0963a8f..0000000 --- a/tools/flappybird/playcanvas-stable.min.js +++ /dev/null @@ -1,1780 +0,0 @@ -;(function (root, factory) { - if (typeof define === 'function' && define.amd) { - define([], factory); - } else if (typeof module === 'object' && module.exports) { - try { - var JSDOM = require("jsdom").JSDOM; - var DOM = new JSDOM(); - var window = DOM.window; - var navigator = window.navigator; - module.exports = factory(window, navigator); - } catch (error) { - module.exports = factory(); - } - } else { - root.pc = factory(root, root.navigator); - } -}(this, function (_window, _navigator) { - window = _window || window; - navigator = _navigator || navigator; - - /* - PlayCanvas Engine v1.16.1 revision d53fd63 - http://playcanvas.com - Copyright 2011-2018 PlayCanvas Ltd. All rights reserved. -*/ -var _typeLookup=function(){for(var e={},b="Array Object Function Date RegExp Float32Array".split(" "),a=0;athis.length)b=this.length;return this.substring(b-e.length,b)===e});String.prototype.includes||(String.prototype.includes=function(e,b){"number"!==typeof b&&(b=0);return b+e.length>this.length?!1:-1!==this.indexOf(e,b)});String.prototype.startsWith||(String.prototype.startsWith=function(e,b){return this.substr(!b||0>b?0:+b,e.length)===e});Object.assign(pc,function(){var e=function(b,a,c,d){var f=b&&b.length;3===f||4===f?(this.r=b[0],this.g=b[1],this.b=b[2],this.a=void 0!==b[3]?b[3]:1):(this.r=b||0,this.g=a||0,this.b=c||0,this.a=void 0!==d?d:1)};Object.assign(e.prototype,{clone:function(){return new pc.Color(this.r,this.g,this.b,this.a)},copy:function(b){this.r=b.r;this.g=b.g;this.b=b.b;this.a=b.a;return this},set:function(b,a,c,d){this.r=b;this.g=a;this.b=c;this.a=void 0===d?1:d;return this},lerp:function(b,a,c){this.r=b.r+c*(a.r- -b.r);this.g=b.g+c*(a.g-b.g);this.b=b.b+c*(a.b-b.b);this.a=b.a+c*(a.a-b.a);return this},fromString:function(b){var a=parseInt(b.replace("#","0x"),16);7b||b>=c)return null;var f=a.charCodeAt(b);return 1=f&&(c=a.charCodeAt(b+1),56320<=c&&57343>=c)?{code:1024*(f-55296)+c-56320+65536,"long":!0}:{code:f,"long":!1}}function b(a,b,d){return a?(a=e(a))?(a=a.code,a>=b&&a<=d):!1:!1}return{ASCII_LOWERCASE:"abcdefghijklmnopqrstuvwxyz",ASCII_UPPERCASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",ASCII_LETTERS:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",format:function(a){var b,d, -f=pc.makeArray(arguments);f.shift();for(b=0;b>10)+55296,d%1024+56320]:[b],a.push(String.fromCharCode.apply(null,b));return a.join("")}}}();pc.debug=function(){var e=null,b=null,a=null,c=null;return{display:function(d){e||(e=document.createElement("table"),b=document.createElement("tr"),a=document.createElement("td"),c=document.createElement("td"),e.style.cssText="position:absolute;font-family:sans-serif;font-size:12px;color:#cccccc",e.style.top="0px",e.style.left="0px",e.style.border="thin solid #cccccc",document.body.appendChild(e));e.innerHTML="";for(var f in d){var g=b.cloneNode(),l=a.cloneNode(),h=c.cloneNode();l.textContent=f;h.textContent= -d[f];g.appendChild(l);g.appendChild(h);e.appendChild(g)}}}}();pc.events={attach:function(e){var b=pc.events;e.on=b.on;e.off=b.off;e.fire=b.fire;e.once=b.once;e.hasEvent=b.hasEvent;e._callbackActive={};return e},on:function(e,b,a){if(!e||"string"!==typeof e||!b)return this;this._callbacks||(this._callbacks={});this._callbacks[e]||(this._callbacks[e]=[]);this._callbackActive||(this._callbackActive={});this._callbackActive[e]&&this._callbackActive[e]===this._callbacks[e]&&(this._callbackActive[e]=this._callbackActive[e].slice());this._callbacks[e].push({callback:b, -scope:a||this});return this},off:function(e,b,a){if(!this._callbacks)return this;if(this._callbackActive)if(e)this._callbackActive[e]&&this._callbackActive[e]===this._callbacks[e]&&(this._callbackActive[e]=this._callbackActive[e].slice());else for(var c in this._callbackActive)this._callbacks[c]&&this._callbacks[c]===this._callbackActive[c]&&(this._callbackActive[c]=this._callbackActive[c].slice());if(e)if(b){e=this._callbacks[e];if(!e)return this;for(c=e.length;c--;)e[c].callback===b&&(a&&e[c].scope!== -a||e.splice(c,1))}else this._callbacks[e]&&delete this._callbacks[e];else this._callbacks=null;return this},fire:function(e,b,a,c,d,f,g,l,h){if(!e||!this._callbacks||!this._callbacks[e])return this;var p;this._callbackActive||(this._callbackActive={});this._callbackActive[e]?(this._callbackActive[e]===this._callbacks[e]&&(this._callbackActive[e]=this._callbackActive[e].slice()),p=this._callbacks[e].slice()):this._callbackActive[e]=this._callbacks[e];for(var k=0;(p||this._callbackActive[e])&&k<(p|| -this._callbackActive[e]).length;k++){var n=(p||this._callbackActive[e])[k];n.callback.call(n.scope,b,a,c,d,f,g,l,h);n.callback.once&&(n=this._callbacks[e].indexOf(n),-1!==n&&(this._callbackActive[e]===this._callbacks[e]&&(this._callbackActive[e]=this._callbackActive[e].slice()),this._callbacks[e].splice(n,1)))}p||(this._callbackActive[e]=null);return this},once:function(e,b,a){b.once=!0;this.on(e,b,a);return this},hasEvent:function(e){return this._callbacks&&this._callbacks[e]&&0!==this._callbacks[e].length|| -!1}};Object.assign(pc,function(){var e=function(a){this._index={};this._key=a||null};Object.assign(e.prototype,{addItem:function(a){for(var b=a.tags._list,d=0;dthis._pool.length)for(var a=this._pool.length;a=this._pool.length&&this._resize(2*this._pool.length);return this._pool[this._count++]},freeAll:function(){this._count=0}});return{AllocatePool:e}}());Object.assign(pc,function(){var e={desktop:!1,mobile:!1,ios:!1,android:!1,windows:!1,cocoonjs:!1,xbox:!1,gamepads:!1,touch:!1,workers:!1},b=navigator.userAgent;/(windows|mac os|linux|cros)/i.test(b)&&(e.desktop=!0);/xbox/i.test(b)&&(e.xbox=!0);/(windows phone|iemobile|wpdesktop)/i.test(b)?(e.desktop=!1,e.mobile=!0,e.windows=!0):/android/i.test(b)?(e.desktop=!1,e.mobile=!0,e.android=!0):/ip([ao]d|hone)/i.test(b)&&(e.desktop=!1,e.mobile=!0,e.ios=!0);navigator.isCocoonJS&&(e.cocoonjs=!0);e.touch="ontouchstart"in -window||"maxTouchPoints"in navigator&&0a&&(this._index[b]= -c-1)}return!0}return!1},list:function(){return this._list},clear:function(){this._list.length=0;for(var b in this._index)delete this._index[b]}});return{IndexedList:e}}());pc.math={DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,clamp:function(e,b,a){return e>=a?a:e<=b?b:e},intToBytes24:function(e){return[e>>16&255,e>>8&255,e&255]},intToBytes32:function(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]},bytesToInt24:function(e,b,a){e.length&&(a=e[2],b=e[1],e=e[0]);return e<<16|b<<8|a},bytesToInt32:function(e,b,a,c){e.length&&(c=e[3],a=e[2],b=e[1],e=e[0]);return(e<<24|b<<16|a<<8|c)>>>32},lerp:function(e,b,a){return e+(b-e)*pc.math.clamp(a,0,1)},lerpAngle:function(e,b,a){180< -b-e&&(b-=360);-180>b-e&&(b+=360);return pc.math.lerp(e,b,pc.math.clamp(a,0,1))},powerOfTwo:function(e){return 0!==e&&!(e&e-1)},nextPowerOfTwo:function(e){e--;e|=e>>1;e|=e>>2;e|=e>>4;e|=e>>8;e|=e>>16;e++;return e},random:function(e,b){return Math.random()*(b-e)+e},smoothstep:function(e,b,a){if(a<=e)return 0;if(a>=b)return 1;a=(a-e)/(b-e);return a*a*(3-2*a)},smootherstep:function(e,b,a){if(a<=e)return 0;if(a>=b)return 1;a=(a-e)/(b-e);return a*a*a*(a*(6*a-15)+10)}};Object.assign(pc,function(){var e=function(b,a){b&&2===b.length?(this.x=b[0],this.y=b[1]):(this.x=b||0,this.y=a||0)};Object.assign(e.prototype,{add:function(b){this.x+=b.x;this.y+=b.y;return this},add2:function(b,a){this.x=b.x+a.x;this.y=b.y+a.y;return this},clone:function(){return(new e).copy(this)},copy:function(b){this.x=b.x;this.y=b.y;return this},dot:function(b){return this.x*b.x+this.y*b.y},equals:function(b){return this.x===b.x&&this.y===b.y},length:function(){return Math.sqrt(this.x*this.x+ -this.y*this.y)},lengthSq:function(){return this.x*this.x+this.y*this.y},lerp:function(b,a,c){this.x=b.x+c*(a.x-b.x);this.y=b.y+c*(a.y-b.y);return this},mul:function(b){this.x*=b.x;this.y*=b.y;return this},mul2:function(b,a){this.x=b.x*a.x;this.y=b.y*a.y;return this},normalize:function(){var b=this.x*this.x+this.y*this.y;0a;a++)b+=this.data[a],b+=8!==a?", ":"";return b+"]"},transpose:function(){var b=this.data, -a;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this}});Object.defineProperty(e,"IDENTITY",{get:function(){var b=new e;return function(){return b}}()});Object.defineProperty(e,"ZERO",{get:function(){var b=(new e).set([0,0,0,0,0,0,0,0,0]);return function(){return b}}()});return{Mat3:e}}());Object.assign(pc,function(){var e=function(){var b=new Float32Array(16);b[0]=b[5]=b[10]=b[15]=1;this.data=b};Object.assign(e.prototype,{add2:function(b,a){var c=b.data,d=a.data,f=this.data;f[0]=c[0]+d[0];f[1]=c[1]+d[1];f[2]=c[2]+d[2];f[3]=c[3]+d[3];f[4]=c[4]+d[4];f[5]=c[5]+d[5];f[6]=c[6]+d[6];f[7]=c[7]+d[7];f[8]=c[8]+d[8];f[9]=c[9]+d[9];f[10]=c[10]+d[10];f[11]=c[11]+d[11];f[12]=c[12]+d[12];f[13]=c[13]+d[13];f[14]=c[14]+d[14];f[15]=c[15]+d[15];return this},add:function(b){return this.add2(this,b)}, -clone:function(){return(new pc.Mat4).copy(this)},copy:function(b){b=b.data;var a=this.data;a[0]=b[0];a[1]=b[1];a[2]=b[2];a[3]=b[3];a[4]=b[4];a[5]=b[5];a[6]=b[6];a[7]=b[7];a[8]=b[8];a[9]=b[9];a[10]=b[10];a[11]=b[11];a[12]=b[12];a[13]=b[13];a[14]=b[14];a[15]=b[15];return this},equals:function(b){var a=this.data;b=b.data;return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]&&a[3]===b[3]&&a[4]===b[4]&&a[5]===b[5]&&a[6]===b[6]&&a[7]===b[7]&&a[8]===b[8]&&a[9]===b[9]&&a[10]===b[10]&&a[11]===b[11]&&a[12]===b[12]&& -a[13]===b[13]&&a[14]===b[14]&&a[15]===b[15]},isIdentity:function(){var b=this.data;return 1===b[0]&&0===b[1]&&0===b[2]&&0===b[3]&&0===b[4]&&1===b[5]&&0===b[6]&&0===b[7]&&0===b[8]&&0===b[9]&&1===b[10]&&0===b[11]&&0===b[12]&&0===b[13]&&0===b[14]&&1===b[15]},mul2:function(b,a){var c,d,f,g,l,h,e,k,n,q,m,r,t,u,x,v,w,y,D,B;v=b.data;var z=a.data,A=this.data;c=v[0];d=v[1];f=v[2];g=v[3];l=v[4];h=v[5];e=v[6];k=v[7];n=v[8];q=v[9];m=v[10];r=v[11];t=v[12];u=v[13];x=v[14];v=v[15];w=z[0];y=z[1];D=z[2];B=z[3];A[0]= -c*w+l*y+n*D+t*B;A[1]=d*w+h*y+q*D+u*B;A[2]=f*w+e*y+m*D+x*B;A[3]=g*w+k*y+r*D+v*B;w=z[4];y=z[5];D=z[6];B=z[7];A[4]=c*w+l*y+n*D+t*B;A[5]=d*w+h*y+q*D+u*B;A[6]=f*w+e*y+m*D+x*B;A[7]=g*w+k*y+r*D+v*B;w=z[8];y=z[9];D=z[10];B=z[11];A[8]=c*w+l*y+n*D+t*B;A[9]=d*w+h*y+q*D+u*B;A[10]=f*w+e*y+m*D+x*B;A[11]=g*w+k*y+r*D+v*B;w=z[12];y=z[13];D=z[14];B=z[15];A[12]=c*w+l*y+n*D+t*B;A[13]=d*w+h*y+q*D+u*B;A[14]=f*w+e*y+m*D+x*B;A[15]=g*w+k*y+r*D+v*B;return this},mul:function(b){return this.mul2(this,b)},transformPoint:function(b, -a){var c,d,f,g;g=this.data;c=b.x;d=b.y;f=b.z;a=void 0===a?new pc.Vec3:a;a.x=c*g[0]+d*g[4]+f*g[8]+g[12];a.y=c*g[1]+d*g[5]+f*g[9]+g[13];a.z=c*g[2]+d*g[6]+f*g[10]+g[14];return a},transformVector:function(b,a){var c,d,f,g;g=this.data;c=b.x;d=b.y;f=b.z;a=void 0===a?new pc.Vec3:a;a.x=c*g[0]+d*g[4]+f*g[8];a.y=c*g[1]+d*g[5]+f*g[9];a.z=c*g[2]+d*g[6]+f*g[10];return a},transformVec4:function(b,a){var c,d,f,g,l;l=this.data;c=b.x;d=b.y;f=b.z;g=b.w;a=void 0===a?new pc.Vec4:a;a.x=c*l[0]+d*l[4]+f*l[8]+g*l[12];a.y= -c*l[1]+d*l[5]+f*l[9]+g*l[13];a.z=c*l[2]+d*l[6]+f*l[10]+g*l[14];a.w=c*l[3]+d*l[7]+f*l[11]+g*l[15];return a},setLookAt:function(){var b,a,c;b=new pc.Vec3;a=new pc.Vec3;c=new pc.Vec3;return function(d,f,g){c.sub2(d,f).normalize();a.copy(g).normalize();b.cross(a,c).normalize();a.cross(c,b);f=this.data;f[0]=b.x;f[1]=b.y;f[2]=b.z;f[3]=0;f[4]=a.x;f[5]=a.y;f[6]=a.z;f[7]=0;f[8]=c.x;f[9]=c.y;f[10]=c.z;f[11]=0;f[12]=d.x;f[13]=d.y;f[14]=d.z;f[15]=1;return this}}(),setFrustum:function(b,a,c,d,f,g){var l,h,e,k, -n;l=2*f;h=a-b;e=d-c;k=g-f;n=this.data;n[0]=l/h;n[1]=0;n[2]=0;n[3]=0;n[4]=0;n[5]=l/e;n[6]=0;n[7]=0;n[8]=(a+b)/h;n[9]=(d+c)/e;n[10]=(-g-f)/k;n[11]=-1;n[12]=0;n[13]=0;n[14]=-l*g/k;n[15]=0;return this},setPerspective:function(b,a,c,d,f){f?(b=c*Math.tan(b*Math.PI/360),f=b/a):(f=c*Math.tan(b*Math.PI/360),b=f*a);return this.setFrustum(-b,b,-f,f,c,d)},setOrtho:function(b,a,c,d,f,g){var l=this.data;l[0]=2/(a-b);l[1]=0;l[2]=0;l[3]=0;l[4]=0;l[5]=2/(d-c);l[6]=0;l[7]=0;l[8]=0;l[9]=0;l[10]=-2/(g-f);l[11]=0;l[12]= --(a+b)/(a-b);l[13]=-(d+c)/(d-c);l[14]=-(g+f)/(g-f);l[15]=1;return this},setFromAxisAngle:function(b,a){var c,d,f,g,l,h,e,k,n;a*=pc.math.DEG_TO_RAD;c=b.x;d=b.y;f=b.z;g=Math.cos(a);l=Math.sin(a);h=1-g;e=h*c;k=h*d;n=this.data;n[0]=e*c+g;n[1]=e*d+l*f;n[2]=e*f-l*d;n[3]=0;n[4]=e*d-l*f;n[5]=k*d+g;n[6]=k*f+l*c;n[7]=0;n[8]=e*f+l*d;n[9]=k*f-c*l;n[10]=h*f*f+g;n[11]=0;n[12]=0;n[13]=0;n[14]=0;n[15]=1;return this},setTranslate:function(b,a,c){var d=this.data;d[0]=1;d[1]=0;d[2]=0;d[3]=0;d[4]=0;d[5]=1;d[6]=0;d[7]= -0;d[8]=0;d[9]=0;d[10]=1;d[11]=0;d[12]=b;d[13]=a;d[14]=c;d[15]=1;return this},setScale:function(b,a,c){var d=this.data;d[0]=b;d[1]=0;d[2]=0;d[3]=0;d[4]=0;d[5]=a;d[6]=0;d[7]=0;d[8]=0;d[9]=0;d[10]=c;d[11]=0;d[12]=0;d[13]=0;d[14]=0;d[15]=1;return this},invert:function(){var b,a,c,d,f,g,l,h,e,k,n,q,m,r,t,u,x,v,w,y,D,B,z,A,F,I,G,H,C,E;E=this.data;b=E[0];a=E[1];c=E[2];d=E[3];f=E[4];g=E[5];l=E[6];h=E[7];e=E[8];k=E[9];n=E[10];q=E[11];m=E[12];r=E[13];t=E[14];u=E[15];x=b*g-a*f;v=b*l-c*f;w=b*h-d*f;y=a*l-c*g; -D=a*h-d*g;B=c*h-d*l;z=e*r-k*m;A=e*t-n*m;F=e*u-q*m;I=k*t-n*r;G=k*u-q*r;H=n*u-q*t;C=x*H-v*G+w*I+y*F-D*A+B*z;0===C?this.setIdentity():(C=1/C,E[0]=(g*H-l*G+h*I)*C,E[1]=(-a*H+c*G-d*I)*C,E[2]=(r*B-t*D+u*y)*C,E[3]=(-k*B+n*D-q*y)*C,E[4]=(-f*H+l*F-h*A)*C,E[5]=(b*H-c*F+d*A)*C,E[6]=(-m*B+t*w-u*v)*C,E[7]=(e*B-n*w+q*v)*C,E[8]=(f*G-g*F+h*z)*C,E[9]=(-b*G+a*F-d*z)*C,E[10]=(m*D-r*w+u*x)*C,E[11]=(-e*D+k*w-q*x)*C,E[12]=(-f*I+g*A-l*z)*C,E[13]=(b*I-a*A+c*z)*C,E[14]=(-m*y+r*v-t*x)*C,E[15]=(e*y-k*v+n*x)*C);return this}, -set:function(b){var a=this.data;a[0]=b[0];a[1]=b[1];a[2]=b[2];a[3]=b[3];a[4]=b[4];a[5]=b[5];a[6]=b[6];a[7]=b[7];a[8]=b[8];a[9]=b[9];a[10]=b[10];a[11]=b[11];a[12]=b[12];a[13]=b[13];a[14]=b[14];a[15]=b[15];return this},setIdentity:function(){var b=this.data;b[0]=1;b[1]=0;b[2]=0;b[3]=0;b[4]=0;b[5]=1;b[6]=0;b[7]=0;b[8]=0;b[9]=0;b[10]=1;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},setTRS:function(b,a,c){var d,f,g,l,h,e,k,n,q,m,r,t,u;d=b.x;f=b.y;b=b.z;g=a.x;l=a.y;h=a.z;e=a.w;a=c.x;k=c.y;c=c.z;n= -g+g;q=l+l;m=h+h;r=g*n;t=g*q;g*=m;u=l*q;l*=m;h*=m;n*=e;q*=e;e*=m;m=this.data;m[0]=(1-(u+h))*a;m[1]=(t+e)*a;m[2]=(g-q)*a;m[3]=0;m[4]=(t-e)*k;m[5]=(1-(r+h))*k;m[6]=(l+n)*k;m[7]=0;m[8]=(g+q)*c;m[9]=(l-n)*c;m[10]=(1-(r+u))*c;m[11]=0;m[12]=d;m[13]=f;m[14]=b;m[15]=1;return this},transpose:function(){var b,a=this.data;b=a[1];a[1]=a[4];a[4]=b;b=a[2];a[2]=a[8];a[8]=b;b=a[3];a[3]=a[12];a[12]=b;b=a[6];a[6]=a[9];a[9]=b;b=a[7];a[7]=a[13];a[13]=b;b=a[11];a[11]=a[14];a[14]=b;return this},invertTo3x3:function(b){var a, -c,d,f;a=this.data;b=b.data;var g=a[0],l=a[1],h=a[2],e=a[4],k=a[5],n=a[6],q=a[8],m=a[9],r=a[10];a=r*k-n*m;c=-r*e+n*q;d=m*e-k*q;f=g*a+l*c+h*d;if(0===f)return this;f=1/f;b[0]=f*a;b[1]=f*(-r*l+h*m);b[2]=f*(n*l-h*k);b[3]=f*c;b[4]=f*(r*g-h*q);b[5]=f*(-n*g+h*e);b[6]=f*d;b[7]=f*(-m*g+l*q);b[8]=f*(k*g-l*e);return this},getTranslation:function(b){b=void 0===b?new pc.Vec3:b;return b.set(this.data[12],this.data[13],this.data[14])},getX:function(b){b=void 0===b?new pc.Vec3:b;return b.set(this.data[0],this.data[1], -this.data[2])},getY:function(b){b=void 0===b?new pc.Vec3:b;return b.set(this.data[4],this.data[5],this.data[6])},getZ:function(b){b=void 0===b?new pc.Vec3:b;return b.set(this.data[8],this.data[9],this.data[10])},getScale:function(){var b,a,c;b=new pc.Vec3;a=new pc.Vec3;c=new pc.Vec3;return function(d){d=void 0===d?new pc.Vec3:d;this.getX(b);this.getY(a);this.getZ(c);d.set(b.length(),a.length(),c.length());return d}}(),setFromEulerAngles:function(b,a,c){var d,f,g,l;b*=pc.math.DEG_TO_RAD;a*=pc.math.DEG_TO_RAD; -c*=pc.math.DEG_TO_RAD;d=Math.sin(-b);b=Math.cos(-b);f=Math.sin(-a);a=Math.cos(-a);g=Math.sin(-c);c=Math.cos(-c);l=this.data;l[0]=a*c;l[1]=-a*g;l[2]=f;l[3]=0;l[4]=b*g+c*d*f;l[5]=b*c-d*f*g;l[6]=-a*d;l[7]=0;l[8]=d*g-b*c*f;l[9]=c*d+b*f*g;l[10]=b*a;l[11]=0;l[12]=0;l[13]=0;l[14]=0;l[15]=1;return this},getEulerAngles:function(){var b=new pc.Vec3;return function(a){var c,d,f,g,l,h;a=void 0===a?new pc.Vec3:a;this.getScale(b);f=b.x;c=b.y;g=b.z;l=this.data;d=Math.asin(-l[2]/f);h=.5*Math.PI;d-h?(c=Math.atan2(l[6]/ -c,l[10]/g),f=Math.atan2(l[1]/f,l[0]/f)):(f=0,c=-Math.atan2(l[4]/c,l[5]/c)):(f=0,c=Math.atan2(l[4]/c,l[5]/c));return a.set(c,d,f).scale(pc.math.RAD_TO_DEG)}}(),toString:function(){var b,a;a="[";for(b=0;16>b;b+=1)a+=this.data[b],a+=15!==b?", ":"";return a+"]"}});Object.defineProperty(e,"IDENTITY",{get:function(){var b=new e;return function(){return b}}()});Object.defineProperty(e,"ZERO",{get:function(){var b=(new e).set([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);return function(){return b}}()});return{Mat4:e}}());Object.assign(pc,function(){var e=function(b,a,c,d){b&&4===b.length?(this.x=b[0],this.y=b[1],this.z=b[2],this.w=b[3]):(this.x=void 0===b?0:b,this.y=void 0===a?0:a,this.z=void 0===c?0:c,this.w=void 0===d?1:d)};Object.assign(e.prototype,{clone:function(){return new pc.Quat(this.x,this.y,this.z,this.w)},conjugate:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;this.w=b.w;return this},equals:function(b){return this.x===b.x&&this.y===b.y&&this.z=== -b.z&&this.w===b.w},getAxisAngle:function(b){var a=2*Math.acos(this.w),c=Math.sin(a/2);if(0!==c){if(b.x=this.x/c,b.y=this.y/c,b.z=this.z/c,0>b.x||0>b.y||0>b.z)b.x*=-1,b.y*=-1,b.z*=-1,a*=-1}else b.x=1,b.y=0,b.z=0;return a*pc.math.RAD_TO_DEG},getEulerAngles:function(b){var a,c,d,f,g,l;b=void 0===b?new pc.Vec3:b;d=this.x;f=this.y;g=this.z;l=this.w;c=2*(l*f-d*g);-.99999>=c?(a=2*Math.atan2(d,l),c=-Math.PI/2,d=0):.99999<=c?(a=2*Math.atan2(d,l),c=Math.PI/2,d=0):(a=Math.atan2(2*(l*d+f*g),1-2*(d*d+f*f)),c= -Math.asin(c),d=Math.atan2(2*(l*g+d*f),1-2*(f*f+g*g)));return b.set(a,c,d).scale(pc.math.RAD_TO_DEG)},invert:function(){return this.conjugate().normalize()},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},mul:function(b){var a,c,d,f,g,l,h;a=this.x;c=this.y;d=this.z;f=this.w;g=b.x;l=b.y;h=b.z;b=b.w;this.x=f*g+a*b+c*h-d*l;this.y=f*l+c*b+d*g-a*h;this.z=f*h+d*b+a*l-c*g;this.w= -f*b-a*g-c*l-d*h;return this},mul2:function(b,a){var c,d,f,g,l,h,e,k;c=b.x;d=b.y;f=b.z;g=b.w;l=a.x;h=a.y;e=a.z;k=a.w;this.x=g*l+c*k+d*e-f*h;this.y=g*h+d*k+f*l-c*e;this.z=g*e+f*k+c*h-d*l;this.w=g*k-c*l-d*h-f*e;return this},normalize:function(){var b=this.length();0===b?(this.x=this.y=this.z=0,this.w=1):(b=1/b,this.x*=b,this.y*=b,this.z*=b,this.w*=b);return this},set:function(b,a,c,d){this.x=b;this.y=a;this.z=c;this.w=d;return this},setFromAxisAngle:function(b,a){var c,d;a*=.5*pc.math.DEG_TO_RAD;c=Math.sin(a); -d=Math.cos(a);this.x=c*b.x;this.y=c*b.y;this.z=c*b.z;this.w=d;return this},setFromEulerAngles:function(b,a,c){var d,f,g;d=.5*pc.math.DEG_TO_RAD;b*=d;a*=d;c*=d;d=Math.sin(b);b=Math.cos(b);f=Math.sin(a);a=Math.cos(a);g=Math.sin(c);c=Math.cos(c);this.x=d*a*c-b*f*g;this.y=b*f*c+d*a*g;this.z=b*a*g-d*f*c;this.w=b*a*c+d*f*g;return this},setFromMat4:function(b){var a,c,d,f,g,l,h,e,k,n,q;b=b.data;a=b[0];c=b[1];d=b[2];f=b[4];g=b[5];l=b[6];h=b[8];e=b[9];b=b[10];k=1/Math.sqrt(a*a+c*c+d*d);n=1/Math.sqrt(f*f+g* -g+l*l);q=1/Math.sqrt(h*h+e*e+b*b);a*=k;c*=k;d*=k;f*=n;g*=n;l*=n;h*=q;e*=q;b*=q;k=a+g+b;0<=k?(a=Math.sqrt(k+1),this.w=.5*a,a=.5/a,this.x=(l-e)*a,this.y=(h-d)*a,this.z=(c-f)*a):a>g?a>b?(a=Math.sqrt(a-(g+b)+1),this.x=.5*a,a=.5/a,this.w=(l-e)*a,this.y=(c+f)*a,this.z=(d+h)*a):(a=Math.sqrt(b-(a+g)+1),this.z=.5*a,a=.5/a,this.w=(c-f)*a,this.x=(h+d)*a,this.y=(e+l)*a):g>b?(a=Math.sqrt(g-(b+a)+1),this.y=.5*a,a=.5/a,this.w=(h-d)*a,this.z=(l+e)*a,this.x=(f+c)*a):(a=Math.sqrt(b-(a+g)+1),this.z=.5*a,a=.5/a,this.w= -(c-f)*a,this.x=(h+d)*a,this.y=(e+l)*a);return this},slerp:function(b,a,c){var d,f,g,l,h,e;d=b.x;f=b.y;g=b.z;b=b.w;l=a.x;h=a.y;e=a.z;a=a.w;var k=b*a+d*l+f*h+g*e;0>k&&(a=-a,l=-l,h=-h,e=-e,k=-k);if(1<=Math.abs(k))return this.w=b,this.x=d,this.y=f,this.z=g,this;var n=Math.acos(k),q=Math.sqrt(1-k*k);if(.001>Math.abs(q))return this.w=.5*b+.5*a,this.x=.5*d+.5*l,this.y=.5*f+.5*h,this.z=.5*g+.5*e,this;k=Math.sin((1-c)*n)/q;c=Math.sin(c*n)/q;this.w=b*k+a*c;this.x=d*k+l*c;this.y=f*k+h*c;this.z=g*k+e*c;return this}, -transformVector:function(b,a){void 0===a&&(a=new pc.Vec3);var c=b.x,d=b.y,f=b.z,g=this.x,l=this.y,h=this.z,e=this.w,k=e*c+l*f-h*d,n=e*d+h*c-g*f,q=e*f+g*d-l*c,c=-g*c-l*d-h*f;a.x=k*e+c*-g+n*-h-q*-l;a.y=n*e+c*-l+q*-g-k*-h;a.z=q*e+c*-h+k*-l-n*-g;return a},toString:function(){return"["+this.x+", "+this.y+", "+this.z+", "+this.w+"]"}});Object.defineProperty(e,"IDENTITY",{get:function(){var b=new e;return function(){return b}}()});Object.defineProperty(e,"ZERO",{get:function(){var b=new e(0,0,0,0);return function(){return b}}()}); -return{Quat:e}}());Object.assign(pc,function(){var e=function(b){this.keys=[];this.type=1;this.tension=.5;if(b)for(var a=0;ab);f++);c=[b,a];this.keys.splice(f,0,c);return c},get:function(b){return this.keys[b]},sort:function(){this.keys.sort(function(b,a){return b[0]-a[0]})},value:function(b){var a,c=this.keys,d=c.length;if(!d)return 0;if(bc[d-1][0])return c[d-1][1];var f=0,g=d?c[0][1]:0,l=1,h=0;for(a=0;aa+1&&(f=c[a+1][0]-c[a][0]);d>a+2&&(n=c[a+2][0]-c[a+1][0],k=c[a+2][1]);e=g+(e-g)*f/l;k=h+(k-h)*f/n;return 2===this.type?this._interpolateCatmullRom(e,g,h, -k,b):this._interpolateCardinal(e,g,h,k,b,this.tension)}return pc.math.lerp(g,h,b)},_interpolateHermite:function(b,a,c,d,f){var g=f*f,l=f*f*f;return b*(2*l-3*g+1)+a*(-2*l+3*g)+c*(l-2*g+f)+d*(l-g)},_interpolateCardinal:function(b,a,c,d,f,g){return this._interpolateHermite(a,c,g*(c-b),g*(d-a),f)},_interpolateCatmullRom:function(b,a,c,d,f){return this._interpolateCardinal(b,a,c,d,f,.5)},closest:function(b){for(var a=this.keys,c=a.length,d=2,f=null,g=0;g=l)d=l,f= -a[g];else break}return f},clone:function(){var b=new pc.Curve;b.keys=pc.extend(b.keys,this.keys);b.type=this.type;return b},quantize:function(b){b=Math.max(b,2);for(var a=new Float32Array(b),c=1/(b-1),d=0;dc&&(c=u);vd&&(d=x);wf&&(f=r);b.x=.5*(t+c);b.y=.5*(e+d);b.z=.5*(m+f);g.x=.5*(c-t);g.y=.5*(d-e);g.z=.5*(f-m)},copy:function(a){this.center.copy(a.center);this.halfExtents.copy(a.halfExtents);this.type=a.type},clone:function(){return new pc.BoundingBox(this.center.clone(),this.halfExtents.clone())},intersects:function(a){var b=this.getMax(),c=this.getMin(),d=a.getMax();a=a.getMin();return c.x<=d.x&&b.x>=a.x&&c.y<=d.y&&b.y>=a.y&&c.z<=d.z&&b.z>=a.z},_intersectsRay:function(d, -f){var g=e.copy(this.getMin()).sub(d.origin),l=b.copy(this.getMax()).sub(d.origin),k=d.direction;0===k.x?(g.x=0>g.x?-Number.MAX_VALUE:Number.MAX_VALUE,l.x=0>l.x?-Number.MAX_VALUE:Number.MAX_VALUE):(g.x/=k.x,l.x/=k.x);0===k.y?(g.y=0>g.y?-Number.MAX_VALUE:Number.MAX_VALUE,l.y=0>l.y?-Number.MAX_VALUE:Number.MAX_VALUE):(g.y/=k.y,l.y/=k.y);0===k.z?(g.z=0>g.z?-Number.MAX_VALUE:Number.MAX_VALUE,l.z=0>l.z?-Number.MAX_VALUE:Number.MAX_VALUE):(g.z/=k.z,l.z/=k.z);k=a.set(Math.min(g.x,l.x),Math.min(g.y,l.y), -Math.min(g.z,l.z));g=c.set(Math.max(g.x,l.x),Math.max(g.y,l.y),Math.max(g.z,l.z));l=Math.max(Math.max(k.x,k.y),k.z);(g=Math.min(Math.min(g.x,g.y),g.z)>=l&&0<=l)&&f.copy(d.direction).scale(l).add(d.origin);return g},_fastIntersectsRay:function(f){var g=f.direction;e.sub2(f.origin,this.center);c.set(Math.abs(e.x),Math.abs(e.y),Math.abs(e.z));a.mul2(e,g);if(c.x>this.halfExtents.x&&0<=a.x||c.y>this.halfExtents.y&&0<=a.y||c.z>this.halfExtents.z&&0<=a.z)return!1;d.set(Math.abs(g.x),Math.abs(g.y),Math.abs(g.z)); -b.cross(g,e);b.set(Math.abs(b.x),Math.abs(b.y),Math.abs(b.z));return b.x>this.halfExtents.y*d.z+this.halfExtents.z*d.y||b.y>this.halfExtents.x*d.z+this.halfExtents.z*d.x||b.z>this.halfExtents.x*d.y+this.halfExtents.y*d.x?!1:!0},intersectsRay:function(a,b){return b?this._intersectsRay(a,b):this._fastIntersectsRay(a)},setMinMax:function(a,b){this.center.add2(b,a).scale(.5);this.halfExtents.sub2(b,a).scale(.5)},getMin:function(){return this._min.copy(this.center).sub(this.halfExtents)},getMax:function(){return this._max.copy(this.center).add(this.halfExtents)}, -containsPoint:function(a){var b=this.getMin(),c=this.getMax();return a.xc.x||a.yc.y||a.zc.z?!1:!0},setFromTransformedAabb:function(a,b){var c=this.center,d=this.halfExtents,f=a.center,g=a.halfExtents;b=b.data;var l=b[0],e=b[4],r=b[8],t=b[1],u=b[5],x=b[9],v=b[2],w=b[6],y=b[10],D=Math.abs(l),B=Math.abs(e),z=Math.abs(r),A=Math.abs(t),F=Math.abs(u),I=Math.abs(x),G=Math.abs(v),H=Math.abs(w),C=Math.abs(y);c.set(b[12]+l*f.x+e*f.y+r*f.z,b[13]+t*f.x+u*f.y+x*f.z,b[14]+v*f.x+w* -f.y+y*f.z);d.set(D*g.x+B*g.y+z*g.z,A*g.x+F*g.y+I*g.z,G*g.x+H*g.y+C*g.z)},compute:function(a){for(var c=e.set(a[0],a[1],a[2]),d=b.set(a[0],a[1],a[2]),f=a.length/3,g=1;gd.x&&(d.x=n);q>d.y&&(d.y=q);m>d.z&&(d.z=m)}this.setMinMax(c,d)},intersectsBoundingSphere:function(a){return this._distanceToBoundingSphereSq(a)<=a.radius*a.radius?!0:!1},_distanceToBoundingSphereSq:function(a){for(var b=this.getMin(),c=this.getMax(), -d=0,f=["x","y","z"],g=0;3>g;++g){var e=0,m=a.center[f[g]],r=b[f[g]],t=c[f[g]];mt&&(r=m-t,e+=r*r);d+=e}return d}});return{BoundingBox:f}}());Object.assign(pc,function(){function e(a,b){this.center=a||new pc.Vec3(0,0,0);this.radius=void 0===b?.5:b}var b=new pc.Vec3,a=new pc.Vec3,c=new pc.Vec3,d=new pc.Vec3;Object.assign(e.prototype,{containsPoint:function(a){a=b.sub2(a,this.center).lengthSq();var c=this.radius;return af)return!1;g=Math.abs(-g-Math.sqrt(f));d&&d.copy(c.direction).scale(g).add(c.origin);return!0},intersectsBoundingSphere:function(a){b.sub2(a.center,this.center);a=a.radius+this.radius;return b.lengthSq()<=a*a?!0:!1}});return{BoundingSphere:e}}());Object.assign(pc,function(){var e=new pc.Mat4,b=function(a,b){a=a||(new pc.Mat4).setPerspective(90,16/9,.1,1E3);b=b||new pc.Mat4;this.planes=[];for(var c=0;6>c;c++)this.planes[c]=[];this.update(a,b)};Object.assign(b.prototype,{update:function(a,b){e.mul2(a,b);var c=e.data;this.planes[0][0]=c[3]-c[0];this.planes[0][1]=c[7]-c[4];this.planes[0][2]=c[11]-c[8];this.planes[0][3]=c[15]-c[12];var f=Math.sqrt(this.planes[0][0]*this.planes[0][0]+this.planes[0][1]*this.planes[0][1]+this.planes[0][2]*this.planes[0][2]); -this.planes[0][0]/=f;this.planes[0][1]/=f;this.planes[0][2]/=f;this.planes[0][3]/=f;this.planes[1][0]=c[3]+c[0];this.planes[1][1]=c[7]+c[4];this.planes[1][2]=c[11]+c[8];this.planes[1][3]=c[15]+c[12];f=Math.sqrt(this.planes[1][0]*this.planes[1][0]+this.planes[1][1]*this.planes[1][1]+this.planes[1][2]*this.planes[1][2]);this.planes[1][0]/=f;this.planes[1][1]/=f;this.planes[1][2]/=f;this.planes[1][3]/=f;this.planes[2][0]=c[3]+c[1];this.planes[2][1]=c[7]+c[5];this.planes[2][2]=c[11]+c[9];this.planes[2][3]= -c[15]+c[13];f=Math.sqrt(this.planes[2][0]*this.planes[2][0]+this.planes[2][1]*this.planes[2][1]+this.planes[2][2]*this.planes[2][2]);this.planes[2][0]/=f;this.planes[2][1]/=f;this.planes[2][2]/=f;this.planes[2][3]/=f;this.planes[3][0]=c[3]-c[1];this.planes[3][1]=c[7]-c[5];this.planes[3][2]=c[11]-c[9];this.planes[3][3]=c[15]-c[13];f=Math.sqrt(this.planes[3][0]*this.planes[3][0]+this.planes[3][1]*this.planes[3][1]+this.planes[3][2]*this.planes[3][2]);this.planes[3][0]/=f;this.planes[3][1]/=f;this.planes[3][2]/= -f;this.planes[3][3]/=f;this.planes[4][0]=c[3]-c[2];this.planes[4][1]=c[7]-c[6];this.planes[4][2]=c[11]-c[10];this.planes[4][3]=c[15]-c[14];f=Math.sqrt(this.planes[4][0]*this.planes[4][0]+this.planes[4][1]*this.planes[4][1]+this.planes[4][2]*this.planes[4][2]);this.planes[4][0]/=f;this.planes[4][1]/=f;this.planes[4][2]/=f;this.planes[4][3]/=f;this.planes[5][0]=c[3]+c[2];this.planes[5][1]=c[7]+c[6];this.planes[5][2]=c[11]+c[10];this.planes[5][3]=c[15]+c[14];f=Math.sqrt(this.planes[5][0]*this.planes[5][0]+ -this.planes[5][1]*this.planes[5][1]+this.planes[5][2]*this.planes[5][2]);this.planes[5][0]/=f;this.planes[5][1]/=f;this.planes[5][2]/=f;this.planes[5][3]/=f},containsPoint:function(a){for(var b=0;6>b;b++)if(0>=this.planes[b][0]*a.x+this.planes[b][1]*a.y+this.planes[b][2]*a.z+this.planes[b][3])return!1;return!0},containsSphere:function(a){var b=0,d,f,g=a.radius;f=a.center;a=f.x;var l=f.y,h=f.z,e=this.planes;for(f=0;6>f;f++){d=e[f];d=d[0]*a+d[1]*l+d[2]*h+d[3];if(d<=-g)return 0;d>g&&b++}return 6===b? -2:1}});return{Frustum:b}}());Object.assign(pc,function(){var e=new pc.Vec3,b=function(a,b){this.normal=b||new pc.Vec3(0,0,1);this.point=a||new pc.Vec3(0,0,0)};Object.assign(b.prototype,{intersectsLine:function(a,b,d){var c=-this.normal.dot(this.point),g=this.normal.dot(a)+c,c=this.normal.dot(b)+c,g=g/(g-c);(c=0<=g&&1>=g)&&d&&d.lerp(a,b,g);return c},intersectsRay:function(a,b){var c=e.sub2(this.point,a.origin),c=this.normal.dot(c)/this.normal.dot(a.direction),f=0<=c;f&&b&&b.copy(a.direction).scale(c).add(a.origin);return f}}); -return{Plane:b}}());Object.assign(pc,function(){return{Ray:function(e,b){this.origin=e||new pc.Vec3(0,0,0);this.direction=b||new pc.Vec3(0,0,-1)}}}());Object.assign(pc,function(){var e=new pc.Ray,b=new pc.Vec3,a=new pc.BoundingSphere,c=new pc.Mat4,d=function(a,b){this.halfExtents=b||new pc.Vec3(.5,.5,.5);a=a||c.setIdentity();this._modelTransform=a.clone().invert();this._worldTransform=a.clone();this._aabb=new pc.BoundingBox(new pc.Vec3,this.halfExtents)};Object.assign(d.prototype,{intersectsRay:function(a,b){this._modelTransform.transformPoint(a.origin,e.origin);this._modelTransform.transformVector(a.direction,e.direction);if(b){var d=this._aabb._intersectsRay(e, -b);c.copy(this._modelTransform).invert().transformPoint(b,b);return d}return this._aabb._fastIntersectsRay(e)},containsPoint:function(a){this._modelTransform.transformPoint(a,b);return this._aabb.containsPoint(b)},intersectsBoundingSphere:function(b){this._modelTransform.transformPoint(b.center,a.center);a.radius=b.radius;return this._aabb.intersectsBoundingSphere(a)?!0:!1}});Object.defineProperty(d.prototype,"worldTransform",{get:function(){return this._worldTransform},set:function(a){this._worldTransform.copy(a); -this._modelTransform.copy(a).invert()}});return{OrientedBox:d}}());(function(){var e={ADDRESS_REPEAT:0,ADDRESS_CLAMP_TO_EDGE:1,ADDRESS_MIRRORED_REPEAT:2,BLENDMODE_ZERO:0,BLENDMODE_ONE:1,BLENDMODE_SRC_COLOR:2,BLENDMODE_ONE_MINUS_SRC_COLOR:3,BLENDMODE_DST_COLOR:4,BLENDMODE_ONE_MINUS_DST_COLOR:5,BLENDMODE_SRC_ALPHA:6,BLENDMODE_SRC_ALPHA_SATURATE:7,BLENDMODE_ONE_MINUS_SRC_ALPHA:8,BLENDMODE_DST_ALPHA:9,BLENDMODE_ONE_MINUS_DST_ALPHA:10,BLENDEQUATION_ADD:0,BLENDEQUATION_SUBTRACT:1,BLENDEQUATION_REVERSE_SUBTRACT:2,BLENDEQUATION_MIN:3,BLENDEQUATION_MAX:4,BUFFER_STATIC:0, -BUFFER_DYNAMIC:1,BUFFER_STREAM:2,BUFFER_GPUDYNAMIC:3,CLEARFLAG_COLOR:1,CLEARFLAG_DEPTH:2,CLEARFLAG_STENCIL:4,CUBEFACE_POSX:0,CUBEFACE_NEGX:1,CUBEFACE_POSY:2,CUBEFACE_NEGY:3,CUBEFACE_POSZ:4,CUBEFACE_NEGZ:5,CULLFACE_NONE:0,CULLFACE_BACK:1,CULLFACE_FRONT:2,CULLFACE_FRONTANDBACK:3,TYPE_INT8:0,TYPE_UINT8:1,TYPE_INT16:2,TYPE_UINT16:3,TYPE_INT32:4,TYPE_UINT32:5,TYPE_FLOAT32:6,FILTER_NEAREST:0,FILTER_LINEAR:1,FILTER_NEAREST_MIPMAP_NEAREST:2,FILTER_NEAREST_MIPMAP_LINEAR:3,FILTER_LINEAR_MIPMAP_NEAREST:4,FILTER_LINEAR_MIPMAP_LINEAR:5, -FUNC_NEVER:0,FUNC_LESS:1,FUNC_EQUAL:2,FUNC_LESSEQUAL:3,FUNC_GREATER:4,FUNC_NOTEQUAL:5,FUNC_GREATEREQUAL:6,FUNC_ALWAYS:7,INDEXFORMAT_UINT8:0,INDEXFORMAT_UINT16:1,INDEXFORMAT_UINT32:2,PIXELFORMAT_A8:0,PIXELFORMAT_L8:1,PIXELFORMAT_L8_A8:2,PIXELFORMAT_R5_G6_B5:3,PIXELFORMAT_R5_G5_B5_A1:4,PIXELFORMAT_R4_G4_B4_A4:5,PIXELFORMAT_R8_G8_B8:6,PIXELFORMAT_R8_G8_B8_A8:7,PIXELFORMAT_DXT1:8,PIXELFORMAT_DXT3:9,PIXELFORMAT_DXT5:10,PIXELFORMAT_RGB16F:11,PIXELFORMAT_RGBA16F:12,PIXELFORMAT_RGB32F:13,PIXELFORMAT_RGBA32F:14, -PIXELFORMAT_R32F:15,PIXELFORMAT_DEPTH:16,PIXELFORMAT_DEPTHSTENCIL:17,PIXELFORMAT_111110F:18,PIXELFORMAT_SRGB:19,PIXELFORMAT_SRGBA:20,PIXELFORMAT_ETC1:21,PIXELFORMAT_ETC2_RGB:22,PIXELFORMAT_ETC2_RGBA:23,PIXELFORMAT_PVRTC_2BPP_RGB_1:24,PIXELFORMAT_PVRTC_2BPP_RGBA_1:25,PIXELFORMAT_PVRTC_4BPP_RGB_1:26,PIXELFORMAT_PVRTC_4BPP_RGBA_1:27,PRIMITIVE_POINTS:0,PRIMITIVE_LINES:1,PRIMITIVE_LINELOOP:2,PRIMITIVE_LINESTRIP:3,PRIMITIVE_TRIANGLES:4,PRIMITIVE_TRISTRIP:5,PRIMITIVE_TRIFAN:6,SEMANTIC_POSITION:"POSITION", -SEMANTIC_NORMAL:"NORMAL",SEMANTIC_TANGENT:"TANGENT",SEMANTIC_BLENDWEIGHT:"BLENDWEIGHT",SEMANTIC_BLENDINDICES:"BLENDINDICES",SEMANTIC_COLOR:"COLOR",SEMANTIC_TEXCOORD0:"TEXCOORD0",SEMANTIC_TEXCOORD1:"TEXCOORD1",SEMANTIC_TEXCOORD2:"TEXCOORD2",SEMANTIC_TEXCOORD3:"TEXCOORD3",SEMANTIC_TEXCOORD4:"TEXCOORD4",SEMANTIC_TEXCOORD5:"TEXCOORD5",SEMANTIC_TEXCOORD6:"TEXCOORD6",SEMANTIC_TEXCOORD7:"TEXCOORD7",SEMANTIC_ATTR0:"ATTR0",SEMANTIC_ATTR1:"ATTR1",SEMANTIC_ATTR2:"ATTR2",SEMANTIC_ATTR3:"ATTR3",SEMANTIC_ATTR4:"ATTR4", -SEMANTIC_ATTR5:"ATTR5",SEMANTIC_ATTR6:"ATTR6",SEMANTIC_ATTR7:"ATTR7",SEMANTIC_ATTR8:"ATTR8",SEMANTIC_ATTR9:"ATTR9",SEMANTIC_ATTR10:"ATTR10",SEMANTIC_ATTR11:"ATTR11",SEMANTIC_ATTR12:"ATTR12",SEMANTIC_ATTR13:"ATTR13",SEMANTIC_ATTR14:"ATTR14",SEMANTIC_ATTR15:"ATTR15",SHADERTAG_MATERIAL:1,STENCILOP_KEEP:0,STENCILOP_ZERO:1,STENCILOP_REPLACE:2,STENCILOP_INCREMENT:3,STENCILOP_INCREMENTWRAP:4,STENCILOP_DECREMENT:5,STENCILOP_DECREMENTWRAP:6,STENCILOP_INVERT:7,TEXTURELOCK_READ:1,TEXTURELOCK_WRITE:2,TEXHINT_NONE:0, -TEXHINT_SHADOWMAP:1,TEXHINT_ASSET:2,TEXHINT_LIGHTMAP:3,UNIFORMTYPE_BOOL:0,UNIFORMTYPE_INT:1,UNIFORMTYPE_FLOAT:2,UNIFORMTYPE_VEC2:3,UNIFORMTYPE_VEC3:4,UNIFORMTYPE_VEC4:5,UNIFORMTYPE_IVEC2:6,UNIFORMTYPE_IVEC3:7,UNIFORMTYPE_IVEC4:8,UNIFORMTYPE_BVEC2:9,UNIFORMTYPE_BVEC3:10,UNIFORMTYPE_BVEC4:11,UNIFORMTYPE_MAT2:12,UNIFORMTYPE_MAT3:13,UNIFORMTYPE_MAT4:14,UNIFORMTYPE_TEXTURE2D:15,UNIFORMTYPE_TEXTURECUBE:16,UNIFORMTYPE_FLOATARRAY:17,UNIFORMTYPE_TEXTURE2D_SHADOW:18,UNIFORMTYPE_TEXTURECUBE_SHADOW:19,UNIFORMTYPE_TEXTURE3D:20}; -Object.assign(pc,e);pc.gfx={};Object.assign(pc.gfx,e)})();Object.assign(pc,function(){var e=function(b){this.name=b;this.value=null;this.versionObject=new pc.VersionedObject};Object.assign(e.prototype,{setValue:function(b){this.value=b;this.versionObject.increment()},getValue:function(b){return this.value}});return{ScopeId:e}}());Object.assign(pc,function(){var e=function(b){this.name=b;this.variables={};this.namespaces={}};Object.assign(e.prototype,{resolve:function(b){this.variables.hasOwnProperty(b)||(this.variables[b]=new pc.ScopeId(b));return this.variables[b]},getSubSpace:function(b){this.namespaces.hasOwnProperty(b)||(this.namespaces[b]=new pc.ScopeSpace(b));return this.namespaces[b]}});return{ScopeSpace:e}}());Object.assign(pc,function(){var e=function(){this.revision=this.globalId=0};Object.assign(e.prototype,{equals:function(b){return this.globalId===b.globalId&&this.revision===b.revision},notequals:function(b){return this.globalId!==b.globalId||this.revision!==b.revision},copy:function(b){this.globalId=b.globalId;this.revision=b.revision},reset:function(){this.revision=this.globalId=0}});return{Version:e}}());Object.assign(pc,function(){var e=0,b=function(){e++;this.version=new pc.Version;this.version.globalId=e};Object.assign(b.prototype,{increment:function(){this.version.revision++}});return{VersionedObject:b}}());Object.assign(pc,function(){function e(f,l){this.index=0;switch(l.dataType){case pc.TYPE_INT8:this.array=new Int8Array(f,l.offset);break;case pc.TYPE_UINT8:this.array=new Uint8Array(f,l.offset);break;case pc.TYPE_INT16:this.array=new Int16Array(f,l.offset);break;case pc.TYPE_UINT16:this.array=new Uint16Array(f,l.offset);break;case pc.TYPE_INT32:this.array=new Int32Array(f,l.offset);break;case pc.TYPE_UINT32:this.array=new Uint32Array(f,l.offset);break;case pc.TYPE_FLOAT32:this.array=new Float32Array(f, -l.offset)}switch(l.numComponents){case 1:this.set=b;break;case 2:this.set=a;break;case 3:this.set=c;break;case 4:this.set=d}}function b(a){this.array[this.index]=a}function a(a,b){this.array[this.index]=a;this.array[this.index+1]=b}function c(a,b,c){this.array[this.index]=a;this.array[this.index+1]=b;this.array[this.index+2]=c}function d(a,b,c,d){this.array[this.index]=a;this.array[this.index+1]=b;this.array[this.index+2]=c;this.array[this.index+3]=d}function f(a){this.vertexBuffer=a;this.buffer= -this.vertexBuffer.lock();this.accessors=[];this.element={};a=this.vertexBuffer.getFormat();for(var b=0;b=pc.PIXELFORMAT_ETC1;this._invalid=!1;this._lockedLevel= --1;this._levels||(this._levels=this._cubemap?[[null,null,null,null,null,null]]:[null]);this.dirtyAll();this._gpuSize=0};Object.defineProperty(e.prototype,"minFilter",{get:function(){return this._minFilter},set:function(a){this._minFilter!==a&&(this._minFilter=a,this._parameterFlags|=1)}});Object.defineProperty(e.prototype,"magFilter",{get:function(){return this._magFilter},set:function(a){this._magFilter!==a&&(this._magFilter=a,this._parameterFlags|=2)}});Object.defineProperty(e.prototype,"addressU", -{get:function(){return this._addressU},set:function(a){this._addressU!==a&&(this._addressU=a,this._parameterFlags|=4)}});Object.defineProperty(e.prototype,"addressV",{get:function(){return this._addressV},set:function(a){this._addressV!==a&&(this._addressV=a,this._parameterFlags|=8)}});Object.defineProperty(e.prototype,"addressW",{get:function(){return this._addressW},set:function(a){this.device.webgl2&&this._volume&&a!==this._addressW&&(this._addressW=a,this._parameterFlags|=16)}});Object.defineProperty(e.prototype, -"compareOnRead",{get:function(){return this._compareOnRead},set:function(a){this._compareOnRead!==a&&(this._compareOnRead=a,this._parameterFlags|=32)}});Object.defineProperty(e.prototype,"compareFunc",{get:function(){return this._compareFunc},set:function(a){this._compareFunc!==a&&(this._compareFunc=a,this._parameterFlags|=64)}});Object.defineProperty(e.prototype,"anisotropy",{get:function(){return this._anisotropy},set:function(a){this._anisotropy!==a&&(this._anisotropy=a,this._parameterFlags|=128)}}); -Object.defineProperty(e.prototype,"autoMipmap",{get:function(){return this._mipmaps},set:function(a){this._mipmaps=a}});Object.defineProperty(e.prototype,"mipmaps",{get:function(){return this._mipmaps},set:function(a){this._mipmaps!==a&&(this._mipmaps=a,this._minFilterDirty=!0,a&&(this._needsMipmapsUpload=!0))}});Object.defineProperty(e.prototype,"width",{get:function(){return this._width}});Object.defineProperty(e.prototype,"height",{get:function(){return this._height}});Object.defineProperty(e.prototype, -"depth",{get:function(){return this._depth}});Object.defineProperty(e.prototype,"format",{get:function(){return this._format}});Object.defineProperty(e.prototype,"cubemap",{get:function(){return this._cubemap}});var b=null;Object.defineProperty(e.prototype,"gpuSize",{get:function(){b||(b=[],b[pc.PIXELFORMAT_A8]=1,b[pc.PIXELFORMAT_L8]=1,b[pc.PIXELFORMAT_L8_A8]=1,b[pc.PIXELFORMAT_R5_G6_B5]=2,b[pc.PIXELFORMAT_R5_G5_B5_A1]=2,b[pc.PIXELFORMAT_R4_G4_B4_A4]=2,b[pc.PIXELFORMAT_R8_G8_B8]=4,b[pc.PIXELFORMAT_R8_G8_B8_A8]= -4,b[pc.PIXELFORMAT_RGB16F]=8,b[pc.PIXELFORMAT_RGBA16F]=8,b[pc.PIXELFORMAT_RGB32F]=16,b[pc.PIXELFORMAT_RGBA32F]=16,b[pc.PIXELFORMAT_R32F]=4,b[pc.PIXELFORMAT_DEPTH]=4,b[pc.PIXELFORMAT_DEPTHSTENCIL]=4,b[pc.PIXELFORMAT_111110F]=4,b[pc.PIXELFORMAT_SRGB]=4,b[pc.PIXELFORMAT_SRGBA]=4);var a=1;!this._pot||!this._mipmaps&&this._minFilter!==pc.FILTER_NEAREST_MIPMAP_NEAREST&&this._minFilter!==pc.FILTER_NEAREST_MIPMAP_LINEAR&&this._minFilter!==pc.FILTER_LINEAR_MIPMAP_NEAREST&&this._minFilter!==pc.FILTER_LINEAR_MIPMAP_LINEAR|| -this._compressed&&1===this._levels.length||(a=Math.round(Math.log2(Math.max(this._width,this._height))+1));for(var c=this._width,d=this._height,f=this._depth,g=0,l=0;lb;b++){if(!a[b]||a[b].width!==f||a[b].height!==g||!(a[b]instanceof HTMLImageElement||a[b]instanceof HTMLCanvasElement||a[b]instanceof HTMLVideoElement)){d=!0;break}}else d=!0;if(!d)for(b=0;6>b;b++)this._levels[0][b]!==a[b]&&(this._levelsUpdated[0][b]=!0)}else a instanceof HTMLImageElement||a instanceof HTMLCanvasElement||a instanceof HTMLVideoElement|| -(d=!0),d||(a!==this._levels[0]&&(this._levelsUpdated[0]=!0),f=a.width,g=a.height);if(d)if(this._height=this._width=4,this._pot=!0,this._cubemap)for(b=0;6>b;b++)this._levels[0][b]=null,this._levelsUpdated[0][b]=!0;else this._levels[0]=null,this._levelsUpdated[0]=!0;else this._width=f,this._height=g,this._pot=pc.math.powerOfTwo(this._width)&&pc.math.powerOfTwo(this._height),this._levels[0]=a;this._invalid===d&&d||(this._invalid=d,this.upload())},getSource:function(){return this._levels[0]},unlock:function(){this.upload(); -this._lockedLevel=-1},upload:function(){this._needsUpload=!0;this._needsMipmapsUpload=this._mipmaps},getDds:function(){this.format!==pc.PIXELFORMAT_R8_G8_B8_A8&&console.error("This format is not implemented yet");for(var a=128,b=0,d,f;this._levels[b];){if(this.cubemap)for(f=0;6>f;f++){if(!this._levels[b][f]){console.error("No level data for mip "+b+", face "+f);return}d=this._levels[b][f].length;if(!d){console.error("No byte array for mip "+b+", face "+f);return}a+=d}else{d=this._levels[b].length; -if(!d){console.error("No byte array for mip "+b);return}a+=d}a+=this._levels[b].length;b++}a=new ArrayBuffer(a);f=new Uint32Array(a,0,32);b=528391;1b;b++)f[8+b]=0;f[19]=32;f[20]=65;f[21]=0;f[22]=32;f[23]=16711680;f[24]= -65280;f[25]=255;f[26]=4278190080;f[27]=d;f[28]=g;f[29]=0;f[30]=0;f[31]=0;var g=128,l,h;if(this.cubemap)for(f=0;6>f;f++)for(b=0;bpc.SHADER_FORWARDHDR&&b<=pc.SHADER_PICK?this._defaultStdMatOptionMin:this._defaultStdMatOption};e.prototype.precompile=function(b){if(b)for(var a=Array(b.length),c=0;cb||d>b){var l=b/Math.max(c,d),h=Math.floor(c*l),l=Math.floor(d*l);console.warn("Image dimensions larger than max supported texture size of "+b+". Resizing from "+c+", "+d+" to "+h+", "+l+".");var e=document.createElement("canvas"); -e.width=h;e.height=l;e.getContext("2d").drawImage(a,0,0,c,d,0,0,h,l);return e}return a},a=function(a,b){var c;this.canvas=a;this.indexBuffer=this.shader=null;this.vertexBuffers=[];this.vbOffsets=[];this._enableAutoInstancing=!1;this.autoInstancingMaxObjects=16384;this.attributesInvalidated=!0;this.boundElementBuffer=this.boundBuffer=null;this.instancedAttribs={};this.enabledAttributes={};this.activeFramebuffer=this.transformFeedbackBuffer=null;this.textureUnit=0;this.textureUnits=[];this._maxPixelRatio= -1;this.feedback=this.renderTarget=null;this._height=this._width=0;this.updateClientRect();this.vertexShaderCache={};this.fragmentShaderCache={};this.shaders=[];this.buffers=[];this.textures=[];this.targets=[];this.contextLost=!1;this._contextLostHandler=function(a){a.preventDefault();this.contextLost=!0;this.fire("devicelost")}.bind(this);this._contextRestoredHandler=function(){this.initializeContext();this.contextLost=!1;this.fire("devicerestored")}.bind(this);a.addEventListener("webglcontextlost", -this._contextLostHandler,!1);a.addEventListener("webglcontextrestored",this._contextRestoredHandler,!1);var d=b&&void 0!==b.preferWebGl2?b.preferWebGl2:!0,l=d?["webgl2","experimental-webgl2","webgl","experimental-webgl"]:["webgl","experimental-webgl"],h=null;b=b||{};b.stencil=!0;for(c=0;cc;break}}if(!h)throw Error("WebGL not supported");this.gl=h;this.initializeExtensions();this.initializeCapabilities();this.initializeRenderState(); -for(c=0;cthis.maxTextures;this.boneLimit=Math.floor((this.vertexUniformsCount- -16-8-1-16)/4);this.boneLimit=Math.min(this.boneLimit,128);"Mali-450 MP"===this.unmaskedRenderer&&(this.boneLimit=34);"Apple A8 GPU"===this.unmaskedRenderer&&(this.forceCpuParticles=!0);this._shaderSwitchesPerFrame=this._drawCallsPerFrame=0;this._primsPerFrame=[];for(c=pc.PRIMITIVE_POINTS;c<=pc.PRIMITIVE_TRIFAN;c++)this._primsPerFrame[c]=0;this._renderTargetCreationTime=0;this._vram={tex:0,vb:0,ib:0};this._shaderStats={vsCompiled:0,fsCompiled:0,linked:0,materialShaders:0,compileTime:0};this.constantTexSource= -this.scope.resolve("source");this.textureFloatRenderable=this.extTextureFloat?this.webgl2?!!this.extColorBufferFloat:e(h,h.FLOAT):!1;this.textureHalfFloatRenderable=this.extTextureHalfFloat?this.webgl2?!!this.extColorBufferFloat:e(h,this.extTextureHalfFloat.HALF_FLOAT_OES):!1;this._textureFloatHighPrecision=void 0;this.initializeGrabPassTexture()};Object.assign(a.prototype,{getPrecision:function(){var a=this.gl,b="highp";if(a.getShaderPrecisionFormat){var f=a.getShaderPrecisionFormat(a.VERTEX_SHADER, -a.HIGH_FLOAT),g=a.getShaderPrecisionFormat(a.VERTEX_SHADER,a.MEDIUM_FLOAT),l=a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.HIGH_FLOAT),a=a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.MEDIUM_FLOAT),g=0h;h++)a._levelsUpdated[0][h]&&(l=g[h],l instanceof -HTMLImageElement&&(l.width>this.maxCubeMapSize||l.height>this.maxCubeMapSize)&&(l=b(l,this.maxCubeMapSize),0===f&&(a.width=l.width,a.height=l.height)),this.setUnpackFlipY(!1),this.setUnpackPremultiplyAlpha(a._premultiplyAlpha),c.texImage2D(c.TEXTURE_CUBE_MAP_POSITIVE_X+h,f,a._glInternalFormat,a._glFormat,a._glPixelType,l));else for(l=1/Math.pow(2,f),h=0;6>h;h++)if(a._levelsUpdated[0][h]){var e=g[h];a._compressed?c.compressedTexImage2D(c.TEXTURE_CUBE_MAP_POSITIVE_X+h,f,a._glInternalFormat,Math.max(a._width* -l,1),Math.max(a._height*l,1),0,e):(this.setUnpackFlipY(!1),this.setUnpackPremultiplyAlpha(a._premultiplyAlpha),c.texImage2D(c.TEXTURE_CUBE_MAP_POSITIVE_X+h,f,a._glInternalFormat,Math.max(a._width*l,1),Math.max(a._height*l,1),0,a._glFormat,a._glPixelType,e))}}else a._volume?(l=1/Math.pow(2,f),a._compressed?c.compressedTexImage3D(c.TEXTURE_3D,f,a._glInternalFormat,Math.max(a._width*l,1),Math.max(a._height*l,1),Math.max(a._depth*l,1),0,g):(this.setUnpackFlipY(!1),this.setUnpackPremultiplyAlpha(a._premultiplyAlpha), -c.texImage3D(c.TEXTURE_3D,f,a._glInternalFormat,Math.max(a._width*l,1),Math.max(a._height*l,1),Math.max(a._depth*l,1),0,a._glFormat,a._glPixelType,g))):(g instanceof HTMLCanvasElement||g instanceof HTMLImageElement||g instanceof HTMLVideoElement?(g instanceof HTMLImageElement&&(g.width>this.maxTextureSize||g.height>this.maxTextureSize)&&(g=b(g,this.maxTextureSize),0===f&&(a.width=g.width,a.height=g.height)),this.setUnpackFlipY(a._flipY),this.setUnpackPremultiplyAlpha(a._premultiplyAlpha),c.texImage2D(c.TEXTURE_2D, -f,a._glInternalFormat,a._glFormat,a._glPixelType,g)):(l=1/Math.pow(2,f),a._compressed?c.compressedTexImage2D(c.TEXTURE_2D,f,a._glInternalFormat,Math.max(a._width*l,1),Math.max(a._height*l,1),0,g):(this.setUnpackFlipY(!1),this.setUnpackPremultiplyAlpha(a._premultiplyAlpha),c.texImage2D(c.TEXTURE_2D,f,a._glInternalFormat,Math.max(a._width*l,1),Math.max(a._height*l,1),0,a._glFormat,a._glPixelType,g))),a._mipmapsUploaded=0===f?!1:!0)}f++}if(a._needsUpload)if(a._cubemap)for(f=0;6>f;f++)a._levelsUpdated[0][f]= -!1;else a._levelsUpdated[0]=!1;!a._compressed&&a._mipmaps&&a._needsMipmapsUpload&&a._pot&&1===a._levels.length&&(c.generateMipmap(a._glTarget),a._mipmapsUploaded=!0);a._gpuSize&&(this._vram.tex-=a._gpuSize);a._gpuSize=a.gpuSize;this._vram.tex+=a._gpuSize}},activeTexture:function(a){this.textureUnit!==a&&(this.gl.activeTexture(this.gl.TEXTURE0+a),this.textureUnit=a)},bindTexture:function(a){var b=a._glTarget;a=a._glTexture;var c=this.textureUnit,g=this.targetToSlot[b];this.textureUnits[c][g]!==a&& -(this.gl.bindTexture(b,a),this.textureUnits[c][g]=a)},bindTextureOnUnit:function(a,b){var c=a._glTarget,d=a._glTexture,l=this.targetToSlot[c];this.textureUnits[b][l]!==d&&(this.activeTexture(b),this.gl.bindTexture(c,d),this.textureUnits[b][l]=d)},setTextureParameters:function(a){var b=this.gl,c=a._parameterFlags,g=a._glTarget;if(c&1){var l=a._minFilter;if(!a._pot||!a._mipmaps||a._compressed&&1===a._levels.length)if(l===pc.FILTER_NEAREST_MIPMAP_NEAREST||l===pc.FILTER_NEAREST_MIPMAP_LINEAR)l=pc.FILTER_NEAREST; -else if(l===pc.FILTER_LINEAR_MIPMAP_NEAREST||l===pc.FILTER_LINEAR_MIPMAP_LINEAR)l=pc.FILTER_LINEAR;b.texParameteri(g,b.TEXTURE_MIN_FILTER,this.glFilter[l])}c&2&&b.texParameteri(g,b.TEXTURE_MAG_FILTER,this.glFilter[a._magFilter]);c&4&&(this.webgl2?b.texParameteri(g,b.TEXTURE_WRAP_S,this.glAddress[a._addressU]):b.texParameteri(g,b.TEXTURE_WRAP_S,this.glAddress[a._pot?a._addressU:pc.ADDRESS_CLAMP_TO_EDGE]));c&8&&(this.webgl2?b.texParameteri(g,b.TEXTURE_WRAP_T,this.glAddress[a._addressV]):b.texParameteri(g, -b.TEXTURE_WRAP_T,this.glAddress[a._pot?a._addressV:pc.ADDRESS_CLAMP_TO_EDGE]));c&16&&this.webgl2&&b.texParameteri(g,b.TEXTURE_WRAP_R,this.glAddress[a._addressW]);c&32&&this.webgl2&&b.texParameteri(g,b.TEXTURE_COMPARE_MODE,a._compareOnRead?b.COMPARE_REF_TO_TEXTURE:b.NONE);c&64&&this.webgl2&&b.texParameteri(g,b.TEXTURE_COMPARE_FUNC,this.glComparison[a._compareFunc]);c&128&&(c=this.extTextureFilterAnisotropic)&&b.texParameterf(g,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.max(1,Math.min(Math.round(a._anisotropy), -this.maxAnisotropy)))},setTexture:function(a,b){a._glTexture||this.initializeTexture(a);if(0y;y++)v=new pc.RenderTarget(b,D,{face:y,depth:!1}),m.x=y,m.y=0,n.setValue(d),q.setValue(m.data),pc.drawQuadWithShader(b,v,k),e(b,v,y);d=D}if(128y;y++)v=new pc.RenderTarget(b,D,{face:y,depth:!1}),m.x=y,m.y=z,m.z=r,m.w=p?3:0,n.setValue(d),q.setValue(m.data),pc.drawQuadWithShader(b,v,k),w===B-1&&l&&e(b,v,y);d=D}}a.sourceCubemap=d;D=null;if(!p&&a.filteredFixedRgbm)for(D=new pc.Texture(b,{cubemap:!0,rgbm:!0,format:pc.PIXELFORMAT_R8_G8_B8_A8, -width:r,height:r,mipmaps:!1}),D.name="prefiltered-cube",y=0;6>y;y++)v=new pc.RenderTarget(b,D,{face:y,depth:!1}),m.x=y,m.w=2,n.setValue(d),q.setValue(m.data),pc.drawQuadWithShader(b,v,k),e(b,v,y);r=0===f?1:2048;v=0===f?0:-1;t[v]=[];for(w=0;5>w;w++)for(k=v;kk?p:!0,format:2>k?h:pc.PIXELFORMAT_R8_G8_B8_A8,fixCubemapSeams:1===k||3===k,width:x[w],height:x[w],mipmaps:!1}),t[k][w].name="prefiltered-cube");for(k=v;kw;w++)for(y=0;6>y;y++)v=new pc.RenderTarget(b,t[k][w],{face:y,depth:!1}),m.x=y,m.y=0>k?r:u[w],m.z=x[w],m.w=p?3:k,n.setValue(0===w?d:0===f?t[0][w-1]:t[-1][w-1]),q.setValue(m.data),pc.drawQuadWithShader(b,v,g),l&&e(b,v,y);a.filtered=t[0];if(l&&a.singleFilteredFixed){d=[d,a.filteredFixed[0],a.filteredFixed[1],a.filteredFixed[2],a.filteredFixed[3],a.filteredFixed[4],a.filteredFixed[5]];p=new pc.Texture(b,{cubemap:!0,rgbm:p,fixCubemapSeams:!0,format:h,width:128, -height:128,addressU:pc.ADDRESS_CLAMP_TO_EDGE,addressV:pc.ADDRESS_CLAMP_TO_EDGE});p.name="prefiltered-cube";for(w=0;6>w;w++)p._levels[w]=d[w]._levels[0];p.upload();p._prefilteredMips=!0;a.singleFilteredFixed=p}if(l&&a.singleFilteredFixedRgbm&&a.filteredFixedRgbm){d=[D,a.filteredFixedRgbm[0],a.filteredFixedRgbm[1],a.filteredFixedRgbm[2],a.filteredFixedRgbm[3],a.filteredFixedRgbm[4],a.filteredFixedRgbm[5]];p=new pc.Texture(b,{cubemap:!0,rgbm:!0,fixCubemapSeams:!0,format:pc.PIXELFORMAT_R8_G8_B8_A8,width:128, -height:128,addressU:pc.ADDRESS_CLAMP_TO_EDGE,addressV:pc.ADDRESS_CLAMP_TO_EDGE});p.name="prefiltered-cube";for(w=0;6>w;w++)p._levels[w]=d[w]._levels[0];p.upload();p._prefilteredMips=!0;a.singleFilteredFixedRgbm=p}}},shFromCubemap:function(a,c){var d,f=a.width,g,l;if(a.format!=pc.PIXELFORMAT_R8_G8_B8_A8)console.error("ERROR: SH: cubemap must be RGBA8");else{if(a._levels[0]){if(!a._levels[0][0].length)if(a._levels[0][0]instanceof HTMLImageElement){g=pc.Application.getApplication().graphicsDevice;l= -g.gl;d=pc.shaderChunks;var h=d.createShaderFromCode(g,d.fullscreenQuadVS,d.fullscreenQuadPS,"fsQuadSimple"),e=g.scope.resolve("source");for(d=0;6>d;d++){var k=a._levels[0][d],n=new pc.Texture(g,{cubemap:!1,rgbm:!1,format:a.format,width:f,height:f,mipmaps:!1});n.name="prefiltered-cube";n._levels[0]=k;n.upload();k=new pc.Texture(g,{cubemap:!1,rgbm:!1,format:a.format,width:f,height:f,mipmaps:!1});k.name="prefiltered-cube";k=new pc.RenderTarget(g,k,{depth:!1});e.setValue(n);pc.drawQuadWithShader(g,k, -h);var q=new Uint8Array(f*f*4);l.bindFramebuffer(l.FRAMEBUFFER,k._glFrameBuffer);l.readPixels(0,0,n.width,n.height,l.RGBA,l.UNSIGNED_BYTE,q);a._levels[0][d]=q}}else{console.error("ERROR: SH: cubemap must be composed of arrays or images");return}h=[];for(l=0;ld;d++)for(l=0;lm;m++)t=a._levels[0][d][4*n+m]/255,a.rgbm?(t*= -8*r,t*=t):t=Math.pow(t,2.2),e[0+m]+=t*w,e[3+m]+=t*y*u,e[6+m]+=t*y*x,e[9+m]+=t*y*v,e[12+m]+=t*D*u*v,e[15+m]+=t*D*v*x,e[18+m]+=t*D*x*u,e[21+m]+=t*B*(3*v*v-1),e[24+m]+=t*z*(u*u-x*x),k+=q}for(m=0;mm;m++){c=pc.paraboloidFromCubemap(e, -b[m],m,a);h.setValue(c);c=d;var r=m;c.x=.5*pc.math.clamp(r-2,0,1);var r=r-6*c.x,t=1-c.x;c.y=Math.min(.5*r,.75)*t+c.x;c.z=(1-.5*pc.math.clamp(r,0,1))*t;c.w=.5*c.z;c=1/c.z;f.x=c*q;f.y=2*f.x;f.x+=1;f.y+=1;p.setValue(f.data);d.x*=g;d.y*=g;d.z*=g;d.w*=g;pc.drawQuadWithShader(e,n,l,d)}return k}}}());pc.shaderChunks.TBNPS="void getTBN() {\n dTBN = mat3(normalize(dTangentW), normalize(dBinormalW), normalize(dVertexNormalW));\n}\n";pc.shaderChunks.TBNderivativePS="// http://www.thetenthplanet.de/archives/1180\nvoid getTBN() {\n vec2 uv = $UV;\n // get edge vectors of the pixel triangle\n vec3 dp1 = dFdx( vPositionW );\n vec3 dp2 = dFdy( vPositionW );\n vec2 duv1 = dFdx( uv );\n vec2 duv2 = dFdy( uv );\n // solve the linear system\n vec3 dp2perp = cross( dp2, dVertexNormalW );\n vec3 dp1perp = cross( dVertexNormalW, dp1 );\n vec3 T = dp2perp * duv1.x + dp1perp * duv2.x;\n vec3 B = dp2perp * duv1.y + dp1perp * duv2.y;\n // construct a scale-invariant frame\n float invmax = 1.0 / sqrt( max( dot(T,T), dot(B,B) ) );\n dTBN = mat3( T * invmax, B * invmax, dVertexNormalW );\n}\n"; -pc.shaderChunks.TBNfastPS="void getTBN() {\n dTBN = mat3(dTangentW, dBinormalW, dVertexNormalW);\n}\n";pc.shaderChunks.alphaTestPS="uniform float alpha_ref;\nvoid alphaTest(float a) {\n if (a < alpha_ref) discard;\n}\n";pc.shaderChunks.ambientConstantPS="\nvoid addAmbient() {\n dDiffuseLight += light_globalAmbient;\n}\n";pc.shaderChunks.ambientPrefilteredCubePS="#ifndef PMREM4\n#define PMREM4\nuniform samplerCube texture_prefilteredCubeMap4;\n#endif\nvoid addAmbient() {\n vec3 fixedReflDir = fixSeamsStatic(dNormalW, 1.0 - 1.0 / 4.0);\n fixedReflDir.x *= -1.0;\n dDiffuseLight += processEnvironment($DECODE(textureCube(texture_prefilteredCubeMap4, fixedReflDir)).rgb);\n}\n"; -pc.shaderChunks.ambientPrefilteredCubeLodPS="#ifndef PMREM4\n#define PMREM4\n#extension GL_EXT_shader_texture_lod : enable\nuniform samplerCube texture_prefilteredCubeMap128;\n#endif\nvoid addAmbient() {\n vec3 fixedReflDir = fixSeamsStatic(dNormalW, 1.0 - 1.0 / 4.0);\n fixedReflDir.x *= -1.0;\n dDiffuseLight += processEnvironment($DECODE( textureCubeLodEXT(texture_prefilteredCubeMap128, fixedReflDir, 5.0) ).rgb);\n}\n";pc.shaderChunks.ambientSHPS="uniform vec3 ambientSH[9];\nvoid addAmbient() {\n vec3 n = dNormalW;\n vec3 color =\n ambientSH[0] +\n ambientSH[1] * n.x +\n ambientSH[2] * n.y +\n ambientSH[3] * n.z +\n ambientSH[4] * n.x * n.z +\n ambientSH[5] * n.z * n.y +\n ambientSH[6] * n.y * n.x +\n ambientSH[7] * (3.0 * n.z * n.z - 1.0) +\n ambientSH[8] * (n.x * n.x - n.y * n.y);\n dDiffuseLight += processEnvironment(max(color, vec3(0.0)));\n}\n"; -pc.shaderChunks.aoPS="#ifdef MAPTEXTURE\nuniform sampler2D texture_aoMap;\n#endif\nvoid applyAO() {\n dAo = 1.0;\n #ifdef MAPTEXTURE\n dAo *= texture2D(texture_aoMap, $UV).$CH;\n #endif\n #ifdef MAPVERTEX\n dAo *= saturate(vVertexColor.$VC);\n #endif\n dDiffuseLight *= dAo;\n}\n";pc.shaderChunks.aoSpecOccPS="uniform float material_occludeSpecularIntensity;\nvoid occludeSpecular() {\n // approximated specular occlusion from AO\n float specPow = exp2(dGlossiness * 11.0);\n // http://research.tri-ace.com/Data/cedec2011_RealtimePBR_Implementation_e.pptx\n float specOcc = saturate(pow(dot(dNormalW, dViewDirW) + dAo, 0.01*specPow) - 1.0 + dAo);\n specOcc = mix(1.0, specOcc, material_occludeSpecularIntensity);\n dSpecularLight *= specOcc;\n dReflection *= specOcc;\n}\n"; -pc.shaderChunks.aoSpecOccConstPS="void occludeSpecular() {\n // approximated specular occlusion from AO\n float specPow = exp2(dGlossiness * 11.0);\n // http://research.tri-ace.com/Data/cedec2011_RealtimePBR_Implementation_e.pptx\n float specOcc = saturate(pow(dot(dNormalW, dViewDirW) + dAo, 0.01*specPow) - 1.0 + dAo);\n dSpecularLight *= specOcc;\n dReflection *= specOcc;\n}\n";pc.shaderChunks.aoSpecOccConstSimplePS="void occludeSpecular() {\n float specOcc = dAo;\n dSpecularLight *= specOcc;\n dReflection *= specOcc;\n}\n"; -pc.shaderChunks.aoSpecOccSimplePS="uniform float material_occludeSpecularIntensity;\nvoid occludeSpecular() {\n float specOcc = mix(1.0, dAo, material_occludeSpecularIntensity);\n dSpecularLight *= specOcc;\n dReflection *= specOcc;\n}\n";pc.shaderChunks.bakeDirLmEndPS="\n vec4 dirLm = texture2D(texture_dirLightMap, vUv1);\n if (bakeDir > 0.5) {\n if (dAtten > 0.00001) {\n dirLm.xyz = dirLm.xyz * 2.0 - vec3(1.0);\n dAtten = saturate(dAtten);\n gl_FragColor.rgb = normalize(dLightDirNormW.xyz*dAtten + dirLm.xyz*dirLm.w) * 0.5 + vec3(0.5);\n gl_FragColor.a = dirLm.w + dAtten;\n gl_FragColor.a = max(gl_FragColor.a, 1.0 / 255.0);\n } else {\n gl_FragColor = dirLm;\n }\n } else {\n gl_FragColor.rgb = dirLm.xyz;\n gl_FragColor.a = max(dirLm.w, dAtten > 0.00001? (1.0/255.0) : 0.0);\n }\n"; -pc.shaderChunks.bakeLmEndPS="\ngl_FragColor.rgb = dDiffuseLight;\ngl_FragColor.rgb = pow(gl_FragColor.rgb, vec3(0.5));\ngl_FragColor.rgb /= 8.0;\ngl_FragColor.a = clamp( max( max( gl_FragColor.r, gl_FragColor.g ), max( gl_FragColor.b, 1.0 / 255.0 ) ), 0.0,1.0 );\ngl_FragColor.a = ceil(gl_FragColor.a * 255.0) / 255.0;\ngl_FragColor.rgb /= gl_FragColor.a;\n";pc.shaderChunks.basePS="\nuniform vec3 view_position;\nuniform vec3 light_globalAmbient;\nfloat square(float x) {\n return x*x;\n}\nfloat saturate(float x) {\n return clamp(x, 0.0, 1.0);\n}\nvec3 saturate(vec3 x) {\n return clamp(x, vec3(0.0), vec3(1.0));\n}\n"; -pc.shaderChunks.baseVS="\nattribute vec3 vertex_position;\nattribute vec3 vertex_normal;\nattribute vec4 vertex_tangent;\nattribute vec2 vertex_texCoord0;\nattribute vec2 vertex_texCoord1;\nattribute vec4 vertex_color;\nuniform mat4 matrix_viewProjection;\nuniform mat4 matrix_model;\nuniform mat3 matrix_normal;\nvec3 dPositionW;\nmat4 dModelMatrix;\nmat3 dNormalMatrix;\nvec3 dLightPosW;\nvec3 dLightDirNormW;\nvec3 dNormalW;\n";pc.shaderChunks.baseNineSlicedPS="#define NINESLICED\nvarying vec2 vMask;\nvarying vec2 vTiledUv;\nuniform mediump vec4 innerOffset;\nuniform mediump vec2 outerScale;\nuniform mediump vec4 atlasRect;\nvec2 nineSlicedUv;\n"; -pc.shaderChunks.baseNineSlicedVS="#define NINESLICED\nvarying vec2 vMask;\nvarying vec2 vTiledUv;\nuniform mediump vec4 innerOffset;\nuniform mediump vec2 outerScale;\nuniform mediump vec4 atlasRect;\n";pc.shaderChunks.baseNineSlicedTiledPS="#define NINESLICED\n#define NINESLICETILED\nvarying vec2 vMask;\nvarying vec2 vTiledUv;\nuniform mediump vec4 innerOffset;\nuniform mediump vec2 outerScale;\nuniform mediump vec4 atlasRect;\nvec2 nineSlicedUv;\n";pc.shaderChunks.biasConstPS="#define SHADOWBIAS\nfloat getShadowBias(float resolution, float maxBias) {\n return maxBias;\n}\n"; -pc.shaderChunks.blurVSMPS="\nvarying vec2 vUv0;\nuniform sampler2D source;\nuniform vec2 pixelOffset;\n#ifdef GAUSS\nuniform float weight[SAMPLES];\n#endif\n#ifdef PACKED\nfloat decodeFloatRG(vec2 rg) {\n return rg.y*(1.0/255.0) + rg.x;\n}\nvec2 encodeFloatRG( float v ) {\n vec2 enc = vec2(1.0, 255.0) * v;\n enc = fract(enc);\n enc -= enc.yy * vec2(1.0/255.0, 1.0/255.0);\n return enc;\n}\n#endif\nvoid main(void) {\n vec3 moments = vec3(0.0);\n vec2 uv = vUv0 - pixelOffset * (float(SAMPLES) * 0.5);\n for(int i=0; ib.length){for(var a=b,c=a.charAt(a.length-1),d=pc._matTex2D[e]-a.length,f=0;f=pc.SHADER_SHADOW&&17>=b.pass;this.options=b;var k="",n="",q="",m=pc.shaderChunks,r,t={vertex_position:pc.SEMANTIC_POSITION};if(b.chunks){var u={};for(c in m)m.hasOwnProperty(c)&&(b.chunks[c]?(r=b.chunks[c],0<=r.indexOf("vertex_normal")&&(t.vertex_normal=pc.SEMANTIC_NORMAL),0<=r.indexOf("vertex_tangent")&&(t.vertex_tangent=pc.SEMANTIC_TANGENT),0<=r.indexOf("vertex_texCoord0")&&(t.vertex_texCoord0=pc.SEMANTIC_TEXCOORD0),0<=r.indexOf("vertex_texCoord1")&&(t.vertex_texCoord1=pc.SEMANTIC_TEXCOORD1), -0<=r.indexOf("vertex_color")&&(t.vertex_color=pc.SEMANTIC_COLOR),0<=r.indexOf("vertex_boneWeights")&&(t.vertex_boneWeights=pc.SEMANTIC_BLENDWEIGHT),0<=r.indexOf("vertex_boneIndices")&&(t.vertex_boneIndices=pc.SEMANTIC_BLENDINDICES),u[c]=r):u[c]=m[c]);for(c in b.chunks)(m=this._oldChunkToNew[c])&&(u[m.n]=m.f(b.chunks[c],m.n,c));m=u}k=this._vsAddBaseCode(k,e,m,b);u=-1;if(!b.noShadow&&!b.twoSidedLighting){for(a=0;a=e.fragmentUniformsCount&&(k+=m.viewNormalVS,n+=" vNormalV = getViewNormal();\n"),(b.heightMap||b.normalMap)&&b.hasTangents&&(t.vertex_tangent=pc.SEMANTIC_TANGENT,k+=m.tangentBinormalVS,n+=" vTangentW = getTangent();\n vBinormalW = getBinormal();\n"), -0<=u&&(r=b.lights[u]._type,n=r===pc.LIGHTTYPE_DIRECTIONAL?n+(" dLightDirNormW = light"+u+"_directionVS;\n"):n+(" getLightDirPoint(light"+u+"_positionVS);\n"),n+=this._nonPointShadowMapProjection(e,b.lights[u],"(light"+u+"_shadowMatrixVS, light"+u+"_shadowParamsVS);\n")));r=[];var x=[],v,w,y;for(c in pc._matTex2D)a=c+"Map",b[c+"VertexColor"]&&(v=c+"VertexColorChannel",b[v]=this._correctChannel(c,b[v])),b[a]&&(v=a+"Channel",w=a+"Transform",y=a+"Uv",b[y]=Math.min(b[y],1),b[v]=this._correctChannel(c, -b[v]),y=b[y],r[y]=!0,x[y]=x[y]||b[a]&&!b[w]);b.forceUv1&&(r[1]=!0);for(a=0;2>a;a++)r[a]&&(t["vertex_texCoord"+a]=pc["SEMANTIC_TEXCOORD"+a],k+=m["uv"+a+"VS"],n+=" vec2 uv"+a+" = getUv"+a+"();\n"),x[a]&&(n+=" vUv"+a+" = uv"+a+";\n");r=[k,q,n,[]];for(c in pc._matTex2D)a=c+"Map",b[a]&&(w=a+"Transform",b[w]&&(y=a+"Uv",this._setMapTransform(r,c,b[w],b[y])));k=r[0];q=r[1];n=r[2];b.vertexColors&&(t.vertex_color=pc.SEMANTIC_COLOR,n+=" vVertexColor = vertex_color;\n");b.skin?(t.vertex_boneWeights=pc.SEMANTIC_BLENDWEIGHT, -t.vertex_boneIndices=pc.SEMANTIC_BLENDINDICES,k+=pc.programlib.skinCode(e,m),k+="#define SKIN\n"):b.useInstancing&&(k+="#define INSTANCING\n");b.screenSpace&&(k+="#define SCREENSPACE\n");b.pixelSnap&&(k+="#define PIXELSNAP\n");k=this._vsAddTransformCode(k,e,m,b);h&&(k+=m.normalVS);k=k+"\n"+m.startVS;c=k=k+n+"}";r=q;q=""+this._addVaryingIfNeeded(k,"vec4","vMainShadowUv");q+=this._addVaryingIfNeeded(k,"vec4","vVertexColor");q+=this._addVaryingIfNeeded(k,"vec3","vPositionW");q+=this._addVaryingIfNeeded(k, -"vec3","vNormalV");q+=this._addVaryingIfNeeded(k,"vec3","vNormalW");q+=this._addVaryingIfNeeded(k,"vec3","vTangentW");q+=this._addVaryingIfNeeded(k,"vec3","vBinormalW");q+=this._addVaryingIfNeeded(k,"vec2","vUv0");q+=this._addVaryingIfNeeded(k,"vec2","vUv1");q+=r;c=q+c;k="";e.webgl2?(k=pc.programlib.versionCode(e),m.extensionVS&&(k+=m.extensionVS+"\n"),c=k+m.gles3VS+c):(m.extensionVS&&(k=m.extensionVS+"\n"),c=k+c);b.forceFragmentPrecision&&"highp"!=b.forceFragmentPrecision&&"mediump"!==b.forceFragmentPrecision&& -"lowp"!==b.forceFragmentPrecision&&(b.forceFragmentPrecision=null);b.forceFragmentPrecision&&("highp"===b.forceFragmentPrecision&&"highp"!==e.maxPrecision&&(b.forceFragmentPrecision="mediump"),"mediump"===b.forceFragmentPrecision&&"lowp"===e.maxPrecision&&(b.forceFragmentPrecision="lowp"));k="";e.webgl2&&(k+=pc.programlib.versionCode(e));e.extStandardDerivatives&&!e.webgl2&&(k+="#extension GL_OES_standard_derivatives : enable\n\n");m.extensionPS&&(k+=m.extensionPS+"\n");e.webgl2&&(k+=m.gles3PS);k+= -b.forceFragmentPrecision?"precision "+b.forceFragmentPrecision+" float;\n\n":pc.programlib.precisionCode(e);if(b.pass===pc.SHADER_PICK)return k=k+"uniform vec4 uColor;"+q,b.alphaTest&&(k=k+"float dAlpha;\n"+this._addMap("opacity","opacityPS",b,m),k+=m.alphaTestPS),k+=pc.programlib.begin(),b.alphaTest&&(k+=" getOpacity();\n alphaTest(dAlpha);\n"),k=k+" gl_FragColor = uColor;\n"+pc.programlib.end(),{attributes:t,vshader:c,fshader:k};if(b.pass===pc.SHADER_DEPTH)return k=k+"varying float vDepth;\n"+ -q+m.packDepthPS,b.alphaTest&&(k+="float dAlpha;\n",k+=this._addMap("opacity","opacityPS",b,m),k+=m.alphaTestPS),k+=pc.programlib.begin(),b.alphaTest&&(k+=" getOpacity();\n",k+=" alphaTest(dAlpha);\n"),k+=" gl_FragColor = packFloat(vDepth);\n",k+=pc.programlib.end(),{attributes:t,vshader:c,fshader:k};if(p){f=b.pass-pc.SHADER_SHADOW;r=Math.floor(f/5);f-=5*r;e.extStandardDerivatives&&!e.webgl2&&(k+="uniform vec2 polygonOffset;\n");f===pc.SHADOW_VSM32?k=e.textureFloatHighPrecision?k+"#define VSM_EXPONENT 15.0\n\n": -k+"#define VSM_EXPONENT 5.54\n\n":f===pc.SHADOW_VSM16&&(k+="#define VSM_EXPONENT 5.54\n\n");r!==pc.LIGHTTYPE_DIRECTIONAL&&(k+="uniform vec3 view_position;\n",k+="uniform float light_radius;\n");k+=q;b.alphaTest&&(k+="float dAlpha;\n",k+=this._addMap("opacity","opacityPS",b,m),k+=m.alphaTestPS);f!==pc.SHADOW_PCF3||e.webgl2&&r!==pc.LIGHTTYPE_POINT?f===pc.SHADOW_VSM8&&(k+="vec2 encodeFloatRG( float v ) {\n",k+=" vec2 enc = vec2(1.0, 255.0) * v;\n",k+=" enc = fract(enc);\n",k+=" enc -= enc.yy * vec2(1.0/255.0, 1.0/255.0);\n", -k+=" return enc;\n",k+="}\n\n"):k+=m.packDepthPS;k+=pc.programlib.begin();b.alphaTest&&(k+=" getOpacity();\n",k+=" alphaTest(dAlpha);\n");var D=f===pc.SHADOW_VSM8||f===pc.SHADOW_VSM16||f===pc.SHADOW_VSM32,k=r===pc.LIGHTTYPE_POINT||D&&r!==pc.LIGHTTYPE_DIRECTIONAL?k+" float depth = min(distance(view_position, vPositionW) / light_radius, 0.99999);\n":k+" float depth = gl_FragCoord.z;\n";f!==pc.SHADOW_PCF3||e.webgl2&&r!==pc.LIGHTTYPE_POINT?k=f===pc.SHADOW_PCF3||f===pc.SHADOW_PCF5?k+" gl_FragColor = vec4(1.0);\n": -f===pc.SHADOW_VSM8?k+" gl_FragColor = vec4(encodeFloatRG(depth), encodeFloatRG(depth*depth));\n":k+m.storeEVSMPS:(e.extStandardDerivatives&&!e.webgl2&&(k+=" float minValue = 2.3374370500153186e-10; //(1.0 / 255.0) / (256.0 * 256.0 * 256.0);\n",k+=" depth += polygonOffset.x * max(abs(dFdx(depth)), abs(dFdy(depth))) + minValue * polygonOffset.y;\n"),k+=" gl_FragColor = packFloat(depth);\n");k+=pc.programlib.end();return{attributes:t,vshader:c,fshader:k}}if(b.customFragmentShader)return k+=b.customFragmentShader, -{attributes:t,vshader:c,fshader:k,tag:pc.SHADERTAG_MATERIAL};q=k=this._fsAddBaseCode(k+q,e,m,b);k="";x=0;w=[];v=y=!1;for(a=0;a 0.00001) {\n",r!==pc.LIGHTTYPE_SPOT||g&&!n._cookieFalloff||(k+=" dAtten *= getSpotEffect(light"+a+"_direction, light"+a+"_innerConeAngle, light"+a+"_outerConeAngle);\n",y=!0)),k+=" dAtten *= getLightDiffuse();\n", -n.castShadows&&!b.noShadow&&(n._shadowType===pc.SHADOW_VSM8?(h="VSM8",D="0.0"):n._shadowType===pc.SHADOW_VSM16?(h="VSM16",D="5.54"):n._shadowType===pc.SHADOW_VSM32?(h="VSM32",D=e.textureFloatHighPrecision?"15.0":"5.54"):h=n._shadowType===pc.SHADOW_PCF5?"PCF5x5":"PCF3x3",null!==h&&(r===pc.LIGHTTYPE_POINT?(d="(light"+a+"_shadowMap, light"+a+"_shadowParams);\n",n._normalOffsetBias&&(k+=" normalOffsetPointShadow(light"+a+"_shadowParams);\n"),k+=" dAtten *= getShadowPoint"+h+d):(u===a?h+="VS": -(d="(light"+a+"_shadowMatrix, light"+a+"_shadowParams);\n",k+=this._nonPointShadowMapProjection(e,b.lights[a],d)),r===pc.LIGHTTYPE_SPOT&&(h="Spot"+h),k+=" dAtten *= getShadow"+h+"(light"+a+"_shadowMap, light"+a+"_shadowParams"+(n._isVsm?", "+D:"")+");\n"))),k+=" dDiffuseLight += dAtten * light"+a+"_color"+(g?" * dAtten3":"")+";\n",b.useSpecular&&(k+=" dAtten *= getLightSpecular();\n",k+=" dSpecularLight += dAtten * light"+a+"_color"+(g?" * dAtten3":"")+";\n"),r!==pc.LIGHTTYPE_DIRECTIONAL&& -(k+=" }\n"),k+="\n";(f||b.sphereMap||b.dpAtlas)&&b.refraction&&(k+=" addRefraction();\n")}k+="\n";p&&(b.occludeDirect&&(k+=" applyAO();\n"),b.occludeSpecular&&(k+=" occludeSpecular();\n"));k+=m.endPS;k=b.blendType===pc.BLEND_NORMAL||b.blendType===pc.BLEND_ADDITIVEALPHA||b.alphaToCoverage?k+m.outputAlphaPS:b.blendType===pc.BLEND_PREMULTIPLIED?k+m.outputAlphaPremulPS:k+m.outputAlphaOpaquePS;b.msdf&&(k+=" gl_FragColor = applyMsdf(gl_FragColor);\n");k+="\n";k+=pc.programlib.end();l&&(k=m.lightDirPointPS+ -k);x&&(k=m.falloffLinearPS+k);w&&(k=m.falloffInvSquaredPS+k);y&&(k=m.spotPS+k);v&&(k=m.cookiePS+k);m="";k.includes("dReflection")&&(m+="vec4 dReflection;\n");k.includes("dTBN")&&(m+="mat3 dTBN;\n");k.includes("dAlbedo")&&(m+="vec3 dAlbedo;\n");k.includes("dEmission")&&(m+="vec3 dEmission;\n");k.includes("dNormalW")&&(m+="vec3 dNormalW;\n");k.includes("dVertexNormalW")&&(m+="vec3 dVertexNormalW;\n");k.includes("dTangentW")&&(m+="vec3 dTangentW;\n");k.includes("dBinormalW")&&(m+="vec3 dBinormalW;\n"); -k.includes("dViewDirW")&&(m+="vec3 dViewDirW;\n");k.includes("dReflDirW")&&(m+="vec3 dReflDirW;\n");k.includes("dDiffuseLight")&&(m+="vec3 dDiffuseLight;\n");k.includes("dSpecularLight")&&(m+="vec3 dSpecularLight;\n");k.includes("dLightDirNormW")&&(m+="vec3 dLightDirNormW;\n");k.includes("dLightDirW")&&(m+="vec3 dLightDirW;\n");k.includes("dLightPosW")&&(m+="vec3 dLightPosW;\n");k.includes("dShadowCoord")&&(m+="vec3 dShadowCoord;\n");k.includes("dNormalMap")&&(m+="vec3 dNormalMap;\n");k.includes("dSpecularity")&& -(m+="vec3 dSpecularity;\n");k.includes("dUvOffset")&&(m+="vec2 dUvOffset;\n");k.includes("dGlossiness")&&(m+="float dGlossiness;\n");k.includes("dAlpha")&&(m+="float dAlpha;\n");k.includes("dAtten")&&(m+="float dAtten;\n");k.includes("dAtten3")&&(m+="vec3 dAtten3;\n");k.includes("dAo")&&(m+="float dAo;\n");k.includes("dMsdf")&&(m+="vec4 dMsdf;\n");k=q+m+k;return{attributes:t,vshader:c,fshader:k,tag:pc.SHADERTAG_MATERIAL}}};pc.programlib.skybox={generateKey:function(e){return"skybox"+e.rgbm+" "+e.hdr+" "+e.fixSeams+""+e.toneMapping+""+e.gamma+""+e.useIntensity+""+e.mip},createShaderDefinition:function(e,b){var a=pc.shaderChunks;return{attributes:{aPosition:pc.SEMANTIC_POSITION},vshader:a.skyboxVS,fshader:pc.programlib.precisionCode(e)+(b.mip?a.fixCubemapSeamsStretchPS:a.fixCubemapSeamsNonePS)+(b.useIntensity?a.envMultiplyPS:a.envConstPS)+pc.programlib.gammaCode(b.gamma)+pc.programlib.tonemapCode(b.toneMapping)+a.rgbmPS+ -a.skyboxHDRPS.replace(/\$textureCubeSAMPLE/g,b.rgbm?"textureCubeRGBM":b.hdr?"textureCube":"textureCubeSRGB").replace(/\$FIXCONST/g,1-1/[128,64,16,8,4,2][b.mip]+"")}}};Object.assign(pc,function(){var e={type:pc.PRIMITIVE_TRISTRIP,base:0,count:4,indexed:!1},b=function(a){this.device=a;this.depthMap=this.shader=null;this.vertexBuffer=pc.createFullscreenQuad(a);this.needsDepthBuffer=!1};Object.assign(b.prototype,{render:function(a,b,d){}});return{PostEffect:b,createFullscreenQuad:function(a){var b=new pc.VertexFormat(a,[{semantic:pc.SEMANTIC_POSITION,components:2,type:pc.TYPE_FLOAT32}]);a=new pc.VertexBuffer(a,b,4);b=new pc.VertexIterator(a);b.element[pc.SEMANTIC_POSITION].set(-1, --1);b.next();b.element[pc.SEMANTIC_POSITION].set(1,-1);b.next();b.element[pc.SEMANTIC_POSITION].set(-1,1);b.next();b.element[pc.SEMANTIC_POSITION].set(1,1);b.end();return a},drawFullscreenQuad:function(a,b,d,f,g){var c=a.getRenderTarget();a.setRenderTarget(b);a.updateBegin();var h=null!==b?b.width:a.width,p=null!==b?b.height:a.height,k=0,n=0;g&&(k=g.x*h,n=g.y*p,h*=g.z,p*=g.w);g=a.vx;b=a.vy;var q=a.vw,m=a.vh;a.setViewport(k,n,h,p);var r=a.sx,t=a.sy,u=a.sw,x=a.sh;a.setScissor(k,n,h,p);var h=a.getBlending(), -p=a.getDepthTest(),k=a.getDepthWrite(),n=a.getCullMode(),v=a.writeRed,w=a.writeGreen,y=a.writeBlue,D=a.writeAlpha;a.setBlending(!1);a.setDepthTest(!1);a.setDepthWrite(!1);a.setCullMode(pc.CULLFACE_NONE);a.setColorWrite(!0,!0,!0,!0);a.setVertexBuffer(d,0);a.setShader(f);a.draw(e);a.setBlending(h);a.setDepthTest(p);a.setDepthWrite(k);a.setCullMode(n);a.setColorWrite(v,w,y,D);a.updateEnd();a.setRenderTarget(c);a.updateBegin();a.setViewport(g,b,q,m);a.setScissor(r,t,u,x)}}}());(function(){var e={BLEND_SUBTRACTIVE:0,BLEND_ADDITIVE:1,BLEND_NORMAL:2,BLEND_NONE:3,BLEND_PREMULTIPLIED:4,BLEND_MULTIPLICATIVE:5,BLEND_ADDITIVEALPHA:6,BLEND_MULTIPLICATIVE2X:7,BLEND_SCREEN:8,BLEND_MIN:9,BLEND_MAX:10,FOG_NONE:"none",FOG_LINEAR:"linear",FOG_EXP:"exp",FOG_EXP2:"exp2",FRESNEL_NONE:0,FRESNEL_SCHLICK:2,LAYER_HUD:0,LAYER_GIZMO:1,LAYER_FX:2,LAYER_WORLD:15,LAYERID_WORLD:0,LAYERID_DEPTH:1,LAYERID_SKYBOX:2,LAYERID_IMMEDIATE:3,LAYERID_UI:4,LIGHTTYPE_DIRECTIONAL:0,LIGHTTYPE_POINT:1,LIGHTTYPE_SPOT:2, -LIGHTFALLOFF_LINEAR:0,LIGHTFALLOFF_INVERSESQUARED:1,SHADOW_PCF3:0,SHADOW_DEPTH:0,SHADOW_VSM8:1,SHADOW_VSM16:2,SHADOW_VSM32:3,SHADOW_PCF5:4,BLUR_BOX:0,BLUR_GAUSSIAN:1,PARTICLESORT_NONE:0,PARTICLESORT_DISTANCE:1,PARTICLESORT_NEWER_FIRST:2,PARTICLESORT_OLDER_FIRST:3,PARTICLEMODE_GPU:0,PARTICLEMODE_CPU:1,EMITTERSHAPE_BOX:0,EMITTERSHAPE_SPHERE:1,PARTICLEORIENTATION_SCREEN:0,PARTICLEORIENTATION_WORLD:1,PARTICLEORIENTATION_EMITTER:2,PROJECTION_PERSPECTIVE:0,PROJECTION_ORTHOGRAPHIC:1,RENDERSTYLE_SOLID:0, -RENDERSTYLE_WIREFRAME:1,RENDERSTYLE_POINTS:2,CUBEPROJ_NONE:0,CUBEPROJ_BOX:1,SPECULAR_PHONG:0,SPECULAR_BLINN:1,GAMMA_NONE:0,GAMMA_SRGB:1,GAMMA_SRGBFAST:2,GAMMA_SRGBHDR:3,TONEMAP_LINEAR:0,TONEMAP_FILMIC:1,TONEMAP_HEJL:2,TONEMAP_ACES:3,TONEMAP_ACES2:4,SPECOCC_NONE:0,SPECOCC_AO:1,SPECOCC_GLOSSDEPENDENT:2,SHADERDEF_NOSHADOW:1,SHADERDEF_SKIN:2,SHADERDEF_UV0:4,SHADERDEF_UV1:8,SHADERDEF_VCOLOR:16,SHADERDEF_INSTANCING:32,SHADERDEF_LM:64,SHADERDEF_DIRLM:128,SHADERDEF_SCREENSPACE:256,SHADERDEF_TANGENTS:512, -LINEBATCH_WORLD:0,LINEBATCH_OVERLAY:1,LINEBATCH_GIZMO:2,SHADOWUPDATE_NONE:0,SHADOWUPDATE_THISFRAME:1,SHADOWUPDATE_REALTIME:2,SORTKEY_FORWARD:0,SORTKEY_DEPTH:1,MASK_DYNAMIC:1,MASK_BAKED:2,MASK_LIGHTMAP:4,SHADER_FORWARD:0,SHADER_FORWARDHDR:1,SHADER_DEPTH:2,SHADER_SHADOW:3,SHADER_PICK:18,BAKE_COLOR:0,BAKE_COLORDIR:1,VIEW_CENTER:0,VIEW_LEFT:1,VIEW_RIGHT:2,SORTMODE_NONE:0,SORTMODE_MANUAL:1,SORTMODE_MATERIALMESH:2,SORTMODE_BACK2FRONT:3,SORTMODE_FRONT2BACK:4,SORTMODE_CUSTOM:5,COMPUPDATED_INSTANCES:1,COMPUPDATED_LIGHTS:2, -COMPUPDATED_CAMERAS:4,COMPUPDATED_BLEND:8,ASPECT_AUTO:0,ASPECT_MANUAL:1,ORIENTATION_HORIZONTAL:0,ORIENTATION_VERTICAL:1};Object.assign(pc,e);pc.scene={};Object.assign(pc.scene,e)})(); -Object.assign(pc,function(){var e=function(){this.root=null;this._gravity=new pc.Vec3(0,-9.8,0);this._layers=null;this._fog=pc.FOG_NONE;this.fogColor=new pc.Color(0,0,0);this.fogStart=1;this.fogEnd=1E3;this.fogDensity=0;this.ambientLight=new pc.Color(0,0,0);this._gammaCorrection=pc.GAMMA_NONE;this._toneMapping=0;this.exposure=1;this._skyboxPrefiltered=[null,null,null,null,null,null];this.skyboxModel=this._skyboxCubeMap=null;this._skyboxIntensity=1;this._skyboxMip=0;this.lightmapSizeMultiplier=1;this.lightmapMaxResolution= -2048;this.lightmapMode=pc.BAKE_COLORDIR;this._stats={meshInstances:0,lights:0,dynamicLights:0,bakedLights:0,lastStaticPrepareFullTime:0,lastStaticPrepareSearchTime:0,lastStaticPrepareWriteTime:0,lastStaticPrepareTriAabbTime:0,lastStaticPrepareCombineTime:0,updateShadersTime:0};this.updateSkybox=this.updateShaders=!0;this._shaderVersion=0;this._statsUpdated=!1;this._models=[];this.defaultMaterial=new pc.StandardMaterial;this.defaultMaterial.name="Default Material";this.defaultMaterial.shadingModel= -pc.SPECULAR_BLINN;pc.events.attach(this)};e.prototype.destroy=function(){this.root=null;this.defaultMaterial.destroy();this.defaultMaterial=null;this.off()};Object.defineProperty(e.prototype,"fog",{get:function(){return this._fog},set:function(b){b!==this._fog&&(this._fog=b,this.updateShaders=!0)}});Object.defineProperty(e.prototype,"gammaCorrection",{get:function(){return this._gammaCorrection},set:function(b){b!==this._gammaCorrection&&(this._gammaCorrection=b,this.updateShaders=!0)}});Object.defineProperty(e.prototype, -"toneMapping",{get:function(){return this._toneMapping},set:function(b){b!==this._toneMapping&&(this._toneMapping=b,this.updateShaders=!0)}});Object.defineProperty(e.prototype,"skybox",{get:function(){return this._skyboxCubeMap},set:function(b){this._skyboxCubeMap=b;this._resetSkyboxModel();this.updateShaders=!0}});Object.defineProperty(e.prototype,"skyboxIntensity",{get:function(){return this._skyboxIntensity},set:function(b){this._skyboxIntensity=b;this._resetSkyboxModel();this.updateShaders=!0}}); -Object.defineProperty(e.prototype,"skyboxMip",{get:function(){return this._skyboxMip},set:function(b){this._skyboxMip=b;this._resetSkyboxModel();this.updateShaders=!0}});Object.defineProperty(e.prototype,"skyboxPrefiltered128",{get:function(){return this._skyboxPrefiltered[0]},set:function(b){this._skyboxPrefiltered[0]!==b&&(this._skyboxPrefiltered[0]=b,this.updateShaders=!0)}});Object.defineProperty(e.prototype,"skyboxPrefiltered64",{get:function(){return this._skyboxPrefiltered[1]},set:function(b){this._skyboxPrefiltered[1]!== -b&&(this._skyboxPrefiltered[1]=b,this.updateShaders=!0)}});Object.defineProperty(e.prototype,"skyboxPrefiltered32",{get:function(){return this._skyboxPrefiltered[2]},set:function(b){this._skyboxPrefiltered[2]!==b&&(this._skyboxPrefiltered[2]=b,this.updateShaders=!0)}});Object.defineProperty(e.prototype,"skyboxPrefiltered16",{get:function(){return this._skyboxPrefiltered[3]},set:function(b){this._skyboxPrefiltered[3]!==b&&(this._skyboxPrefiltered[3]=b,this.updateShaders=!0)}});Object.defineProperty(e.prototype, -"skyboxPrefiltered8",{get:function(){return this._skyboxPrefiltered[4]},set:function(b){this._skyboxPrefiltered[4]!==b&&(this._skyboxPrefiltered[4]=b,this.updateShaders=!0)}});Object.defineProperty(e.prototype,"skyboxPrefiltered4",{get:function(){return this._skyboxPrefiltered[5]},set:function(b){this._skyboxPrefiltered[5]!==b&&(this._skyboxPrefiltered[5]=b,this.updateShaders=!0)}});Object.defineProperty(e.prototype,"drawCalls",{get:function(){var b=this.layers._meshInstances;b.length||(this.layers._update(), -b=this.layers._meshInstances);return b},set:function(b){}});Object.defineProperty(e.prototype,"layers",{get:function(){return this._layers},set:function(b){var a=this._layers;this._layers=b;this.fire("set:layers",a,b)}});e.prototype.applySettings=function(b){this._gravity.set(b.physics.gravity[0],b.physics.gravity[1],b.physics.gravity[2]);this.ambientLight.set(b.render.global_ambient[0],b.render.global_ambient[1],b.render.global_ambient[2]);this._fog=b.render.fog;this.fogColor.set(b.render.fog_color[0], -b.render.fog_color[1],b.render.fog_color[2]);this.fogStart=b.render.fog_start;this.fogEnd=b.render.fog_end;this.fogDensity=b.render.fog_density;this._gammaCorrection=b.render.gamma_correction;this._toneMapping=b.render.tonemapping;this.lightmapSizeMultiplier=b.render.lightmapSizeMultiplier;this.lightmapMaxResolution=b.render.lightmapMaxResolution;this.lightmapMode=b.render.lightmapMode;this.exposure=b.render.exposure;this._skyboxIntensity=void 0===b.render.skyboxIntensity?1:b.render.skyboxIntensity; -this._skyboxMip=void 0===b.render.skyboxMip?0:b.render.skyboxMip;this._resetSkyboxModel();this.updateShaders=!0};e.prototype._updateSkybox=function(b){if(this._skyboxCubeMap&&!this.skyboxModel){var a=new pc.Material,c=this;a.updateShader=function(a,d,f,g,l){this.shader=b.getProgramLibrary().getProgram("skybox",{rgbm:c._skyboxCubeMap.rgbm,hdr:c._skyboxCubeMap.rgbm||c._skyboxCubeMap.format===pc.PIXELFORMAT_RGBA32F,useIntensity:1!==c.skyboxIntensity,mip:c._skyboxCubeMap.fixCubemapSeams?c.skyboxMip:0, -fixSeams:c._skyboxCubeMap.fixCubemapSeams,gamma:l===pc.SHADER_FORWARDHDR?c.gammaCorrection?pc.GAMMA_SRGBHDR:pc.GAMMA_NONE:c.gammaCorrection,toneMapping:l===pc.SHADER_FORWARDHDR?pc.TONEMAP_LINEAR:c.toneMapping})};a.updateShader();var d;if(this._skyboxCubeMap.fixCubemapSeams&&c._skyboxMip){var f=this["skyboxPrefiltered"+[null,"64","16","8","4"][c._skyboxMip]];f&&(d=f)}else d=this._skyboxCubeMap;a.setParameter("texture_cubeMap",d);a.cull=pc.CULLFACE_NONE;if(f=this.layers.getLayerById(pc.LAYERID_SKYBOX)){var g= -new pc.GraphNode,l=pc.createBox(b),a=new pc.MeshInstance(g,l,a);a.cull=!1;a._noDepthDrawGl1=!0;l=new pc.Model;l.graph=g;l.meshInstances=[a];this.skyboxModel=l;f.addMeshInstances(l.meshInstances);f.enabled=!0;this.skyLayer=f;this.fire("set:skybox",d)}}};e.prototype._resetSkyboxModel=function(){this.skyboxModel&&(this.skyLayer.removeMeshInstances(this.skyboxModel.meshInstances),this.skyLayer.enabled=!1);this.skyboxModel=null;this.updateSkybox=!0};e.prototype.setSkybox=function(b){var a;b||(b=[null, -null,null,null,null,null,null]);var c=!1;this._skyboxCubeMap!==b[0]&&(c=!0);if(!c)for(a=0;6>a&&!c;a++)this._skyboxPrefiltered[a]!==b[a+1]&&(c=!0);if(c){for(a=0;6>a;a++)this._skyboxPrefiltered[a]=b[a+1];this.skybox=b[0]}};e.prototype.destroy=function(){this.skybox=null};e.prototype.addModel=function(b){if(!this.containsModel(b)){var a=this.layers.getLayerById(pc.LAYERID_WORLD);a&&(a.addMeshInstances(b.meshInstances),this._models.push(b))}};e.prototype.addShadowCaster=function(b){var a=this.layers.getLayerById(pc.LAYERID_WORLD); -a&&a.addShadowCasters(b.meshInstances)};e.prototype.removeModel=function(b){var a=this._models.indexOf(b);if(-1!==a){var c=this.layers.getLayerById(pc.LAYERID_WORLD);c&&(c.removeMeshInstances(b.meshInstances),this._models.splice(a,1))}};e.prototype.removeShadowCasters=function(b){var a=this.layers.getLayerById(pc.LAYERID_WORLD);a&&a.removeShadowCasters(b.meshInstances)};e.prototype.containsModel=function(b){return 0<=this._models.indexOf(b)};e.prototype.getModels=function(b){return this._models}; -return{Scene:e}}());Object.assign(pc,function(){function e(a,b){if(b!==pc.SHADOW_PCF3||a.webgl2){if(b===pc.SHADOW_VSM32)return a.extTextureFloatLinear?pc.FILTER_LINEAR:pc.FILTER_NEAREST;if(b===pc.SHADOW_VSM16)return a.extTextureHalfFloatLinear?pc.FILTER_LINEAR:pc.FILTER_NEAREST}else return pc.FILTER_NEAREST;return pc.FILTER_LINEAR}function b(a,b,c,d){var f=d===pc.SHADOW_VSM32?pc.PIXELFORMAT_RGBA32F:d===pc.SHADOW_VSM16?pc.PIXELFORMAT_RGBA16F:d===pc.SHADOW_PCF5||d===pc.SHADOW_PCF3&&a.webgl2?pc.PIXELFORMAT_DEPTH:pc.PIXELFORMAT_R8_G8_B8_A8, -g=e(a,d);b=new pc.Texture(a,{format:f,width:b,height:c,mipmaps:!1,minFilter:g,magFilter:g,addressU:pc.ADDRESS_CLAMP_TO_EDGE,addressV:pc.ADDRESS_CLAMP_TO_EDGE});b.name="shadowmap";return d===pc.SHADOW_PCF5||d===pc.SHADOW_PCF3&&a.webgl2?(b.compareOnRead=!0,b.compareFunc=pc.FUNC_LESS,new pc.RenderTarget({depthBuffer:b})):new pc.RenderTarget({colorBuffer:b,depth:!0})}function a(a,b){var c=new pc.Texture(a,{format:pc.PIXELFORMAT_R8_G8_B8_A8,width:b,height:b,cubemap:!0,mipmaps:!1,minFilter:pc.FILTER_NEAREST, -magFilter:pc.FILTER_NEAREST,addressU:pc.ADDRESS_CLAMP_TO_EDGE,addressV:pc.ADDRESS_CLAMP_TO_EDGE});c.name="shadowcube";for(var d=[],f,g=0;6>g;g++)f=new pc.RenderTarget({colorBuffer:c,face:g,depth:!0}),d.push(f);return d}function c(a){25pc.SHADOW_PCF3&&(f._shadowType=pc.SHADOW_PCF3),f._cacheShadowMap?(g=O[f._shadowResolution],g||(g=a(c,f._shadowResolution),O[f._shadowResolution]=g)):g=a(c,f._shadowResolution),f._shadowCamera.renderTarget=g[0],f._shadowCubeMap=g):(g=f._cacheShadowMap?d(c,f._shadowResolution,f._shadowType):b(c,f._shadowResolution,f._shadowResolution,f._shadowType),f._shadowCamera.renderTarget=g);f._isCachedShadowMap=f._cacheShadowMap}function g(a){a=this.device= -a;this._instancingTime=this._morphTime=this._skinTime=this._sortTime=this._cullTime=this._forwardTime=this._depthMapTime=this._shadowMapTime=this._shadowMapUpdates=this._materialSwitches=this._camerasRendered=this._skinDrawCalls=this._forwardDrawCalls=this._shadowDrawCalls=0;this.library=a.getProgramLibrary();a=a.scope;this.projId=a.resolve("matrix_projection");this.viewId=a.resolve("matrix_view");this.viewId3=a.resolve("matrix_view3");this.viewInvId=a.resolve("matrix_viewInverse");this.viewProjId= -a.resolve("matrix_viewProjection");this.viewPos=new Float32Array(3);this.viewPosId=a.resolve("view_position");this.nearClipId=a.resolve("camera_near");this.farClipId=a.resolve("camera_far");this.cameraParamsId=a.resolve("camera_params");this.shadowMapLightRadiusId=a.resolve("light_radius");this.fogColorId=a.resolve("fog_color");this.fogStartId=a.resolve("fog_start");this.fogEndId=a.resolve("fog_end");this.fogDensityId=a.resolve("fog_density");this.modelMatrixId=a.resolve("matrix_model");this.normalMatrixId= -a.resolve("matrix_normal");this.poseMatrixId=a.resolve("matrix_pose[0]");this.boneTextureId=a.resolve("texture_poseMap");this.boneTextureSizeId=a.resolve("texture_poseMapSize");this.alphaTestId=a.resolve("alpha_ref");this.opacityMapId=a.resolve("texture_opacityMap");this.ambientId=a.resolve("light_globalAmbient");this.exposureId=a.resolve("exposure");this.skyboxIntensityId=a.resolve("skyboxIntensity");this.lightColorId=[];this.lightDir=[];this.lightDirId=[];this.lightShadowMapId=[];this.lightShadowMatrixId= -[];this.lightShadowParamsId=[];this.lightShadowMatrixVsId=[];this.lightShadowParamsVsId=[];this.lightDirVs=[];this.lightDirVsId=[];this.lightRadiusId=[];this.lightPos=[];this.lightPosId=[];this.lightInAngleId=[];this.lightOutAngleId=[];this.lightPosVsId=[];this.lightCookieId=[];this.lightCookieIntId=[];this.lightCookieMatrixId=[];this.lightCookieOffsetId=[];this.depthMapId=a.resolve("uDepthMap");this.screenSizeId=a.resolve("uScreenSize");this._screenSize=new Float32Array(4);this.sourceId=a.resolve("source"); -this.pixelOffsetId=a.resolve("pixelOffset");this.weightId=a.resolve("weight[0]");var b=pc.shaderChunks;this.blurVsmShaderCode=[b.blurVSMPS,"#define GAUSS\n"+b.blurVSMPS];this.blurPackedVsmShaderCode=["#define PACKED\n"+this.blurVsmShaderCode[0],"#define PACKED\n"+this.blurVsmShaderCode[1]];this.blurVsmShader=[{},{}];this.blurPackedVsmShader=[{},{}];this.blurVsmWeights={};this.polygonOffsetId=a.resolve("polygonOffset");this.polygonOffset=new Float32Array(2);this.fogColor=new Float32Array(3);this.ambientColor= -new Float32Array(3)}function l(a,b){a.data[0]=b.data[0];a.data[1]=b.data[1];a.data[2]=b.data[2];a.data[3]=b.data[4];a.data[4]=b.data[5];a.data[5]=b.data[6];a.data[6]=b.data[8];a.data[7]=b.data[9];a.data[8]=b.data[10]}for(var h=(new pc.Mat4).mul2((new pc.Mat4).setTranslate(.5,.5,.5),(new pc.Mat4).setScale(.5,.5,.5)),p={r:1,g:2,b:3,a:4},k=[(new pc.Quat).setFromEulerAngles(0,90,180),(new pc.Quat).setFromEulerAngles(0,-90,180),(new pc.Quat).setFromEulerAngles(90,0,0),(new pc.Quat).setFromEulerAngles(-90, -0,0),(new pc.Quat).setFromEulerAngles(0,180,180),(new pc.Quat).setFromEulerAngles(0,0,180)],n=[{},{},{},{},{}],q=new Float32Array(2),m={x:1,y:1,z:0,w:0},r=new pc.Mat4,t=new pc.Mat4,u=new pc.Mat4,x=new pc.Mat4,v=new pc.Mat4,w=new pc.Mat3,y=new pc.Mat4,D,B=new pc.Mat4,z=new pc.Mat4,A=new pc.Mat4,F=new pc.Mat4,I=new pc.Vec3,G=new pc.Vec3,H,C,E=new pc.Mat4,K=new pc.Mat4,N=new pc.Mat4,X=new pc.Mat4,M=new pc.Vec3,U={center:null,radius:0},aa,V=new pc.BoundingBox,P=[0,0],T,Y,L,Q,O={},J,ba,R=[],ca=0;8>ca;ca++)R.push(new pc.Vec3); -var S=[new pc.Vec3,new pc.Vec3,new pc.Vec3,new pc.Vec3,new pc.Vec3,new pc.Vec3,new pc.Vec3,new pc.Vec3];Object.assign(g.prototype,{sortCompare:function(a,b){if(a.layer===b.layer){if(a.drawOrder&&b.drawOrder)return a.drawOrder-b.drawOrder;if(a.zdist&&b.zdist)return b.zdist-a.zdist;if(a.zdist2&&b.zdist2)return a.zdist2-b.zdist2}return b._key[pc.SORTKEY_FORWARD]-a._key[pc.SORTKEY_FORWARD]},sortCompareMesh:function(a,b){if(a.layer===b.layer){if(a.drawOrder&&b.drawOrder)return a.drawOrder-b.drawOrder; -if(a.zdist&&b.zdist)return b.zdist-a.zdist}J=a._key[pc.SORTKEY_FORWARD];ba=b._key[pc.SORTKEY_FORWARD];return J===ba&&a.mesh&&b.mesh?b.mesh.id-a.mesh.id:ba-J},depthSortCompare:function(a,b){J=a._key[pc.SORTKEY_DEPTH];ba=b._key[pc.SORTKEY_DEPTH];return J===ba&&a.mesh&&b.mesh?b.mesh.id-a.mesh.id:ba-J},lightCompare:function(a,b){return a.key-b.key},_isVisible:function(a,b){if(!b.visible)return!1;if(b.isVisibleFunc)return b.isVisibleFunc(a);aa=b.aabb.center;b._aabb._radiusVer!==b._aabbVer&&(b._aabb._radius= -b._aabb.halfExtents.length(),b._aabb._radiusVer=b._aabbVer);U.radius=b._aabb._radius;U.center=aa;return a.frustum.containsSphere(U)},getShadowCamera:function(a,b){var c=b._shadowCamera,d;if(null===c){c=b._shadowType;d=pc.CLEARFLAG_DEPTH;var g=c===pc.SHADOW_PCF5||c===pc.SHADOW_PCF3&&a.webgl2;b._type===pc.LIGHTTYPE_POINT&&(g=!1);g||(d|=pc.CLEARFLAG_COLOR);g=new pc.Camera;c>=pc.SHADOW_VSM8&&c<=pc.SHADOW_VSM32?(g.clearColor[0]=0,g.clearColor[1]=0,g.clearColor[2]=0,g.clearColor[3]=0):(g.clearColor[0]= -1,g.clearColor[1]=1,g.clearColor[2]=1,g.clearColor[3]=1);g.clearDepth=1;g.clearFlags=d;g.clearStencil=null;g._node=new pc.GraphNode;c=b._shadowCamera=g;f(a,b)}else d=c.renderTarget,d.width===b._shadowResolution&&d.height===b._shadowResolution||f(a,b);return c},updateCameraFrustum:function(a){if(a.vrDisplay&&a.vrDisplay.presenting){D=a.vrDisplay.combinedProj;var b=a._node.getParent();b?v.copy(b.getWorldTransform()).mul(a.vrDisplay.combinedViewInv).invert():v.copy(a.vrDisplay.combinedView);x.copy(v).invert(); -this.viewInvId.setValue(x.data)}else{D=a.getProjectionMatrix();a.overrideCalculateProjection&&a.calculateProjection(D,pc.VIEW_CENTER);if(a.overrideCalculateTransform)a.calculateTransform(x,pc.VIEW_CENTER);else{var b=a._node.getPosition(),c=a._node.getRotation();x.setTRS(b,c,pc.Vec3.ONE);this.viewInvId.setValue(x.data)}v.copy(x).invert()}a.frustum.update(D,v)},setCamera:function(a,b,c,d){var f=a.vrDisplay;if(f&&f.presenting){H=f.leftProj;C=f.rightProj;D=f.combinedProj;a.overrideCalculateProjection&& -(a.calculateProjection(H,pc.VIEW_LEFT),a.calculateProjection(C,pc.VIEW_RIGHT),a.calculateProjection(D,pc.VIEW_CENTER));if(a.overrideCalculateTransform)a.calculateTransform(B,pc.VIEW_LEFT),a.calculateTransform(z,pc.VIEW_RIGHT),a.calculateTransform(x,pc.VIEW_CENTER),A.copy(B).invert(),F.copy(z).invert(),v.copy(x).invert();else{var g=a._node.getParent();if(g){var h=g.getWorldTransform();B.mul2(h,f.leftViewInv);z.mul2(h,f.rightViewInv);A.copy(B).invert();F.copy(z).invert();v.copy(g.getWorldTransform()).mul(f.combinedViewInv).invert()}else B.copy(f.leftViewInv), -z.copy(f.rightViewInv),A.copy(f.leftView),F.copy(f.rightView),v.copy(f.combinedView)}l(E,A);l(K,F);N.mul2(H,A);X.mul2(C,F);I.x=B.data[12];I.y=B.data[13];I.z=B.data[14];G.x=z.data[12];G.y=z.data[13];G.z=z.data[14]}else D=a.getProjectionMatrix(),a.overrideCalculateProjection&&a.calculateProjection(D,pc.VIEW_CENTER),this.projId.setValue(D.data),a.overrideCalculateTransform?a.calculateTransform(x,pc.VIEW_CENTER):(f=a._node.getPosition(),g=a._node.getRotation(),x.setTRS(f,g,pc.Vec3.ONE)),this.viewInvId.setValue(x.data), -v.copy(x).invert(),this.viewId.setValue(v.data),l(w,v),this.viewId3.setValue(w.data),y.mul2(D,v),this.viewProjId.setValue(y.data),f=a._node.getPosition(),this.viewPos[0]=f.x,this.viewPos[1]=f.y,this.viewPos[2]=f.z,this.viewPosId.setValue(this.viewPos);a.frustum.update(D,v);this.nearClipId.setValue(a._nearClip);this.farClipId.setValue(a._farClip);this.cameraParamsId.setValue(a._shaderParams);f=this.device;f.setRenderTarget(b);f.updateBegin();h=a.getRect();g=b?b.width:f.width;b=b?b.height:f.height; -var e=Math.floor(h.x*g),k=Math.floor(h.y*b),p=Math.floor(h.width*g),h=Math.floor(h.height*b);f.setViewport(e,k,p,h);f.setScissor(e,k,p,h);c&&f.clear(a._clearOptions);h=a._scissorRect;e=Math.floor(h.x*g);k=Math.floor(h.y*b);p=Math.floor(h.width*g);h=Math.floor(h.height*b);f.setScissor(e,k,p,h);d&&f.setScissor(1,1,g-2,b-2)},dispatchGlobalLights:function(a){var b;this.mainLight=-1;this.ambientColor[0]=a.ambientLight.r;this.ambientColor[1]=a.ambientLight.g;this.ambientColor[2]=a.ambientLight.b;if(a.gammaCorrection)for(b= -0;3>b;b++)this.ambientColor[b]=Math.pow(this.ambientColor[b],2.2);this.ambientId.setValue(this.ambientColor);this.exposureId.setValue(a.exposure);a.skyboxModel&&this.skyboxIntensityId.setValue(a.skyboxIntensity)},_resolveLight:function(a,b){var c="light"+b;this.lightColorId[b]=a.resolve(c+"_color");this.lightDir[b]=new Float32Array(3);this.lightDirId[b]=a.resolve(c+"_direction");this.lightShadowMapId[b]=a.resolve(c+"_shadowMap");this.lightShadowMatrixId[b]=a.resolve(c+"_shadowMatrix");this.lightShadowParamsId[b]= -a.resolve(c+"_shadowParams");this.lightShadowMatrixVsId[b]=a.resolve(c+"_shadowMatrixVS");this.lightShadowParamsVsId[b]=a.resolve(c+"_shadowParamsVS");this.lightDirVs[b]=new Float32Array(3);this.lightDirVsId[b]=a.resolve(c+"_directionVS");this.lightRadiusId[b]=a.resolve(c+"_radius");this.lightPos[b]=new Float32Array(3);this.lightPosId[b]=a.resolve(c+"_position");this.lightInAngleId[b]=a.resolve(c+"_innerConeAngle");this.lightOutAngleId[b]=a.resolve(c+"_outerConeAngle");this.lightPosVsId[b]=a.resolve(c+ -"_positionVS");this.lightCookieId[b]=a.resolve(c+"_cookie");this.lightCookieIntId[b]=a.resolve(c+"_cookieIntensity");this.lightCookieMatrixId[b]=a.resolve(c+"_cookieMatrix");this.lightCookieOffsetId[b]=a.resolve(c+"_cookieOffset")},dispatchDirectLights:function(a,b,c){var d=a.length,f,g,l,h=0;this.mainLight=-1;var e=this.device.scope;for(f=0;fthis.mainLight&&(this.lightShadowMatrixVsId[h].setValue(g._shadowMatrix.data),this.lightShadowParamsVsId[h].setValue(k),g._direction.normalize(),this.lightDirVs[h][0]=g._direction.x,this.lightDirVs[h][1]=g._direction.y, -this.lightDirVs[h][2]=g._direction.z,this.lightDirVsId[h].setValue(this.lightDirVs[h]),this.mainLight=f)}h++}return h},dispatchPointLight:function(a,b,c,d){var f=c._node.getWorldTransform();this.lightColorId[d]||this._resolveLight(b,d);this.lightRadiusId[d].setValue(c.attenuationEnd);this.lightColorId[d].setValue(a.gammaCorrection?c._linearFinalColor:c._finalColor);f.getTranslation(c._position);this.lightPos[d][0]=c._position.x;this.lightPos[d][1]=c._position.y;this.lightPos[d][2]=c._position.z;this.lightPosId[d].setValue(this.lightPos[d]); -c.castShadows&&(this.lightShadowMapId[d].setValue(c._shadowCamera.renderTarget.colorBuffer),a=c._rendererParams,4!==a.length&&(a.length=4),a[0]=c._shadowResolution,a[1]=c._normalOffsetBias,a[2]=c.shadowBias,a[3]=1/c.attenuationEnd,this.lightShadowParamsId[d].setValue(a));c._cookie&&(this.lightCookieId[d].setValue(c._cookie),this.lightShadowMatrixId[d].setValue(f.data),this.lightCookieIntId[d].setValue(c.cookieIntensity))},dispatchSpotLight:function(a,b,c,d){var f=c._node.getWorldTransform();this.lightColorId[d]|| -this._resolveLight(b,d);this.lightInAngleId[d].setValue(c._innerConeAngleCos);this.lightOutAngleId[d].setValue(c._outerConeAngleCos);this.lightRadiusId[d].setValue(c.attenuationEnd);this.lightColorId[d].setValue(a.gammaCorrection?c._linearFinalColor:c._finalColor);f.getTranslation(c._position);this.lightPos[d][0]=c._position.x;this.lightPos[d][1]=c._position.y;this.lightPos[d][2]=c._position.z;this.lightPosId[d].setValue(this.lightPos[d]);f.getY(c._direction).scale(-1);c._direction.normalize();this.lightDir[d][0]= -c._direction.x;this.lightDir[d][1]=c._direction.y;this.lightDir[d][2]=c._direction.z;this.lightDirId[d].setValue(this.lightDir[d]);c.castShadows&&(c._isVsm?a=-2E-4:(a=20*c.shadowBias,!this.device.webgl2&&this.device.extStandardDerivatives&&(a*=-100)),b=c._isVsm?c.vsmBias/(c.attenuationEnd/7):c._normalOffsetBias,this.lightShadowMapId[d].setValue(c._isPcf&&this.device.webgl2?c._shadowCamera.renderTarget.depthBuffer:c._shadowCamera.renderTarget.colorBuffer),this.lightShadowMatrixId[d].setValue(c._shadowMatrix.data), -f=c._rendererParams,4!==f.length&&(f.length=4),f[0]=c._shadowResolution,f[1]=b,f[2]=a,f[3]=1/c.attenuationEnd,this.lightShadowParamsId[d].setValue(f));c._cookie&&(this.lightCookieId[d].setValue(c._cookie),c.castShadows||(a=this.getShadowCamera(this.device,c),b=a._node,b.setPosition(c._node.getPosition()),b.setRotation(c._node.getRotation()),b.rotateLocal(-90,0,0),a.projection=pc.PROJECTION_PERSPECTIVE,a.aspectRatio=1,a.fov=2*c._outerConeAngle,r.setTRS(b.getPosition(),b.getRotation(),pc.Vec3.ONE).invert(), -t.mul2(a.getProjectionMatrix(),r),c._shadowMatrix.mul2(h,t)),this.lightShadowMatrixId[d].setValue(c._shadowMatrix.data),this.lightCookieIntId[d].setValue(c.cookieIntensity),c._cookieTransform&&(c._cookieTransformUniform[0]=c._cookieTransform.x,c._cookieTransformUniform[1]=c._cookieTransform.y,c._cookieTransformUniform[2]=c._cookieTransform.z,c._cookieTransformUniform[3]=c._cookieTransform.w,this.lightCookieMatrixId[d].setValue(c._cookieTransformUniform),c._cookieOffsetUniform[0]=c._cookieOffset.x, -c._cookieOffsetUniform[1]=c._cookieOffset.y,this.lightCookieOffsetId[d].setValue(c._cookieOffsetUniform)))},dispatchLocalLights:function(a,b,c,d,f){var g,l=a[pc.LIGHTTYPE_POINT];a=a[pc.LIGHTTYPE_SPOT];var h=l.length,e=a.length,k=d,p=this.device.scope;for(d=0;de._visibleLength[b])continue;x=e._visibleCameraSettings[b];C.setPosition(x.x,x.y,x.z); -v.orthoHeight=x.orthoHeight;v.farClip=x.farClip;x=b}else u===pc.LIGHTTYPE_SPOT?(y=C.getPosition(),this.viewPos[0]=y.x,this.viewPos[1]=y.y,this.viewPos[2]=y.z,this.viewPosId.setValue(this.viewPos),this.shadowMapLightRadiusId.setValue(e.attenuationEnd)):u===pc.LIGHTTYPE_POINT&&(y=C.getPosition(),this.viewPos[0]=y.x,this.viewPos[1]=y.y,this.viewPos[2]=y.z,this.viewPosId.setValue(this.viewPos),this.shadowMapLightRadiusId.setValue(e.attenuationEnd),w=6);u!==pc.LIGHTTYPE_POINT&&(r.setTRS(C.getPosition(), -C.getRotation(),pc.Vec3.ONE).invert(),t.mul2(v.getProjectionMatrix(),r),e._shadowMatrix.mul2(h,t));f.webgl2?u===pc.LIGHTTYPE_POINT?f.setDepthBias(!1):(f.setDepthBias(!0),f.setDepthBiasValues(-1E3*e.shadowBias,-1E3*e.shadowBias)):f.extStandardDerivatives&&(u===pc.LIGHTTYPE_POINT?(this.polygonOffset[0]=0,this.polygonOffset[1]=0):(this.polygonOffset[0]=-1E3*e.shadowBias,this.polygonOffset[1]=-1E3*e.shadowBias),this.polygonOffsetId.setValue(this.polygonOffset));e.shadowUpdateMode===pc.SHADOWUPDATE_THISFRAME&& -(e.shadowUpdateMode=pc.SHADOWUPDATE_NONE);this._shadowMapUpdates+=w;f.setBlending(!1);f.setDepthWrite(!0);f.setDepthTest(!0);e._isPcf&&f.webgl2&&u!==pc.LIGHTTYPE_POINT?f.setColorWrite(!1,!1,!1,!1):f.setColorWrite(!0,!0,!0,!0);for(x?w=x+1:x=0;xg;g++)d=q[3*f+g+w],d=d*u+v,l=m[d],x=m[d+1],d=m[d+2],lI&&(I=l),x>y&&(y=x),d>G&&(G=d);d=6*f;W[d]=C;W[d+1]=H;W[d+2]=E;W[d+3]=I;W[d+4]=y;W[d+5]=G}for(l=0;l=x.x&&W[d+1]<=C.y&&W[d+4]>=x.y&&W[d+2]<=C.z&&W[d+5]>=x.z&&(D[f]|=g,r=!0);if(r){r={};for(f=0;fI&&(I=l),x>y&&(y=x),d>G&&(G=d);Q.set(C,H,E);z.set(I,y,G);f=new pc.BoundingBox;f.setMinMax(Q,z); -t=new pc.Mesh;t.vertexBuffer=B;t.indexBuffer[0]=q;t.primitive[0].type=pc.PRIMITIVE_TRIANGLES;t.primitive[0].base=0;t.primitive[0].count=g.length;t.primitive[0].indexed=!0;t.aabb=f;q=new pc.MeshInstance(k.node,t,k.material);q.isStatic=k.isStatic;q.visible=k.visible;q.layer=k.layer;q.castShadow=k.castShadow;q._receiveShadow=k._receiveShadow;q.cull=k.cull;q.pick=k.pick;q.mask=k.mask;q.parameters=k.parameters;q._shaderDefs=k._shaderDefs;q._staticSource=k;q._staticLightList=k._staticLightList?k._staticLightList: -[];for(f=0;fq._staticLightList.indexOf(t)&&q._staticLightList.push(t));q._staticLightList.sort(this.lightCompare);n.push(q)}}else n.push(k)}}else n.push(k);a.length=n.length;for(c=0;cf;f++)u.transformPoint(R[f],R[f]);n=m=c=1E6;q=t=k=-1E6;for(f=0;8>f;f++)p=R[f],p.xq&&(q=p.x),p.yt&&(t=p.y),p.zk&&(k=p.z);f=e/a._shadowResolution;n=Math.floor((n-.5*(e-(q-n)))/f)*f;m=Math.floor((m-.5*(e-(t-m)))/f)*f;n=.5*(n+e+n);m=.5*(m+e+m);l.translateLocal(n,m,1E5);g.projection=pc.PROJECTION_ORTHOGRAPHIC; -g.nearClip=0;g.farClip=2E5;g.aspectRatio=1;g.orthoHeight=.5*e;this.updateCameraFrustum(g);t=!0;(k=a._visibleList[d])||(k=a._visibleList[d]=[]);f=e=a._visibleLength[d]=0;for(q=b.length;fk;++k)r.transformPoint(S[k],S[k]),e=S[k].z,eb&&(b=e);k=b;f>c&&(c=f);l.setPosition(h.getPosition());l.translateLocal(n,m,k+.01);g.farClip=k-c;(h=a._visibleCameraSettings[d])||(h=a._visibleCameraSettings[d]={});a=l.getPosition();h.x=a.x;h.y=a.y;h.z=a.z;h.orthoHeight=g.orthoHeight;h.farClip=g.farClip},gpuUpdate:function(a){this.updateGpuSkinMatrices(a); -this.updateMorphing(a)},clearView:function(a,b,c){a=a.camera;var d=this.device;d.setRenderTarget(b);d.updateBegin();d.setColorWrite(!0,!0,!0,!0);d.setDepthWrite(!0);var f=a.getRect(),g=b?b.width:d.width,l=b?b.height:d.height;b=Math.floor(f.x*g);var h=Math.floor(f.y*l),g=Math.floor(f.width*g),f=Math.floor(f.height*l);d.setViewport(b,h,g,f);d.setScissor(b,h,g,f);d.clear(c?c:a._clearOptions)},setSceneConstants:function(){var a,b=this.device,c=this.scene;this.dispatchGlobalLights(c);if(c.fog!==pc.FOG_NONE){this.fogColor[0]= -c.fogColor.r;this.fogColor[1]=c.fogColor.g;this.fogColor[2]=c.fogColor.b;if(c.gammaCorrection)for(a=0;3>a;a++)this.fogColor[a]=Math.pow(this.fogColor[a],2.2);this.fogColorId.setValue(this.fogColor);c.fog===pc.FOG_LINEAR?(this.fogStartId.setValue(c.fogStart),this.fogEndId.setValue(c.fogEnd)):this.fogDensityId.setValue(c.fogDensity)}this._screenSize[0]=b.width;this._screenSize[1]=b.height;this._screenSize[2]=1/b.width;this._screenSize[3]=1/b.height;this.screenSizeId.setValue(this._screenSize)},renderComposition:function(a){var b= -this.device,c,d=a._renderedRt,f=a._renderedByCam,g=a._renderedLayer,l,h,e,k,p,n,m,q;this.beginLayers(a);a._update()&pc.COMPUPDATED_LIGHTS&&(this.scene.updateLitShaders=!0);this.beginFrame(a);this.setSceneConstants();var t=0,r,u;for(l=0;l=pc.SHADOW_VSM8&&a<=pc.SHADOW_VSM32;this._isPcf=a===pc.SHADOW_PCF5||a===pc.SHADOW_PCF3;this._shadowType=a;this._destroyShadowMap();this.updateKey()}}});Object.defineProperty(d.prototype,"castShadows",{get:function(){return this._castShadows&&this._mask!==pc.MASK_LIGHTMAP&&0!==this._mask},set:function(a){this._castShadows!==a&&(this._castShadows=a,this.updateKey())}});Object.defineProperty(d.prototype, -"shadowResolution",{get:function(){return this._shadowResolution},set:function(a){if(this._shadowResolution!==a){var b=pc.Application.getApplication().graphicsDevice;this._shadowResolution=a=this._type===pc.LIGHTTYPE_POINT?Math.min(a,b.maxCubeMapSize):Math.min(a,b.maxTextureSize)}}});Object.defineProperty(d.prototype,"vsmBlurSize",{get:function(){return this._vsmBlurSize},set:function(a){this._vsmBlurSize!==a&&(0===a%2&&a++,this._vsmBlurSize=a)}});Object.defineProperty(d.prototype,"normalOffsetBias", -{get:function(){return this._normalOffsetBias},set:function(a){this._normalOffsetBias!==a&&((!this._normalOffsetBias&&a||this._normalOffsetBias&&!a)&&this.updateKey(),this._normalOffsetBias=a)}});Object.defineProperty(d.prototype,"falloffMode",{get:function(){return this._falloffMode},set:function(a){this._falloffMode!==a&&(this._falloffMode=a,this.updateKey())}});Object.defineProperty(d.prototype,"innerConeAngle",{get:function(){return this._innerConeAngle},set:function(a){this._innerConeAngle!== -a&&(this._innerConeAngle=a,this._innerConeAngleCos=Math.cos(a*Math.PI/180))}});Object.defineProperty(d.prototype,"outerConeAngle",{get:function(){return this._outerConeAngle},set:function(a){this._outerConeAngle!==a&&(this._outerConeAngle=a,this._outerConeAngleCos=Math.cos(a*Math.PI/180))}});Object.defineProperty(d.prototype,"intensity",{get:function(){return this._intensity},set:function(a){this._intensity!==a&&(this._intensity=a,this._updateFinalColor())}});Object.defineProperty(d.prototype,"cookie", -{get:function(){return this._cookie},set:function(a){this._cookie!==a&&(this._cookie=a,this.updateKey())}});Object.defineProperty(d.prototype,"cookieFalloff",{get:function(){return this._cookieFalloff},set:function(a){this._cookieFalloff!==a&&(this._cookieFalloff=a,this.updateKey())}});Object.defineProperty(d.prototype,"cookieChannel",{get:function(){return this._cookieChannel},set:function(a){if(this._cookieChannel!==a){if(3>a.length)for(var b=a.charAt(a.length-1),c=3-a.length,d=0;dg;g++)d[g]=f?Math.pow(b.data[g],2.2):b.data[g],h&&(d[g]*=a[m]);return{name:"material_"+c,value:d}};h&&(a[m]=1,Object.defineProperty(e.prototype,n,{get:function(){return this[m]},set:function(a){var b=this[m];(0===b||1===b)^(0===a||1===a)&&(this.dirtyShader=!0);this.dirtyColor=!0;this[m]=a}}),b.push(n),f[n]= -function(a,b,d){b=d?a[p]:new Float32Array(3);d=!1;a.useGammaTonemap&&(d=(a._scene||pc.Application.getApplication().scene).gammaCorrection);for(var f=0;3>f;f++)b[f]=d?Math.pow(a[k].data[f],2.2):a[k].data[f],b[f]*=a[m];return{name:"material_"+c,value:b}})},p=function(a,c,d,g){var l="_"+c;a[l]=d;Object.defineProperty(e.prototype,c,{get:function(){return this[l]},set:function(a){var b=this[l];b!==a&&(this[l]=a,0===b||1===b||0===a||1===a)&&(this.dirtyShader=!0)}});b.push(c);f[c]=void 0!==g?g:function(a, -b,d){return{name:"material_"+c,value:b}}},k=function(a,c,d){var g="_"+c;a[g]=null;Object.defineProperty(e.prototype,c,{get:function(){return this[g]},set:function(a){!!this[g]^!!a&&(this.dirtyShader=!0);this[g]=a}});b.push(c);f[c]=d},n=function(a,b,c){Object.defineProperty(e.prototype,c,{get:function(){return this[b]},set:function(a){this[b]=a}})},q=function(a){Object.defineProperty(e.prototype,"chunks",{get:function(){this.dirtyShader=!0;return this._chunks},set:function(a){this.dirtyShader=!0;this._chunks= -a}});b.push("chunks")},m=function(a,c,d){var f="_"+c;a[f]=d;Object.defineProperty(e.prototype,c,{get:function(){return this[f]},set:function(a){this[f]!==a&&(this.dirtyShader=!0);this[f]=a}});b.push(c)},r=function(){};r.prototype.copy=function(a){for(var b in a)a.hasOwnProperty(b)&&"copy"!==b&&(this[b]=a[b])};Object.assign(e.prototype,{reset:function(){var f;for(f=0;fthis.metalness)&&this._setParameter("material_metalness",this.metalness):this.specularMap&&!this.specularTint||this._setParameter("material_specular", -this.specularUniform);a=this.getUniform("shininess",this.shininess,!0);this._setParameter(a.name,a.value);this.emissiveMap&&!this.emissiveTint||this._setParameter("material_emissive",this.emissiveUniform);this.emissiveMap&&this._setParameter("material_emissiveIntensity",this.emissiveIntensity);0a;a++)this.emissiveUniform[a]*=this.emissiveIntensity;this.dirtyColor=!1}},updateShader:function(a,b,c,d,f,g){!this._colorProcessed&&this._scene&&(this._colorProcessed=!0,this._processColor());var l=a.useTexCubeLod,h=!a.extTextureLod,e,k,p,n,m,q;this.useSkybox&&(e=b._skyboxPrefiltered[0],k=b._skyboxPrefiltered[1],p=b._skyboxPrefiltered[2],n=b._skyboxPrefiltered[3],m=b._skyboxPrefiltered[4],q=b._skyboxPrefiltered[5]);e=this.prefilteredCubeMap128|| -e;k=this.prefilteredCubeMap64||k;p=this.prefilteredCubeMap32||p;n=this.prefilteredCubeMap16||n;m=this.prefilteredCubeMap8||m;q=this.prefilteredCubeMap4||q;if(e){var r=e&&k&&p&&n&&m&&q;h&&r?(e.dpAtlas||(e.dpAtlas=pc.generateDpAtlas(a,[e,k,p,n,m,q]),e.sh=pc.shFromCubemap(n)),this.dpAtlas=e.dpAtlas,this.ambientSH=e.sh,this._setParameter("ambientSH[0]",this.ambientSH),this._setParameter("texture_sphereMap",this.dpAtlas)):l?6>e._levels.length?r?this._setParameter("texture_prefilteredCubeMap128",e):console.log("Can't use prefiltered cubemap: "+ -r+", "+l+", "+e._levels):this._setParameter("texture_prefilteredCubeMap128",e):r?(this._setParameter("texture_prefilteredCubeMap128",e),this._setParameter("texture_prefilteredCubeMap64",k),this._setParameter("texture_prefilteredCubeMap32",p),this._setParameter("texture_prefilteredCubeMap16",n),this._setParameter("texture_prefilteredCubeMap8",m),this._setParameter("texture_prefilteredCubeMap4",q)):console.log("Can't use prefiltered cubemap: "+r+", "+l+", "+e._levels)}h=pc.programlib.standard;h=(l= -f>pc.SHADER_FORWARDHDR&&f<=pc.SHADER_PICK)?h.optionsContextMin:h.optionsContext;l?this.shaderOptBuilder.updateMinRef(h,a,b,this,c,d,f,g,e):this.shaderOptBuilder.updateRef(h,a,b,this,c,d,f,g,e);this.onUpdateShader&&(h=this.onUpdateShader(h));this.shader=a.getProgramLibrary().getProgram("standard",h);c||(this.clearVariants(),this.variants[0]=this.shader);this.dirtyShader=!1}});(function(c){c.dirtyShader=!0;c.dirtyColor=!0;c._scene=null;c._colorProcessed=!1;h(c,"ambient",new pc.Color(.7,.7,.7));h(c, -"diffuse",new pc.Color(1,1,1));h(c,"specular",new pc.Color(0,0,0));h(c,"emissive",new pc.Color(0,0,0),!0);p(c,"shininess",25,function(a,b){return{name:"material_shininess",value:a.shadingModel===pc.SPECULAR_PHONG?Math.pow(2,.11*b):.01*b}});p(c,"heightMapFactor",1,function(a,b){return{name:"material_heightMapFactor",value:.025*b}});p(c,"opacity",1);p(c,"alphaTest",0);p(c,"bumpiness",1);p(c,"reflectivity",1);p(c,"occludeSpecularIntensity",1);p(c,"refraction",0);p(c,"refractionIndex",1/1.5);p(c,"metalness", -1);p(c,"aoUvSet",0,null);k(c,"ambientSH",function(a,b,c){return{name:"ambientSH[0]",value:b}});k(c,"cubeMapProjectionBox",function(a,b,c){var d=c?a.cubeMapMinUniform:new Float32Array(3);a=c?a.cubeMapMaxUniform:new Float32Array(3);d[0]=b.center.x-b.halfExtents.x;d[1]=b.center.y-b.halfExtents.y;d[2]=b.center.z-b.halfExtents.z;a[0]=b.center.x+b.halfExtents.x;a[1]=b.center.y+b.halfExtents.y;a[2]=b.center.z+b.halfExtents.z;return[{name:"envBoxMin",value:d},{name:"envBoxMax",value:a}]});q(c);m(c,"ambientTint", -!1);m(c,"diffuseTint",!1);m(c,"specularTint",!1);m(c,"emissiveTint",!1);m(c,"fastTbn",!1);m(c,"specularAntialias",!1);m(c,"useMetalness",!1);m(c,"occludeDirect",!1);m(c,"normalizeNormalMap",!0);m(c,"conserveEnergy",!0);m(c,"occludeSpecular",pc.SPECOCC_AO);m(c,"shadingModel",pc.SPECULAR_BLINN);m(c,"fresnelModel",pc.FRESNEL_NONE);m(c,"cubeMapProjection",pc.CUBEPROJ_NONE);m(c,"customFragmentShader",null);m(c,"forceFragmentPrecision",null);m(c,"useFog",!0);m(c,"useLighting",!0);m(c,"useGammaTonemap", -!0);m(c,"useSkybox",!0);m(c,"forceUv1",!1);m(c,"pixelSnap",!1);m(c,"twoSidedLighting",!1);m(c,"nineSlicedMode",pc.SPRITE_RENDERMODE_SLICED);g(c,"diffuse",0,3);g(c,"specular",0,3);g(c,"emissive",0,3);g(c,"normal",0,-1);g(c,"metalness",0,1);g(c,"gloss",0,1);g(c,"opacity",0,1,"a");g(c,"height",0,1);g(c,"ao",0,1);g(c,"light",1,3);g(c,"msdf",0,3);k(c,"cubeMap");k(c,"sphereMap");k(c,"dpAtlas");k(c,"prefilteredCubeMap128");k(c,"prefilteredCubeMap64");k(c,"prefilteredCubeMap32");k(c,"prefilteredCubeMap16"); -k(c,"prefilteredCubeMap8");k(c,"prefilteredCubeMap4");n(c,"diffuseTint","diffuseMapTint");n(c,"specularTint","specularMapTint");n(c,"emissiveTint","emissiveMapTint");n(c,"aoVertexColor","aoMapVertexColor");n(c,"diffuseVertexColor","diffuseMapVertexColor");n(c,"specularVertexColor","specularMapVertexColor");n(c,"emissiveVertexColor","emissiveMapVertexColor");n(c,"metalnessVertexColor","metalnessMapVertexColor");n(c,"glossVertexColor","glossMapVertexColor");n(c,"opacityVertexColor","opacityMapVertexColor"); -n(c,"lightVertexColor","lightMapVertexColor");for(var d=0;da.metalness?1:0;b.glossTint=1;b.emissiveTint=g;b.alphaToCoverage=a.alphaToCoverage;b.needsNormalFloat=a.normalizeNormalMap;b.sphereMap=!!a.sphereMap;b.cubeMap=!!a.cubeMap;b.dpAtlas=!!a.dpAtlas;b.ambientSH=!!a.ambientSH;b.useSpecular=f;b.emissiveFormat=a.emissiveMap?a.emissiveMap.rgbm?1:a.emissiveMap.format===pc.PIXELFORMAT_RGBA32F?2:0:null;b.lightMapFormat= -a.lightMap?a.lightMap.rgbm?1:a.lightMap.format===pc.PIXELFORMAT_RGBA32F?2:0:null;b.specularAntialias=a.specularAntialias;b.conserveEnergy=a.conserveEnergy;b.occludeSpecular=a.occludeSpecular;b.occludeSpecularFloat=1!==a.occludeSpecularIntensity;b.occludeDirect=a.occludeDirect;b.shadingModel=a.shadingModel;b.fresnelModel=a.fresnelModel;b.packedNormal=a.normalMap?a.normalMap.format===pc.PIXELFORMAT_DXT5:!1;b.fastTbn=a.fastTbn;b.cubeMapProjection=a.cubeMapProjection;b.customFragmentShader=a.customFragmentShader; -b.refraction=!!a.refraction;b.useMetalness=a.useMetalness;b.msdf=!!a.msdfMap;b.twoSidedLighting=a.twoSidedLighting;b.pixelSnap=a.pixelSnap;b.nineSlicedMode=a.nineSlicedMode||0;b.aoMapUv=a.aoUvSet};e.prototype._updateEnvOptions=function(b,a,c,d){var f=(d?d.rgbm:!1)||(a.cubeMap?a.cubeMap.rgbm:!1)||(a.dpAtlas?a.dpAtlas.rgbm:!1),g=(d?d.rgbm||d.format===pc.PIXELFORMAT_RGBA32F:!1)||(a.cubeMap?a.cubeMap.rgbm||a.cubeMap.format===pc.PIXELFORMAT_RGBA32F:!1)||(a.dpAtlas?a.dpAtlas.rgbm||a.dpAtlas.format===pc.PIXELFORMAT_RGBA32F: -!1),l=(!d||a.cubeMap||a.sphereMap||a.dpAtlas?!1:d.rgbm)||(a.cubeMap?a.cubeMap.rgbm:!1)||(a.sphereMap?a.sphereMap.rgbm:!1)||(a.dpAtlas?a.dpAtlas.rgbm:!1),h=(!d||a.cubeMap||a.sphereMap||a.dpAtlas?!1:d.rgbm||d.format===pc.PIXELFORMAT_RGBA32F)||(a.cubeMap?a.cubeMap.rgbm||a.cubeMap.format===pc.PIXELFORMAT_RGBA32F:!1)||(a.sphereMap?a.sphereMap.rgbm||a.sphereMap.format===pc.PIXELFORMAT_RGBA32F:!1)||(a.dpAtlas?a.dpAtlas.rgbm||a.dpAtlas.format===pc.PIXELFORMAT_RGBA32F:!1),e;a.useSkybox&&c._skyboxPrefiltered&& -(e=c._skyboxPrefiltered[0]);b.fog=a.useFog?c.fog:"none";b.gamma=a.useGammaTonemap?c.gammaCorrection:pc.GAMMA_NONE;b.toneMap=a.useGammaTonemap?c.toneMapping:-1;b.rgbmAmbient=f;b.hdrAmbient=g;b.rgbmReflection=l;b.hdrReflection=h;b.useRgbm=l||f||(a.emissiveMap?a.emissiveMap.rgbm:!1)||(a.lightMap?a.lightMap.rgbm:!1);b.fixSeams=d?d.fixCubemapSeams:a.cubeMap?a.cubeMap.fixCubemapSeams:!1;b.prefilteredCubemap=!!d;b.skyboxIntensity=d&&e&&d===e&&1!==c.skyboxIntensity};e.prototype._updateLightOptions=function(b, -a,c,d,f){b.lightMap=!1;b.lightMapChannel="";b.lightMapUv=0;b.lightMapTransform=0;b.lightMapWithoutAmbient=!1;b.dirLightMap=!1;c&&(b.noShadow=0!==(c&pc.SHADERDEF_NOSHADOW),0!==(c&pc.SHADERDEF_LM)&&(b.lightMapFormat=1,b.lightMap=!0,b.lightMapChannel="rgb",b.lightMapUv=1,b.lightMapTransform=0,b.lightMapWithoutAmbient=!a.lightMap,b.useRgbm=!0,0!==(c&pc.SHADERDEF_DIRLM)&&(b.dirLightMap=!0)));a.useLighting?(a=[],c=c?c>>16:1,d&&(this._collectLights(pc.LIGHTTYPE_DIRECTIONAL,d[pc.LIGHTTYPE_DIRECTIONAL],a, -c),this._collectLights(pc.LIGHTTYPE_POINT,d[pc.LIGHTTYPE_POINT],a,c,f),this._collectLights(pc.LIGHTTYPE_SPOT,d[pc.LIGHTTYPE_SPOT],a,c,f)),b.lights=a):b.lights=[];0===b.lights.length&&(b.noShadow=!0)};e.prototype._updateTexOptions=function(b,a,c,d,f,g,l){var h=c+"Map",e=c+"VertexColor",k=c+"VertexColorChannel",n=h+"Channel",q=h+"Transform",m=h+"Uv";"light"!==c&&(b[h]=!1,b[n]="",b[q]=0,b[m]=0);b[e]=!1;b[k]="";var r="opacity"===c;if(r&&a.blendType===pc.BLEND_NONE&&0===a.alphaTest&&!a.alphaToCoverage)return b; -if(!l||r)"height"!==c&&a[e]&&g&&(b[e]=a[e],b[k]=a[k],b.vertexColors=!0),a[h]&&(c=!0,0!==a[m]||d||(c=!1),1!==a[m]||f||(c=!1),c&&(b[h]=!!a[h],b[q]=this._getMapTransformID(a[q],a[m]),b[n]=a[n],b[m]=a[m]))};e.prototype._collectLights=function(b,a,c,d,f){var g,l;for(l=0;lf;f++)0A&&(z.x=A),z.y>F&&(z.y=F),z.z>I&&(z.z=I),B.xm?H[3*G]+=m:C[3*G]+=m,0>B?H[3*G+1]+=B:C[3*G+1]+=B,0>z?H[3*G+2]+=z:C[3*G+2]+=z;for(e=0;eE;E++)0A&&(z.x=A),z.y>F&&(z.y=F),z.z>I&&(z.z=I),A=C[3*G],F=C[3*G+1],I=C[3*G+2],B.x>16},set:function(a){this._shaderDefs=this._shaderDefs&65535|a<<16;this._shader[pc.SHADER_FORWARD]=null;this._shader[pc.SHADER_FORWARDHDR]=null}});Object.assign(d.prototype,{syncAabb:function(){},updateKey:function(){var a=this.material;this._key[pc.SORTKEY_FORWARD]=e(this.layer,a.alphaToCoverage||a.alphaTest?pc.BLEND_NORMAL:a.blendType,!1,a.id)},setParameter:pc.Material.prototype.setParameter,setParameters:pc.Material.prototype.setParameters,deleteParameter:pc.Material.prototype.deleteParameter, -getParameter:pc.Material.prototype.getParameter,getParameters:pc.Material.prototype.getParameters,clearParameters:pc.Material.prototype.clearParameters});var f=function(a,b,c){this._key=[];this._key[pc.SORTKEY_FORWARD]=e(a,b,!0,0);this.command=c};Object.defineProperty(f.prototype,"key",{get:function(){return this._key[pc.SORTKEY_FORWARD]},set:function(a){this._key[pc.SORTKEY_FORWARD]=a}});var g=function(a,b,c){this.buffer=new Float32Array(a*(c||16));this.count=a;this.offset=0;this.usage=b?pc.BUFFER_DYNAMIC: -pc.BUFFER_STATIC;this._buffer=null};Object.assign(g.prototype,{update:function(){this._buffer&&this._buffer.setData(this.buffer)}});return{Command:f,Mesh:c,MeshInstance:d,InstancingData:g,_getDrawcallSortKey:e}}());Object.assign(pc,function(){var e=new pc.Mat4,b=function(a){this.skin=a;this._dirty=!0;this.bones=[];var b=a.inverseBindPose.length;a=a.device;if(a.supportsBoneTextures){var d;d=256d;d++)0!==c.blendWeight.data[4*b+d]&&(a.boneIndices[d]=this.getBoneRemap(c.blendIndices.data[4*a.index+d]));c=this.vertices.length;this.indices.push(c);this.vertices.push(a); -this.indexMap[b]=c}},addPrimitive:function(a,b,c,l){var d,f,g=[],e=0,q=a.length;for(d=0;dr;r++)if(0l)return!1;for(d=0;dg){var x=q.splice(l,1)[0],v=[];for(h=0;hh&&(e.x=h),e.y>k&&(e.y=k),e.z>p&&(e.z=p),b.xc._refCount){c.vertexBuffer&&(c.vertexBuffer.destroy(),c.vertexBuffer=null);for(f=0;fc;c++){d=k[a+q[c][0]];f=k[a+q[c][1]];var t=d>f?f<<16|d:d<<16|f;void 0===m[t]&&(m[t]=0,r.push(d,f))}p.unlock();a=new pc.IndexBuffer(p.device,pc.INDEXFORMAT_UINT16,r.length);c=new Uint16Array(a.lock());c.set(r);a.unlock();g.primitive[pc.RENDERSTYLE_WIREFRAME]= -{type:pc.PRIMITIVE_LINES,base:0,count:r.length,indexed:!0};g.indexBuffer[pc.RENDERSTYLE_WIREFRAME]=a}}});return{Model:e}}());Object.assign(pc,function(){function e(a){return a-Math.floor(a)}function b(a){var b=e(a);a=e(255*a);return[b-a/255,a-a/255]}function a(a,b){return a-b*Math.floor(a/b)}function c(a,b){T[a]=void 0!==Y[a]&&null!==Y[a]?Y[a]:b}function d(a,b){for(var c=a.length/3,d=Array(4*c),f=0;fg;g++)for(f=0;16>f;f++)e=f+1-8.5,h=g+1-8.5,h=Math.max(Math.min(1-Math.max(Math.min(Math.sqrt(e*e+h*h)/16,1),0)-.5,1),0),e=16*g+f,d[4*e]=1,d[4*e+1]=1,d[4*e+2]=1,d[4*e+3]=h;L.DEFAULT_PARAM_TEXTURE=p(a,16,16,d,pc.PIXELFORMAT_R8_G8_B8_A8,1,!0);L.DEFAULT_PARAM_TEXTURE.minFilter=pc.FILTER_LINEAR;L.DEFAULT_PARAM_TEXTURE.magFilter=pc.FILTER_LINEAR}T=this;Y=b;c("numParticles",1);this.numParticles>a.maxTextureSize&&(console.warn("WARNING: can't create more than "+a.maxTextureSize+ -" particles on this device."),this.numParticles=a.maxTextureSize);c("rate",1);c("rate2",this.rate);c("lifetime",50);c("emitterExtents",new pc.Vec3(0,0,0));c("emitterExtentsInner",new pc.Vec3(0,0,0));c("emitterRadius",0);c("emitterRadiusInner",0);c("emitterShape",pc.EMITTERSHAPE_BOX);c("initialVelocity",1);c("wrap",!1);c("localSpace",!1);c("wrapBounds",null);c("colorMap",L.DEFAULT_PARAM_TEXTURE);c("normalMap",null);c("loop",!0);c("preWarm",!1);c("sort",pc.PARTICLESORT_NONE);c("mode",pc.PARTICLEMODE_GPU); -c("scene",null);c("lighting",!1);c("halfLambert",!1);c("intensity",1);c("stretch",0);c("alignToMotion",!1);c("depthSoftening",0);c("mesh",null);c("particleNormal",new pc.Vec3(0,1,0));c("orientation",pc.PARTICLEORIENTATION_SCREEN);c("depthWrite",!1);c("noFog",!1);c("blendType",pc.BLEND_NORMAL);c("node",null);c("startAngle",0);c("startAngle2",this.startAngle);c("animTilesX",1);c("animTilesY",1);c("animNumFrames",1);c("animSpeed",1);c("animLoop",!0);this.frameRandomUniform=new Float32Array(3);this.emitterPosUniform= -new Float32Array(3);this.wrapBoundsUniform=new Float32Array(3);this.emitterScaleUniform=new Float32Array([1,1,1]);c("colorGraph",m);c("colorGraph2",this.colorGraph);c("scaleGraph",n);c("scaleGraph2",this.scaleGraph);c("alphaGraph",n);c("alphaGraph2",this.alphaGraph);c("localVelocityGraph",q);c("localVelocityGraph2",this.localVelocityGraph);c("velocityGraph",q);c("velocityGraph2",this.velocityGraph);c("rotationSpeedGraph",k);c("rotationSpeedGraph2",this.rotationSpeedGraph);c("radialSpeedGraph",k); -c("radialSpeedGraph2",this.radialSpeedGraph);this.constantParticleTexIN=a.scope.resolve("particleTexIN");this.constantParticleTexOUT=a.scope.resolve("particleTexOUT");this.constantEmitterPos=a.scope.resolve("emitterPos");this.constantEmitterScale=a.scope.resolve("emitterScale");this.constantSpawnBounds=a.scope.resolve("spawnBounds");this.constantSpawnPosInnerRatio=a.scope.resolve("spawnPosInnerRatio");this.constantSpawnBoundsSphere=a.scope.resolve("spawnBoundsSphere");this.constantSpawnBoundsSphereInnerRatio= -a.scope.resolve("spawnBoundsSphereInnerRatio");this.constantInitialVelocity=a.scope.resolve("initialVelocity");this.constantFrameRandom=a.scope.resolve("frameRandom");this.constantDelta=a.scope.resolve("delta");this.constantRate=a.scope.resolve("rate");this.constantRateDiv=a.scope.resolve("rateDiv");this.constantLifetime=a.scope.resolve("lifetime");this.constantLightCube=a.scope.resolve("lightCube[0]");this.constantGraphSampleSize=a.scope.resolve("graphSampleSize");this.constantGraphNumSamples=a.scope.resolve("graphNumSamples"); -this.constantInternalTex0=a.scope.resolve("internalTex0");this.constantInternalTex1=a.scope.resolve("internalTex1");this.constantInternalTex2=a.scope.resolve("internalTex2");this.constantInternalTex3=a.scope.resolve("internalTex3");this.constantEmitterMatrix=a.scope.resolve("emitterMatrix");this.constantEmitterMatrixInv=a.scope.resolve("emitterMatrixInv");this.constantNumParticles=a.scope.resolve("numParticles");this.constantNumParticlesPot=a.scope.resolve("numParticlesPot");this.constantLocalVelocityDivMult= -a.scope.resolve("localVelocityDivMult");this.constantVelocityDivMult=a.scope.resolve("velocityDivMult");this.constantRotSpeedDivMult=a.scope.resolve("rotSpeedDivMult");this.constantSeed=a.scope.resolve("seed");this.constantStartAngle=a.scope.resolve("startAngle");this.constantStartAngle2=a.scope.resolve("startAngle2");this.constantOutBoundsMul=a.scope.resolve("outBoundsMul");this.constantOutBoundsAdd=a.scope.resolve("outBoundsAdd");this.constantInBoundsSize=a.scope.resolve("inBoundsSize");this.constantInBoundsCenter= -a.scope.resolve("inBoundsCenter");this.constantMaxVel=a.scope.resolve("maxVel");this.constantFaceTangent=a.scope.resolve("faceTangent");this.constantFaceBinorm=a.scope.resolve("faceBinorm");this.lightCube=new Float32Array(18);this.lightCubeDir=Array(6);this.lightCubeDir[0]=new pc.Vec3(-1,0,0);this.lightCubeDir[1]=new pc.Vec3(1,0,0);this.lightCubeDir[2]=new pc.Vec3(0,-1,0);this.lightCubeDir[3]=new pc.Vec3(0,1,0);this.lightCubeDir[4]=new pc.Vec3(0,0,-1);this.lightCubeDir[5]=new pc.Vec3(0,0,1);this.animParams= -new Float32Array(4);this.camera=this.particleDistance=this.vbOld=this.vbToSort=this.colorParam=this.internalTex2=this.internalTex1=this.internalTex0=null;this.swapTex=!1;this.useMesh=!0;this.useCpu=!1;this.pack8=!0;this.localBounds=new pc.BoundingBox;this.worldBoundsNoTrail=new pc.BoundingBox;this.worldBoundsTrail=[new pc.BoundingBox,new pc.BoundingBox];this.worldBounds=new pc.BoundingBox;this.inBoundsCenterUniform=new Float32Array(3);this.worldBoundsSize=new pc.Vec3;this.inBoundsSizeUniform=new Float32Array(3); -this.prevWorldBoundsSize=new pc.Vec3;this.prevWorldBoundsCenter=new pc.Vec3;this.worldBoundsMul=new pc.Vec3;this.worldBoundsMulUniform=new Float32Array(3);this.worldBoundsAdd=new pc.Vec3;this.worldBoundsAddUniform=new Float32Array(3);this.timeToSwitchBounds=0;this.shaderParticleUpdateOnStop=this.shaderParticleUpdateNoRespawn=this.shaderParticleUpdateRespawn=null;this.numParticleIndices=this.numParticleVerts=0;this.meshInstance=this.material=null;this.seed=0;this.fixedTimeStep=1/60;this.maxSubSteps= -10;this.simTimeTotal=this.simTime=0;this.beenReset=!1;this._layer=null;this.rebuild()};Object.assign(L.prototype,{onChangeCamera:function(){this.regenShader();this.resetMaterial()},calculateBoundsMad:function(){this.worldBoundsMul.x=1/this.worldBoundsSize.x;this.worldBoundsMul.y=1/this.worldBoundsSize.y;this.worldBoundsMul.z=1/this.worldBoundsSize.z;this.worldBoundsAdd.copy(this.worldBounds.center).mul(this.worldBoundsMul).scale(-1);this.worldBoundsAdd.x+=.5;this.worldBoundsAdd.y+=.5;this.worldBoundsAdd.z+= -.5},calculateWorldBounds:function(){if(this.node){this.prevWorldBoundsSize.copy(this.worldBoundsSize);this.prevWorldBoundsCenter.copy(this.worldBounds.center);this.worldBoundsNoTrail.setFromTransformedAabb(this.localBounds,this.localSpace?pc.Mat4.IDENTITY:this.node.getWorldTransform());this.worldBoundsTrail[0].add(this.worldBoundsNoTrail);this.worldBoundsTrail[1].add(this.worldBoundsNoTrail);var a=this.simTimeTotal;a>this.timeToSwitchBounds&&(this.worldBoundsTrail[0].copy(this.worldBoundsTrail[1]), -this.worldBoundsTrail[1].copy(this.worldBoundsNoTrail),this.timeToSwitchBounds=a+this.lifetime);this.worldBounds.copy(this.worldBoundsTrail[0]);this.worldBoundsSize.copy(this.worldBounds.halfExtents).scale(2);this.meshInstance.mesh.aabb=this.worldBounds;this.meshInstance._aabbVer=1-this.meshInstance._aabbVer;this.pack8&&this.calculateBoundsMad()}},calculateLocalBounds:function(){var a=Number.MAX_VALUE,b=Number.MAX_VALUE,c=Number.MAX_VALUE,d=-Number.MAX_VALUE,f=-Number.MAX_VALUE,g=-Number.MAX_VALUE, -e=0,h=0,l=this.lifetime/this.precision,k=[this.qVelocity,this.qVelocity2,this.qLocalVelocity,this.qLocalVelocity2],p=[0,0,0,0],m=[0,0,0,0],n=[0,0,0,0],q=[0,0],r,t,u,v,w,x;for(r=0;rt;t++)v=k[t][3*u]*l+p[t],w=k[t][3*u+1]*l+m[t],x=k[t][3*u+2]*l+n[t],a>v&&(a=v),b>w&&(b=w),c>x&&(c=x),dpc.PARTICLESORT_NONE||1>=b.maxVertexTextures||64>b.fragmentUniformsCount||b.forceCpuParticles||!b.extTextureFloat;this._destroyResources();this.pack8=(this.pack8||!b.textureFloatRenderable)&&!this.useCpu;r=this.useCpu||this.pack8?4:2;this.useMesh=!1;this.mesh&&(65535h;h++)F.data[h]=e.data[h];I.copy(F);I.invert();N=this.meshInstance.node.localScale;K=Math.max(Math.max(N.x,N.y),N.z)}h=null===this.meshInstance.node||this.localSpace?pc.Vec3.ZERO:this.meshInstance.node.getPosition(); -var p=this.camera?this.camera._node.getPosition():pc.Vec3.ZERO,m=this.useMesh?16:14,n,q,r,U,O,L,Q,P,Y=this.precision-1;for(e=0;ega&&(this.particleTex[4*T+3+8*this.numParticlesPot]=-1):(ga>=ha&&(ga-=Math.max(ha,(this.numParticles-1)*ja),this.particleTex[4*T+3+8*this.numParticlesPot]=this.loop?1:-1),0>ga&&this.loop&&(this.particleTex[4*T+3+8*this.numParticlesPot]=1));0>this.particleTex[4*T+3+8*this.numParticlesPot]&&(ma=!1);this.particleTex[4*T+3+4*this.numParticlesPot]=ga;for(r=0;rpc.PARTICLESORT_NONE&&this.camera){k=this.useMesh?6:4;h=this.particleDistance;for(e=0;ethis.endTime){if(this.onFinished)this.onFinished();this.meshInstance.visible=!1}},_destroyResources:function(){this.particleTexIN&& -(this.particleTexIN.destroy(),this.particleTexIN=null);this.particleTexOUT&&(this.particleTexOUT.destroy(),this.particleTexOUT=null);this.particleTexStart&&this.particleTexStart.destroy&&(this.particleTexStart.destroy(),this.particleTexStart=null);this.rtParticleTexIN&&(this.rtParticleTexIN.destroy(),this.rtParticleTexIN=null);this.rtParticleTexOUT&&(this.rtParticleTexOUT.destroy(),this.rtParticleTexOUT=null);this.internalTex0&&(this.internalTex0.destroy(),this.internalTex0=null);this.internalTex1&& -(this.internalTex1.destroy(),this.internalTex1=null);this.internalTex2&&(this.internalTex2.destroy(),this.internalTex2=null);this.internalTex3&&(this.internalTex3.destroy(),this.internalTex3=null);this.colorParam&&(this.colorParam.destroy(),this.colorParam=null);this.vertexBuffer&&(this.vertexBuffer.destroy(),this.vertexBuffer=void 0);this.indexBuffer&&(this.indexBuffer.destroy(),this.indexBuffer=void 0);this.material&&(this.material.destroy(),this.material=null)},destroy:function(){this.camera=null; -this._destroyResources()}});return{ParticleEmitter:L}}());Object.assign(pc,function(){var e=!1,b=function(a,b,d){a instanceof pc.GraphicsDevice&&(a=pc.Application.getApplication(),e||(e=!0));this.app=a;var c=this.device=a.graphicsDevice;this.library=c.getProgramLibrary();this.pickColor=new Float32Array(4);this.pickColor[3]=1;this.scene=null;this.drawCalls=[];this.layerComp=this.layer=null;this.clearOptions={color:[1,1,1,1],depth:1,flags:pc.CLEARFLAG_COLOR|pc.CLEARFLAG_DEPTH};var g=this;this._clearDepthOptions={depth:1,flags:pc.CLEARFLAG_DEPTH};this.clearDepthCommand= -new pc.Command(0,0,function(){c.clear(g._clearDepthOptions)});this.resize(b,d);this._ignoreOpacityFor=null};b.prototype.getSelection=function(a,b,d,f){var c=this.device;"object"===typeof a?(f=a,a=f.x,b=f.y,d=f.width,f=f.height):b=this.layer.renderTarget.height-(b+(f||1));d=d||1;f=f||1;var e=c.renderTarget;c.setRenderTarget(this.layer.renderTarget);c.updateBegin();var h=new Uint8Array(4*d*f);c.readPixels(a,b,d,f,h);c.updateEnd();c.setRenderTarget(e);a=[];b=this.layer.instances.visibleOpaque[0].list; -for(var p,k,c=0;c>16&255)/255;e.pickColor[1]=(b>>8&255)/255;e.pickColor[2]= -(b&255)/255;k.setValue(e.pickColor);c.setBlending(!1)}});this.layerComp=new pc.LayerComposition;this.layerComp.pushOpaque(this.layer);this.meshInstances=this.layer.opaqueMeshInstances;this._instancesVersion=-1}var n,q,m;if(!h){this.layer.clearMeshInstances();d=b.layers.layerList;var r=b.layers.subLayerEnabled,t=b.layers.subLayerList;for(b=0;bn)))for(g.overrideClear&&g._clearDepthBuffer&&!g._pickerCleared&&(this.meshInstances.push(this.clearDepthCommand),g._pickerCleared=!0),n=(n=t[b])?g.instances.transparentMeshInstances:g.instances.opaqueMeshInstances,q=n.length,g=0;ga.dot(v)?-1:1;return K}; -pc.createMesh=function(e,b,a){var c=a&&void 0!==a.normals?a.normals:null,d=a&&void 0!==a.tangents?a.tangents:null,f=a&&void 0!==a.colors?a.colors:null,g=a&&void 0!==a.uvs?a.uvs:null,l=a&&void 0!==a.uvs1?a.uvs1:null,h=a&&void 0!==a.indices?a.indices:null,p=a&&void 0!==a.blendIndices?a.blendIndices:null,k=a&&void 0!==a.blendWeights?a.blendWeights:null;a=[{semantic:pc.SEMANTIC_POSITION,components:3,type:pc.TYPE_FLOAT32}];null!==c&&a.push({semantic:pc.SEMANTIC_NORMAL,components:3,type:pc.TYPE_FLOAT32}); -null!==d&&a.push({semantic:pc.SEMANTIC_TANGENT,components:4,type:pc.TYPE_FLOAT32});null!==f&&a.push({semantic:pc.SEMANTIC_COLOR,components:4,type:pc.TYPE_UINT8,normalize:!0});null!==g&&a.push({semantic:pc.SEMANTIC_TEXCOORD0,components:2,type:pc.TYPE_FLOAT32});null!==l&&a.push({semantic:pc.SEMANTIC_TEXCOORD1,components:2,type:pc.TYPE_FLOAT32});null!==p&&a.push({semantic:pc.SEMANTIC_BLENDINDICES,components:2,type:pc.TYPE_UINT8});null!==k&&a.push({semantic:pc.SEMANTIC_BLENDWEIGHT,components:2,type:pc.TYPE_FLOAT32}); -var n=new pc.VertexFormat(e,a);a=b.length/3;for(var n=new pc.VertexBuffer(e,n,a),q=new pc.VertexIterator(n),m=0;mf.indexOf(d)&&f.push(d),!b&&d.castShadow&&0>e.indexOf(d)&&e.push(d),!this.passThrough&&0<=c&&g._shaderVersion!==c&&(g.updateShader!==pc.Material.prototype.updateShader&&(g.clearVariants(),g.shader=null),g._shaderVersion=c);this.passThrough||(this._dirty=!0)};p.prototype.removeMeshInstances=function(a,b){var c,d,f,g,e,h,l,k=this.opaqueMeshInstances, -p=this.transparentMeshInstances,n=this.shadowCasters;for(c=0;cg&&(g=d),e++;else if(0<=g)break}0<=g&&k.splice(g,e);g=-1;e=0;h=p.length;for(d=0;dg&&(g=d),e++;else if(0<=g)break}0<=g&&p.splice(g,e);b||(d=n.indexOf(f),0<=d&&n.splice(d,1))}this._dirty=!0};p.prototype.clearMeshInstances=function(a){if(0!==this.opaqueMeshInstances.length|| -0!==this.transparentMeshInstances.length||!a&&0!==this.shadowCasters.length)this.opaqueMeshInstances.length=0,this.transparentMeshInstances.length=0,a||(this.shadowCasters.length=0),this.passThrough||(this._dirty=!0)};p.prototype.addLight=function(a){0<=this._lightComponents.indexOf(a)||(this._lightComponents.push(a),this._lights.push(a.light),this._dirtyLights=!0,this._generateLightHash())};p.prototype.removeLight=function(a){var b=this._lightComponents.indexOf(a);0>b||(this._lightComponents.splice(b, -1),b=this._lights.indexOf(a.light),this._lights.splice(b,1),this._dirtyLights=!0,this._generateLightHash())};p.prototype.clearLights=function(){this._lightComponents.length=0;this._lights.length=0;this._dirtyLights=!0};p.prototype.addShadowCasters=function(a){for(var b,c=this.shadowCasters,d=0;dc.indexOf(b)&&c.push(b);this._dirtyLights=!0};p.prototype.removeShadowCasters=function(a){for(var b,c=this.shadowCasters,d=0;da||(this.cameras.splice(a,1),this._generateCameraHash(),this.instances.clearVisibleLists(a))};p.prototype.clearCameras=function(){this._cameraHash=this.cameras.length=0;this._dirtyCameras=!0};p.prototype._sortCameras= -function(){this._generateCameraHash()};p.prototype._calculateSortDistances=function(a,b,c,d){var f,g,e,h,l;for(f=0;fthis._meshInstances.indexOf(c)&&(this._meshInstances.push(c),c.material&&c.material._dirtyBlend&&(this._dirtyBlend=!0,c.material._dirtyBlend=!1));e=d.transparentMeshInstances;for(a=0;athis._meshInstances.indexOf(c)&&(this._meshInstances.push(c), -c.material&&c.material._dirtyBlend&&(this._dirtyBlend=!0,c.material._dirtyBlend=!1))}for(b=0;bc&&(this._lights.push(h),c=this._lights.length- -1),(h=this._lightShadowCasters[c])||(this._lightShadowCasters[c]=[]);if(this._dirtyLights)for(this._sortLights(this),this._dirtyLights=!1,b=0;bthis._meshInstances.indexOf(h[c])?(h[c]=h[h.length-1],--h.length):c++;for(c=0;ch.indexOf(p[c])&&h.push(p[c])}if(g& -pc.COMPUPDATED_LIGHTS||this._dirtyCameras)for(this._globalLightCameras.length=0,e=this._sortedLights[pc.LIGHTTYPE_DIRECTIONAL],a=0;ad._sortedLights[pc.LIGHTTYPE_DIRECTIONAL].indexOf(h)))for(c=0;cc&&this.cameras.push(e);this._renderList.length=0;for(b=c=this._renderListCamera.length=0;bc||e.push(c);this._globalLightCameraIds.push(e)}return g}; -e.prototype._isLayerAdded=function(b){return 0<=this.layerList.indexOf(b)?!0:!1};e.prototype._isSublayerAdded=function(b,a){for(var c=0;cthis.layerList.indexOf(b)&&this.fire("remove",b);break}};e.prototype.pushTransparent=function(b){this._isSublayerAdded(b,!0)||(this.layerList.push(b),this._transparentOrder[b.id]=this.subLayerList.push(!0)-1,this.subLayerEnabled.push(!0),this._dirtyCameras=this._dirtyLights=this._dirty=!0,this.fire("add",b))};e.prototype.insertTransparent=function(b,a){this._isSublayerAdded(b, -!0)||(this.layerList.splice(a,0,b),this.subLayerList.splice(a,0,!0),this._updateTransparentOrder(a,this.subLayerList.length-1),this.subLayerEnabled.splice(a,0,!0),this._dirtyCameras=this._dirtyLights=this._dirty=!0,this.fire("add",b))};e.prototype.removeTransparent=function(b){for(var a=0,c=this.layerList.length;athis.layerList.indexOf(b)&&this.fire("remove",b);break}};e.prototype._getSublayerIndex=function(b,a){var c=this.layerList.indexOf(b);return 0>c||this.subLayerList[c]!==a&&(c=this.layerList.indexOf(b,c+1),0>c||this.subLayerList[c]!==a)?-1:c};e.prototype.getOpaqueIndex=function(b){return this._getSublayerIndex(b,!1)};e.prototype.getTransparentIndex=function(b){return this._getSublayerIndex(b,!0)};e.prototype.getLayerById=function(b){for(var a=0;a=b;b++)for(h=0===b||3===b?0:1,f=0;3>=f;f++)g=-a.x+2*a.x*(1>=b?0:3)/3,e=-(-a.y+2*a.y*(1>=f?0:3)/3),p=0===f||3===f?0:1,k.push(-g,0,e),n.push(0,1,0),q.push(h,p),3>b&&3>f&&(m.push(r+3+1,r+1,r),m.push(r+3+1,r+3+2,r+1)),r++;return pc.createMesh(this._device,k,{normals:n,uvs:q,indices:m})};a.prototype._onSetFrames=function(a){this._updatingProperties?this._meshesDirty=!0:this._createMeshes()};a.prototype._onFrameChanged=function(a,b){var c=this._frameKeys.indexOf(a); -0>c||(b?this.renderMode===pc.SPRITE_RENDERMODE_SIMPLE&&(this._meshes[c]=this._createSimpleMesh(b)):this._meshes[c]=null,this.fire("set:meshes"))};a.prototype._onFrameRemoved=function(a){a=this._frameKeys.indexOf(a);0>a||(this._meshes[a]=null,this.fire("set:meshes"))};a.prototype.startUpdate=function(){this._updatingProperties=!0;this._meshesDirty=!1};a.prototype.endUpdate=function(){this._updatingProperties=!1;this._meshesDirty&&this._atlas&&this._frameKeys&&this._createMeshes();this._meshesDirty= -!1};a.prototype.destroy=function(){var a,b;a=0;for(b=this._meshes.length;af?b(a,c,g,f):a[g]b)for(this._time=this.looping?0:b,b=0;bthis._time)for(this._time=this.looping?b:0,b=0;b=this._time){p=(this._time-e.time)/(h.time-e.time);g._pos.lerp(e.position,h.position,p);g._quat.slerp(e.rotation,h.rotation,p);g._scale.lerp(e.scale,h.scale,p);g._written=!0;this._currKeyIndices[f]=n;p=!0;break}if(1=== -d.length||!p&&0===this._time&&this.looping)g._pos.copy(d[0].position),g._quat.copy(d[0].rotation),g._scale.copy(d[0].scale),g._written=!0}}}};b.prototype.blend=function(a,b,d){for(var c=this._interpolatedKeys.length,g=0;gb))if(0===this._state){this.stop();var a=this._suspendInstanceEvents;this._suspendInstanceEvents=!0;this._startOffset=b;this.play();this._suspendInstanceEvents=a}else this._currentTime=this._startOffset=b}})):pc.SoundManager.hasAudio()?(e=function(b,a,c){pc.events.attach(this);c=c||{};this._volume= -void 0!==c.volume?pc.math.clamp(Number(c.volume)||0,0,1):1;this._pitch=void 0!==c.pitch?Math.max(.01,Number(c.pitch)||0):1;this._loop=!(void 0===c.loop||!c.loop);this._sound=a;this._state=2;this._suspendInstanceEvents=this._suspendEndEvent=this._suspended=!1;this._playWhenLoaded=!0;this._startTime=Math.max(0,Number(c.startTime)||0);this._duration=Math.max(0,Number(c.duration)||0);this._startOffset=null;this._isReady=!1;this._manager=b;this._loadedMetadataHandler=this._onLoadedMetadata.bind(this); -this._timeUpdateHandler=this._onTimeUpdate.bind(this);this._endedHandler=this._onEnded.bind(this);this._onPlayCallback=c.onPlay;this._onPauseCallback=c.onPause;this._onResumeCallback=c.onResume;this._onStopCallback=c.onStop;this._onEndCallback=c.onEnd;this.source=null;this._createSource()},Object.assign(e.prototype,{play:function(){2!==this._state&&this.stop();if(!this.source&&!this._createSource())return!1;this.volume=this._volume;this.pitch=this._pitch;this.loop=this._loop;this.source.play();this._state= -0;this._playWhenLoaded=!1;this._manager.on("volumechange",this._onManagerVolumeChange,this);this._manager.on("suspend",this._onManagerSuspend,this);this._manager.on("resume",this._onManagerResume,this);this._manager.on("destroy",this._onManagerDestroy,this);this._manager.suspended&&this._onManagerSuspend();this._suspendInstanceEvents||this._onPlay();return!0},pause:function(){if(!this.source||0!==this._state)return!1;this._suspendEndEvent=!0;this.source.pause();this._playWhenLoaded=!1;this._state= -1;this._startOffset=null;this._suspendInstanceEvents||this._onPause();return!0},resume:function(){if(!this.source||1!==this._state)return!1;this._state=0;this._playWhenLoaded=!1;this.source.paused&&(this.source.play(),this._suspendInstanceEvents||this._onResume());return!0},stop:function(){if(!this.source||2===this._state)return!1;this._manager.off("volumechange",this._onManagerVolumeChange,this);this._manager.off("suspend",this._onManagerSuspend,this);this._manager.off("resume",this._onManagerResume, -this);this._manager.off("destroy",this._onManagerDestroy,this);this._suspendEndEvent=!0;this.source.pause();this._playWhenLoaded=!1;this._state=2;this._startOffset=null;this._suspendInstanceEvents||this._onStop();return!0},setExternalNodes:function(){},clearExternalNodes:function(){},getExternalNodes:function(){return[null,null]},_onLoadedMetadata:function(){this.source.removeEventListener("loadedmetadata",this._loadedMetadataHandler);this._isReady=!0;var b=this._startOffset%this.duration||0,b=(this._startTime+ -b)%this._sound.duration||0;this._startOffset=null;this.source.currentTime=b},_createSource:function(){this._sound&&this._sound.audio&&(this._isReady=!1,this.source=this._sound.audio.cloneNode(!0),this.source.addEventListener("loadedmetadata",this._loadedMetadataHandler),this.source.addEventListener("timeupdate",this._timeUpdateHandler),this.source.onended=this._endedHandler);return this.source},_onTimeUpdate:function(){this._duration&&this.source.currentTime>((this._startTime+this._duration)%this.source.duration|| -0)&&(this.loop?this.source.currentTime=this._startTime%this.source.duration||0:(this.source.removeEventListener("timeupdate",this._timeUpdateHandler),this.source.pause(),this._onEnded()))},_onManagerDestroy:function(){this.source&&this.source.pause()}}),Object.defineProperty(e.prototype,"volume",{get:function(){return this._volume},set:function(b){this._volume=b=pc.math.clamp(b,0,1);this.source&&(this.source.volume=b*this._manager.volume)}}),Object.defineProperty(e.prototype,"pitch",{get:function(){return this._pitch}, -set:function(b){this._pitch=Math.max(Number(b)||0,.01);this.source&&(this.source.playbackRate=this._pitch)}}),Object.defineProperty(e.prototype,"loop",{get:function(){return this._loop},set:function(b){this._loop=!!b;this.source&&(this.source.loop=this._loop)}}),Object.defineProperty(e.prototype,"sound",{get:function(){return this._sound},set:function(b){this.stop();this._sound=b}}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return null!==this._startOffset?this._startOffset:2!== -this._state&&this.source?this.source.currentTime-this._startTime:0},set:function(b){0>b||(this._startOffset=b,this.source&&this._isReady&&(this.source.currentTime=(this._startTime+(b%this.duration||0))%this._sound.duration||0,this._startOffset=null))}})):e=function(){};Object.assign(e.prototype,{_onPlay:function(){this.fire("play");this._onPlayCallback&&this._onPlayCallback(this)},_onPause:function(){this.fire("pause");this._onPauseCallback&&this._onPauseCallback(this)},_onResume:function(){this.fire("resume"); -this._onResumeCallback&&this._onResumeCallback(this)},_onStop:function(){this.fire("stop");this._onStopCallback&&this._onStopCallback(this)},_onEnded:function(){this._suspendEndEvent?this._suspendEndEvent=!1:(this.fire("end"),this._onEndCallback&&this._onEndCallback(this),this.stop())},_onManagerVolumeChange:function(){this.volume=this._volume},_onManagerSuspend:function(){0!==this._state||this._suspended||(this._suspended=!0,this.pause())},_onManagerResume:function(){this._suspended&&(this._suspended= -!1,this.resume())}});Object.defineProperty(e.prototype,"startTime",{get:function(){return this._startTime},set:function(b){this._startTime=Math.max(0,Number(b)||0);b=0===this._state;this.stop();b&&this.play()}});Object.defineProperty(e.prototype,"duration",{get:function(){return this._sound?this._duration?this._duration%this._sound.duration||0:this._sound.duration:0},set:function(b){this._duration=Math.max(0,Number(b)||0);b=0===this._state;this.stop();b&&this.play()}});Object.defineProperty(e.prototype, -"isPlaying",{get:function(){return 0===this._state}});Object.defineProperty(e.prototype,"isPaused",{get:function(){return 1===this._state}});Object.defineProperty(e.prototype,"isStopped",{get:function(){return 2===this._state}});Object.defineProperty(e.prototype,"isSuspended",{get:function(){return this._suspended}});return{SoundInstance:e}}());Object.assign(pc,function(){var e;if(pc.SoundManager.hasAudioContext())e=function(a,b,d){pc.SoundInstance.call(this,a,b,d);d=d||{};this._position=new pc.Vec3;d.position&&(this.position=d.position);this._velocity=new pc.Vec3;d.velocity&&(this.velocity=d.velocity);this.maxDistance=void 0!==d.maxDistance?Number(d.maxDistance):1E4;this.refDistance=void 0!==d.refDistance?Number(d.refDistance):1;this.rollOffFactor=void 0!==d.rollOffFactor?Number(d.rollOffFactor):1;this.distanceModel=void 0!==d.distanceModel? -d.distanceModel:pc.DISTANCE_LINEAR},e.prototype=Object.create(pc.SoundInstance.prototype),e.prototype.constructor=e,Object.assign(e.prototype,{_initializeNodes:function(){this.gain=this._manager.context.createGain();this.panner=this._manager.context.createPanner();this.panner.connect(this.gain);this._inputNode=this.panner;this._connectorNode=this.gain;this._connectorNode.connect(this._manager.context.destination)}}),Object.defineProperty(e.prototype,"position",{get:function(){return this._position}, -set:function(a){this._position.copy(a);this.panner.setPosition(a.x,a.y,a.z)}}),Object.defineProperty(e.prototype,"velocity",{get:function(){return this._velocity},set:function(a){this._velocity.copy(a);this.panner.setVelocity(a.x,a.y,a.z)}}),Object.defineProperty(e.prototype,"maxDistance",{get:function(){return this.panner.maxDistance},set:function(a){this.panner.maxDistance=a}}),Object.defineProperty(e.prototype,"refDistance",{get:function(){return this.panner.refDistance},set:function(a){this.panner.refDistance= -a}}),Object.defineProperty(e.prototype,"rollOffFactor",{get:function(){return this.panner.rolloffFactor},set:function(a){this.panner.rolloffFactor=a}}),Object.defineProperty(e.prototype,"distanceModel",{get:function(){return this.panner.distanceModel},set:function(a){this.panner.distanceModel=a}});else if(pc.SoundManager.hasAudio()){var b=new pc.Vec3;e=function(a,b,d){pc.SoundInstance.call(this,a,b,d);d=d||{};this._position=new pc.Vec3;d.position&&(this.position=d.position);this._velocity=new pc.Vec3; -d.velocity&&(this.velocity=d.velocity);this._maxDistance=void 0!==d.maxDistance?Number(d.maxDistance):1E4;this._refDistance=void 0!==d.refDistance?Number(d.refDistance):1;this._rollOffFactor=void 0!==d.rollOffFactor?Number(d.rollOffFactor):1;this._distanceModel=void 0!==d.distanceModel?d.distanceModel:pc.DISTANCE_LINEAR};e.prototype=Object.create(pc.SoundInstance.prototype);e.prototype.constructor=e;Object.defineProperty(e.prototype,"position",{get:function(){return this._position},set:function(a){this._position.copy(a); -if(this.source){var c=this._manager.listener.getPosition();a=this.refDistance;var d=this.maxDistance,f=this.rollOffFactor,g=this.distanceModel;b=b.sub2(c,this._position);c=b.length();if(cd)a=0;else{var e=0;g===pc.DISTANCE_LINEAR?e=1-f*(c-a)/(d-a):g===pc.DISTANCE_INVERSE?e=a/(a+f*(c-a)):g===pc.DISTANCE_EXPONENTIAL&&(e=Math.pow(c/a,-f));a=pc.math.clamp(e,0,1)}this.source.volume=this.volume*a*this._manager.volume}}});Object.defineProperty(e.prototype,"velocity",{get:function(){return this._velocity}, -set:function(a){this._velocity.copy(a)}});Object.defineProperty(e.prototype,"maxDistance",{get:function(){return this._maxDistance},set:function(a){this._maxDistance=a}});Object.defineProperty(e.prototype,"refDistance",{get:function(){return this._refDistance},set:function(a){this._refDistance=a}});Object.defineProperty(e.prototype,"rollOffFactor",{get:function(){return this._rollOffFactor},set:function(a){this._rollOffFactor=a}});Object.defineProperty(e.prototype,"distanceModel",{get:function(){return this._distanceModel}, -set:function(a){this._distanceModel=a}})}else e=function(){};return{SoundInstance3d:e}}());Object.assign(pc,function(){var e;pc.AudioManager.hasAudioContext()?(e=function(b,a,c){c=c||{};this.volume=void 0===c.volume?1:c.volume;this.loop=void 0===c.loop?!1:c.loop;this.pitch=void 0===c.pitch?1:c.pitch;this.sound=a;this.suspended=this.paused=!1;this.startOffset=this.startTime=0;this.manager=b;this.source=null;this.gain=b.context.createGain()},Object.assign(e.prototype,{play:function(){if(this.source)throw Error("Call stop() before calling play()");this._createSource();if(this.source&&(this.startTime= -this.manager.context.currentTime,this.source.start(0,this.startOffset%this.source.buffer.duration),this.setVolume(this.volume),this.setLoop(this.loop),this.setPitch(this.pitch),this.manager.on("volumechange",this.onManagerVolumeChange,this),this.manager.on("suspend",this.onManagerSuspend,this),this.manager.on("resume",this.onManagerResume,this),this.manager.suspended))this.onManagerSuspend()},pause:function(){this.source&&(this.paused=!0,this.startOffset+=this.manager.context.currentTime-this.startTime, -this.source.stop(0),this.source=null)},unpause:function(){this.source||!this.paused?console.warn("Call pause() before unpausing."):(this._createSource(),this.source&&(this.startTime=this.manager.context.currentTime,this.source.start(0,this.startOffset%this.source.buffer.duration),this.setVolume(this.volume),this.setLoop(this.loop),this.setPitch(this.pitch),this.paused=!1))},stop:function(){this.source&&(this.source.stop(0),this.source=null);this.manager.off("volumechange",this.onManagerVolumeChange, -this);this.manager.off("suspend",this.onManagerSuspend,this);this.manager.off("resume",this.onManagerResume,this)},setLoop:function(b){this.loop=b;this.source&&(this.source.loop=b)},setVolume:function(b){this.volume=b=pc.math.clamp(b,0,1);this.gain&&(this.gain.gain.value=b*this.manager.volume)},setPitch:function(b){this.pitch=b;this.source&&(this.source.playbackRate.value=b)},isPlaying:function(){return!this.paused&&this.source.playbackState===this.source.PLAYING_STATE},getDuration:function(){return this.source? -this.source.buffer.duration:0},_createSource:function(){var b=this.manager.context;this.sound.buffer&&(this.source=b.createBufferSource(),this.source.buffer=this.sound.buffer,this.source.connect(this.gain),this.gain.connect(b.destination),this.loop||(this.source.onended=this.pause.bind(this)))}})):pc.AudioManager.hasAudio()?(e=function(b,a,c){this.volume=c.volume||1;this.loop=c.loop||!1;this.sound=a;this.pitch=void 0!==c.pitch?c.pitch:1;this.suspended=this.paused=!1;this.manager=b;a.audio&&(this.source= -a.audio.cloneNode(!1),this.source.pause())},Object.assign(e.prototype,{play:function(){this.source&&(this.paused=!1,this.setVolume(this.volume),this.setLoop(this.loop),this.setPitch(this.pitch),this.source.play());this.manager.on("volumechange",this.onManagerVolumeChange,this);this.manager.on("suspend",this.onManagerSuspend,this);this.manager.on("resume",this.onManagerResume,this);if(this.manager.suspended)this.onManagerSuspend()},pause:function(){this.source&&(this.paused=!0,this.source.pause())}, -unpause:function(){this.source&&(this.paused=!1,this.source.play())},stop:function(){this.source&&this.source.pause();this.manager.off("volumechange",this.onManagerVolumeChange,this);this.manager.off("suspend",this.onManagerSuspend,this);this.manager.off("resume",this.onManagerResume,this)},setVolume:function(b){this.volume=b=pc.math.clamp(b,0,1);this.source&&(this.source.volume=b*this.manager.volume)},setLoop:function(b){this.loop=b;this.source&&(this.source.loop=b)},setPitch:function(b){this.pitch= -b;this.source&&(this.source.playbackRate=b)},getDuration:function(){return this.source&&!isNaN(this.source.duration)?this.source.duration:0},isPlaying:function(){return!this.source.paused}})):e=function(){};Object.assign(e.prototype,{getVolume:function(){return this.volume},getLoop:function(){return this.loop},getPitch:function(){return this.pitch},onManagerVolumeChange:function(){this.setVolume(this.getVolume())},onManagerSuspend:function(){this.isPlaying()&&!this.suspended&&(this.suspended=!0,this.pause())}, -onManagerResume:function(){this.suspended&&(this.suspended=!1,this.unpause())}});return{Channel:e}}());Object.assign(pc,function(){var e;if(pc.AudioManager.hasAudioContext())e=function(a,b,d){pc.Channel.call(this,a,b,d);this.position=new pc.Vec3;this.velocity=new pc.Vec3;this.panner=a.context.createPanner()},e.prototype=Object.create(pc.Channel.prototype),e.prototype.constructor=e,Object.assign(e.prototype,{getPosition:function(){return this.position},setPosition:function(a){this.position.copy(a);this.panner.setPosition(a.x,a.y,a.z)},getVelocity:function(){return this.velocity},setVelocity:function(a){this.velocity.copy(a); -this.panner.setVelocity(a.x,a.y,a.z)},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(a){this.panner.maxDistance=a},getMinDistance:function(){return this.panner.refDistance},setMinDistance:function(a){this.panner.refDistance=a},getRollOffFactor:function(){return this.panner.rolloffFactor},setRollOffFactor:function(a){this.panner.rolloffFactor=a},getDistanceModel:function(){return this.pannel.distanceModel},setDistanceModel:function(a){this.panner.distanceModel=a}, -_createSource:function(){var a=this.manager.context;this.source=a.createBufferSource();this.source.buffer=this.sound.buffer;this.source.connect(this.panner);this.panner.connect(this.gain);this.gain.connect(a.destination);this.loop||(this.source.onended=this.pause.bind(this))}});else if(pc.AudioManager.hasAudio()){var b=new pc.Vec3;e=function(a,b){pc.Channel.call(this,a,b);this.position=new pc.Vec3;this.velocity=new pc.Vec3;this.maxDistance=1E4;this.rollOffFactor=this.minDistance=1;this.distanceModel= -pc.DISTANCE_INVERSE};e.prototype=Object.create(pc.Channel.prototype);e.prototype.constructor=e;Object.assign(e.prototype,{getPosition:function(){return this.position},setPosition:function(a){this.position.copy(a);if(this.source){var c=this.manager.listener.getPosition();a=this.minDistance;var d=this.maxDistance,f=this.rollOffFactor,g=this.distanceModel;b=b.sub2(c,this.position);c=b.length();if(cd)a=0;else{var e=0;g===pc.DISTANCE_LINEAR?e=1-f*(c-a)/(d-a):g===pc.DISTANCE_INVERSE?e= -a/(a+f*(c-a)):g===pc.DISTANCE_EXPONENTIAL&&(e=Math.pow(c/a,-f));a=pc.math.clamp(e,0,1)}d=this.getVolume();this.source.volume=d*a}},getVelocity:function(){return this.velocity},setVelocity:function(a){this.velocity.copy(a)},getMaxDistance:function(){return this.maxDistance},setMaxDistance:function(a){this.maxDistance=a},getMinDistance:function(){return this.minDistance},setMinDistance:function(a){this.minDistance=a},getRollOffFactor:function(){return this.rollOffFactor},setRollOffFactor:function(a){this.rollOffFactor= -a},getDistanceModel:function(){return this.distanceModel},setDistanceModel:function(a){this.distanceModel=a}})}else e=function(){};return{Channel3d:e}}());(function(){var e={ACTION_MOUSE:"mouse",ACTION_KEYBOARD:"keyboard",ACTION_GAMEPAD:"gamepad",AXIS_MOUSE_X:"mousex",AXIS_MOUSE_Y:"mousey",AXIS_PAD_L_X:"padlx",AXIS_PAD_L_Y:"padly",AXIS_PAD_R_X:"padrx",AXIS_PAD_R_Y:"padry",AXIS_KEY:"key",EVENT_KEYDOWN:"keydown",EVENT_KEYUP:"keyup",EVENT_MOUSEDOWN:"mousedown",EVENT_MOUSEMOVE:"mousemove",EVENT_MOUSEUP:"mouseup",EVENT_MOUSEWHEEL:"mousewheel",EVENT_TOUCHSTART:"touchstart",EVENT_TOUCHEND:"touchend",EVENT_TOUCHMOVE:"touchmove",EVENT_TOUCHCANCEL:"touchcancel", -KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ENTER:13,KEY_SHIFT:16,KEY_CONTROL:17,KEY_ALT:18,KEY_PAUSE:19,KEY_CAPS_LOCK:20,KEY_ESCAPE:27,KEY_SPACE:32,KEY_PAGE_UP:33,KEY_PAGE_DOWN:34,KEY_END:35,KEY_HOME:36,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_PRINT_SCREEN:44,KEY_INSERT:45,KEY_DELETE:46,KEY_0:48,KEY_1:49,KEY_2:50,KEY_3:51,KEY_4:52,KEY_5:53,KEY_6:54,KEY_7:55,KEY_8:56,KEY_9:57,KEY_SEMICOLON:59,KEY_EQUAL:61,KEY_A:65,KEY_B:66,KEY_C:67,KEY_D:68,KEY_E:69,KEY_F:70,KEY_G:71,KEY_H:72,KEY_I:73,KEY_J:74, -KEY_K:75,KEY_L:76,KEY_M:77,KEY_N:78,KEY_O:79,KEY_P:80,KEY_Q:81,KEY_R:82,KEY_S:83,KEY_T:84,KEY_U:85,KEY_V:86,KEY_W:87,KEY_X:88,KEY_Y:89,KEY_Z:90,KEY_WINDOWS:91,KEY_CONTEXT_MENU:93,KEY_NUMPAD_0:96,KEY_NUMPAD_1:97,KEY_NUMPAD_2:98,KEY_NUMPAD_3:99,KEY_NUMPAD_4:100,KEY_NUMPAD_5:101,KEY_NUMPAD_6:102,KEY_NUMPAD_7:103,KEY_NUMPAD_8:104,KEY_NUMPAD_9:105,KEY_MULTIPLY:106,KEY_ADD:107,KEY_SEPARATOR:108,KEY_SUBTRACT:109,KEY_DECIMAL:110,KEY_DIVIDE:111,KEY_F1:112,KEY_F2:113,KEY_F3:114,KEY_F4:115,KEY_F5:116,KEY_F6:117, -KEY_F7:118,KEY_F8:119,KEY_F9:120,KEY_F10:121,KEY_F11:122,KEY_F12:123,KEY_COMMA:188,KEY_PERIOD:190,KEY_SLASH:191,KEY_OPEN_BRACKET:219,KEY_BACK_SLASH:220,KEY_CLOSE_BRACKET:221,KEY_META:224,MOUSEBUTTON_NONE:-1,MOUSEBUTTON_LEFT:0,MOUSEBUTTON_MIDDLE:1,MOUSEBUTTON_RIGHT:2,PAD_1:0,PAD_2:1,PAD_3:2,PAD_4:3,PAD_FACE_1:0,PAD_FACE_2:1,PAD_FACE_3:2,PAD_FACE_4:3,PAD_L_SHOULDER_1:4,PAD_R_SHOULDER_1:5,PAD_L_SHOULDER_2:6,PAD_R_SHOULDER_2:7,PAD_SELECT:8,PAD_START:9,PAD_L_STICK_BUTTON:10,PAD_R_STICK_BUTTON:11,PAD_UP:12, -PAD_DOWN:13,PAD_LEFT:14,PAD_RIGHT:15,PAD_VENDOR:16,PAD_L_STICK_X:0,PAD_L_STICK_Y:1,PAD_R_STICK_X:2,PAD_R_STICK_Y:3};Object.assign(pc,e);pc.input={};Object.assign(pc.input,e)})();Object.assign(pc,function(){var e=function(a,b){var c={x:0,y:0};if(b){if(b instanceof e)throw Error("Expected MouseEvent");c=a._getTargetCoords(b)}else b={};if(c)this.x=c.x,this.y=c.y;else if(pc.Mouse.isPointerLocked())this.y=this.x=0;else return;this.wheel=b.detail?-1*b.detail:b.wheelDelta?b.wheelDelta/120:0;pc.Mouse.isPointerLocked()?(this.dx=b.movementX||b.webkitMovementX||b.mozMovementX||0,this.dy=b.movementY||b.webkitMovementY||b.mozMovementY||0):(this.dx=this.x-a._lastX,this.dy=this.y-a._lastY); -this.button="mousedown"===b.type||"mouseup"===b.type?b.button:pc.MOUSEBUTTON_NONE;this.buttons=a._buttons.slice(0);this.element=b.target;this.ctrlKey=b.ctrlKey||!1;this.altKey=b.altKey||!1;this.shiftKey=b.shiftKey||!1;this.metaKey=b.metaKey||!1;this.event=b},b=function(a){this._lastY=this._lastX=0;this._buttons=[!1,!1,!1];this._lastbuttons=[!1,!1,!1];this._upHandler=this._handleUp.bind(this);this._downHandler=this._handleDown.bind(this);this._moveHandler=this._handleMove.bind(this);this._wheelHandler= -this._handleWheel.bind(this);this._contextMenuHandler=function(a){a.preventDefault()};this._target=null;this._attached=!1;this.attach(a);pc.events.attach(this)};b.isPointerLocked=function(){return!!(document.pointerLockElement||document.mozPointerLockElement||document.webkitPointerLockElement)};Object.assign(b.prototype,{attach:function(a){this._target=a;this._attached||(this._attached=!0,window.addEventListener("mouseup",this._upHandler,!1),window.addEventListener("mousedown",this._downHandler,!1), -window.addEventListener("mousemove",this._moveHandler,!1),window.addEventListener("mousewheel",this._wheelHandler,!1),window.addEventListener("DOMMouseScroll",this._wheelHandler,!1))},detach:function(){this._attached&&(this._attached=!1,this._target=null,window.removeEventListener("mouseup",this._upHandler),window.removeEventListener("mousedown",this._downHandler),window.removeEventListener("mousemove",this._moveHandler),window.removeEventListener("mousewheel",this._wheelHandler),window.removeEventListener("DOMMouseScroll", -this._wheelHandler))},disableContextMenu:function(){this._target&&this._target.addEventListener("contextmenu",this._contextMenuHandler)},enableContextMenu:function(){this._target&&this._target.removeEventListener("contextmenu",this._contextMenuHandler)},enablePointerLock:function(a,b){if(document.body.requestPointerLock){var c=function(){a();document.removeEventListener("pointerlockchange",c)},f=function(){b();document.removeEventListener("pointerlockerror",f)};a&&document.addEventListener("pointerlockchange", -c,!1);b&&document.addEventListener("pointerlockerror",f,!1);document.body.requestPointerLock()}else b&&b()},disablePointerLock:function(a){if(document.exitPointerLock){var b=function(){a();document.removeEventListener("pointerlockchange",b)};a&&document.addEventListener("pointerlockchange",b,!1);document.exitPointerLock()}},update:function(){this._lastbuttons[0]=this._buttons[0];this._lastbuttons[1]=this._buttons[1];this._lastbuttons[2]=this._buttons[2]},isPressed:function(a){return this._buttons[a]}, -wasPressed:function(a){return this._buttons[a]&&!this._lastbuttons[a]},wasReleased:function(a){return!this._buttons[a]&&this._lastbuttons[a]},_handleUp:function(a){this._buttons[a.button]=!1;a=new e(this,a);a.event&&this.fire(pc.EVENT_MOUSEUP,a)},_handleDown:function(a){this._buttons[a.button]=!0;a=new e(this,a);a.event&&this.fire(pc.EVENT_MOUSEDOWN,a)},_handleMove:function(a){a=new e(this,a);a.event&&(this.fire(pc.EVENT_MOUSEMOVE,a),this._lastX=a.x,this._lastY=a.y)},_handleWheel:function(a){a=new e(this, -a);a.event&&this.fire(pc.EVENT_MOUSEWHEEL,a)},_getTargetCoords:function(a){var b=this._target.getBoundingClientRect(),d=Math.floor(b.left),b=Math.floor(b.top);return a.clientX=d+this._target.clientWidth||a.clientY=b+this._target.clientHeight?null:{x:a.clientX-d,y:a.clientY-b}}});return{Mouse:b,MouseEvent:e}}());Object.assign(pc,function(){function e(a){c.key=a.keyCode;c.element=a.target;c.event=a;return c}function b(a){return"string"===typeof a?a.toUpperCase().charCodeAt(0):a}var a=function(a,b){b?(this.key=b.keyCode,this.element=b.target,this.event=b):this.event=this.element=this.key=null},c=new a,d={9:"Tab",13:"Enter",16:"Shift",17:"Control",18:"Alt",27:"Escape",37:"Left",38:"Up",39:"Right",40:"Down",46:"Delete",91:"Win"},f=function(a,b){b=b||{};this._element=null;this._keyDownHandler=this._handleKeyDown.bind(this); -this._keyUpHandler=this._handleKeyUp.bind(this);this._keyPressHandler=this._handleKeyPress.bind(this);pc.events.attach(this);this._keymap={};this._lastmap={};a&&this.attach(a);this.preventDefault=b.preventDefault||!1;this.stopPropagation=b.stopPropagation||!1};f.prototype.attach=function(a){this._element&&this.detach();this._element=a;this._element.addEventListener("keydown",this._keyDownHandler,!1);this._element.addEventListener("keypress",this._keyPressHandler,!1);this._element.addEventListener("keyup", -this._keyUpHandler,!1)};f.prototype.detach=function(){this._element.removeEventListener("keydown",this._keyDownHandler);this._element.removeEventListener("keypress",this._keyPressHandler);this._element.removeEventListener("keyup",this._keyUpHandler);this._element=null};f.prototype.toKeyIdentifier=function(a){a=b(a);var c,f;if(c=d[a.toString()])return c;c=a.toString(16).toUpperCase();f=c.length;for(a=0;a<4-f;a++)c="0"+c;return"U+"+c};f.prototype._handleKeyDown=function(a){var b=a.keyCode||a.charCode; -void 0!==b&&(b=this.toKeyIdentifier(b),this._keymap[b]=!0,this.fire("keydown",e(a)),this.preventDefault&&a.preventDefault(),this.stopPropagation&&a.stopPropagation())};f.prototype._handleKeyUp=function(a){var b=a.keyCode||a.charCode;void 0!==b&&(b=this.toKeyIdentifier(b),delete this._keymap[b],this.fire("keyup",e(a)),this.preventDefault&&a.preventDefault(),this.stopPropagation&&a.stopPropagation())};f.prototype._handleKeyPress=function(a){this.fire("keypress",e(a));this.preventDefault&&a.preventDefault(); -this.stopPropagation&&a.stopPropagation()};f.prototype.update=function(){for(var a in this._lastmap)delete this._lastmap[a];for(a in this._keymap)this._keymap.hasOwnProperty(a)&&(this._lastmap[a]=this._keymap[a])};f.prototype.isPressed=function(a){a=b(a);a=this.toKeyIdentifier(a);return!!this._keymap[a]};f.prototype.wasPressed=function(a){a=b(a);a=this.toKeyIdentifier(a);return!!this._keymap[a]&&!this._lastmap[a]};f.prototype.wasReleased=function(a){a=b(a);a=this.toKeyIdentifier(a);return!this._keymap[a]&& -!!this._lastmap[a]};return{Keyboard:f,KeyboardEvent:a}}());Object.assign(pc,function(){var e=function(){this.gamepadsSupported=!!navigator.getGamepads||!!navigator.webkitGetGamepads;this.current=[];this.previous=[];this.deadZone=.25},b={DEFAULT:{buttons:"PAD_FACE_1 PAD_FACE_2 PAD_FACE_3 PAD_FACE_4 PAD_L_SHOULDER_1 PAD_R_SHOULDER_1 PAD_L_SHOULDER_2 PAD_R_SHOULDER_2 PAD_SELECT PAD_START PAD_L_STICK_BUTTON PAD_R_STICK_BUTTON PAD_UP PAD_DOWN PAD_LEFT PAD_RIGHT PAD_VENDOR".split(" "),axes:["PAD_L_STICK_X","PAD_L_STICK_Y","PAD_R_STICK_X","PAD_R_STICK_Y"]},PS3:{buttons:"PAD_FACE_1 PAD_FACE_2 PAD_FACE_4 PAD_FACE_3 PAD_L_SHOULDER_1 PAD_R_SHOULDER_1 PAD_L_SHOULDER_2 PAD_R_SHOULDER_2 PAD_SELECT PAD_START PAD_L_STICK_BUTTON PAD_R_STICK_BUTTON PAD_UP PAD_DOWN PAD_LEFT PAD_RIGHT PAD_VENDOR".split(" "), -axes:["PAD_L_STICK_X","PAD_L_STICK_Y","PAD_R_STICK_X","PAD_R_STICK_Y"]}},a={"Product: 0268":"PS3"};Object.assign(e.prototype,{update:function(){var a,b,f,g,e;a=0;for(f=this.current.length;aMath.abs(a)&&(a=f)}else this._axesValues[b]&&Math.abs(this._axesValues[b][c])>Math.abs(a)&&(a=this._axesValues[b][c])}return a};e.prototype._enableMouse=function(){this._mouse=new pc.Mouse;if(!this._element)throw Error("Controller must be attached to an Element");this._mouse.attach(this._element)}; -e.prototype._enableKeyboard=function(){this._keyboard=new pc.Keyboard;if(!this._element)throw Error("Controller must be attached to an Element");this._keyboard.attach(this._element)};return{Controller:e}}());Object.assign(pc,function(){var e,b,a=new pc.Vec3,c=new pc.Vec3,d=new pc.Vec3,f=new pc.Vec3,g=new pc.Vec3,l=new pc.Vec3,h=new pc.Vec3,p=new pc.Vec3,k=new pc.Vec3,n=new pc.Vec2,q=new pc.Vec3,m=new pc.Vec3,r=new pc.Vec3,t=new pc.Vec3,u=new pc.Vec3,x=new pc.Vec3,v=new pc.Vec3,w=new pc.Vec3,y=new pc.Vec4,D=function(a,b,c){d.sub2(b,a);f.sub2(c[0],a);g.sub2(c[1],a);l.sub2(c[2],a);p.cross(l,d);if(0<=f.dot(p)){if(0>-g.dot(p)||0>k.cross(d,g).dot(f))return!1}else if(h.sub2(c[3],a),0>h.dot(p)||0>k.cross(d,f).dot(h))return!1; -return 1E-8>d.sub2(c[0],c[2]).lengthSq()||1E-8>d.sub2(c[1],c[3]).lengthSq()?!1:!0},B=function(a,b,c){this.event=a;this.element=b;this.camera=c;this._stopPropagation=!1};Object.assign(B.prototype,{stopPropagation:function(){this._stopPropagation=!0;this.event.stopImmediatePropagation();this.event.stopPropagation()}});var z=function(a,b,c,d,f,g,e){B.call(this,a,b,c);this.x=d;this.y=f;this.ctrlKey=a.ctrlKey||!1;this.altKey=a.altKey||!1;this.shiftKey=a.shiftKey||!1;this.metaKey=a.metaKey||!1;this.button= -a.button;pc.Mouse.isPointerLocked()?(this.dx=a.movementX||a.webkitMovementX||a.mozMovementX||0,this.dy=a.movementY||a.webkitMovementY||a.mozMovementY||0):(this.dx=d-g,this.dy=f-e);this.wheel=a.detail?-1*a.detail:a.wheelDelta?a.wheelDelta/120:0};z.prototype=Object.create(B.prototype);z.prototype.constructor=z;var A=function(a,b,c,d,f,g){B.call(this,a,b,c);this.touches=a.touches;this.changedTouches=a.changedTouches;this.x=d;this.y=f};A.prototype=Object.create(B.prototype);A.prototype.constructor=A; -var F=function(a,b){this._app=null;this._attached=!1;this._target=null;this._enabled=!0;this._lastY=this._lastX=0;this._upHandler=this._handleUp.bind(this);this._downHandler=this._handleDown.bind(this);this._moveHandler=this._handleMove.bind(this);this._wheelHandler=this._handleWheel.bind(this);this._touchstartHandler=this._handleTouchStart.bind(this);this._touchcancelHandler=this._touchendHandler=this._handleTouchEnd.bind(this);this._touchmoveHandler=this._handleTouchMove.bind(this);this._sortHandler= -this._sortElements.bind(this);this._elements=[];this._pressedElement=this._hoveredElement=null;this._touchedElements={};this._touchesForWhichTouchLeaveHasFired={};this._useMouse=!b||!1!==b.useMouse;this._useTouch=!b||!1!==b.useTouch;pc.platform.touch&&(this._clickedEntities={});this.attach(a,b)};Object.assign(F.prototype,{attach:function(a){this._attached&&(this._attached=!1,this.detach());this._target=a;this._attached=!0;this._useMouse&&(window.addEventListener("mouseup",this._upHandler,{passive:!0}), -window.addEventListener("mousedown",this._downHandler,{passive:!0}),window.addEventListener("mousemove",this._moveHandler,{passive:!0}),window.addEventListener("mousewheel",this._wheelHandler,{passive:!0}),window.addEventListener("DOMMouseScroll",this._wheelHandler,{passive:!0}));this._useTouch&&pc.platform.touch&&(this._target.addEventListener("touchstart",this._touchstartHandler,{passive:!0}),this._target.addEventListener("touchend",this._touchendHandler,!1),this._target.addEventListener("touchmove", -this._touchmoveHandler,!1),this._target.addEventListener("touchcancel",this._touchcancelHandler,!1))},detach:function(){this._attached&&(this._attached=!1,this._useMouse&&(window.removeEventListener("mouseup",this._upHandler,!1),window.removeEventListener("mousedown",this._downHandler,!1),window.removeEventListener("mousemove",this._moveHandler,!1),window.removeEventListener("mousewheel",this._wheelHandler,!1),window.removeEventListener("DOMMouseScroll",this._wheelHandler,!1)),this._useTouch&&(this._target.removeEventListener("touchstart", -this._touchstartHandler,!1),this._target.removeEventListener("touchend",this._touchendHandler,!1),this._target.removeEventListener("touchmove",this._touchmoveHandler,!1),this._target.removeEventListener("touchcancel",this._touchcancelHandler,!1)),this._target=null)},addElement:function(a){-1===this._elements.indexOf(a)&&this._elements.push(a)},removeElement:function(a){a=this._elements.indexOf(a);-1!==a&&this._elements.splice(a,1)},_handleUp:function(a){this._enabled&&!pc.Mouse.isPointerLocked()&& -(this._calcMouseCoords(a),null!==e&&this._onElementMouseEvent(a))},_handleDown:function(a){this._enabled&&!pc.Mouse.isPointerLocked()&&(this._calcMouseCoords(a),null!==e&&this._onElementMouseEvent(a))},_handleMove:function(a){this._enabled&&(this._calcMouseCoords(a),null!==e&&(this._onElementMouseEvent(a),this._lastX=e,this._lastY=b))},_handleWheel:function(a){this._enabled&&(this._calcMouseCoords(a),null!==e&&this._onElementMouseEvent(a))},_determineTouchedElements:function(a){var b={},c=this.app.systems.camera.cameras, -d,f,g;for(d=c.length-1;0<=d;d--){var e=c[d],h=0;f=0;for(g=a.changedTouches.length;f=d+this._target.clientWidth||a.clientY=c+this._target.clientHeight?b=e=null:(e=a.clientX-d,b=a.clientY-c)},_calcTouchCoords:function(a){for(var b=0,c=0,d=a.target;!(d instanceof HTMLElement);)d=d.parentNode;do b+=d.offsetLeft-d.scrollLeft,c+=d.offsetTop-d.scrollTop,d=d.offsetParent;while(d);return{x:a.pageX-b,y:a.pageY-c}},_sortElements:function(a,b){var c=this.app.scene.layers.sortTransparentLayers(a.layers,b.layers);return 0!== -c?c:a.screen&&!b.screen?-1:!a.screen&&b.screen?1:a.screen||b.screen?a.screen.screen.screenSpace&&!b.screen.screen.screenSpace?-1:b.screen.screen.screenSpace&&!a.screen.screen.screenSpace?1:b.drawOrder-a.drawOrder:0},_getTargetElement:function(a,b,c){var d=null;this._elements.sort(this._sortHandler);for(var f=0,g=this._elements.length;f=p&&b<=p+l&&d<=g&&d>=n&&(b=e*(b-p)/l,d=h-h*(d-n)/k,e=this._calculateScaleToScreen(f),f=this._buildHitCorners(f,f.screenCorners,e.x,e.y),a.set(b,d,1),c.set(b,d,-1),D(a, -c,f))?!0:!1},_checkElement3d:function(b,d,f,g){if(f.maskedBy&&!this._checkElement3d(b,d,f.maskedBy.element,g))return!1;var e=this._target.clientWidth,h=this._target.clientHeight,l=g.rect.z*e,k=g.rect.w*h,p=g.rect.x*e,n=(1-g.rect.y)*h,m=n-k,q=d;return b>=p&&b<=p+l&&d<=n&&q>=m&&(b=e*(b-p)/l,q=h*(q-m)/k,h=f.entity.getWorldTransform().getScale(),f=this._buildHitCorners(f,f.worldCorners,h.x,h.y),g.screenToWorld(b,q,g.nearClip,a),g.screenToWorld(b,q,g.farClip,c),D(a,c,f))?!0:!1}});Object.defineProperty(F.prototype, -"enabled",{get:function(){return this._enabled},set:function(a){this._enabled=a}});Object.defineProperty(F.prototype,"app",{get:function(){return this._app||pc.app},set:function(a){this._app=a}});return{ElementInput:F,ElementInputEvent:B,ElementMouseEvent:z,ElementTouchEvent:A}}());Object.assign(pc,function(){var e=function(b){pc.events.attach(this);var a=this;this.isSupported=e.isSupported;this.usesPolyfill=e.usesPolyfill;window.InitializeWebVRPolyfill&&window.InitializeWebVRPolyfill();this._index={};this.displays=[];this.display=null;this._app=b;this._onDisplayConnect=this._onDisplayConnect.bind(this);this._onDisplayDisconnect=this._onDisplayDisconnect.bind(this);a._attach();this._getDisplays(function(b,d){if(b)a.fire("error",b);else{for(var c=0;c=c.length){for(a=0;a=a?0:1});b(["fr"],function(a){return 0<=a&&2>a?0:1});b("de en it el es tr".split(" "),function(a){return 1===a?0:1});b(["ru","uk"],function(a){if(Number.isInteger(a)){var b= -a%10;a%=100;if(1===b&&11!==a)return 0;if(2<=b&&4>=b&&(12>a||14=b||11<=a&&14>=a)return 2}return 3});b(["ar"],function(a){if(0===a)return 0;if(1===a)return 1;if(2===a)return 2;if(Number.isInteger(a)){a%=100;if(3<=a&&10>=a)return 3;if(11<=a&&99>=a)return 4}return 5});var d=e[a("en-US")],b=function(a){pc.events.attach(this);this.locale="en-US";this._translations={};this._availableLangs={};this._app=a;this._assets=[];this._parser=new pc.I18nParser};b.prototype.getText=function(b, -c){var d=b,f;c||(c=this._locale,f=this._lang);var g=this._translations[c];g||(f||(f=a(c)),c=this._findFallbackLocale(f),g=this._translations[c]);g&&g.hasOwnProperty(b)&&(d=g[b],Array.isArray(d)&&(d=d[0]),null===d||void 0===d)&&(d=b);return d};b.prototype.getPluralText=function(b,c,l){var f=b,g,k;l?(k=a(l),g=e[k]||d):(l=this._locale,k=this._lang,g=this._pluralFn);l=this._translations[l];l||(l=this._findFallbackLocale(k),k=a(l),g=e[k]||d,l=this._translations[l]);l&&l[b]&&g&&(c=g(c),f=l[b][c],null=== -f||void 0===f)&&(f=b);return f};b.prototype.addData=function(b){var c;try{c=this._parser.parse(b)}catch(n){console.error(n);return}b=0;for(var d=c.length;bu)))for(u=(x=l[w])?t.instances.visibleTransparent[u]:t.instances.visibleOpaque[u],x=u.length,u=u.list,t=0;td._timeToCountFrames?(d.fps=d._fpsAccum,d._fpsAccum=0,d._timeToCountFrames=a+1E3):d._fpsAccum++;d.cameras=this.renderer._camerasRendered;d.materials=this.renderer._materialSwitches; -d.shaders=this.graphicsDevice._shaderSwitchesPerFrame;d.shadowMapUpdates=this.renderer._shadowMapUpdates;d.shadowMapTime=this.renderer._shadowMapTime;d.depthMapTime=this.renderer._depthMapTime;d.forwardTime=this.renderer._forwardTime;a=this.graphicsDevice._primsPerFrame;d.triangles=a[pc.PRIMITIVE_TRIANGLES]/3+Math.max(a[pc.PRIMITIVE_TRISTRIP]-2,0)+Math.max(a[pc.PRIMITIVE_TRIFAN]-2,0);d.cullTime=this.renderer._cullTime;d.sortTime=this.renderer._sortTime;d.skinTime=this.renderer._skinTime;d.morphTime= -this.renderer._morphTime;d.instancingTime=this.renderer._instancingTime;for(b=d.otherPrimitives=0;bc/d?(a=c,b=a/f):(b=d,a=b*f)}else this._fillMode===pc.FILLMODE_FILL_WINDOW&&(a=c,b=d);this.graphicsDevice.canvas.style.width=a+"px";this.graphicsDevice.canvas.style.height=b+"px";this._resolutionMode===pc.RESOLUTION_AUTO&&this.setCanvasResolution(pc.RESOLUTION_AUTO)}return{width:a,height:b}}},onLibrariesLoaded:function(){this._librariesLoaded= -!0;this.systems.rigidbody.onLibraryLoaded();this.systems.collision.onLibraryLoaded()},applySceneSettings:function(a){var b;this.systems.rigidbody&&"undefined"!==typeof Ammo&&(b=a.physics.gravity,this.systems.rigidbody.setGravity(b[0],b[1],b[2]));this.scene.applySettings(a);if(a.render.hasOwnProperty("skybox"))if(a.render.skybox)if(b=this.assets.get(a.render.skybox))this.setSkybox(b);else this.assets.once("add:"+a.render.skybox,this.setSkybox,this);else this.setSkybox(null)},setSkybox:function(a){a? -this._skyboxLast===a.id?0!==this.scene.skyboxMip||a.loadFaces?this._onSkyboxChange(a):this._skyboxLoad(a):(this._skyboxLast&&(this.assets.off("add:"+this._skyboxLast,this.setSkybox,this),this.assets.off("load:"+this._skyboxLast,this._onSkyboxChange,this),this.assets.off("remove:"+this._skyboxLast,this._skyboxRemove,this)),this._skyboxLast=a.id,this.assets.on("load:"+a.id,this._onSkyboxChange,this),this.assets.once("remove:"+a.id,this._skyboxRemove,this),a.resource&&this.scene.setSkybox(a.resources), -this._skyboxLoad(a)):this._skyboxLast&&this._skyboxRemove({id:this._skyboxLast})},_onVrChange:function(a){a?this.vr||(this.vr=new pc.VrManager(this)):this.vr&&(this.vr.destroy(),this.vr=null)},_onSkyboxChange:function(a){this.scene.setSkybox(a.resources)},_skyboxLoad:function(a){0===this.scene.skyboxMip&&(a.loadFaces=!0);this.assets.load(a);this._onSkyboxChange(a)},_skyboxRemove:function(a){this._skyboxLast&&(this.assets.off("add:"+a.id,this.setSkybox,this),this.assets.off("load:"+a.id,this._onSkyboxChange, -this),this.assets.off("remove:"+a.id,this._skyboxRemove,this),this.scene.setSkybox(null),this._skyboxLast=null)},_firstBake:function(){this.lightmapper.bake(null,this.scene.lightmapMode)},_firstBatch:function(){this.scene._needsStaticPrepare&&(this.renderer.prepareStaticMeshes(this.graphicsDevice,this.scene),this.scene._needsStaticPrepare=!1);this.batcher.generate()},destroy:function(){var a,b,c=this.graphicsDevice.canvas.id;this.off("librariesloaded");document.removeEventListener("visibilitychange", -this._visibilityChangeHandler,!1);document.removeEventListener("mozvisibilitychange",this._visibilityChangeHandler,!1);document.removeEventListener("msvisibilitychange",this._visibilityChangeHandler,!1);document.removeEventListener("webkitvisibilitychange",this._visibilityChangeHandler,!1);this.onVisibilityChange=this._visibilityChangeHandler=null;this.root.destroy();this.root=null;this.mouse&&(this.mouse.off(),this.mouse.detach(),this.mouse=null);this.keyboard&&(this.keyboard.off(),this.keyboard.detach(), -this.keyboard=null);this.touch&&(this.touch.off(),this.touch.detach(),this.touch=null);this.elementInput&&(this.elementInput.detach(),this.elementInput=null);this.controller&&(this.controller=null);var l=this.systems.list;a=0;for(b=l.length;ag.blendTimeRemaining&&(g.blendTimeRemaining=0),f.blend(g.fromSkel,g.toSkel,1-g.blendTimeRemaining/g.blendTime)):(f.addTime(a*g.speed),f._time!==f._animation.duration||g.loop||(g.playing=!1)),g.blending&&0===g.blendTimeRemaining&&(g.blending=!1,f.animation=g.toSkel._animation),f.updateGraph()))}}});return{AnimationComponentSystem:b}}());Object.assign(pc,function(){return{AnimationComponentData:function(){this.assets=[];this.speed=1;this.enabled=this.activate=this.loop=!0;this.animations={};this.toSkel=this.fromSkel=this.currAnim=this.prevAnim=this.model=this.skeleton=null;this.blending=!1;this.blendTimeRemaining=this.blendTime=0;this.playing=!1}}}());Object.assign(pc,function(){var e=function(b,a){pc.Component.call(this,b,a);this._type="asset";this._model=this._asset=null;this._mapping={};this._receiveShadows=this._castShadows=!0;this._materialAsset=null;this._material=b.defaultMaterial;this._castShadowsLightmap=!0;this._lightmapped=!1;this._lightmapSizeMultiplier=1;this._isStatic=!1;this._layers=[pc.LAYERID_WORLD];this._batchGroupId=-1;this._area=null;this._assetOld=0;this._materialEvents=null;this._clonedModel=this._dirtyMaterialAsset=this._dirtyModelAsset= -!1};e.prototype=Object.create(pc.Component.prototype);e.prototype.constructor=e;Object.assign(e.prototype,{setVisible:function(b){console.warn("WARNING: setVisible: Function is deprecated. Set enabled property instead.");this.enabled=b},addModelToLayers:function(){for(var b,a=this.system.app.scene.layers,c=0;cthis.layers.indexOf(b.id)||b.addMeshInstances(this.meshInstances)},onLayerRemoved:function(b){0>this.layers.indexOf(b.id)|| -b.removeMeshInstances(this.meshInstances)},_setMaterialEvent:function(b,a,c,d){a=a+":"+c;this.system.app.assets.on(a,d,this);this._materialEvents||(this._materialEvents=[]);this._materialEvents[b]||(this._materialEvents[b]={});this._materialEvents[b][a]={id:c,handler:d}},_unsetMaterialEvents:function(){var b=this.system.app.assets,a=this._materialEvents;if(a){for(var c=0,d=a.length;cb&&0<=this._batchGroupId&&this.enabled&&this.entity.enabled&&this.addModelToLayers();this._batchGroupId=b}}});Object.defineProperty(e.prototype,"materialAsset",{get:function(){return this._materialAsset},set:function(b){var a=b;b instanceof pc.Asset&& -(a=b.id);b=this.system.app.assets;if(a!==this._materialAsset){if(this._materialAsset){b.off("add:"+this._materialAsset,this._onMaterialAdded,this);var c=b.get(this._materialAsset);c&&this._unbindMaterialAsset(c)}(this._materialAsset=a)?(a=b.get(this._materialAsset))?this._bindMaterialAsset(a):(this.material=this.system.defaultMaterial,b.on("add:"+this._materialAsset,this._onMaterialAdded,this)):this.material=this.system.defaultMaterial}}});Object.defineProperty(e.prototype,"material",{get:function(){return this._material}, -set:function(b){if(this._material!==b){this._material=b;var a=this._model;if(a&&"asset"!==this._type)for(var a=a.meshInstances,c=0,d=a.length;cthis.layers.indexOf(b.id)||b.addCamera(this)},onLayerRemoved:function(b){0>this.layers.indexOf(b.id)||b.removeCamera(this)},updateClearFlags:function(){var b=0;this.clearColorBuffer&&(b|= -pc.CLEARFLAG_COLOR);this.clearDepthBuffer&&(b|=pc.CLEARFLAG_DEPTH);this.clearStencilBuffer&&(b|=pc.CLEARFLAG_STENCIL);this.data.camera.clearFlags=b},onSetRenderTarget:function(b,a,c){this.data.camera.renderTarget=c},onSetRect:function(b,a,c){this.data.camera.setRect(c.x,c.y,c.z,c.w)},onSetScissorRect:function(b,a,c){this.data.camera.setScissorRect(c.x,c.y,c.z,c.w)},onEnable:function(){this.system.addCamera(this);this.system.app.scene.on("set:layers",this.onLayersChanged,this);this.system.app.scene.layers&& -(this.system.app.scene.layers.on("add",this.onLayerAdded,this),this.system.app.scene.layers.on("remove",this.onLayerRemoved,this));this.enabled&&this.entity.enabled&&this.addCameraToLayers();this.postEffects.enable()},onDisable:function(){this.postEffects.disable();this.removeCameraFromLayers();this.system.app.scene.off("set:layers",this.onLayersChanged,this);this.system.app.scene.layers&&(this.system.app.scene.layers.off("add",this.onLayerAdded,this),this.system.app.scene.layers.off("remove",this.onLayerRemoved, -this));this.system.removeCamera(this)},onRemove:function(){this.off()},calculateAspectRatio:function(b){b=b?b:this.system.app.graphicsDevice;var a=this.rect;return b.width*a.z/(b.height*a.w)},frameBegin:function(b){this.aspectRatioMode===pc.ASPECT_AUTO&&(this.aspectRatio=this.calculateAspectRatio(b));this.data.isRendering=!0},frameEnd:function(){this.data.isRendering=!1},enterVr:function(b,a){b instanceof Function&&!a&&(a=b,b=null);if(this.system.app.vr)if(b||(b=this.system.app.vr.display),b){var c= -this;b.capabilities.canPresent?b.requestPresent(function(d){d||(c.vrDisplay=b,c.vrDisplay.once("beforepresentchange",function(a){a.presenting||(c.vrDisplay=null)}));a(d)}):(c.vrDisplay=b,a())}else a("No pc.VrDisplay to present");else a("VrManager not created. Enable VR in project settings.")},exitVr:function(b){if(this.vrDisplay)if(this.vrDisplay.capabilities.canPresent){var a=this.vrDisplay;this.vrDisplay=null;a.exitPresent(b)}else this.vrDisplay=null,b();else b("Not presenting VR")}});return{CameraComponent:e}}());Object.assign(pc,function(){var e="enabled clearColorBuffer clearColor clearDepthBuffer clearStencilBuffer frustumCulling projection fov orthoHeight nearClip farClip priority rect scissorRect camera aspectRatio aspectRatioMode horizontalFov model renderTarget calculateTransform calculateProjection cullFaces flipFaces layers".split(" "),b=function(a){pc.ComponentSystem.call(this,a);this.id="camera";this.description="Renders the scene from the location of the Entity.";this.ComponentType=pc.CameraComponent; -this.DataType=pc.CameraComponentData;this.schema=e;this.cameras=[];this.on("beforeremove",this.onBeforeRemove,this);this.on("remove",this.onRemove,this);this.app.on("prerender",this.onPrerender,this);pc.ComponentSystem.bind("update",this.onUpdate,this)};b.prototype=Object.create(pc.ComponentSystem.prototype);b.prototype.constructor=b;pc.Component._buildAccessors(pc.CameraComponent.prototype,e);Object.assign(b.prototype,{initializeComponentData:function(a,b,d){d="postEffects enabled model camera aspectRatio aspectRatioMode horizontalFov renderTarget clearColor fov orthoHeight nearClip farClip projection priority clearColorBuffer clearDepthBuffer clearStencilBuffer frustumCulling rect scissorRect calculateTransform calculateProjection cullFaces flipFaces layers".split(" "); -for(var c={},g=0,e=d.length;gg&&(g=k))}this.app.scene.layers.insertOpaque(this.layer,g+1);this._sourceTarget=d.inputTarget;this.layer._commandList=[];this.layer.isPostEffect=!0}b.push(d); -g=b.length;1this._postEffectCombined)n.setup&&n.setup(q,n,d,null,this.renderTarget);else{var g;g=this._postEffectCombinedSrc?this._postEffectCombinedSrc:n.srcRenderTarget?n.srcRenderTarget:b[this._backbufferRtId];1G;G++)b[G]=new pc.RenderTarget({depth:!0,stencil:q.supportsStencil,samples:H,autoResolve:!1}),b[G].name="backbuffer"+G;e.on("prerender",function(){var a=e.scene.layers.layerList,c,d,f=0,k=0;p=h=l=!1;var n=pc.PIXELFORMAT_R8_G8_B8_A8;if(e.scene.layers._dirty){var C=0,E,H;for(c=0;c=f;d--)a[d].renderTarget||(a[d].renderTarget=b[k]);a[c]._backbufferRtId= -k;f=c;l=!0;1===k&&(h=!0);a[c].postEffect.hdr&&(n=q.webgl2&&q.textureFloatRenderable?pc.PIXELFORMAT_111110F:q.extTextureHalfFloatLinear&&q.textureHalfFloatRenderable?pc.PIXELFORMAT_RGBA16F:pc.PIXELFORMAT_R8_G8_B8_A8);a[c].postEffect.shader&&!a[c].renderTarget&&(k=1-k)}else a[c].isPostEffect||a[c].renderTarget||!l||(a[c].renderTarget=b[k]);a[c].isPostEffect&&!a[c].renderTarget&&(p=!0)}if(l)if(!b[0].colorBuffer)F(0,q,n);else if(b[0].width!==q.width||b[0].height!==q.height||b[0]._colorBuffer._format!== -n)b[0].colorBuffer.destroy(),b[0].destroy(),F(0,q,n);if(h)if(!b[1].colorBuffer)F(1,q,n);else if(b[1].width!==q.width||b[1].height!==q.height||b[1]._colorBuffer._format!==n)b[1].colorBuffer.destroy(),b[1].destroy(),F(1,q,n)},this);e.on("postrender",function(){var a=e.graphicsDevice;if(l&&!p){for(var c=e.scene.layers.layerList,d,f=c.length-1;0<=f&&(d=c[f].renderTarget,d!==b[0]&&d!==b[1]);f--);d&&(1this.layers.indexOf(a.id)||this.enabled&&this.entity.enabled&&a.addLight(this)},onLayerRemoved:function(a){0>this.layers.indexOf(a.id)||a.removeLight(this)},refreshProperties:function(){for(var a,c=0;ca.ind&&(l=a.ind);this._insertScriptInstance(f,l,g);this._scriptsIndex[d.__name]={instance:f,onSwap:function(){c.swap(d.__name)}};this[d.__name]=f;a.preloading||f.__initializeAttributes();this.fire("create",d.__name,f);this.fire("create:"+d.__name,f);this.system.app.scripts.on("swap:"+ -d.__name,this._scriptsIndex[d.__name].onSwap);a.preloading||(f.enabled&&!f._initialized&&(f._initialized=!0,f.initialize&&this._scriptMethod(f,e.scriptMethods.initialize)),f.enabled&&!f._postInitialized&&(f._postInitialized=!0,f.postInitialize&&this._scriptMethod(f,e.scriptMethods.postInitialize)));return f}console.warn("script '"+f+"' is already added to entity '"+this.entity.name+"'")}else this._scriptsIndex[f]={awaiting:!0,ind:this._scripts.length},console.warn("script '"+f+"' is not found, awaiting it to be added to registry"); -return null},destroy:function(b){var a=b;"string"===typeof b&&(b=this.system.app.scripts.get(b))&&(a=b.__name);b=this._scriptsIndex[a];delete this._scriptsIndex[a];if(!b)return!1;if(b.instance&&!b.instance._destroyed)if(b.instance.enabled=!1,b.instance._destroyed=!0,this._isLoopingThroughScripts)this._destroyedScripts.push(b.instance);else{var c=this._removeScriptInstance(b.instance);0<=c&&this._resetExecutionOrder(c,this._scripts.length)}this.system.app.scripts.off("swap:"+a,b.onSwap);delete this[a]; -this.fire("destroy",a,b.instance||null);this.fire("destroy:"+a,b.instance||null);b.instance&&b.instance.fire("destroy");return!0},swap:function(b){"string"===typeof b&&(b=this.system.app.scripts.get(b));var a=this._scriptsIndex[b.__name];if(!a||!a.instance)return!1;var a=a.instance,c=this._scripts.indexOf(a),d=new b({app:this.system.app,entity:this.entity,enabled:a.enabled,attributes:a.__attributes});if(!d.swap)return!1;d.__initializeAttributes();this._scripts[c]=d;this._scriptsIndex[b.__name].instance= -d;this[b.__name]=d;d.__executionOrder=c;a.update&&this._updateList.remove(a);a.postUpdate&&this._postUpdateList.remove(a);d.update&&this._updateList.insert(d);d.postUpdate&&this._postUpdateList.insert(d);this._scriptMethod(d,e.scriptMethods.swap,a);this.fire("swap",b.__name,d);this.fire("swap:"+b.__name,d);return!0},resolveDuplicatedEntityReferenceProperties:function(b,a){var c=this.entity.script,d;for(d in b._scriptsIndex){var f=this.system.app.scripts.get(d);if(f){var g=b._scriptsIndex[d];if(g&& -g.instance){var e=c[d].__attributesRaw,h=c[d].__attributes;if(e||h){var g=g.instance.__attributes,p;for(p in g)if(g[p]){var k=f.attributes.get(p);if(k&&"entity"===k.type)if(k.array){var n=g[p];if(k=n.length){for(var n=n.slice(),q=0;q=c||0>a)return!1;var d=b;"string"!==typeof d&&(d=b.__name);var f=this._scriptsIndex[d];if(!f||!f.instance)return!1;var g=this._scripts.indexOf(f.instance);if(-1===g||g===a)return!1;this._scripts.splice(a,0,this._scripts.splice(g,1)[0]);this._resetExecutionOrder(0,c);this._updateList.sort();this._postUpdateList.sort();this.fire("move",d,f.instance,a,g);this.fire("move:"+d,f.instance,a,g);return!0}});Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled}, -set:function(b){var a=this._enabled;this._enabled=b;this.fire("set","enabled",a,b)}});Object.defineProperty(e.prototype,"scripts",{get:function(){return this._scripts},set:function(b){this._scriptsData=b;for(var a in b)if(b.hasOwnProperty(a)){var c=this._scriptsIndex[a];if(c){if("boolean"===typeof b[a].enabled&&(c.enabled=!!b[a].enabled),"object"===typeof b[a].attributes)for(var d in b[a].attributes)if(!pc.createScript.reservedAttributes[d]){if(!c.__attributes.hasOwnProperty(d)){var f=this.system.app.scripts.get(a); -f&&f.attributes.add(d,{})}c[d]=b[a].attributes[d]}}else console.log(this.order)}}});return{ScriptComponent:e}}());Object.assign(pc,function(){var e=0,b=function(a){pc.ComponentSystem.call(this,a);this.id="script";this.app=a;this.ComponentType=pc.ScriptComponent;this.DataType=pc.ScriptComponentData;this._components=new pc.SortedLoopArray({sortBy:"_executionOrder"});this._enabledComponents=new pc.SortedLoopArray({sortBy:"_executionOrder"});this.preloading=!0;this.on("beforeremove",this._onBeforeRemove,this);pc.ComponentSystem.bind("initialize",this._onInitialize,this);pc.ComponentSystem.bind("postInitialize",this._onPostInitialize, -this);pc.ComponentSystem.bind("update",this._onUpdate,this);pc.ComponentSystem.bind("postUpdate",this._onPostUpdate,this)};b.prototype=Object.create(pc.ComponentSystem.prototype);b.prototype.constructor=b;Object.assign(b.prototype,{initializeComponentData:function(a,b){a._executionOrder=e++;this._components.append(a);e>Number.MAX_SAFE_INTEGER&&this._resetExecutionOrder();a.enabled=b.hasOwnProperty("enabled")?!!b.enabled:!0;a.enabled&&a.entity.enabled&&this._enabledComponents.append(a);if(b.hasOwnProperty("order")&& -b.hasOwnProperty("scripts")){a._scriptsData=b.scripts;for(var c=0;ca.indexOf(c[d])&&(c[d]instanceof pc.Asset?b.push(c[d].id):b.push(c[d]));!this.system._inTools&&b.length&&this.loadAudioSourceAssets(b)},onAssetChanged:function(b, -a,c,d){"resource"===a&&this.data.sources&&(this.data.sources[b.name]=c,this.data.currentSource===b.name&&this.channel&&(this.channel.paused?(this.play(b.name),this.pause()):this.play(b.name)))},onAssetRemoved:function(b){b.off("remove",this.onAssetRemoved,this);this.data.sources[b.name]&&(delete this.data.sources[b.name],this.data.currentSource===b.name&&(this.stop(),this.data.currentSource=null))},onSetLoop:function(b,a,c){a!=c&&this.channel&&this.channel.setLoop(c)},onSetVolume:function(b,a,c){a!= -c&&this.channel&&this.channel.setVolume(c)},onSetPitch:function(b,a,c){a!=c&&this.channel&&this.channel.setPitch(c)},onSetMaxDistance:function(b,a,c){a!=c&&this.channel instanceof pc.Channel3d&&this.channel.setMaxDistance(c)},onSetMinDistance:function(b,a,c){a!=c&&this.channel instanceof pc.Channel3d&&this.channel.setMinDistance(c)},onSetRollOffFactor:function(b,a,c){a!=c&&this.channel instanceof pc.Channel3d&&this.channel.setRollOffFactor(c)},onSetDistanceModel:function(b,a,c){a!==c&&this.channel instanceof -pc.Channel3d&&this.channel.setDistanceModel(c)},onSet3d:function(b,a,c){a!==c&&this.system.initialized&&this.currentSource&&(a=b=!1,this.channel&&(b=this.channel.paused,a=this.channel.suspended),this.play(this.currentSource),this.channel&&(this.channel.paused=b,this.channel.suspended=a))},onEnable:function(){var b=this.data.assets;if(b)for(var a=this.system.app.assets,c=0,d=b.length;carguments.length?(arguments[0]&&this.entity.setPosition(arguments[0]),arguments[1]&&(arguments[1]instanceof pc.Quat?this.entity.setRotation(arguments[1]):this.entity.setEulerAngles(arguments[1]))):(6===arguments.length&&this.entity.setEulerAngles(arguments[3],arguments[4],arguments[5]),this.entity.setPosition(arguments[0],arguments[1],arguments[2]));this.syncEntityToBody()},_updateKinematic:function(a){this._displacement.copy(this._linearVelocity).scale(a);this.entity.translate(this._displacement); -this._displacement.copy(this._angularVelocity).scale(a);this.entity.rotate(this._displacement.x,this._displacement.y,this._displacement.z);if(this.body.getMotionState()){a=this.entity.getPosition();var b=this.entity.getRotation();e.getOrigin().setValue(a.x,a.y,a.z);c.setValue(b.x,b.y,b.z,b.w);e.setRotation(c);this.body.getMotionState().setWorldTransform(e)}},onEnable:function(){this.body||this.createBody();this.enableSimulation()},onDisable:function(){this.disableSimulation()},onSetMass:function(a, -b,c){if(a=this.data.body){(b=this.enabled&&this.entity.enabled)&&this.disableSimulation();var d=new Ammo.btVector3(0,0,0);a.getCollisionShape().calculateLocalInertia(c,d);a.setMassProps(c,d);a.updateInertiaTensor();b&&this.enableSimulation()}},onSetLinearDamping:function(a,b,c){(a=this.data.body)&&a.setDamping(c,this.data.angularDamping)},onSetAngularDamping:function(a,b,c){(a=this.data.body)&&a.setDamping(this.data.linearDamping,c)},onSetLinearFactor:function(a,c,d){if(a=this.data.body)b.setValue(d.x, -d.y,d.z),a.setLinearFactor(b)},onSetAngularFactor:function(a,c,d){if(a=this.data.body)b.setValue(d.x,d.y,d.z),a.setAngularFactor(b)},onSetFriction:function(a,b,c){(a=this.data.body)&&a.setFriction(c)},onSetRestitution:function(a,b,c){(a=this.data.body)&&a.setRestitution(c)},onSetType:function(a,b,c){c!==b&&(this.disableSimulation(),c===pc.BODYTYPE_DYNAMIC?(this.data.group=pc.BODYGROUP_DYNAMIC,this.data.mask=pc.BODYMASK_ALL):c===pc.BODYTYPE_KINEMATIC?(this.data.group=pc.BODYGROUP_KINEMATIC,this.data.mask= -pc.BODYMASK_ALL):(this.data.group=pc.BODYGROUP_STATIC,this.data.mask=pc.BODYMASK_NOT_STATIC),this.createBody())},onSetGroupOrMask:function(a,b,c){c!==b&&this.enabled&&this.entity.enabled&&(this.disableSimulation(),this.enableSimulation())},onSetBody:function(a,b,c){this.body&&this.data.simulationEnabled&&this.body.activate()}});return{RigidBodyComponent:f}}());Object.assign(pc,function(){var e,b,a={},c={},d=!1,f=function(a,b,c){this.entity=a;this.point=b;this.normal=c},g=function(a,b,c){0===arguments.length?(this.b=this.a=null,this.localPointA=new pc.Vec3,this.localPointB=new pc.Vec3,this.pointA=new pc.Vec3,this.pointB=new pc.Vec3,this.normal=new pc.Vec3):(this.a=a,this.b=b,this.localPointA=c.localPoint,this.localPointB=c.localPointOther,this.pointA=c.point,this.pointB=c.pointOther,this.normal=c.normal)},l=function(a,b,c,d,f){0===arguments.length?(this.localPoint= -new pc.Vec3,this.localPointOther=new pc.Vec3,this.point=new pc.Vec3,this.pointOther=new pc.Vec3,this.normal=new pc.Vec3):(this.localPoint=a,this.localPointOther=b,this.point=c,this.pointOther=d,this.normal=f)},h=function(a,b){this.other=a;this.contacts=b},p="enabled type mass linearDamping angularDamping linearFactor angularFactor friction restitution group mask body".split(" "),k=function(a){pc.ComponentSystem.call(this,a);this.id="rigidbody";this.description="Adds the entity to the scene's physical simulation."; -this._stats=a.stats.frame;this.ComponentType=pc.RigidBodyComponent;this.DataType=pc.RigidBodyComponentData;this.contactPointPool=new pc.AllocatePool(l,1);this.contactResultPool=new pc.AllocatePool(h,1);this.singleContactResultPool=new pc.AllocatePool(g,1);this.schema=p;this.maxSubSteps=10;this.fixedTimeStep=1/60;this.on("remove",this.onRemove,this)};k.prototype=Object.create(pc.ComponentSystem.prototype);k.prototype.constructor=k;pc.Component._buildAccessors(pc.RigidBodyComponent.prototype,p);Object.assign(k.prototype, -{onLibraryLoaded:function(){if("undefined"!==typeof Ammo){var a=new Ammo.btDefaultCollisionConfiguration,c=new Ammo.btCollisionDispatcher(a),d=new Ammo.btDbvtBroadphase,f=new Ammo.btSequentialImpulseConstraintSolver;this.dynamicsWorld=new Ammo.btDiscreteDynamicsWorld(c,d,f,a);this._ammoGravity=new Ammo.btVector3(0,-9.82,0);this.dynamicsWorld.setGravity(this._ammoGravity);e=new Ammo.btVector3;b=new Ammo.btVector3;pc.ComponentSystem.bind("update",this.onUpdate,this)}else pc.ComponentSystem.unbind("update", -this.onUpdate,this)},initializeComponentData:function(a,b,c){c="enabled mass linearDamping angularDamping linearFactor angularFactor friction restitution type group mask".split(" ");for(var d={},f=0,g=c.length;fa[g].others.indexOf(d)&&(a[g].others.push(d),f=!0);c[g]=c[g]||{others:[],entity:b};c[g].others.push(d);return f},_createContactPointFromAmmo:function(a){var b=this.contactPointPool.allocate();b.localPoint.set(a.get_m_localPointA().x(),a.get_m_localPointA().y(),a.get_m_localPointA().z());b.localPointOther.set(a.get_m_localPointB().x(),a.get_m_localPointB().y(),a.get_m_localPointB().z());b.point.set(a.getPositionWorldOnA().x(),a.getPositionWorldOnA().y(),a.getPositionWorldOnA().z()); -b.pointOther.set(a.getPositionWorldOnB().x(),a.getPositionWorldOnB().y(),a.getPositionWorldOnB().z());b.normal.set(a.get_m_normalWorldOnB().x(),a.get_m_normalWorldOnB().y(),a.get_m_normalWorldOnB().z());return b},_createReverseContactPointFromAmmo:function(a){var b=this.contactPointPool.allocate();b.localPointOther.set(a.get_m_localPointA().x(),a.get_m_localPointA().y(),a.get_m_localPointA().z());b.localPoint.set(a.get_m_localPointB().x(),a.get_m_localPointB().y(),a.get_m_localPointB().z());b.pointOther.set(a.getPositionWorldOnA().x(), -a.getPositionWorldOnA().y(),a.getPositionWorldOnA().z());b.point.set(a.getPositionWorldOnB().x(),a.getPositionWorldOnB().y(),a.getPositionWorldOnB().z());b.normal.set(a.get_m_normalWorldOnB().x(),a.get_m_normalWorldOnB().y(),a.get_m_normalWorldOnB().z());return b},_createSingleContactResult:function(a,b,c){var d=this.singleContactResultPool.allocate();d.a=a;d.b=b;d.localPointA=c.localPoint;d.localPointB=c.localPointOther;d.pointA=c.point;d.pointB=c.pointOther;d.normal=c.normal;return d},_createContactResult:function(a, -b){var c=this.contactResultPool.allocate();c.other=a;c.contacts=b;return c},_cleanOldCollisions:function(){for(var b in a)if(a.hasOwnProperty(b)){for(var d=a[b].entity,f=d.collision,g=a[b].others,e=g.length;e--;){var h=g[e];if(!c[b]||0>c[b].others.indexOf(h))g.splice(e,1),f&&h.collision&&(d.rigidbody&&h.rigidbody?f.fire("collisionend",h):d.trigger&&f.fire("triggerleave",h))}0===g.length&&delete a[b]}},onUpdate:function(a){this.dynamicsWorld.stepSimulation(a,this.maxSubSteps,this.fixedTimeStep);var b= -this.store,d;for(d in b)if(b.hasOwnProperty(d)){var f=b[d].entity,g=b[d].data;g.body&&g.body.isActive()&&g.enabled&&f.enabled&&(g.type===pc.BODYTYPE_DYNAMIC?f.rigidbody.syncBodyToEntity():g.type===pc.BODYTYPE_KINEMATIC&&f.rigidbody._updateKinematic(a))}a=this.dynamicsWorld.getDispatcher();var b=a.getNumManifolds(),e;c={};for(d=0;dthis.layers.indexOf(a.id)||a.addMeshInstances(this.data.model.meshInstances))},onLayerRemoved:function(a){this.data.model&&(0>this.layers.indexOf(a.id)||a.removeMeshInstances(this.data.model.meshInstances))}, -_bindColorMapAsset:function(a){a.once("remove",this._onColorMapRemoved,this);a.resource?this.colorMap=a.resource:(a.once("load",this._onColorMapLoad,this),this.enabled&&this.entity.enabled&&this.system.app.assets.load(a))},_unbindColorMapAsset:function(a){a.off("remove",this._onColorMapRemoved,this);a.off("load",this._onColorMapLoad,this)},_onColorMapLoad:function(a){this.colorMap=a.resource},_onColorMapRemoved:function(a){this.colorMapAsset=null},onSetColorMapAsset:function(a,b,c){var d=this;a=this.system.app.assets; -b&&(b=a.get(b))&&this._unbindColorMapAsset(b);if(c)if(c instanceof pc.Asset&&(c=this.data.colorMapAsset=c.id),b=a.get(c))d._bindColorMapAsset(b);else a.once("add:"+c,function(a){d._bindColorMapAsset(a)});else this.colorMap=null},_bindNormalMapAsset:function(a){a.once("remove",this._onNormalMapRemoved,this);a.resource?this.normalMap=a.resource:(a.once("load",this._onNormalMapLoad,this),this.enabled&&this.entity.enabled&&this.system.app.assets.load(a))},_unbindNormalMapAsset:function(a){a.off("remove", -this._onNormalMapRemoved,this);a.off("load",this._onNormalMapLoad,this)},_onNormalMapLoad:function(a){this.normalMap=a.resource},_onNormalMapRemoved:function(a){this.normalMapAsset=null},onSetNormalMapAsset:function(a,b,c){var d=this;a=this.system.app.assets;b&&(b=a.get(b))&&this._unbindNormalMapAsset(b);if(c)if(c instanceof pc.Asset&&(c=this.data.normalMapAsset=c.id),b=a.get(c))d._bindNormalMapAsset(b);else a.once("add:"+c,function(a){d._bindNormalMapAsset(a)});else this.normalMap=null},_bindMeshAsset:function(a){a.on("remove", -this._onMeshAssetRemoved,this);a.on("load",this._onMeshAssetLoad,this)},_unbindMeshAsset:function(a){a.off("remove",this._onMeshAssetRemoved,this);a.off("load",this._onMeshAssetLoad,this)},_onMeshAssetLoad:function(a){this._onMeshChanged(a.resource)},onSetMeshAsset:function(a,b,c){a=this.system.app.assets;b&&(b=a.get(b))&&this._unbindMeshAsset(b);if(c){if(c instanceof pc.Asset&&(c=this.data.meshAsset=c.id),b=a.get(c))this._bindMeshAsset(b),b.resource?this._onMeshChanged(b.resource):a.load(b)}else this._onMeshChanged(null)}, -onSetMesh:function(a,b,c){!c||c instanceof pc.Asset||"number"===typeof c?this.meshAsset=c:this._onMeshChanged(c)},_onMeshChanged:function(a){!a||a instanceof pc.Mesh||(a=a.meshInstances[0]?a.meshInstances[0].mesh:null);this.data.mesh=a;this.emitter&&(this.emitter.mesh=a,this.emitter.resetMaterial(),this.rebuild())},onMeshAssetRemoved:function(a){a.off("remove",this.onMeshAssetRemoved,this);this.mesh=null},onSetLoop:function(a,b,c){this.emitter&&(this.emitter[a]=c,this.emitter.resetTime())},onSetBlendType:function(a, -b,c){this.emitter&&(this.emitter[a]=c,this.emitter.material.blendType=c,this.emitter.resetMaterial(),this.rebuild())},_requestDepth:function(){this._requestedDepth||(d||(d=this.system.app.scene.layers.getLayerById(pc.LAYERID_DEPTH)),d&&(d.incrementCounter(),this._requestedDepth=!0))},_releaseDepth:function(){this._requestedDepth&&d&&(d.decrementCounter(),this._requestedDepth=!1)},onSetDepthSoftening:function(a,b,c){b!==c&&(c?this.enabled&&this.entity.enabled&&this._requestDepth():this.enabled&&this.entity.enabled&& -this._releaseDepth(),this.emitter&&(this.emitter[a]=c),this.emitter&&(this.reset(),this.emitter.resetMaterial(),this.rebuild()))},onSetSimpleProperty:function(a,b,c){this.emitter&&(this.emitter[a]=c,this.emitter.resetMaterial())},onSetComplexProperty:function(a,b,c){this.emitter&&(this.emitter[a]=c,this.reset(),this.emitter.resetMaterial(),this.rebuild())},onSetGraphProperty:function(a,b,c){this.emitter&&(this.emitter[a]=c,this.emitter.rebuildGraphs(),this.emitter.resetMaterial())},onEnable:function(){for(var a= -this.data,b=0,d=c.length;bf;f++)q[3*f]=this.app.scene.ambientLight.r,q[3*f+1]=this.app.scene.ambientLight.g,q[3*f+2]=this.app.scene.ambientLight.b;var r=e._sortedLights[pc.LIGHTTYPE_DIRECTIONAL];for(g=0;ge;e++){var t=Math.max(n.lightCubeDir[e].dot(r[g]._direction), -0)*r[g]._intensity;q[3*e]+=r[g]._color.r*t;q[3*e+1]+=r[g]._color.g*t;q[3*e+2]+=r[g]._color.b*t}}n.constantLightCube.setValue(q)}if(!k.paused){n.simTime+=a;n.simTime>n.fixedTimeStep&&(d=Math.floor(n.simTime/n.fixedTimeStep),n.simTime-=d*n.fixedTimeStep);if(d){d=Math.min(d,n.maxSubSteps);for(f=0;fthis.fps?-1:1),c=this.duration;b=a>c||0>a;this._setTime(a);a=this._sprite?Math.floor(this._sprite.frameKeys.length*this._time/c):0;a!==this._frame&&this._setFrame(a);b&&(this.loop?(this.fire("loop"),this._component.fire("loop", -this)):(this._paused=this._playing=!1,this.fire("end"),this._component.fire("end",this)))}},_setTime:function(b){this._time=b;b=this.duration;0>this._time?this._time=this.loop?this._time%b+b:0:this._time>b&&(this._time=this.loop?this._time%b:b)},_setFrame:function(b){this._frame=this._sprite?pc.math.clamp(b,0,this._sprite.frameKeys.length-1):b;this._component.currentClip===this&&this._component._showFrame(this._frame)},_destroy:function(){this._sprite&&(this.sprite=null);this._spriteAsset&&(this.spriteAsset= -null)},play:function(){this._playing||(this._playing=!0,this._paused=!1,this.frame=0,this.fire("play"),this._component.fire("play",this))},pause:function(){this._playing&&!this._paused&&(this._paused=!0,this.fire("pause"),this._component.fire("pause",this))},resume:function(){this._paused&&(this._paused=!1,this.fire("resume"),this._component.fire("resume",this))},stop:function(){this._playing&&(this._paused=this._playing=!1,this.frame=this._time=0,this.fire("stop"),this._component.fire("stop",this))}}); -Object.defineProperty(e.prototype,"spriteAsset",{get:function(){return this._spriteAsset},set:function(b){var a=this._component.system.app.assets,c=b;b instanceof pc.Asset&&(c=b.id);this._spriteAsset!==c&&(this._spriteAsset&&(b=a.get(this._spriteAsset))&&this._unbindSpriteAsset(b),(this._spriteAsset=c)?(c=a.get(this._spriteAsset))?this._bindSpriteAsset(c):(this.sprite=null,a.on("add:"+this._spriteAsset,this._onSpriteAssetAdded,this)):this.sprite=null)}});Object.defineProperty(e.prototype,"sprite", -{get:function(){return this._sprite},set:function(b){this._sprite&&(this._sprite.off("set:meshes",this._onSpriteMeshesChange,this),this._sprite.off("set:pixelsPerUnit",this._onSpritePpuChanged,this),this._sprite.off("set:atlas",this._onSpriteMeshesChange,this),this._sprite.atlas&&this._sprite.atlas.off("set:texture",this._onSpriteMeshesChange,this));if(this._sprite=b)if(this._sprite.on("set:meshes",this._onSpriteMeshesChange,this),this._sprite.on("set:pixelsPerUnit",this._onSpritePpuChanged,this), -this._sprite.on("set:atlas",this._onSpriteMeshesChange,this),this._sprite.atlas)this._sprite.atlas.on("set:texture",this._onSpriteMeshesChange,this);if(this._component.currentClip===this){var a;if(b&&b.atlas){if(b.atlas.texture){if(a=this._component._meshInstance)a.setParameter("texture_emissiveMap",b.atlas.texture),a.setParameter("texture_opacityMap",b.atlas.texture);this._component.enabled&&this._component.entity.enabled&&this._component._showModel()}this.time&&this.fps?this.time=this.time:this.frame= -this.frame}else{if(a=this._component._meshInstance)a.deleteParameter("texture_emissiveMap"),a.deleteParameter("texture_opacityMap");this._component._hideModel()}}}});Object.defineProperty(e.prototype,"frame",{get:function(){return this._frame},set:function(b){this._setFrame(b);this._setTime(this._frame/(this.fps||Number.MIN_VALUE))}});Object.defineProperty(e.prototype,"isPlaying",{get:function(){return this._playing}});Object.defineProperty(e.prototype,"isPaused",{get:function(){return this._paused}}); -Object.defineProperty(e.prototype,"duration",{get:function(){return this._sprite?this._sprite.frameKeys.length/Math.abs(this.fps||Number.MIN_VALUE):0}});Object.defineProperty(e.prototype,"time",{get:function(){return this._time},set:function(b){this._setTime(b);this.frame=this._sprite?Math.min(this._sprite.frameKeys.length-1,Math.floor(this._time*Math.abs(this.fps))):0}});return{SpriteAnimationClip:e}}());Object.assign(pc,function(){pc.SPRITETYPE_SIMPLE="simple";pc.SPRITETYPE_ANIMATED="animated";var e=function(b,a){pc.Component.call(this,b,a);this._type=pc.SPRITETYPE_SIMPLE;this._material=b.defaultMaterial;this._color=new pc.Color(1,1,1,1);this._colorUniform=new Float32Array(3);this._speed=1;this._flipY=this._flipX=!1;this._height=this._width=1;this._drawOrder=0;this._layers=[pc.LAYERID_WORLD];this._outerScale=new pc.Vec2(1,1);this._outerScaleUniform=new Float32Array(2);this._innerOffset=new pc.Vec4; -this._innerOffsetUniform=new Float32Array(4);this._atlasRect=new pc.Vec4;this._atlasRectUniform=new Float32Array(4);this._batchGroupId=-1;this._batchGroup=null;this._node=new pc.GraphNode;this._model=new pc.Model;this._model.graph=this._node;this._meshInstance=null;a.addChild(this._model.graph);this._model._entity=a;this._updateAabbFunc=this._updateAabb.bind(this);this._addedModel=!1;this._autoPlayClip=null;this._clips={};this._currentClip=this._defaultClip=new pc.SpriteAnimationClip(this,{name:this.entity.name, -fps:0,loop:!1,spriteAsset:null})};e.prototype=Object.create(pc.Component.prototype);e.prototype.constructor=e;Object.assign(e.prototype,{onEnable:function(){var b=this.system.app,a=b.scene;a.on("set:layers",this._onLayersChanged,this);a.layers&&(a.layers.on("add",this._onLayerAdded,this),a.layers.on("remove",this._onLayerRemoved,this));this._showModel();this._autoPlayClip&&this._tryAutoPlay();0<=this._batchGroupId&&b.batcher.insert(pc.BatchGroup.SPRITE,this._batchGroupId,this.entity)},onDisable:function(){var b= -this.system.app,a=b.scene;a.off("set:layers",this._onLayersChanged,this);a.layers&&(a.layers.off("add",this._onLayerAdded,this),a.layers.off("remove",this._onLayerRemoved,this));this.stop();this._hideModel();0<=this._batchGroupId&&b.batcher.remove(pc.BatchGroup.SPRITE,this._batchGroupId,this.entity)},onDestroy:function(){this._currentClip=null;this._defaultClip&&(this._defaultClip._destroy(),this._defaultClip=null);for(var b in this._clips)this._clips[b]._destroy();this._clips=null;this._hideModel(); -this._model=null;this._node&&(this._node.parent&&this._node.parent.removeChild(this._node),this._node=null);this._meshInstance&&(this._meshInstance.material=null,this._meshInstance=this._meshInstance.mesh=null)},_showModel:function(){if(!this._addedModel&&this._meshInstance){var b,a,c=[this._meshInstance];b=0;for(a=this._layers.length;bthis.layers.indexOf(b.id)||this._addedModel&&this.enabled&&this.entity.enabled&&this._meshInstance&&b.addMeshInstances([this._meshInstance])},_onLayerRemoved:function(b){this._meshInstance&&(0>this.layers.indexOf(b.id)||b.removeMeshInstances([this._meshInstance]))}, -addClip:function(b){var a=new pc.SpriteAnimationClip(this,{name:b.name,fps:b.fps,loop:b.loop,spriteAsset:b.spriteAsset});this._clips[b.name]=a;a.name&&a.name===this._autoPlayClip&&this._tryAutoPlay();return a},removeClip:function(b){delete this._clips[b]},clip:function(b){return this._clips[b]},play:function(b){var a=this._clips[b],c=this._currentClip;c&&c!==a&&(c._playing=!1);(this._currentClip=a)?(this._currentClip=a,this._currentClip.play()):logWARNING("Trying to play sprite animation "+b+" which does not exist."); -return a},pause:function(){this._currentClip!==this._defaultClip&&this._currentClip.isPlaying&&this._currentClip.pause()},resume:function(){this._currentClip!==this._defaultClip&&this._currentClip.isPaused&&this._currentClip.resume()},stop:function(){this._currentClip!==this._defaultClip&&this._currentClip.stop()}});Object.defineProperty(e.prototype,"type",{get:function(){return this._type},set:function(b){this._type!==b&&(this._type=b,this._type===pc.SPRITETYPE_SIMPLE?(this.stop(),this._currentClip= -this._defaultClip,this.enabled&&this.entity.enabled&&(this._currentClip.frame=this.frame,this._currentClip.sprite?this._showModel():this._hideModel())):this._type===pc.SPRITETYPE_ANIMATED&&(this.stop(),this._autoPlayClip&&this._tryAutoPlay(),this._currentClip&&this._currentClip.isPlaying&&this.enabled&&this.entity.enabled?this._showModel():this._hideModel()))}});Object.defineProperty(e.prototype,"frame",{get:function(){return this._currentClip.frame},set:function(b){this._currentClip.frame=b}});Object.defineProperty(e.prototype, -"spriteAsset",{get:function(){return this._defaultClip._spriteAsset},set:function(b){this._defaultClip.spriteAsset=b}});Object.defineProperty(e.prototype,"sprite",{get:function(){return this._currentClip.sprite},set:function(b){this._currentClip.sprite=b}});Object.defineProperty(e.prototype,"material",{get:function(){return this._material},set:function(b){this._material=b;this._meshInstance&&(this._meshInstance.material=b)}});Object.defineProperty(e.prototype,"color",{get:function(){return this._color}, -set:function(b){this._color.r=b.r;this._color.g=b.g;this._color.b=b.b;this._meshInstance&&(this._colorUniform[0]=this._color.r,this._colorUniform[1]=this._color.g,this._colorUniform[2]=this._color.b,this._meshInstance.setParameter("material_emissive",this._colorUniform))}});Object.defineProperty(e.prototype,"opacity",{get:function(){return this._color.a},set:function(b){this._color.a=b;this._meshInstance&&this._meshInstance.setParameter("material_opacity",b)}});Object.defineProperty(e.prototype,"clips", -{get:function(){return this._clips},set:function(b){var a,c;if(b){for(a in this._clips){var d=!1;for(c in b)if(b[c].name===a){d=!0;this._clips[a].fps=b[c].fps;this._clips[a].loop=b[c].loop;b[c].hasOwnProperty("sprite")?this._clips[a].sprite=b[c].sprite:b[c].hasOwnProperty("spriteAsset")&&(this._clips[a].spriteAsset=b[c].spriteAsset);break}d||this.removeClip(a)}for(c in b)this._clips[b[c].name]||this.addClip(b[c]);this._autoPlayClip&&this._tryAutoPlay();this._currentClip&&this._currentClip.sprite|| -this._hideModel()}else for(a in this._clips)this.removeClip(a)}});Object.defineProperty(e.prototype,"currentClip",{get:function(){return this._currentClip}});Object.defineProperty(e.prototype,"speed",{get:function(){return this._speed},set:function(b){this._speed=b}});Object.defineProperty(e.prototype,"flipX",{get:function(){return this._flipX},set:function(b){this._flipX!==b&&(this._flipX=b,this._updateTransform())}});Object.defineProperty(e.prototype,"flipY",{get:function(){return this._flipY}, -set:function(b){this._flipY!==b&&(this._flipY=b,this._updateTransform())}});Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(b){b!==this._width&&(this._width=b,this._outerScale.x=this._width,!this.sprite||this.sprite.renderMode!==pc.SPRITE_RENDERMODE_TILED&&this.sprite.renderMode!==pc.SPRITE_RENDERMODE_SLICED||this._updateTransform())}});Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(b){b!==this._height&&(this._height= -b,this._outerScale.y=this.height,!this.sprite||this.sprite.renderMode!==pc.SPRITE_RENDERMODE_TILED&&this.sprite.renderMode!==pc.SPRITE_RENDERMODE_SLICED||this._updateTransform())}});Object.defineProperty(e.prototype,"batchGroupId",{get:function(){return this._batchGroupId},set:function(b){if(this._batchGroupId!==b){var a=this._batchGroupId;this._batchGroupId=b;this.entity.enabled&&0<=a&&this.system.app.batcher.remove(pc.BatchGroup.SPRITE,a,this.entity);this.entity.enabled&&0<=b?this.system.app.batcher.insert(pc.BatchGroup.SPRITE, -b,this.entity):0<=a&&this._currentClip&&this._currentClip.sprite&&this.enabled&&this.entity.enabled&&this._showModel()}}});Object.defineProperty(e.prototype,"autoPlayClip",{get:function(){return this._autoPlayClip},set:function(b){this._autoPlayClip=b instanceof pc.SpriteAnimationClip?b.name:b;this._tryAutoPlay()}});Object.defineProperty(e.prototype,"drawOrder",{get:function(){return this._drawOrder},set:function(b){this._drawOrder=b;this._meshInstance&&(this._meshInstance.drawOrder=b)}});Object.defineProperty(e.prototype, -"layers",{get:function(){return this._layers},set:function(b){this._addedModel&&this._hideModel();this._layers=b;this._meshInstance&&this.enabled&&this.entity.enabled&&this._showModel()}});Object.defineProperty(e.prototype,"aabb",{get:function(){return this._meshInstance?this._meshInstance.aabb:null}});return{SpriteComponent:e}}());Object.assign(pc,function(){var e=["enabled"],b=function(a){pc.ComponentSystem.call(this,a);this.id="sprite";this.app=a;this.ComponentType=pc.SpriteComponent;this.DataType=pc.SpriteComponentData;this.schema=e;this._defaultTexture=new pc.Texture(a.graphicsDevice,{width:1,height:1,format:pc.PIXELFORMAT_R8_G8_B8_A8});a=this._defaultTexture.lock();var b=new Uint8Array(4);b[0]=255;b[1]=255;b[2]=255;b[3]=255;a.set(b);this._defaultTexture.name="sprite";this._defaultTexture.unlock();this.defaultMaterial= -new pc.StandardMaterial;this.defaultMaterial.diffuse=new pc.Color(0,0,0,1);this.defaultMaterial.emissive=new pc.Color(.5,.5,.5,1);this.defaultMaterial.emissiveMap=this._defaultTexture;this.defaultMaterial.emissiveMapTint=!0;this.defaultMaterial.opacityMap=this._defaultTexture;this.defaultMaterial.opacityMapChannel="a";this.defaultMaterial.opacityTint=!0;this.defaultMaterial.opacity=0;this.defaultMaterial.useLighting=!1;this.defaultMaterial.useGammaTonemap=!1;this.defaultMaterial.useFog=!1;this.defaultMaterial.useSkybox= -!1;this.defaultMaterial.blendType=pc.BLEND_PREMULTIPLIED;this.defaultMaterial.depthWrite=!1;this.defaultMaterial.pixelSnap=!1;this.defaultMaterial.cull=pc.CULLFACE_NONE;this.defaultMaterial.update();this.default9SlicedMaterialSlicedMode=this.defaultMaterial.clone();this.default9SlicedMaterialSlicedMode.nineSlicedMode=pc.SPRITE_RENDERMODE_SLICED;this.default9SlicedMaterialSlicedMode.update();this.default9SlicedMaterialTiledMode=this.defaultMaterial.clone();this.default9SlicedMaterialTiledMode.nineSlicedMode= -pc.SPRITE_RENDERMODE_TILED;this.default9SlicedMaterialTiledMode.update();pc.ComponentSystem.bind("update",this.onUpdate,this);this.on("beforeremove",this.onBeforeRemove,this)};b.prototype=Object.create(pc.ComponentSystem.prototype);b.prototype.constructor=b;pc.Component._buildAccessors(pc.SpriteComponent.prototype,e);Object.assign(b.prototype,{destroy:function(){this._defaultTexture.destroy();this._defaultTexture=null},initializeComponentData:function(a,b,d){void 0!==b.enabled&&(a.enabled=b.enabled); -a.type=b.type;b.layers&&"array"===pc.type(b.layers)&&(a.layers=b.layers.slice(0));void 0!==b.drawOrder&&(a.drawOrder=b.drawOrder);void 0!==b.color&&(b.color instanceof pc.Color?a.color.set(b.color.r,b.color.g,b.color.b,void 0!==b.opacity?b.opacity:1):a.color.set(b.color[0],b.color[1],b.color[2],void 0!==b.opacity?b.opacity:1),a.color=a.color);void 0!==b.opacity&&(a.opacity=b.opacity);void 0!==b.flipX&&(a.flipX=b.flipX);void 0!==b.flipY&&(a.flipY=b.flipY);void 0!==b.width&&(a.width=b.width);void 0!== -b.height&&(a.height=b.height);void 0!==b.spriteAsset&&(a.spriteAsset=b.spriteAsset);b.sprite&&(a.sprite=b.sprite);void 0!==b.frame&&(a.frame=b.frame);if(b.clips)for(var c in b.clips)a.addClip(b.clips[c]);void 0!==b.speed&&(a.speed=b.speed);b.autoPlayClip&&(a.autoPlayClip=b.autoPlayClip);a.batchGroupId=void 0===b.batchGroupId||null===b.batchGroupId?-1:b.batchGroupId;pc.ComponentSystem.prototype.initializeComponentData.call(this,a,b,d)},cloneComponent:function(a,b){var c=a.sprite;return this.addComponent(b, -{enabled:c.enabled,type:c.type,spriteAsset:c.spriteAsset,sprite:c.sprite,frame:c.frame,color:c.color.clone(),opacity:c.opacity,flipX:c.flipX,flipY:c.flipY,speed:c.speed,clips:c.clips,autoPlayClip:c.autoPlayClip,batchGroupId:c.batchGroupId,drawOrder:c.drawOrder,layers:c.layers.slice(0)})},onUpdate:function(a){var b=this.store,d;for(d in b)if(b.hasOwnProperty(d)){var f=b[d];f.data.enabled&&f.entity.enabled&&(f=f.entity.sprite,f._currentClip&&f._currentClip._update(a))}},onBeforeRemove:function(a,b){b.onDestroy()}}); -return{SpriteComponentSystem:b}}());Object.assign(pc,function(){return{SpriteComponentData:function(){this.enabled=!0}}}());Object.assign(pc,function(){pc.SCALEMODE_NONE="none";pc.SCALEMODE_BLEND="blend";var e=function(a,b){pc.Component.call(this,a,b);this._resolution=new pc.Vec2(640,320);this._referenceResolution=new pc.Vec2(640,320);this._scaleMode=pc.SCALEMODE_NONE;this.scale=1;this._scaleBlend=.5;this._priority=0;this.cull=this._screenSpace=!1;this._screenMatrix=new pc.Mat4;a.app.graphicsDevice.on("resizecanvas",this._onResize,this)};e.prototype=Object.create(pc.Component.prototype);e.prototype.constructor=e;var b= -new pc.Mat4;Object.assign(e.prototype,{syncDrawOrder:function(){this.system.queueDrawOrderSync(this.entity.getGuid(),this._processDrawOrderSync,this)},_recurseDrawOrderSync:function(a,b){if(!(a instanceof pc.Entity))return b;if(a.element){var c=a.element.drawOrder;a.element.drawOrder=b++;0<=a.element._batchGroupId&&c!=a.element.drawOrder&&this.system.app.batcher.markGroupDirty(a.element._batchGroupId)}for(var c=a.getChildren(),f=0;fthis.system._prerender.indexOf(a)&& -this.system._prerender.push(a)}a=b}},_onPrerender:function(){for(var a=0;athis.layers.indexOf(a.id)||(this._image?a.addMeshInstances(this._image._model.meshInstances):this._text&&a.addMeshInstances(this._text._model.meshInstances))},onLayerRemoved:function(a){0> -this.layers.indexOf(a.id)||(this._image?a.removeMeshInstances(this._image._model.meshInstances):this._text&&a.removeMeshInstances(this._text._model.meshInstances))},onEnable:function(){if(this._image)this._image.onEnable();if(this._text)this._text.onEnable();if(this._group)this._group.onEnable();this.useInput&&this.system.app.elementInput&&this.system.app.elementInput.addElement(this);this.system.app.scene.on("set:layers",this.onLayersChanged,this);this.system.app.scene.layers&&(this.system.app.scene.layers.on("add", -this.onLayerAdded,this),this.system.app.scene.layers.on("remove",this.onLayerRemoved,this));0<=this._batchGroupId&&this.system.app.batcher.insert(pc.BatchGroup.ELEMENT,this.batchGroupId,this.entity);this.fire("enableelement")},onDisable:function(){this.system.app.scene.off("set:layers",this.onLayersChanged,this);this.system.app.scene.layers&&(this.system.app.scene.layers.off("add",this.onLayerAdded,this),this.system.app.scene.layers.off("remove",this.onLayerRemoved,this));if(this._image)this._image.onDisable(); -if(this._text)this._text.onDisable();if(this._group)this._group.onDisable();this.system.app.elementInput&&this.useInput&&this.system.app.elementInput.removeElement(this);0<=this._batchGroupId&&this.system.app.batcher.remove(pc.BatchGroup.ELEMENT,this.batchGroupId,this.entity);this.fire("disableelement")},onRemove:function(){this.entity.off("insert",this._onInsert,this);this._unpatch();this._image&&this._image.destroy();this._text&&this._text.destroy();this.system.app.elementInput&&this.useInput&& -this.system.app.elementInput.removeElement(this);this.screen&&this.screen.screen&&(this._unbindScreen(this.screen.screen),this.screen.screen.syncDrawOrder());this.off()},_calculateSize:function(a,b){if(this.entity._parent||this.screen){this._calculateLocalAnchors();var c=this._absRight-this._absLeft,d=this._absTop-this._absBottom;a?this._setWidth(c):this._setCalculatedWidth(c,!1);b?this._setHeight(d):this._setCalculatedHeight(d,!1);c=this.entity.getLocalPosition();c.x=this._margin.x+this._calculatedWidth* -this._pivot.x;c.y=this._margin.y+this._calculatedHeight*this._pivot.y;this.entity.setLocalPosition(c);this._sizeDirty=!1}},_setWidth:function(a){this._width=a;this._setCalculatedWidth(a,!1);this.fire("set:width",this._width)},_setHeight:function(a){this._height=a;this._setCalculatedHeight(a,!1);this.fire("set:height",this._height)},_setCalculatedWidth:function(a,b){if(!(1E-4>=Math.abs(a-this._calculatedWidth))){this._calculatedWidth=a;this.entity._dirtifyLocal();if(b){var c=this.entity.getLocalPosition(); -this._margin.x=c.x-this._calculatedWidth*this._pivot.x;this._margin.z=this._localAnchor.z-this._localAnchor.x-this._calculatedWidth-this._margin.x}this._flagChildrenAsDirty();this.fire("set:calculatedWidth",this._calculatedWidth);this.fire("resize",this._calculatedWidth,this._calculatedHeight)}},_setCalculatedHeight:function(a,b){if(!(1E-4>=Math.abs(a-this._calculatedHeight))){this._calculatedHeight=a;this.entity._dirtifyLocal();if(b){var c=this.entity.getLocalPosition();this._margin.y=c.y-this._calculatedHeight* -this._pivot.y;this._margin.w=this._localAnchor.w-this._localAnchor.y-this._calculatedHeight-this._margin.y}this._flagChildrenAsDirty();this.fire("set:calculatedHeight",this._calculatedHeight);this.fire("resize",this._calculatedWidth,this._calculatedHeight)}},_flagChildrenAsDirty:function(){var a,b,c=this.entity._children;a=0;for(b=c.length;ac||e>a||hc;c++)this._screenTransform.transformPoint(this._screenCorners[c],this._screenCorners[c]),b&&this._screenCorners[c].scale(this.screen.screen.scale),a&&this._screenCorners[c].add(a); -this._cornersDirty=!1;this._worldCornersDirty=this._canvasCornersDirty=!0;return this._screenCorners}});Object.defineProperty(g.prototype,"canvasCorners",{get:function(){if(!this._canvasCornersDirty||!this.screen||!this.screen.screen.screenSpace)return this._canvasCorners;for(var a=this.system.app.graphicsDevice,b=this.screenCorners,c=a.canvas.clientWidth/a.width,d=a.canvas.clientHeight/a.height,f=0;4>f;f++)this._canvasCorners[f].set(b[f].x*c,(a.height-b[f].y)*d);this._canvasCornersDirty=!1;return this._canvasCorners}}); -Object.defineProperty(g.prototype,"worldCorners",{get:function(){if(!this._worldCornersDirty)return this._worldCorners;if(this.screen){var b=this.screenCorners;if(!this.screen.screen.screenSpace){a.copy(this.screen.screen._screenMatrix);a.data[13]=-a.data[13];a.mul2(this.screen.getWorldTransform(),a);for(var g=0;4>g;g++)a.transformPoint(b[g],this._worldCorners[g])}}else b=this.entity.getLocalPosition(),a.setTranslate(-b.x,-b.y,-b.z),c.setTRS(pc.Vec3.ZERO,this.entity.getLocalRotation(),this.entity.getLocalScale()), -d.setTranslate(b.x,b.y,b.z),f.copy(this.entity.parent.getWorldTransform()),f.mul(d).mul(c).mul(a),e.set(b.x-this.pivot.x*this.calculatedWidth,b.y-this.pivot.y*this.calculatedHeight,b.z),f.transformPoint(e,this._worldCorners[0]),e.set(b.x+(1-this.pivot.x)*this.calculatedWidth,b.y-this.pivot.y*this.calculatedHeight,b.z),f.transformPoint(e,this._worldCorners[1]),e.set(b.x+(1-this.pivot.x)*this.calculatedWidth,b.y+(1-this.pivot.y)*this.calculatedHeight,b.z),f.transformPoint(e,this._worldCorners[2]),e.set(b.x- -this.pivot.x*this.calculatedWidth,b.y+(1-this.pivot.y)*this.calculatedHeight,b.z),f.transformPoint(e,this._worldCorners[3]);this._worldCornersDirty=!1;return this._worldCorners}});Object.defineProperty(g.prototype,"textWidth",{get:function(){return this._text?this._text.width:0}});Object.defineProperty(g.prototype,"textHeight",{get:function(){return this._text?this._text.height:0}});Object.defineProperty(g.prototype,"useInput",{get:function(){return this._useInput},set:function(a){this._useInput!== -a&&(this._useInput=a,this.system.app.elementInput&&(a?this.enabled&&this.entity.enabled&&this.system.app.elementInput.addElement(this):this.system.app.elementInput.removeElement(this)),this.fire("set:useInput",a))}});Object.defineProperty(g.prototype,"batchGroupId",{get:function(){return this._batchGroupId},set:function(a){this._batchGroupId!==a&&(this.entity.enabled&&0<=this._batchGroupId&&this.system.app.batcher.remove(pc.BatchGroup.ELEMENT,this.batchGroupId,this.entity),this.entity.enabled&&0<= -a&&this.system.app.batcher.insert(pc.BatchGroup.ELEMENT,a,this.entity),0>a&&0<=this._batchGroupId&&this.enabled&&this.entity.enabled&&(this._image&&this._image._renderable.model?this.addModelToLayers(this._image._renderable.model):this._text&&this._text._model&&this.addModelToLayers(this._text._model)),this._batchGroupId=a)}});Object.defineProperty(g.prototype,"maskedBy",{get:function(){return this._maskedBy}});var l=function(a){Object.defineProperty(g.prototype,a,{get:function(){return this._text? -this._text[a]:this._image?this._image[a]:null},set:function(b){this._text?this._text[a]=b:this._image&&(this._image[a]=b)}})};l("fontSize");l("minFontSize");l("maxFontSize");l("maxLines");l("autoFitWidth");l("autoFitHeight");l("color");l("font");l("fontAsset");l("spacing");l("lineHeight");l("wrapLines");l("lines");l("alignment");l("autoWidth");l("autoHeight");l("rtlReorder");l("unicodeConverter");l("text");l("key");l("texture");l("textureAsset");l("material");l("materialAsset");l("sprite");l("spriteAsset"); -l("spriteFrame");l("pixelsPerUnit");l("opacity");l("rect");l("mask");l("outlineColor");l("outlineThickness");l("shadowColor");l("shadowOffset");return{ElementComponent:g}}());Object.assign(pc,function(){var e=["enabled"],b=function(a){pc.ComponentSystem.call(this,a);this.id="element";this.app=a;this.ComponentType=pc.ElementComponent;this.DataType=pc.ElementComponentData;this.schema=e;this._rtlReorder=this._unicodeConverter=null;this._defaultTexture=new pc.Texture(a.graphicsDevice,{width:1,height:1,format:pc.PIXELFORMAT_R8_G8_B8_A8});this._defaultTexture.name="element-system";a=this._defaultTexture.lock();var b=new Uint8Array(4);b[0]=255;b[1]=255;b[2]=255;b[3]=255;a.set(b); -this._defaultTexture.unlock();this.defaultScreenSpaceBitmapTextMaterial=this.defaultScreenSpaceTextMaterial=this.defaultBitmapTextMaterial=this.defaultTextMaterial=this.defaultScreenSpaceImageMaskMaterial=this.defaultScreenSpaceImageMask9TiledMaterial=this.defaultScreenSpaceImageMask9SlicedMaterial=this.defaultScreenSpaceImage9TiledMaterial=this.defaultScreenSpaceImage9SlicedMaterial=this.defaultScreenSpaceImageMaterial=this.defaultImage9TiledMaskMaterial=this.defaultImage9SlicedMaskMaterial=this.defaultImageMaskMaterial= -this.defaultImage9TiledMaterial=this.defaultImage9SlicedMaterial=this.defaultImageMaterial=null;this.defaultImageMaterials=[];this.on("beforeremove",this.onRemoveComponent,this)};b.prototype=Object.create(pc.ComponentSystem.prototype);b.prototype.constructor=b;pc.Component._buildAccessors(pc.ElementComponent.prototype,e);Object.assign(b.prototype,{destroy:function(){this._defaultTexture.destroy()},initializeComponentData:function(a,b,d){a._beingInitialized=!0;void 0!==b.anchor&&(b.anchor instanceof -pc.Vec4?a.anchor.copy(b.anchor):a.anchor.set(b.anchor[0],b.anchor[1],b.anchor[2],b.anchor[3]));void 0!==b.pivot&&(b.pivot instanceof pc.Vec2?a.pivot.copy(b.pivot):a.pivot.set(b.pivot[0],b.pivot[1]));var c=.001this._maxLines||x=F&&0< -B&&!L&&(0>this._maxLines||x=this._meshInfo.length)P.lines[x-1]-=C,P.quad-=C;else for(H=w;Hthis._element.calculatedWidth&&(N=Math.floor(this._element.fontSize*this._element.calculatedWidth/(this.width||1E-4)),N=pc.math.clamp(N,p,k),N!==this._element.fontSize)){this._fontSize=N;K=!0;break}this.height=Math.max(this.height,A-(t+I));if(this._shouldAutoFitHeight()&&this.height>this._element.calculatedHeight&&(N=pc.math.clamp(this._fontSize-1,p,k),N!==this._element.fontSize)){this._fontSize= -N;K=!0;break}m+=this._spacing*M;L||Y||(r=m);d.test(H)&&(D++,v=r,w=E+1);B++;H=this._getUv(H);P.uvs[8*C+0]=H[0];P.uvs[8*C+1]=H[1];P.uvs[8*C+2]=H[2];P.uvs[8*C+3]=H[1];P.uvs[8*C+4]=H[2];P.uvs[8*C+5]=H[3];P.uvs[8*C+6]=H[0];P.uvs[8*C+7]=H[3];P.quad++}}K||y=F?(T.element[pc.SEMANTIC_POSITION].set(0,0,0),T.element[pc.SEMANTIC_TEXCOORD0].set(0,0)):(T.element[pc.SEMANTIC_POSITION].set(this._meshInfo[E].positions[3*r+0],this._meshInfo[E].positions[3*r+1],this._meshInfo[E].positions[3*r+2]),T.element[pc.SEMANTIC_TEXCOORD0].set(this._meshInfo[E].uvs[2* -r+0],this._meshInfo[E].uvs[2*r+1])),T.next();T.end();this._meshInfo[E].meshInstance.mesh.aabb.compute(this._meshInfo[E].positions);this._meshInfo[E].meshInstance._aabbVer=-1}this._aabbDirty=!0},_onFontAdded:function(a){this._system.app.assets.off("add:"+a.id,this._onFontAdded,this);a.id===this._fontAsset&&this._bindFont(a)},_bindFont:function(a){this._entity.enabled&&(a.on("load",this._onFontLoad,this),a.on("change",this._onFontChange,this),a.on("remove",this._onFontRemove,this),a.resource?this._onFontLoad(a): -this._system.app.assets.load(a))},_unbindFont:function(a){a.off("load",this._onFontLoad,this);a.off("change",this._onFontChange,this);a.off("remove",this._onFontRemove,this)},_onFontRender:function(){this.font=this._font},_onFontLoad:function(a){this.font!==a.resource&&(this.font=a.resource)},_onFontChange:function(a,b,c,d){if("data"===b)for(this._font.data=c,a=this._font.data.info.maps.length,b=0;bthis._font.textures.length&&(this._meshInfo.length=this._font.textures.length);this._updateText()}}});Object.defineProperty(b.prototype,"alignment",{get:function(){return this._alignment},set:function(a){a instanceof pc.Vec2?this._alignment.set(a.x,a.y):this._alignment.set(a[0], -a[1]);this._font&&this._updateText()}});Object.defineProperty(b.prototype,"autoWidth",{get:function(){return this._autoWidth},set:function(a){var b=this._autoWidth;(this._autoWidth=a)&&1E-4>Math.abs(this._element.anchor.x-this._element.anchor.z)&&(this._element.width=this.width);b!==a&&(a=this._shouldAutoFit()?this._maxFontSize:this._originalFontSize,a!==this._fontSize&&(this._fontSize=a,this._font&&this._updateText()))}});Object.defineProperty(b.prototype,"autoHeight",{get:function(){return this._autoHeight}, -set:function(a){var b=this._autoHeight;(this._autoHeight=a)&&1E-4>Math.abs(this._element.anchor.y-this._element.anchor.w)&&(this._element.height=this.height);b!==a&&(a=this._shouldAutoFit()?this._maxFontSize:this._originalFontSize,a!==this._fontSize&&(this._fontSize=a,this._font&&this._updateText()))}});Object.defineProperty(b.prototype,"rtlReorder",{get:function(){return this._rtlReorder},set:function(a){this._rtlReorder!==a&&(this._rtlReorder=a,this._font&&this._updateText())}});Object.defineProperty(b.prototype, -"unicodeConverter",{get:function(){return this._unicodeConverter},set:function(a){this._unicodeConverter!==a&&(this._unicodeConverter=a,this.text=this._text)}});Object.defineProperty(b.prototype,"aabb",{get:function(){if(this._aabbDirty){for(var a=!1,b=0;bthis.dragThreshold||Math.abs(b)>this.dragThreshold)&&this._disableContentInput()}},_onSetContentOrViewportSize:function(){this._syncAll()},_onSetHorizontalScrollbarValue:function(a){!this._scrollbarUpdateFlags[pc.ORIENTATION_HORIZONTAL]&&this.enabled&&this.entity.enabled&&this._onSetScroll(a,null)},_onSetVerticalScrollbarValue:function(a){!this._scrollbarUpdateFlags[pc.ORIENTATION_VERTICAL]&& -this.enabled&&this.entity.enabled&&this._onSetScroll(null,a)},_onSetHorizontalScrollingEnabled:function(){this._syncScrollbarEnabledState(pc.ORIENTATION_HORIZONTAL)},_onSetVerticalScrollingEnabled:function(){this._syncScrollbarEnabledState(pc.ORIENTATION_VERTICAL)},_onHorizontalScrollbarGain:function(){this._syncScrollbarEnabledState(pc.ORIENTATION_HORIZONTAL);this._syncScrollbarPosition(pc.ORIENTATION_HORIZONTAL)},_onVerticalScrollbarGain:function(){this._syncScrollbarEnabledState(pc.ORIENTATION_VERTICAL); -this._syncScrollbarPosition(pc.ORIENTATION_VERTICAL)},_onSetScroll:function(a,b,d){!1!==d&&this._velocity.set(0,0,0);a=0|this._updateAxis(a,"x",pc.ORIENTATION_HORIZONTAL);(a|=this._updateAxis(b,"y",pc.ORIENTATION_VERTICAL))&&this.fire("set:scroll",this._scroll)},_updateAxis:function(a,b,d){var c=null!==a&&1E-5this._getViewportSize(a)},_contentPositionToScrollValue:function(a){var b=this._getMaxOffset(pc.ORIENTATION_HORIZONTAL),d=this._getMaxOffset(pc.ORIENTATION_VERTICAL); -e.x=0===b?0:a.x/b;e.y=0===d?0:a.y/-d;return e},_getMaxOffset:function(a,b){b=void 0===b?this._getContentSize(a):b;var c=this._getViewportSize(a);return bMath.abs(f))return 1;c=Math.min(c/f,1);f=this._toOvershoot(this._scroll[a],b);return 0===f?c:c/(1+Math.abs(f))},_getViewportSize:function(a){return this._getSize(a, -this._viewportReference)},_getContentSize:function(a){return this._getSize(a,this._contentReference)},_getSize:function(a,b){return b.entity&&b.entity.element?b.entity.element[this._getCalculatedDimension(a)]:0},_getScrollingEnabled:function(a){if(a===pc.ORIENTATION_HORIZONTAL)return this.horizontal;if(a===pc.ORIENTATION_VERTICAL)return this.vertical;console.warn("Unrecognized orientation: "+a)},_getScrollbarVisibility:function(a){if(a===pc.ORIENTATION_HORIZONTAL)return this.horizontalScrollbarVisibility; -if(a===pc.ORIENTATION_VERTICAL)return this.verticalScrollbarVisibility;console.warn("Unrecognized orientation: "+a)},_getSign:function(a){return a===pc.ORIENTATION_HORIZONTAL?1:-1},_getAxis:function(a){return a===pc.ORIENTATION_HORIZONTAL?"x":"y"},_getCalculatedDimension:function(a){return a===pc.ORIENTATION_HORIZONTAL?"calculatedWidth":"calculatedHeight"},_destroyDragHelper:function(){this._contentDragHelper&&this._contentDragHelper.destroy()},onUpdate:function(){this._contentReference.entity&&(this._updateVelocity(), -this._syncScrollbarEnabledState(pc.ORIENTATION_HORIZONTAL),this._syncScrollbarEnabledState(pc.ORIENTATION_VERTICAL))},_updateVelocity:function(){if(!this._isDragging()&&(this.scrollMode===pc.SCROLL_MODE_BOUNCE&&(this._hasOvershoot("x",pc.ORIENTATION_HORIZONTAL)&&this._setVelocityFromOvershoot(this.scroll.x,"x",pc.ORIENTATION_HORIZONTAL),this._hasOvershoot("y",pc.ORIENTATION_VERTICAL)&&this._setVelocityFromOvershoot(this.scroll.y,"y",pc.ORIENTATION_VERTICAL)),this._velocity.x*=1-this.friction,this._velocity.y*= -1-this.friction,1E-4a?a:a>c?a-c:0},_setVelocityFromOvershoot:function(a,b,d){a=this._toOvershoot(a, -d)*this._getMaxOffset(d)*this._getSign(d);0d&&(a.x=-1*Math.log10(1-d));b=this._getMaxScrollValue(pc.ORIENTATION_VERTICAL);d=this._toOvershoot(a.y,pc.ORIENTATION_VERTICAL);0d&&(a.y=-1*Math.log10(1-d));return a},_isDragging:function(){return this._contentDragHelper&&this._contentDragHelper.isDragging},_setScrollbarComponentsEnabled:function(a){this._scrollbarReferences[pc.ORIENTATION_HORIZONTAL].hasComponent("scrollbar")&& -(this._scrollbarReferences[pc.ORIENTATION_HORIZONTAL].entity.scrollbar.enabled=a);this._scrollbarReferences[pc.ORIENTATION_VERTICAL].hasComponent("scrollbar")&&(this._scrollbarReferences[pc.ORIENTATION_VERTICAL].entity.scrollbar.enabled=a)},_setContentDraggingEnabled:function(a){this._contentDragHelper&&(this._contentDragHelper.enabled=a)},_enableContentInput:function(){for(;this._disabledContentInputEntities.length;){var a=this._disabledContentInputEntities.pop();a.element&&(a.element.useInput=!0)}this._disabledContentInput= -!1},_disableContentInput:function(){var a=this,b=function(c){c.element&&c.element.useInput&&(a._disabledContentInputEntities.push(c),c.element.useInput=!1);c=c.children;var d,f;d=0;for(f=c.length;d=c?f.APPLY_SHRINKING:f.NONE;case pc.FITTING_BOTH:return b=c?f.APPLY_SHRINKING:f.NONE;default:throw Error("Unrecognized fitting mode: "+a);}}function l(a,b){return x(a,b.size)+(a.length- -1)*z.spacing[b.axis]}function q(a,b,c){var d=w(a,c.maxSize),f=v(a,c.fittingProportion),e=B(f,d);b=g[c.axis]-b;for(var h=0;hMath.abs(c)&&1E-5>Math.abs(a)?b:b*c/a}function t(a){for(var b=[],c=0;cg[A.axis]&&0!==d[d.length-1].length&&(n=u,d.push([]));d[d.length-1].push(c[r]);p&&n>g[A.axis]&&r!==c.length-1&&(n=0,d.push([]))}c=d}else c=[c];d=z.orientation===pc.ORIENTATION_HORIZONTAL&&z.reverseX||z.orientation===pc.ORIENTATION_VERTICAL&&z.reverseY;k=z.orientation===pc.ORIENTATION_HORIZONTAL&&z.reverseY||z.orientation===pc.ORIENTATION_VERTICAL&&z.reverseX;if(d)for(n= -0;np.largestSize[F.size]&&(p.largestElement=p[k],p.largestSize=v)}u.push(p.largestElement);r.push(p.largestSize)}k= -l(r,F);n=h(z[F.fitting],k,g[F.axis]);n===f.APPLY_STRETCHING?q(r,k,F):n===f.APPLY_SHRINKING&&m(r,k,F);for(n=0;nthis._data.version)if(this._data.info.maps=[{width:this._data.info.width, -height:this._data.info.height}],this._data.chars)for(var a in this._data.chars)this._data.chars[a].map=0}});return{FONT_MSDF:pc.FONT_MSDF,Font:e}}());Object.assign(pc,function(){var e=function(b,a){this.type="bitmap";this.app=b;this.intensity=0;a=a||{};this.fontWeight=a.fontWeight||"normal";this.glyphSize=this.fontSize=parseInt(a.fontSize,10);this.fontName=a.fontName||"Arial";this.color=a.color||new pc.Color(1,1,1);var c=4096w&&(w=this.fontSize*this.fontSize/y,e.font=this.fontWeight+" "+w.toString()+"px "+this.fontName,y=this.fontSize);this.renderCharacter(e,a,u,x,f);this._addChar(this.data,a,v,u-t,x-r,k,r,(k-y)/2,q[a].descent-n,y,b-1,c,d);u+=k;u+t>c&&(u=t,x+=r,x>d&&(this.textures[b-1].upload(),b++,x=r,b>p?(a=document.createElement("canvas"), -a.height=d,a.width=c,e=this._getAndClearContext(a,l),v=new pc.Texture(this.app.graphicsDevice,{format:pc.PIXELFORMAT_R8_G8_B8_A8,autoMipmap:!0}),v.name="font-atlas",v.setSource(a),v.minFilter=pc.FILTER_LINEAR_MIPMAP_LINEAR,v.magFilter=pc.FILTER_LINEAR,v.addressU=pc.ADDRESS_CLAMP_TO_EDGE,v.addressV=pc.ADDRESS_CLAMP_TO_EDGE,this.textures.push(v)):(a=this.textures[b-1].getSource(),e=this._getAndClearContext(a,l))))}this.textures[b-1].upload();if(bb&&(c=d-1);return a};e.prototype._doSort=function(b,a){var c=this._sortBy;return b[c]-a[c]};e.prototype.insert=function(b){var a=this._binarySearch(b);this.items.splice(a,0,b); -this.length++;this.loopIndex>=a&&this.loopIndex++};e.prototype.append=function(b){this.items.push(b);this.length++};e.prototype.remove=function(b){b=this.items.indexOf(b);0>b||(this.items.splice(b,1),this.length--,this.loopIndex>=b&&this.loopIndex--)};e.prototype.sort=function(){var b=0<=this.loopIndex?this.items[this.loopIndex]:null;this.items.sort(this._sortHandler);null!==b&&(this.loopIndex=this.items.indexOf(b))};return{SortedLoopArray:e}}());Object.assign(pc,function(){var e=function(b){this._handlers={};this._requests={};this._cache={};this._app=b};Object.assign(e.prototype,{addHandler:function(b,a){this._handlers[b]=a;a._loader=this},removeHandler:function(b){delete this._handlers[b]},getHandler:function(b){return this._handlers[b]},load:function(b,a,c,d){var f=this._handlers[a];if(f){var e=b+a;if(void 0!==this._cache[e])c(null,this._cache[e]);else if(this._requests[e])this._requests[e].push(c);else{this._requests[e]=[c];var l=function(a, -b){if(a){console.error(a);if(this._requests[e])for(var c=0,g=this._requests[e].length;c=f)throw Error("Invalid PAX header data format.");var l=parseInt(d.decode(new Uint8Array(a,b+g,k-g)),10);k=d.decode(new Uint8Array(a,b+k+1,l-(k- -g)-2)).split("=");if(2!==k.length)throw Error("Invalid PAX header data format.");0===k[1].length&&(k[1]=null);h.push({name:k[0],value:k[1]});g+=l}return new c(h)};c.prototype.applyHeader=function(a){for(var b=0;bd;d++)f=new pc.Texture(this._device, -{cubemap:!0,fixCubemapSeams:!0,mipmaps:!0,format:b._dds.format,rgbm:b._dds.rgbm,width:Math.pow(2,7-d),height:Math.pow(2,7-d)}),f.name="cubemap-mip",f._levels[0]=b._dds._levels[d],f.upload(),b.resources.push(f);d=!0}f=b.resource;f.name!==b.name&&(f.name=b.name);var e=!!b.data.rgbm;b.data.hasOwnProperty("rgbm")&&f.rgbm!==e&&(f.rgbm=e);f.fixCubemapSeams=!!b._dds;b.data.hasOwnProperty("minFilter")&&f.minFilter!==b.data.minFilter&&(f.minFilter=b.data.minFilter);b.data.hasOwnProperty("magFilter")&&f.magFilter!== -b.data.magFilter&&(f.magFilter=b.data.magFilter);b.data.hasOwnProperty("anisotropy")&&f.anisotropy!==b.data.anisotropy&&(f.anisotropy=b.data.anisotropy);f.addressU!==pc.ADDRESS_CLAMP_TO_EDGE&&(f.addressU=pc.ADDRESS_CLAMP_TO_EDGE);f.addressV!==pc.ADDRESS_CLAMP_TO_EDGE&&(f.addressV=pc.ADDRESS_CLAMP_TO_EDGE);this._patchTextureFaces(b,a);d&&(a.fire("load",b),a.fire("load:"+b.id,b),b.fire("load",b))},_patchTexture:function(){this.registry._loader._handlers.cubemap._patchTextureFaces(this,this.registry)}, -_patchTextureFaces:function(b,a){if(b.loadFaces||!b.file){var c=b.resource,d=[],f=0,e=!1,l=this;b._levelsEvents||(b._levelsEvents=[null,null,null,null,null,null]);b.data.textures.forEach(function(g,p){var h=function(g){f++;d[p]=g&&g.resource.getSource()||null;var h=b._levelsEvents[p];if(h!==g){h&&h.off("load",l._patchTexture,b);if(g)g.on("load",l._patchTexture,b);b._levelsEvents[p]=g||null}d[p]!==c._levels[0][p]&&(e=!0);6===f&&e&&(c.setSource(d),a.fire("load",b),a.fire("load:"+b.id,b),b.fire("load", -b))},n=function(b){b.ready(h);a.load(b)},q=a.get(g);q?(q.ready(h),a.load(q)):g?(a.once("load:"+g,h),a.once("add:"+g,n)):h(null)})}}});return{CubemapHandler:e}}());Object.assign(pc,function(){var e=function(){};Object.assign(e.prototype,{load:function(b,a){"string"===typeof b&&(b={load:b,original:b});var c={};b.load.startsWith("blob:")&&(c.responseType=pc.Http.ResponseType.JSON);pc.http.get(b.load,c,function(c,f){c?a(pc.string.format("Error loading JSON resource: {0} [{1}]",b.original,c)):a(null,f)})},open:function(b,a){return a},patch:function(b,a){}});return{JsonHandler:e}}());Object.assign(pc,function(){var e={aoMap:"white",diffuseMap:"gray",specularMap:"gray",metalnessMap:"black",glossMap:"gray",emissiveMap:"gray",normalMap:"normal",heightMap:"gray",opacityMap:"gray",sphereMap:"gray",lightMap:"white"},b=function(a){this._assets=a.assets;this._device=a.graphicsDevice;this._placeholderTextures=null;this._parser=new pc.JsonStandardMaterialParser};Object.assign(b.prototype,{load:function(a,b){"string"===typeof a&&(a={load:a,original:a});pc.http.get(a.load,function(c,f){c? -b&&b(pc.string.format("Error loading material: {0} [{1}]",a.original,c)):b&&(f._engine=!0,b(null,f))})},open:function(a,b){var c=this._parser.parse(b);b._engine&&(c._data=b,delete b._engine);return c},_createPlaceholders:function(){this._placeholderTextures={};var a={white:[255,255,255,255],gray:[128,128,128,255],black:[0,0,0,255],normal:[128,128,255,255]},b;for(b in a)if(a.hasOwnProperty(b)){this._placeholderTextures[b]=new pc.Texture(this._device,{width:2,height:2,format:pc.PIXELFORMAT_R8_G8_B8_A8}); -this._placeholderTextures[b].name="placeholder";for(var d=this._placeholderTextures[b].lock(),f=0;4>f;f++)for(var e=0;4>e;e++)d[4*f+e]=a[b][e];this._placeholderTextures[b].unlock()}},patch:function(a,b){a.resource._data&&(a._data=a.resource._data,delete a.resource._data);a.data.name=a.name;a.resource.name=a.name;this._bindAndAssignAssets(a,b);a.off("unload",this._onAssetUnload,this);a.on("unload",this._onAssetUnload,this)},_onAssetUnload:function(a){delete a.data.parameters;delete a.data.chunks;delete a.data.name}, -_assignTexture:function(a,b,d){b.data[a]=d;b.resource[a]=d},_assignPlaceholderTexture:function(a,b){this._placeholderTextures||this._createPlaceholders();b.resource[a]=this._placeholderTextures[e[a]]},_onTextureLoad:function(a,b,d){this._assignTexture(a,b,d.resource);b.resource.update()},_onTextureAdd:function(a,b,d){this._assets.load(d)},_onTextureRemove:function(a,b,d){var c=b.resource;c[a]===d.resource&&(this._assignTexture(a,b,null),c.update())},_assignCubemap:function(a,b,d){b.data[a]=d[0];7=== -d.length&&(b.data.prefilteredCubeMap128=d[1],b.data.prefilteredCubeMap64=d[2],b.data.prefilteredCubeMap32=d[3],b.data.prefilteredCubeMap16=d[4],b.data.prefilteredCubeMap8=d[5],b.data.prefilteredCubeMap4=d[6])},_onCubemapLoad:function(a,b,d){this._assignCubemap(a,b,d.resources);this._parser.initialize(b.resource,b.data)},_onCubemapAdd:function(a,b,d){b.data.shadingModel===pc.SPECULAR_PHONG&&(b.loadFaces=!0);this._assets.load(d)},_onCubemapRemove:function(a,b,d){var c=b.resource;c[a]===d.resource&& -(this._assignCubemap(a,b,[null,null,null,null,null,null,null]),c.update())},_bindAndAssignAssets:function(a,b){var c=this._parser.migrate(a.data),f=a.resource,e="path"===c.mappingFormat,l=pc.StandardMaterial.TEXTURE_PARAMETERS,h;e&&(h=pc.path.getDirectory(a.getFileUrl()));var p,k,n;for(p=0;pa.version&&(2>a.version&&(a.info.maps=a.info.maps||[{width:a.info.width,height:a.info.height}]),a.chars=Object.keys(a.chars||{}).reduce(function(b,d){var c=a.chars[d],e=void 0!==c.letter?c.letter:pc.string.fromCodePoint(d);2>a.version&&(c.map=c.map||0);b[e]=c;return b},{}),a.version=3);return a}var b=function(a){this._loader=a};Object.assign(b.prototype,{load:function(a,b,d){"string"===typeof a&&(a={load:a,original:a});var c=this;".json"===pc.path.getExtension(a.original)? -pc.http.get(a.load,function(d,f){var g=e(f);d?b(pc.string.format("Error loading font resource: {0} [{1}]",a.original,d)):c._loadTextures(a.original.replace(".json",".png"),g,function(a,c){if(a)return b(a);b(null,{data:g,textures:c})})}):(d&&d.data&&(d.data=e(d.data)),this._loadTextures(a.original,d&&d.data,b))},_loadTextures:function(a,b,d){var c=b.info.maps.length,e=0,l=null,h=Array(c),p=this._loader;b=function(b){var f=function(a,f){if(!l){if(a)return l=a,d(a);f.upload();h[b]=f;e++;e===c&&d(null, -h)}};0===b?p.load(a,"texture",f):p.load(a.replace(".png",b+".png"),"texture",f)};for(var k=0;k=b.version)return null;var b=this._parseNodes(a),c=this._parseSkins(a,b),e=this._parseMorphs(a,b),l=this._parseVertexBuffers(a),h=this._parseIndexBuffers(a,l),h=this._parseMeshes(a,c.skins,e.morphs,l,h.buffer,h.data);this._initMorphs(a,e.morphs,l,h);a=this._parseMeshInstances(a,b,h,c.skins,c.instances,e.morphs,e.instances);l=new pc.Model;l.graph=b[0];l.meshInstances=a;l.skinInstances=c.instances;l.morphInstances=e.instances;l.getGraph().syncHierarchy();return l}, -_parseNodes:function(a){a=a.model;var b=[],c;for(c=0;cr* -I+v*G+w*H?-1:1;return k},_initMorphs:function(a,b,f,e){a=a.model;var c,d,g,k,n,q,m,r,t,u,x,v,w,y,D,B=[],z=[];for(f=0;fe&&(e=a)}});Object.defineProperty(d.prototype,"file",{get:function(){return this._file}, -set:function(a){var b;if(!!a!==!!this._file||a&&this._file&&a.hash!==this._file)if(a){this._file||(this._file={});this._file.url=a.url;this._file.filename=a.filename;this._file.hash=a.hash;this._file.size=a.size;this._file.variants=this.variants;if(a.hasOwnProperty("variants")&&(this.variants.clear(),a.variants))for(b in a.variants)a.variants[b]&&(this.variants[b]=a.variants[b]);this.fire("change",this,"file",this._file,this._file);this.reload()}else this._file=null,this.variants.clear();else if(a&& -this._file&&a.hasOwnProperty("variants")&&(this.variants.clear(),a.variants))for(b in a.variants)a.variants[b]&&(this.variants[b]=a.variants[b])}});Object.defineProperty(d.prototype,"data",{get:function(){return this._data},set:function(a){var b=this._data;this._data=a;a!==b&&(this.fire("change",this,"data",a,b),this.loaded&&this.registry._loader.patch(this,this.registry))}});Object.defineProperty(d.prototype,"resource",{get:function(){return this._resources[0]},set:function(a){var b=this._resources[0]; -this._resources[0]=a;this.fire("change",this,"resource",a,b)}});Object.defineProperty(d.prototype,"resources",{get:function(){return this._resources},set:function(a){var b=this._resources;this._resources=a;this.fire("change",this,"resources",a,b)}});Object.defineProperty(d.prototype,"preload",{get:function(){return this._preload},set:function(a){a=!!a;this._preload!==a&&(this._preload=a)&&!this.loaded&&!this.loading&&this.registry&&this.registry.load(this)}});return{Asset:d,ASSET_ANIMATION:"animation", -ASSET_AUDIO:"audio",ASSET_IMAGE:"image",ASSET_JSON:"json",ASSET_MODEL:"model",ASSET_MATERIAL:"material",ASSET_TEXT:"text",ASSET_TEXTURE:"texture",ASSET_CUBEMAP:"cubemap",ASSET_SHADER:"shader",ASSET_CSS:"css",ASSET_HTML:"html",ASSET_SCRIPT:"script",ABSOLUTE_URL:b}}());Object.assign(pc,function(){var e=[],b=function(a){this.asset=a},a=function(a){var c="_"+a;e.push(c);Object.defineProperty(b.prototype,a,{get:function(){return this[c]||null},set:function(a){if(!!this[c]!==!!a||this[c]&&a&&this[c].hash!==a.hash)this[c]=a?{url:a.url,filename:a.filename,size:a.size,hash:a.hash,opt:a.opt||0}:null,this.asset.file&&(this.asset.fire("change",this.asset,"file",this.asset._file,this.asset._file),this.asset.reload())}})};a("dxt");a("pvr");a("etc1");a("etc2");b.prototype.clear= -function(){for(var a=0;athis.layers.indexOf(a)&& -this.layers.push(a)};d.prototype.getLayerIdx=function(a){return this.layerToBatch[a.id]};d.prototype.addLayerIdx=function(a,b){this.layerToBatch[b.id]=a};var f=function(){this.numLinesAllocated=128;this.mesh=this.vbRam=this.vb=null;this.linesUsed=0;this.layer=this.meshInstance=this.material=null};Object.assign(f.prototype,{init:function(a,c,d,e){this.mesh||(this.mesh=new pc.Mesh,this.mesh.primitive[0].type=pc.PRIMITIVE_LINES,this.mesh.primitive[0].base=0,this.mesh.primitive[0].indexed=!1,this.material= -new pc.BasicMaterial,this.material.vertexColors=!0,this.material.blend=!0,this.material.blendType=pc.BLEND_NORMAL,this.material.update());for(this.layer=d;this.linesUsed+e>this.numLinesAllocated;)this.vb&&(this.vb.destroy(),this.vb=null),this.numLinesAllocated*=2;this.vertexFormat=c;this.vb||(this.vb=new pc.VertexBuffer(a,c,2*this.numLinesAllocated,pc.BUFFER_DYNAMIC),this.mesh.vertexBuffer=this.vb,this.vbRam=new DataView(this.vb.lock()),this.meshInstance||(b.worldTransform=pc.Mat4.IDENTITY,b._dirtyWorld= -b._dirtyNormal=!1,this.meshInstance=new pc.MeshInstance(b,this.mesh,this.material),this.meshInstance.cull=!1))},addLines:function(a,b){for(var c=!!b.length,d=2*this.linesUsed*this.vertexFormat.size,e,f=0;fd;d++)a.transformPoint(e[d],f[d]);this.renderLines([f[0],f[1],f[1],f[2],f[2],f[3],f[3],f[0],f[4],f[5],f[5],f[6],f[6],f[7],f[7],f[4],f[0],f[4],f[1],f[5],f[2],f[6],f[3],f[7]],b,c)},_addLines:function(a,b,c){void 0===c.layer&&(c.layer=this.scene.layers.getLayerById(pc.LAYERID_IMMEDIATE));void 0===c.depthTest&&(c.depthTest=!0);this._initImmediate();var d=c.layer; -this._immediateData.addLayer(d);var e=this._immediateData.getLayerIdx(d);void 0===e?(e=new f,e.init(this.graphicsDevice,this._immediateData.lineVertexFormat,d,a.length/2),e.material.depthTest=c.depthTest,c.mask&&(e.meshInstance.mask=c.mask),e=this._immediateData.lineBatches.push(e)-1,this._immediateData.addLayerIdx(e,d)):(this._immediateData.lineBatches[e].init(this.graphicsDevice,this._immediateData.lineVertexFormat,d,a.length/2),this._immediateData.lineBatches[e].material.depthTest=c.depthTest, -c.mask&&(this._immediateData.lineBatches[e].meshInstance.mask=c.mask));this._immediateData.lineBatches[e].addLines(a,b)},_initImmediate:function(){this._immediateData||(this._immediateData=new d(this.graphicsDevice),this.on("prerender",this._preRenderImmediate,this),this.on("postrender",this._postRenderImmediate,this))},_preRenderImmediate:function(){for(var a=0;am;m++)M.setValue(Q),pc.drawQuadWithShader(t,J,I),M.setValue(fa),pc.drawQuadWithShader(t,ea,I);for(m=0;mb.indexOf(a[c]))return!1;for(c=0;c -a.indexOf(b[c]))return!1;return!0}var c=function(a,b,c,d,e){this.dynamic=c;this.maxAabbSize=d;this.id=a;this.name=b;this.layers=void 0===e?[pc.LAYERID_WORLD]:e;this._ui=!1;this._obj={model:[],element:[],sprite:[]}};c.MODEL="model";c.ELEMENT="element";c.SPRITE="sprite";var d=function(a,b,c){this.device=a;this.rootNode=c;this._dirty=!0;this.bones=b;b=b.length;a.supportsBoneTextures?(b=256 -this._dirtyGroups.indexOf(a)&&this._dirtyGroups.push(a)};f.prototype.getGroupByName=function(a){var b=this._batchGroups,c;for(c in b)if(b.hasOwnProperty(c)&&b[c].name===a)return b[c];return null};f.prototype.getBatches=function(a){for(var b=[],c=this._batchList.length,d=0;dd._obj[a].indexOf(c)&&(d._obj[a].push(c),this.markGroupDirty(b))};f.prototype.remove=function(a,b,c){var d=this._batchGroups[b];d&&(c=d._obj[a].indexOf(c),0<=c&&(d._obj[a].splice(c,1),this.markGroupDirty(b)))};f.prototype._extractModel=function(a,b, -c,d){if(!a.model||!a.model.model)return b;if(a.model.isStatic){d=this.scene.drawCalls;var e=a.model.meshInstances;for(c=0;ce.indexOf(d[c]._staticSource)||b.push(d[c]));for(c=0;ca.indexOf(this._batchList[b].batchGroupId)?c.push(this._batchList[b]):this.destroy(this._batchList[b]);this._batchList=c;this._collectAndRemoveModels(d,a);if(a===this._dirtyGroups)this._dirtyGroups.length=0;else{c=[];for(b=0;ba.indexOf(this._dirtyGroups[b])&&c.push(this._dirtyGroups[b]);this._dirtyGroups=c}var e,f, -g;for(g in d)if(d.hasOwnProperty(g)&&(b=d[g],a=this._batchGroups[g]))for(e=this.prepare(b,a.dynamic,a.maxAabbSize,a._ui),b=0;b=g){F=F.concat(A.slice(c));break}if(h!==G.material|| -l!==G.layer||u!==G._shaderDefs||65535e||y.halfExtents.y>e||y.halfExtents.z>e)I(G);else if(!x||(H=G.stencilFront)&&x.func==H.func&&x.zpass==H.zpass)if(b(p,G.parameters)){v=G._staticLightList;if(t&&v){if(!a(t,v)){I(G);continue}}else if(t||v){I(G);continue}f&&D&&D.intersects(G.aabb)?I(G):(w.add(G.aabb),m+=G.mesh.vertexBuffer.getNumVertices(),B[z].push(G))}else I(G);else I(G)}z++;A=F}return B};f.prototype.create= -function(a,b,c){this._init||(this.transformVS="#define BONE_LIMIT "+this.device.getBoneLimit()+"\n#define DYNAMICBATCH\n"+pc.shaderChunks.transformVS,this.skinTexVS=pc.shaderChunks.skinBatchTexVS,this.skinConstVS=pc.shaderChunks.skinBatchConstVS,this.vertexFormats={},this._init=!0);var e,f,g=null,h,l,r,t,u,x,v,w,y,D=0,B=0,z=0;for(e=0;e