diff --git a/docs/api/math/Box3.html b/docs/api/math/Box3.html index 45fbd844a152a8dc04d5c0f33c7ec39d8f1ea6fe..c02c671ba30029f33c2a418717b7d14ff37a5995 100644 --- a/docs/api/math/Box3.html +++ b/docs/api/math/Box3.html @@ -51,15 +51,6 @@ Sets the lower and upper (x, y, z) boundaries of this box. -

.addPoint([page:Vector3 point]) [page:Box3 this]

-
- point -- [page:Vector3] to add to the box
-
-
- If the *point* is outside the bounds of the box, the bounds are expanded - so that the point is within the bounds. -
-

.applyMatrix4([page:Matrix4 matrix]) [page:Box3 this]

matrix -- The [page:Matrix4] to apply diff --git a/src/core/BufferGeometry.js b/src/core/BufferGeometry.js index 40eecb44c99c1d622f2c43bef0834d9db3d35512..9f0f416988893be73eb1c4dc322344be99d56850 100644 --- a/src/core/BufferGeometry.js +++ b/src/core/BufferGeometry.js @@ -329,7 +329,7 @@ THREE.BufferGeometry.prototype = { for ( var i = 0, il = positions.length; i < il; i += 3 ) { vector.set( positions[ i ], positions[ i + 1 ], positions[ i + 2 ] ); - box.addPoint( vector ); + box.expandByPoint( vector ); } diff --git a/src/math/Box3.js b/src/math/Box3.js index bad1fc30f3508a4f616cea3d94e9cc0d4c95ab59..1eb157952592a74e80232d2d39dc1d3ad46d5891 100644 --- a/src/math/Box3.js +++ b/src/math/Box3.js @@ -23,42 +23,6 @@ THREE.Box3.prototype = { }, - addPoint: function ( point ) { - - if ( point.x < this.min.x ) { - - this.min.x = point.x; - - } else if ( point.x > this.max.x ) { - - this.max.x = point.x; - - } - - if ( point.y < this.min.y ) { - - this.min.y = point.y; - - } else if ( point.y > this.max.y ) { - - this.max.y = point.y; - - } - - if ( point.z < this.min.z ) { - - this.min.z = point.z; - - } else if ( point.z > this.max.z ) { - - this.max.z = point.z; - - } - - return this; - - }, - setFromPoints: function ( points ) { if ( points.length > 0 ) { @@ -70,7 +34,7 @@ THREE.Box3.prototype = { for ( var i = 1, il = points.length; i < il; i ++ ) { - this.addPoint( points[ i ] ) + this.expandByPoint( points[ i ] ) }