浏览代码

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 年之前
父节点
当前提交
02c38a985d
共有 1 个文件被更改,包括 1 次插入2 次删除
  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 );