Explorar el Código

Support interleaved buffer attributes in BufferGeometry.toNonIndexed() - Resolves mrdoob/three.js#21992 (#21999)

Xavier Willemin hace 4 años
padre
commit
2618155fbb
Se han modificado 1 ficheros con 9 adiciones y 1 borrados
  1. 9 1
      src/core/BufferGeometry.js

+ 9 - 1
src/core/BufferGeometry.js

@@ -807,7 +807,15 @@ class BufferGeometry extends EventDispatcher {
 
 			for ( let i = 0, l = indices.length; i < l; i ++ ) {
 
-				index = indices[ i ] * itemSize;
+				if ( attribute.isInterleavedBufferAttribute ) {
+
+					index = indices[ i ] * attribute.data.stride + attribute.offset;
+
+				} else {
+
+					index = indices[ i ] * itemSize;
+
+				}
 
 				for ( let j = 0; j < itemSize; j ++ ) {