浏览代码

InstancedMesh/SkinnedMesh: Honor bounding volumes in `copy()`. (#25973)

Michael Herzog 2 年之前
父节点
当前提交
ddd2a85068
共有 2 个文件被更改,包括 6 次插入0 次删除
  1. 3 0
      src/objects/InstancedMesh.js
  2. 3 0
      src/objects/SkinnedMesh.js

+ 3 - 0
src/objects/InstancedMesh.js

@@ -110,6 +110,9 @@ class InstancedMesh extends Mesh {
 
 		this.count = source.count;
 
+		if ( source.boundingBox !== null ) this.boundingBox = source.boundingBox.clone();
+		if ( source.boundingSphere !== null ) this.boundingSphere = source.boundingSphere.clone();
+
 		return this;
 
 	}

+ 3 - 0
src/objects/SkinnedMesh.js

@@ -96,6 +96,9 @@ class SkinnedMesh extends Mesh {
 
 		this.skeleton = source.skeleton;
 
+		if ( source.boundingBox !== null ) this.boundingBox = source.boundingBox.clone();
+		if ( source.boundingSphere !== null ) this.boundingSphere = source.boundingSphere.clone();
+
 		return this;
 
 	}