2
0
Эх сурвалжийг харах

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

Xavier Willemin 4 жил өмнө
parent
commit
2618155fbb

+ 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 ++ ) {