Skip to content

Commit

Permalink
Particle bounds attribute name made consistent issue #49
Browse files Browse the repository at this point in the history
  • Loading branch information
ashrafabu committed Dec 17, 2014
1 parent 735a8ba commit 09ff15d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
16 changes: 8 additions & 8 deletions js/neuron/view/ParticleTextureMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ define( function( require ) {
w = this.potassiumParticleSize;
}
var h = w;
coords.leftX = xPos - w;
coords.topY = yPos - h;
coords.rightX = xPos + w;
coords.bottomY = yPos + h;
coords.left = xPos - w;
coords.top = yPos - h;
coords.right = xPos + w;
coords.bottom = yPos + h;

return coords;
},
Expand Down Expand Up @@ -200,10 +200,10 @@ define( function( require ) {
coords = coords || {};
// Particle Pos is at center tp get the left corder, substrat the radius and normalize the value by
// dividing it by canvasWidth, the Tex Coords needs to be on the range of 0..1
coords.leftX = (tilePost.x - tileRadius) / this.canvasWidth;
coords.topY = (tilePost.y - tileRadius) / this.canvasHeight;
coords.rightX = (tilePost.x + tileRadius) / this.canvasWidth;
coords.bottomY = (tilePost.y + tileRadius) / this.canvasHeight;
coords.left = (tilePost.x - tileRadius) / this.canvasWidth;
coords.top = (tilePost.y - tileRadius) / this.canvasHeight;
coords.right = (tilePost.x + tileRadius) / this.canvasWidth;
coords.bottom = (tilePost.y + tileRadius) / this.canvasHeight;


return coords;
Expand Down
48 changes: 24 additions & 24 deletions js/neuron/view/ParticlesWebGLNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,42 +214,42 @@ define( function( require ) {
textCords = thisNode.particleTextureMap.getTexCords( particle.getType(), particle.getOpaqueness(), tilePosVector, textCords );

//left bottom
thisNode.vertexData[index++] = vertexCords.leftX;//x
thisNode.vertexData[index++] = vertexCords.bottomY;//y
thisNode.vertexData[index++] = textCords.leftX; //u
thisNode.vertexData[index++] = textCords.bottomY; //v
thisNode.vertexData[index++] = vertexCords.left;//x
thisNode.vertexData[index++] = vertexCords.bottom;//y
thisNode.vertexData[index++] = textCords.left; //u
thisNode.vertexData[index++] = textCords.bottom; //v

//left top
thisNode.vertexData[index++] = vertexCords.leftX;
thisNode.vertexData[index++] = vertexCords.topY;
thisNode.vertexData[index++] = textCords.leftX;//u
thisNode.vertexData[index++] = textCords.topY;//v
thisNode.vertexData[index++] = vertexCords.left;
thisNode.vertexData[index++] = vertexCords.top;
thisNode.vertexData[index++] = textCords.left;//u
thisNode.vertexData[index++] = textCords.top;//v

//right top
thisNode.vertexData[index++] = vertexCords.rightX;
thisNode.vertexData[index++] = vertexCords.topY;
thisNode.vertexData[index++] = textCords.rightX;//u
thisNode.vertexData[index++] = textCords.topY;//v
thisNode.vertexData[index++] = vertexCords.right;
thisNode.vertexData[index++] = vertexCords.top;
thisNode.vertexData[index++] = textCords.right;//u
thisNode.vertexData[index++] = textCords.top;//v

//---2nd triangle-----

//right top
thisNode.vertexData[index++] = vertexCords.rightX;
thisNode.vertexData[index++] = vertexCords.topY;
thisNode.vertexData[index++] = textCords.rightX;//u
thisNode.vertexData[index++] = textCords.topY;//v
thisNode.vertexData[index++] = vertexCords.right;
thisNode.vertexData[index++] = vertexCords.top;
thisNode.vertexData[index++] = textCords.right;//u
thisNode.vertexData[index++] = textCords.top;//v

//right bottom
thisNode.vertexData[index++] = vertexCords.rightX;
thisNode.vertexData[index++] = vertexCords.bottomY;
thisNode.vertexData[index++] = textCords.rightX;//u
thisNode.vertexData[index++] = textCords.bottomY;//v
thisNode.vertexData[index++] = vertexCords.right;
thisNode.vertexData[index++] = vertexCords.bottom;
thisNode.vertexData[index++] = textCords.right;//u
thisNode.vertexData[index++] = textCords.bottom;//v

//left bottom
thisNode.vertexData[index++] = vertexCords.leftX;
thisNode.vertexData[index++] = vertexCords.bottomY;
thisNode.vertexData[index++] = textCords.leftX;//u
thisNode.vertexData[index++] = textCords.bottomY;//v
thisNode.vertexData[index++] = vertexCords.left;
thisNode.vertexData[index++] = vertexCords.bottom;
thisNode.vertexData[index++] = textCords.left;//u
thisNode.vertexData[index++] = textCords.bottom;//v

} );
},
Expand Down

0 comments on commit 09ff15d

Please sign in to comment.