adds getballindices

This commit is contained in:
Francisco Dans 2015-02-26 18:19:48 +01:00
parent dc7516e9e6
commit aa79eeda20

View File

@ -18,16 +18,22 @@ function BallRenderer(thecanvas){
this.ballsSoFar = 0;
this.balls = 0;
this.cumulative = true;
this.RW4 = this.radius * this.width *4;
}
BallRenderer.prototype = {
getBallIndices: function(x, y){
var indices = new Int8Array(2*r+1);
return indices;
},
addBall: function(x0, y0){
if(this.cachedBall){
var startingPoint = this.getRIndexPos(x0, y0) - this.radius * this.width *4 - this.radius*4;
var startingPoint = this.getRIndexPos(x0, y0) - this.RW4 - this.radius*4;
var i = 0,
pointer = startingPoint,
ballWidth = (this.radius*2)*4
linemax = startingPoint + 2 * this.radius*4,
endPoint = this.getRIndexPos(x0, y0) + this.radius * this.width *4 + this.radius;
endPoint = this.getRIndexPos(x0, y0) + this.RW4 + this.radius;
while (pointer <= endPoint){
while (pointer <= linemax){
this.pointLayer[pointer+3] += this.cachedBall[i+3];