diff options
author | hwc487 | 2012-04-15 05:16:34 -0700 |
---|---|---|
committer | hwc487 | 2012-04-15 05:16:34 -0700 |
commit | 8992d9baf542135e910bb59328a592d9e330703a (patch) | |
tree | 268465b69fd37ec1dc33d304de959e79dc619ecd /js/lib/geom | |
parent | 331b2ad4d602016f9bb3d03be759fd81fed50c10 (diff) | |
download | ninja-8992d9baf542135e910bb59328a592d9e330703a.tar.gz |
Cloud Material
Diffstat (limited to 'js/lib/geom')
-rwxr-xr-x | js/lib/geom/rectangle.js | 7 |
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 | ||
1295 | RectangleGeometry.addQuad = function( verts, normals, uvs ) | 1295 | RectangleGeometry.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 | ||
1308 | RectangleGeometry.buildPrimitive = function() | 1309 | RectangleGeometry.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 | ||