<commit_before>var SPP=SPP||{REVISION:"alpha",AUTHOR:"flashhawk",BLOG:"flashquake.cn"};SPP.inherit=function(a){function b(){}if(null==a)throw TypeError();if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw TypeError();b.prototype=a;return new b};SPP.frameTime=0;
(function(){for(var a=0,b=["ms","moz","webkit","o"],c=0;c<b.length&&!window.requestAnimationFrame;++c)window.requestAnimationFrame=window[b[c]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[b[c]+"CancelAnimationFrame"]||window[b[c]+"CancelRequestAnimationFrame"];void 0===window.requestAnimationFrame&&(window.requestAnimationFrame=function(b){var c=Date.now(),f=Math.max(0,16-(c-a)),g=window.setTimeout(function(){b(c+f)},f);a=c+f;return g});window.cancelAnimationFrame=window.cancelAnimationFrame||
function(a){window.clearTimeout(a)}})();SPP.EventDispatcher=function(){var a={},b=[];this.addEventListener=function(b,d){void 0===a[b]&&(a[b]=[]);-1===a[b].indexOf(d)&&a[b].push(d)};this.removeEventListener=function(b,d){var e=a[b].indexOf(d);-1!==e&&a[b].splice(e,1)};this.removeAllEventListeners=function(){a={};b=[]};this.dispatchEvent=function(c){var d=a[c.type];if(void 0!=d){c.target=this;b=d.slice();for(var d=0,e=b.length;d<e;d++)b[d].call(this,c)}}};SPP.Event=function(a){this.type=a;this.target=null};SPP.Event.prototype={constructor:SPP.Event,clone:function(){return new SPP.Event(this.type,this.target)}};SPP.Vector2D=function(a,b){this.x=a||0;this.y=b||0};
SPP.Vector2D.prototype={constructor:SPP.Vector2D,toString:function(){return"[Vector2D (x="+this.x+" y="+this.y+")]"},clone:function(){return new SPP.Vector2D(this.x,this.y)},reset:function(a,b){this.x=a;this.y=b},equals:function(a){return this.x==a.x&&this.y==a.y},plus:function(a){this.x+=a.x;this.y+=a.y},plusNew:function(a){return new SPP.Vector2D(this.x+a.x,this.y+a.y)},minus:function(a){this.x-=a.x;this.y-=a.x},minusNew:function(a){return new SPP.Vector2D(this.x-a.x,this.y-a.y)},negate:function(){this.x*=
-1;this.y*=-1},negateX:function(){this.x*=-1},negateY:function(){this.y*=-1},negateNew:function(){return new SPP.Vector2D(-this.x,-this.y)},scale:function(a){this.x*=a;this.y*=a},scaleX:function(a){this.x*=a},scaleY:function(a){this.y*=a},scaleNew:function(a){return new SPP.Vector2D(this.x*a,this.y*a)},getLength:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},setLength:function(a){a/=this.getLength();this.scale(a)},getAngle:function(){return SPP.MathUtils.atan2D(this.y,this.x)},setAngle:function(a){var b=
this.getLength();this.x=b*SPP.MathUtils.cosD(a);this.y=b*SPP.MathUtils.sinD(a)},rotate:function(a){var b=SPP.MathUtils.sinD(a);a=SPP.MathUtils.cosD(a);var c=this.x,d=this.y;this.x=c*a-d*b;this.y=c*b+d*a},rotateNew:function(a){var b=this.clone();b.rotate(a);return b},dot:function(a){return this.x*a.x+this.y*a.y},projection:function(a){var b=this.angleBetween(a),b=this.getLength()*SPP.MathUtils.cosD(b)/a.getLength();return a.scaleNew(b)},normalized:function(){return new SPP.Vector2D(this.x/this.getLength(),
this.y/this.getLength())},getNormal:function(){return new SPP.Vector2D(-this.y,this.x)},isPerpTo:function(a){return 0==this.dot(a)},angleBetween:function(a){a=this.dot(a)/(this.getLength()*a.getLength());return SPP.MathUtils.acosD(a)}};SPP.Point=function(a,b){this.x=a||0;this.y=b||0};SPP.Point.prototype={constructor:SPP.Point,clone:function(){return new SPP.Point(this.x,this.y)},toString:function(){return"[Point (x="+this.x+" y="+this.y+")]"}};SPP.Point.distance=function(a,b){return Math.sqrt(Math.pow(a.x-b.x,2)+Math.pow(a.y-b.y,2))};SPP.Rectangle=function(a,b,c,d){this.x=a||0;this.y=b||0;this.width=c||0;this.height=d||0};
SPP.Rectangle.prototype={constructor:SPP.Rectangle,top:function(){return this.y},bottom:function(){return this.y+this.height},left:function(){return this.x},right:function(){return this.x+this.width},topLeft:function(){return new SPP.Point(this.x,this.y)},bottomRight:function(){return new SPP.Point(this.right(),this.bottom())},clone:function(){return SPP.Rectangle(this.x,this.y,this.width,this.height)},toString:function(){return"[Rectangle (x="+this.x+" y="+this.y+" width="+this.width+" height="+
this.height+")]"}};SPP.Particle=function(){SPP.EventDispatcher.call(this);this.position=new SPP.Vector2D;this.point=new SPP.Point;this.v=new SPP.Vector2D;this.a=new SPP.Vector2D;this.f=new SPP.Vector2D(0.1,0.1);this.life=0;this.forcesMap={};this.extra={};this.sumForce=new SPP.Vector2D;this.boundary=null;this.bounceIntensity=2};
SPP.Particle.prototype={constructor:SPP.Particle,init:function(a,b,c){0>=c?this.dispatchEvent(new SPP.Event("dead")):(this.life=c||Infinity,this.position.reset(a,b),this.point.x=this.position.x,this.point.y=this.position.y)},addForce:function(a,b){this.forcesMap[a]=b},removeForce:function(a){delete this.forcesMap[a]},removeAllForces:function(){for(var a in this.forcesMap)delete _forces[a]},render:function(){this.update();this.sumForce.reset(0,0);for(var a in this.forcesMap)this.forcesMap[a].isLive()?
(this.sumForce.plus(this.forcesMap[a].value),this.a.reset(this.sumForce.x,this.sumForce.y)):delete this.forcesMap[a];this.v.plus(this.a);this.v.x*=1-this.f.x;this.v.y*=1-this.f.y;this.position.plus(this.v);this.point.x=this.position.x;this.point.y=this.position.y;null!=this.boundary&&(1==this.boundary.type?this.bounce():this.bounce2());this.life-=SPP.frameTime;0<this.life||this.dispatchEvent(new SPP.Event("dead"))},update:function(){},bounce:function(){if(this.position.x<this.boundary.left()||this.position.x>
this.boundary.right())this.position.x=this.position.x<this.boundary.left()?this.boundary.left():this.boundary.right(),this.v.scaleX(-this.bounceIntensity),this.a.scale(0);if(this.position.y<this.boundary.top()||this.position.y>this.boundary.bottom())this.position.y=this.position.y<this.boundary.top()?this.boundary.top():this.boundary.bottom(),this.v.scaleY(-this.bounceIntensity),this.a.scale(0)},bounce2:function(){this.position.x<this.boundary.left()&&(this.position.x=this.boundary.right());this.position.x>
this.boundary.right()&&(this.position.x=this.boundary.left());this.position.y<this.boundary.top()&&(this.position.y=this.boundary.bottom());this.position.y>this.boundary.bottom()&&(this.position.y=this.boundary.top())},destory:function(){},reset:function(){this.v.reset(0,0);this.forcesMap={};this.extra={}}};SPP.ParticlePool=function(){var a=[];this.get=function(b){for(var c in a)if(a[c].constructor==b)return b=a[c],a.splice(c,1),b;return new b};this.recycle=function(b){a.push(b)};this.getParticles=function(){return a}};SPP.ParticleSystem=function(){var a=[],b=new SPP.ParticlePool,c=0,d=this;this.getParticles=function(){return a};this.createParticle=function(c){c=b.get(c);c.addEventListener("dead",e);a.push(c);return c};var e=function(a){d.removeParticle(a.target)};this.removeParticle=function(c){var d=a.indexOf(c);-1!=d&&(a.splice(d,1),c.removeEventListener("dead",e),c.reset(),b.recycle(c))};this.removeAllParticles=function(){for(var b=a.length;0<b--;)this.removeParticle(a[b]);a=[]};this.render=function(){SPP.frameTime=
0.001*(Date.now()-c);c=Date.now();for(var b=a.length;0<b--;)a[b].render()};this.resume=function(){c+=Date.now()-c};this.getParticlePool=function(){return b}};SPP.Force=function(a,b,c){SPP.EventDispatcher.call(this);this.value=new SPP.Vector2D(a,b);this.life=c||Infinity};SPP.Force.prototype={constructor:SPP.Force,isLive:function(){if(0>=(this.life-=SPP.frameTime))return this.destory(),dispatchEvent(new SPP.Event("dead")),!1;this.update();return!0},update:function(){},destory:function(){}};SPP.Brownian=function(a,b,c){SPP.Force.call(this,0,0,c);this.maxValue=a;this.cycle=b;this.pastTime=0;this.update()};SPP.Brownian.prototype=SPP.inherit(SPP.Force.prototype);SPP.Brownian.prototype.constructor=SPP.Brownian;SPP.Brownian.prototype.update=function(){this.pastTime+=SPP.frameTime;this.pastTime>=this.cycle&&(this.value.reset((2*Math.random()-1)*this.maxValue,(2*Math.random()-1)*this.maxValue),this.pastTime=0)};SPP.Brownian.prototype.destory=function(){};SPP.Gravity=function(a){SPP.Force.call(this,0,a,Infinity)};SPP.Gravity.prototype=SPP.inherit(SPP.Force.prototype);SPP.Gravity.prototype.constructor=SPP.Gravity;SPP.Attraction=function(a,b,c,d){SPP.Force.call(this,a.x,a.y,d);this.maxValue=b;this.r=c;this.attractionPoint=a;this.attractionVector=new SPP.Vector2D;this.target=null};SPP.Attraction.prototype=SPP.inherit(SPP.Force.prototype);SPP.Attraction.prototype.constructor=SPP.Attraction;
SPP.Attraction.prototype.update=function(){this.attractionVector.reset(this.attractionPoint.x,this.attractionPoint.y);var a=SPP.Point.distance(this.attractionPoint,this.target.point);this.value=a<this.r?this.target.position.minusNew(this.attractionVector):this.attractionVector.minusNew(this.target.position);this.value.scale(this.maxValue/a)};SPP.MathUtils=function(){};SPP.MathUtils.toDegree=function(a){return 180*(a/Math.PI)};SPP.MathUtils.toRadian=function(a){return a/180*Math.PI};SPP.MathUtils.sinD=function(a){return Math.sin(SPP.MathUtils.toRadian(a))};SPP.MathUtils.asinD=function(a){return SPP.MathUtils.toDegree(Math.asin(a))};SPP.MathUtils.cosD=function(a){return Math.cos(SPP.MathUtils.toRadian(a))};SPP.MathUtils.acosD=function(a){return SPP.MathUtils.toDegree(Math.acos(a))};SPP.MathUtils.tanD=function(a){return Math.tan(SPP.MathUtils.toRadian(a))};
SPP.MathUtils.atanD=function(a){return SPP.MathUtils.toDegree(Math.atan(a))};SPP.MathUtils.atan2D=function(a,b){return SPP.MathUtils.toDegree(Math.atan2(a,b))};SPP.MathUtils.random=function(a){return 0>=a?0:Math.round(Math.random()*(a-1))};SPP.UIDUtil={_counter:0};SPP.UIDUtil.createUID=function(a){var b=a.charCodeAt(a.length-1);48<=b&&57>=b&&(a+="_");return a+this._counter++};SPP.SpriteImage=function(){SPP.Particle.call(this);this.onUpdate=this.texture=this.context=null;this.scale=1;this.rotation=0;this.alpha=1;this.registrationY=this.registrationX=0.5};SPP.SpriteImage.prototype=SPP.inherit(SPP.Particle.prototype);SPP.SpriteImage.prototype.constructor=SPP.SpriteImage;
SPP.SpriteImage.prototype.update=function(){null==this.context||null==this.texture||(this.context.globalAlpha=this.alpha,this.context.translate(this.position.x,this.position.y),this.context.rotate(this.rotation),this.context.scale(this.scale,this.scale),this.context.drawImage(this.texture,0,0,this.texture.width,this.texture.height,-this.texture.width*this.registrationX,-this.texture.height*this.registrationY,this.texture.width,this.texture.height),this.context.setTransform(1,0,0,1,0,0),this.context.globalAlpha=
1,this.onUpdate&&this.onUpdate.apply(this))};SPP.SpriteImage.prototype.init=function(a,b,c,d,e){SPP.Particle.prototype.init.apply(this,[a,b,c]);this.context=e;this.texture=d};SPP.SpriteImage.prototype.setRegistration=function(a,b){this.registrationX=a;this.registrationY=b};SPP.SpriteImage.prototype.reset=function(){SPP.Particle.prototype.reset.apply(this);this.onUpdate=this.texture=this.context=null;this.scale=1;this.rotation=0;this.alpha=1;this.registrationY=this.registrationX=0.5};<commit_msg>update spp.min.js<commit_after>var SPP=SPP||{REVISION:"alpha",AUTHOR:"flashhawk",BLOG:"flashquake.cn"};SPP.inherit=function(a){function b(){}if(null==a)throw TypeError();if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw TypeError();b.prototype=a;return new b};SPP.frameTime=0;
(function(){for(var a=0,b=["ms","moz","webkit","o"],c=0;c<b.length&&!window.requestAnimationFrame;++c)window.requestAnimationFrame=window[b[c]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[b[c]+"CancelAnimationFrame"]||window[b[c]+"CancelRequestAnimationFrame"];void 0===window.requestAnimationFrame&&(window.requestAnimationFrame=function(b){var c=Date.now(),f=Math.max(0,16-(c-a)),g=window.setTimeout(function(){b(c+f)},f);a=c+f;return g});window.cancelAnimationFrame=window.cancelAnimationFrame||
function(a){window.clearTimeout(a)}})();SPP.EventDispatcher=function(){var a={},b=[];this.addEventListener=function(b,d){void 0===a[b]&&(a[b]=[]);-1===a[b].indexOf(d)&&a[b].push(d)};this.removeEventListener=function(b,d){var e=a[b].indexOf(d);-1!==e&&a[b].splice(e,1)};this.removeAllEventListeners=function(){a={};b=[]};this.dispatchEvent=function(c){var d=a[c.type];if(void 0!=d){c.target=this;b=d.slice();for(var d=0,e=b.length;d<e;d++)b[d].call(this,c)}}};SPP.Event=function(a){this.type=a;this.target=null};SPP.Event.prototype={constructor:SPP.Event,clone:function(){return new SPP.Event(this.type,this.target)}};SPP.Vector2D=function(a,b){this.x=a||0;this.y=b||0};
SPP.Vector2D.prototype={constructor:SPP.Vector2D,toString:function(){return"[Vector2D (x="+this.x+" y="+this.y+")]"},clone:function(){return new SPP.Vector2D(this.x,this.y)},reset:function(a,b){this.x=a;this.y=b},equals:function(a){return this.x==a.x&&this.y==a.y},plus:function(a){this.x+=a.x;this.y+=a.y},plusNew:function(a){return new SPP.Vector2D(this.x+a.x,this.y+a.y)},minus:function(a){this.x-=a.x;this.y-=a.x},minusNew:function(a){return new SPP.Vector2D(this.x-a.x,this.y-a.y)},negate:function(){this.x*=
-1;this.y*=-1},negateX:function(){this.x*=-1},negateY:function(){this.y*=-1},negateNew:function(){return new SPP.Vector2D(-this.x,-this.y)},scale:function(a){this.x*=a;this.y*=a},scaleX:function(a){this.x*=a},scaleY:function(a){this.y*=a},scaleNew:function(a){return new SPP.Vector2D(this.x*a,this.y*a)},getLength:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},setLength:function(a){a/=this.getLength();this.scale(a)},getAngle:function(){return SPP.MathUtils.atan2D(this.y,this.x)},setAngle:function(a){var b=
this.getLength();this.x=b*SPP.MathUtils.cosD(a);this.y=b*SPP.MathUtils.sinD(a)},rotate:function(a){var b=SPP.MathUtils.sinD(a);a=SPP.MathUtils.cosD(a);var c=this.x,d=this.y;this.x=c*a-d*b;this.y=c*b+d*a},rotateNew:function(a){var b=this.clone();b.rotate(a);return b},dot:function(a){return this.x*a.x+this.y*a.y},projection:function(a){var b=this.angleBetween(a),b=this.getLength()*SPP.MathUtils.cosD(b)/a.getLength();return a.scaleNew(b)},normalized:function(){return new SPP.Vector2D(this.x/this.getLength(),
this.y/this.getLength())},getNormal:function(){return new SPP.Vector2D(-this.y,this.x)},isPerpTo:function(a){return 0==this.dot(a)},angleBetween:function(a){a=this.dot(a)/(this.getLength()*a.getLength());return SPP.MathUtils.acosD(a)}};SPP.Point=function(a,b){this.x=a||0;this.y=b||0};SPP.Point.prototype={constructor:SPP.Point,reset:function(a,b){this.x=a||0;this.y=b||0},clone:function(){return new SPP.Point(this.x,this.y)},toString:function(){return"[Point (x="+this.x+" y="+this.y+")]"}};SPP.Point.distance=function(a,b){return Math.sqrt(Math.pow(a.x-b.x,2)+Math.pow(a.y-b.y,2))};SPP.Rectangle=function(a,b,c,d){this.x=a||0;this.y=b||0;this.width=c||0;this.height=d||0};
SPP.Rectangle.prototype={constructor:SPP.Rectangle,top:function(){return this.y},bottom:function(){return this.y+this.height},left:function(){return this.x},right:function(){return this.x+this.width},topLeft:function(){return new SPP.Point(this.x,this.y)},bottomRight:function(){return new SPP.Point(this.right(),this.bottom())},clone:function(){return SPP.Rectangle(this.x,this.y,this.width,this.height)},toString:function(){return"[Rectangle (x="+this.x+" y="+this.y+" width="+this.width+" height="+
this.height+")]"}};SPP.Particle=function(){SPP.EventDispatcher.call(this);this.position=new SPP.Vector2D;this.point=new SPP.Point;this.v=new SPP.Vector2D;this.a=new SPP.Vector2D;this.f=new SPP.Vector2D(0.1,0.1);this.life=0;this.forcesMap={};this.extra={};this.sumForce=new SPP.Vector2D;this.boundary=null;this.bounceIntensity=2};
SPP.Particle.prototype={constructor:SPP.Particle,init:function(a,b,c){0>=c?this.dispatchEvent(new SPP.Event("dead")):(this.life=c||Infinity,this.position.reset(a,b),this.point.x=this.position.x,this.point.y=this.position.y)},addForce:function(a,b){this.forcesMap[a]=b},removeForce:function(a){delete this.forcesMap[a]},removeAllForces:function(){for(var a in this.forcesMap)delete _forces[a]},render:function(){this.update();this.sumForce.reset(0,0);for(var a in this.forcesMap)this.forcesMap[a].isLive()?
(this.sumForce.plus(this.forcesMap[a].value),this.a.reset(this.sumForce.x,this.sumForce.y)):delete this.forcesMap[a];this.v.plus(this.a);this.v.x*=1-this.f.x;this.v.y*=1-this.f.y;this.position.plus(this.v);this.point.x=this.position.x;this.point.y=this.position.y;null!=this.boundary&&(1==this.boundary.type?this.bounce():this.bounce2());this.life-=SPP.frameTime;0<this.life||this.dispatchEvent(new SPP.Event("dead"))},update:function(){},bounce:function(){if(this.position.x<this.boundary.left()||this.position.x>
this.boundary.right())this.position.x=this.position.x<this.boundary.left()?this.boundary.left():this.boundary.right(),this.v.scaleX(-this.bounceIntensity),this.a.scale(0);if(this.position.y<this.boundary.top()||this.position.y>this.boundary.bottom())this.position.y=this.position.y<this.boundary.top()?this.boundary.top():this.boundary.bottom(),this.v.scaleY(-this.bounceIntensity),this.a.scale(0)},bounce2:function(){this.position.x<this.boundary.left()&&(this.position.x=this.boundary.right());this.position.x>
this.boundary.right()&&(this.position.x=this.boundary.left());this.position.y<this.boundary.top()&&(this.position.y=this.boundary.bottom());this.position.y>this.boundary.bottom()&&(this.position.y=this.boundary.top())},destory:function(){},reset:function(){this.position.reset(0,0);this.point.reset(0,0);this.v.reset(0,0);this.a.reset(0,0);this.f.reset(0.1,0.1);this.life=0;this.forcesMap={};this.extra={};this.sumForce.reset(0,0);this.boundary=null;this.bounceIntensity=2}};SPP.ParticlePool=function(){var a=[];this.get=function(b){for(var c in a)if(a[c].constructor==b)return b=a[c],a.splice(c,1),b;return new b};this.recycle=function(b){a.push(b)};this.getParticles=function(){return a}};SPP.ParticleSystem=function(){var a=[],b=new SPP.ParticlePool,c=0,d=this;this.getParticles=function(){return a};this.createParticle=function(c){c=b.get(c);c.addEventListener("dead",e);a.push(c);return c};var e=function(a){d.removeParticle(a.target)};this.removeParticle=function(c){var d=a.indexOf(c);-1!=d&&(a.splice(d,1),c.removeEventListener("dead",e),c.reset(),b.recycle(c))};this.removeAllParticles=function(){for(var b=a.length;0<b--;)this.removeParticle(a[b]);a=[]};this.render=function(){SPP.frameTime=
0.001*(Date.now()-c);c=Date.now();for(var b=a.length;0<b--;)a[b].render()};this.resume=function(){c+=Date.now()-c};this.getParticlePool=function(){return b}};SPP.Force=function(a,b,c){SPP.EventDispatcher.call(this);this.value=new SPP.Vector2D(a,b);this.life=c||Infinity};SPP.Force.prototype={constructor:SPP.Force,isLive:function(){if(0>=(this.life-=SPP.frameTime))return this.destory(),dispatchEvent(new SPP.Event("dead")),!1;this.update();return!0},update:function(){},destory:function(){}};SPP.Brownian=function(a,b,c){SPP.Force.call(this,0,0,c);this.maxValue=a;this.cycle=b;this.pastTime=0;this.update()};SPP.Brownian.prototype=SPP.inherit(SPP.Force.prototype);SPP.Brownian.prototype.constructor=SPP.Brownian;SPP.Brownian.prototype.update=function(){this.pastTime+=SPP.frameTime;this.pastTime>=this.cycle&&(this.value.reset((2*Math.random()-1)*this.maxValue,(2*Math.random()-1)*this.maxValue),this.pastTime=0)};SPP.Brownian.prototype.destory=function(){};SPP.Gravity=function(a){SPP.Force.call(this,0,a,Infinity)};SPP.Gravity.prototype=SPP.inherit(SPP.Force.prototype);SPP.Gravity.prototype.constructor=SPP.Gravity;SPP.Attraction=function(a,b,c,d){SPP.Force.call(this,a.x,a.y,d);this.maxValue=b;this.r=c;this.attractionPoint=a;this.attractionVector=new SPP.Vector2D;this.target=null};SPP.Attraction.prototype=SPP.inherit(SPP.Force.prototype);SPP.Attraction.prototype.constructor=SPP.Attraction;
SPP.Attraction.prototype.update=function(){this.attractionVector.reset(this.attractionPoint.x,this.attractionPoint.y);var a=SPP.Point.distance(this.attractionPoint,this.target.point);this.value=a<this.r?this.target.position.minusNew(this.attractionVector):this.attractionVector.minusNew(this.target.position);this.value.scale(this.maxValue/a)};SPP.MathUtils=function(){};SPP.MathUtils.toDegree=function(a){return 180*(a/Math.PI)};SPP.MathUtils.toRadian=function(a){return a/180*Math.PI};SPP.MathUtils.sinD=function(a){return Math.sin(SPP.MathUtils.toRadian(a))};SPP.MathUtils.asinD=function(a){return SPP.MathUtils.toDegree(Math.asin(a))};SPP.MathUtils.cosD=function(a){return Math.cos(SPP.MathUtils.toRadian(a))};SPP.MathUtils.acosD=function(a){return SPP.MathUtils.toDegree(Math.acos(a))};SPP.MathUtils.tanD=function(a){return Math.tan(SPP.MathUtils.toRadian(a))};
SPP.MathUtils.atanD=function(a){return SPP.MathUtils.toDegree(Math.atan(a))};SPP.MathUtils.atan2D=function(a,b){return SPP.MathUtils.toDegree(Math.atan2(a,b))};SPP.MathUtils.random=function(a){return 0>=a?0:Math.round(Math.random()*(a-1))};SPP.UIDUtil={_counter:0};SPP.UIDUtil.createUID=function(a){var b=a.charCodeAt(a.length-1);48<=b&&57>=b&&(a+="_");return a+this._counter++};SPP.SpriteImage=function(){SPP.Particle.call(this);this.onUpdate=this.texture=this.context=null;this.scale=1;this.rotation=0;this.alpha=1;this.registrationY=this.registrationX=0.5};SPP.SpriteImage.prototype=SPP.inherit(SPP.Particle.prototype);SPP.SpriteImage.prototype.constructor=SPP.SpriteImage;
SPP.SpriteImage.prototype.update=function(){null==this.context||null==this.texture||(this.context.globalAlpha=this.alpha,this.context.translate(this.position.x,this.position.y),this.context.rotate(this.rotation),this.context.scale(this.scale,this.scale),this.context.drawImage(this.texture,0,0,this.texture.width,this.texture.height,-this.texture.width*this.registrationX,-this.texture.height*this.registrationY,this.texture.width,this.texture.height),this.context.setTransform(1,0,0,1,0,0),this.context.globalAlpha=
1,this.onUpdate&&this.onUpdate.apply(this))};SPP.SpriteImage.prototype.init=function(a,b,c,d,e){SPP.Particle.prototype.init.apply(this,[a,b,c]);this.context=e;this.texture=d};SPP.SpriteImage.prototype.setRegistration=function(a,b){this.registrationX=a;this.registrationY=b};SPP.SpriteImage.prototype.reset=function(){SPP.Particle.prototype.reset.apply(this);this.onUpdate=this.texture=this.context=null;this.scale=1;this.rotation=0;this.alpha=1;this.registrationY=this.registrationX=0.5};
{'fraction_non_alphanumeric': 0.23128732432311078, 'fraction_numerical': 0.01185398051277446, 'mean_word_length': 12.202133965619442, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4577518', 'n_tokens_mistral': 8770, 'n_tokens_neox': 8625, 'n_words': 274}