Browse Source

Fix temporary drawcalls creation

dubejf 10 years ago
parent
commit
2038fec6a6
3 changed files with 5 additions and 6 deletions
  1. 1 1
      src/objects/Line.js
  2. 1 1
      src/objects/Mesh.js
  3. 3 4
      src/objects/PointCloud.js

+ 1 - 1
src/objects/Line.js

@@ -65,7 +65,7 @@ THREE.Line.prototype.raycast = ( function () {
 
 				var indices = attributes.index.array;
 				var positions = attributes.position.array;
-				var offsets = geometry.drawcalls.slice();
+				var offsets = geometry.drawcalls;
 
 				if ( offsets.length === 0 ) {
 

+ 1 - 1
src/objects/Mesh.js

@@ -111,7 +111,7 @@ THREE.Mesh.prototype.raycast = ( function () {
 
 				var indices = attributes.index.array;
 				var positions = attributes.position.array;
-				var offsets = geometry.drawcalls.slice();
+				var offsets = geometry.drawcalls;
 
 				if ( offsets.length === 0 ) {
 

+ 3 - 4
src/objects/PointCloud.js

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