Browse Source

Raycaster: Support for indexed BufferGeometry with no offsets.

Mr.doob 11 years ago
parent
commit
e64dc034f7
1 changed files with 7 additions and 1 deletions
  1. 7 1
      src/core/Raycaster.js

+ 7 - 1
src/core/Raycaster.js

@@ -109,9 +109,15 @@
 
 				if ( attributes.index !== undefined ) {
 
-					var offsets = geometry.offsets;
 					var indices = attributes.index.array;
 					var positions = attributes.position.array;
+					var offsets = geometry.offsets;
+
+					if ( offsets.length === 0 ) {
+
+						offsets = [ { start: 0, count: positions.length, index: 0 } ];
+
+					}
 
 					for ( var oi = 0, ol = offsets.length; oi < ol; ++oi ) {