Selaa lähdekoodia

Merge pull request #13428 from WJsjtu/dev1

DirectGeometry: clone bounding volumes in fromGeometry method
Mr.doob 6 vuotta sitten
vanhempi
commit
2d19c071fa
1 muutettua tiedostoa jossa 12 lisäystä ja 0 poistoa
  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;
 
 	}