Browse Source

Box3: Renamed .setFromBuffer to .setFromBufferAttribute

Mugen87 8 years ago
parent
commit
cc2a20d411
3 changed files with 9 additions and 9 deletions
  1. 2 2
      docs/api/math/Box3.html
  2. 2 2
      src/core/BufferGeometry.js
  3. 5 5
      src/math/Box3.js

+ 2 - 2
docs/api/math/Box3.html

@@ -101,12 +101,12 @@
 		Sets the upper and lower bounds of this box to include all of the data in *array*.
 		</div>
 
-		<h3>[method:Box3 setFromBuffer]( [page:BufferAttribute buffer] ) [page:Box3 this]</h3>
+		<h3>[method:Box3 setFromBufferAttribute]( [page:BufferAttribute attribute] ) [page:Box3 this]</h3>
 		<div>
 		buffer -- An buffer attribute of position data that the resulting box will envelop.
 		</div>
 		<div>
-		Sets the upper and lower bounds of this box to include all of the data in *buffer*.
+		Sets the upper and lower bounds of this box to include all of the data in *attribute*.
 		</div>
 
 		<h3>[method:Box3 setFromPoints]( [page:Array points] ) [page:Box3 this]</h3>

+ 2 - 2
src/core/BufferGeometry.js

@@ -583,7 +583,7 @@ Object.assign( BufferGeometry.prototype, EventDispatcher.prototype, {
 
 		if ( position !== undefined ) {
 
-			this.boundingBox.setFromBuffer( position );
+			this.boundingBox.setFromBufferAttribute( position );
 
 		} else {
 
@@ -618,7 +618,7 @@ Object.assign( BufferGeometry.prototype, EventDispatcher.prototype, {
 
 				var center = this.boundingSphere.center;
 
-				box.setFromBuffer( position );
+				box.setFromBufferAttribute( position );
 				box.getCenter( center );
 
 				// hoping to find a boundingSphere with a radius smaller than the

+ 5 - 5
src/math/Box3.js

@@ -59,7 +59,7 @@ Box3.prototype = {
 
 	},
 
-	setFromBuffer: function ( buffer ) {
+	setFromBufferAttribute: function ( attribute ) {
 
 		var minX = + Infinity;
 		var minY = + Infinity;
@@ -69,11 +69,11 @@ Box3.prototype = {
 		var maxY = - Infinity;
 		var maxZ = - Infinity;
 
-		for ( var i = 0, l = buffer.count; i < l; i ++ ) {
+		for ( var i = 0, l = attribute.count; i < l; i ++ ) {
 
-			var x = buffer.getX( i );
-			var y = buffer.getY( i );
-			var z = buffer.getZ( i );
+			var x = attribute.getX( i );
+			var y = attribute.getY( i );
+			var z = attribute.getZ( i );
 
 			if ( x < minX ) minX = x;
 			if ( y < minY ) minY = y;