Parcourir la source

Raycaster: Support for indexed BufferGeometry with no offsets.

Mr.doob il y a 11 ans
Parent
commit
e64dc034f7
1 fichiers modifiés avec 7 ajouts et 1 suppressions
  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 ) {