Преглед изворни кода

Raycaster: Support for indexed BufferGeometry with no offsets.

Mr.doob пре 12 година
родитељ
комит
e64dc034f7
1 измењених фајлова са 7 додато и 1 уклоњено
  1. 7 1
      src/core/Raycaster.js

+ 7 - 1
src/core/Raycaster.js

@@ -109,9 +109,15 @@
 
 
 				if ( attributes.index !== undefined ) {
 				if ( attributes.index !== undefined ) {
 
 
-					var offsets = geometry.offsets;
 					var indices = attributes.index.array;
 					var indices = attributes.index.array;
 					var positions = attributes.position.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 ) {
 					for ( var oi = 0, ol = offsets.length; oi < ol; ++oi ) {
 
 

粤ICP备19079148号