Răsfoiți Sursa

BufferGeometry: Compute BoundingBox/Sphere after applyMatrix(). #6167

Mr.doob 10 ani în urmă
părinte
comite
48b299b23b
1 a modificat fișierele cu 12 adăugiri și 0 ștergeri
  1. 12 0
      src/core/BufferGeometry.js

+ 12 - 0
src/core/BufferGeometry.js

@@ -84,6 +84,18 @@ THREE.BufferGeometry.prototype = {
 
 		}
 
+		if ( this.boundingBox instanceof THREE.Box3 ) {
+
+			this.computeBoundingBox();
+
+		}
+
+		if ( this.boundingSphere instanceof THREE.Sphere ) {
+
+			this.computeBoundingSphere();
+
+		}
+
 	},
 
 	center: function () {