aboutsummaryrefslogtreecommitdiff
path: root/js/lib/geom
diff options
context:
space:
mode:
authorhwc4872012-04-15 05:16:34 -0700
committerhwc4872012-04-15 05:16:34 -0700
commit8992d9baf542135e910bb59328a592d9e330703a (patch)
tree268465b69fd37ec1dc33d304de959e79dc619ecd /js/lib/geom
parent331b2ad4d602016f9bb3d03be759fd81fed50c10 (diff)
downloadninja-8992d9baf542135e910bb59328a592d9e330703a.tar.gz
Cloud Material
Diffstat (limited to 'js/lib/geom')
-rwxr-xr-xjs/lib/geom/rectangle.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/js/lib/geom/rectangle.js b/js/lib/geom/rectangle.js
index d4dd8033..70f6b01b 100755
--- a/js/lib/geom/rectangle.js
+++ b/js/lib/geom/rectangle.js
@@ -1294,6 +1294,7 @@ RectangleGeometry.init = function()
1294 1294
1295RectangleGeometry.addQuad = function( verts, normals, uvs ) 1295RectangleGeometry.addQuad = function( verts, normals, uvs )
1296{ 1296{
1297 var offset = this.vertices.length/3;
1297 for (var i=0; i<4; i++) 1298 for (var i=0; i<4; i++)
1298 { 1299 {
1299 RectangleGeometry.pushVertex( verts[i][0], verts[i][1], verts[i][2]); 1300 RectangleGeometry.pushVertex( verts[i][0], verts[i][1], verts[i][2]);
@@ -1301,13 +1302,13 @@ RectangleGeometry.addQuad = function( verts, normals, uvs )
1301 RectangleGeometry.pushUV( uvs[i] ); 1302 RectangleGeometry.pushUV( uvs[i] );
1302 } 1303 }
1303 1304
1304 RectangleGeometry.pushIndices( 0, 1, 2 ); 1305 RectangleGeometry.pushIndices( 0+offset, 1+offset, 2+offset );
1305 RectangleGeometry.pushIndices( 2, 3, 0 ); 1306 RectangleGeometry.pushIndices( 2+offset, 3+offset, 0+offset );
1306} 1307}
1307 1308
1308RectangleGeometry.buildPrimitive = function() 1309RectangleGeometry.buildPrimitive = function()
1309{ 1310{
1310 var nVertices = this.vertices.length; 1311 var nVertices = this.vertices.length/3;
1311 return ShapePrimitive.create(this.vertices, this.normals, this.uvs, this.indices, g_Engine.getContext().renderer.TRIANGLES, nVertices); 1312 return ShapePrimitive.create(this.vertices, this.normals, this.uvs, this.indices, g_Engine.getContext().renderer.TRIANGLES, nVertices);
1312} 1313}
1313 1314