Przeglądaj źródła

Raycaster: Support for indexed BufferGeometry with no offsets.

Mr.doob 12 lat temu
rodzic
commit
e64dc034f7
1 zmienionych plików z 7 dodań i 1 usunięć
  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 ) {
 

粤ICP备19079148号