浏览代码

Merge pull request #13428 from WJsjtu/dev1

DirectGeometry: clone bounding volumes in fromGeometry method
Mr.doob 6 年之前
父节点
当前提交
2d19c071fa
共有 1 个文件被更改,包括 12 次插入0 次删除
  1. 12 0
      src/core/DirectGeometry.js

+ 12 - 0
src/core/DirectGeometry.js

@@ -264,6 +264,18 @@ Object.assign( DirectGeometry.prototype, {
 		this.uvsNeedUpdate = geometry.uvsNeedUpdate;
 		this.groupsNeedUpdate = geometry.groupsNeedUpdate;
 
+		if ( geometry.boundingSphere !== null ) {
+
+			this.boundingSphere = geometry.boundingSphere.clone();
+
+		}
+
+		if ( geometry.boundingBox !== null ) {
+
+			this.boundingBox = geometry.boundingBox.clone();
+
+		}
+
 		return this;
 
 	}