Browse Source

Removed unneeded addDrawCalls()s.

Mr.doob 10 years ago
parent
commit
5fa3f190e6

+ 0 - 2
examples/js/loaders/AWDLoader.js

@@ -766,8 +766,6 @@
 						attrib = new THREE.IndexBufferAttribute( buffer, 1 );
 						attrib = new THREE.IndexBufferAttribute( buffer, 1 );
 						geom.addAttribute( 'index', attrib );
 						geom.addAttribute( 'index', attrib );
 
 
-						geom.addDrawCall( 0, str_len / 2 );
-
 						idx = 0;
 						idx = 0;
 
 
 						while ( this._ptr < str_end ) {
 						while ( this._ptr < str_end ) {

+ 1 - 5
examples/js/loaders/BabylonLoader.js

@@ -137,14 +137,10 @@ THREE.BabylonLoader.prototype = {
 
 
 				var subMesh = subMeshes[ j ];
 				var subMesh = subMeshes[ j ];
 
 
-				geometry.addDrawCall( subMesh.indexStart, subMesh.indexCount );
+				geometry.addGroup( subMesh.indexStart, subMesh.indexCount );
 
 
 			}
 			}
 
 
-		} else {
-
-			geometry.addDrawCall( 0, json.indices.length );
-
 		}
 		}
 
 
 		return geometry;
 		return geometry;

+ 0 - 2
examples/js/loaders/UTF8Loader.js

@@ -99,8 +99,6 @@ THREE.UTF8Loader.BufferGeometryCreator.prototype.create = function ( attribArray
 	geometry.addAttribute( 'normal', new THREE.BufferAttribute( normals, 3 ) );
 	geometry.addAttribute( 'normal', new THREE.BufferAttribute( normals, 3 ) );
 	geometry.addAttribute( 'uv', new THREE.BufferAttribute( uvs, 2 ) );
 	geometry.addAttribute( 'uv', new THREE.BufferAttribute( uvs, 2 ) );
 
 
-	geometry.addDrawCall( 0, indices.length );
-
 	geometry.computeBoundingSphere();
 	geometry.computeBoundingSphere();
 
 
 	return geometry;
 	return geometry;

+ 5 - 2
src/objects/Line.js

@@ -65,11 +65,14 @@ THREE.Line.prototype.raycast = ( function () {
 
 
 				var indices = attributes.index.array;
 				var indices = attributes.index.array;
 				var positions = attributes.position.array;
 				var positions = attributes.position.array;
-				var offsets = geometry.drawcalls;
+				var offsets = geometry.groups;
 
 
 				if ( offsets.length === 0 ) {
 				if ( offsets.length === 0 ) {
 
 
-					geometry.addDrawCall( 0, indices.length );
+					offsets = [ {
+						start: 0,
+						count: indices.length
+					} ];
 
 
 				}
 				}
 
 

+ 5 - 2
src/objects/Mesh.js

@@ -115,11 +115,14 @@ THREE.Mesh.prototype.raycast = ( function () {
 
 
 				var indices = attributes.index.array;
 				var indices = attributes.index.array;
 				var positions = attributes.position.array;
 				var positions = attributes.position.array;
-				var offsets = geometry.drawcalls;
+				var offsets = geometry.groups;
 
 
 				if ( offsets.length === 0 ) {
 				if ( offsets.length === 0 ) {
 
 
-					geometry.addDrawCall( 0, indices.length );
+					offsets = [ {
+						start: 0,
+						count: indices.length
+					} ];
 
 
 				}
 				}
 
 

+ 5 - 2
src/objects/PointCloud.js

@@ -80,11 +80,14 @@ THREE.PointCloud.prototype.raycast = ( function () {
 			if ( attributes.index !== undefined ) {
 			if ( attributes.index !== undefined ) {
 
 
 				var indices = attributes.index.array;
 				var indices = attributes.index.array;
-				var offsets = geometry.drawcalls;
+				var offsets = geometry.groups;
 
 
 				if ( offsets.length === 0 ) {
 				if ( offsets.length === 0 ) {
 
 
-					geometry.addDrawCall( 0, indices.length );
+					offsets = [ {
+						start: 0,
+						count: indices.length
+					} ];
 
 
 				}
 				}