Browse Source

BatchedMesh: don't keep srcAttribute type and directly create BufferAttribute, omit usage (#27978)

as sugested https://github.com/mrdoob/three.js/issues/27973#issuecomment-2016252079
Marcel Wiessler 1 year ago
parent
commit
02c38a985d
1 changed files with 1 additions and 2 deletions
  1. 1 2
      src/objects/BatchedMesh.js

+ 1 - 2
src/objects/BatchedMesh.js

@@ -195,8 +195,7 @@ class BatchedMesh extends Mesh {
 				const { array, itemSize, normalized } = srcAttribute;
 
 				const dstArray = new array.constructor( maxVertexCount * itemSize );
-				const dstAttribute = new srcAttribute.constructor( dstArray, itemSize, normalized );
-				dstAttribute.setUsage( srcAttribute.usage );
+				const dstAttribute = new BufferAttribute( dstArray, itemSize, normalized );
 
 				geometry.setAttribute( attributeName, dstAttribute );