Browse Source

boundingSphere -> getBoundingSphere(), boundingBox -> getBoundingBox() per @mrdoob

Ben Houston 12 years ago
parent
commit
8c2d2e9872
4 changed files with 10 additions and 10 deletions
  1. 1 1
      src/math/Box3.js
  2. 1 1
      src/math/Sphere.js
  3. 4 4
      test/math/Box3.js
  4. 4 4
      test/math/Sphere.js

+ 1 - 1
src/math/Box3.js

@@ -226,7 +226,7 @@ THREE.Box3.prototype = {
 
 
 	},
 	},
 
 
-	boundingSphere: function ( optionalTarget ) {
+	getBoundingSphere: function ( optionalTarget ) {
 
 
 		var result = optionalTarget || new THREE.Sphere();
 		var result = optionalTarget || new THREE.Sphere();
 		
 		

+ 1 - 1
src/math/Sphere.js

@@ -85,7 +85,7 @@ THREE.Sphere.prototype = {
 
 
 	},
 	},
 
 
-	boundingBox: function ( optionalTarget ) {
+	getBoundingBox: function ( optionalTarget ) {
 
 
 		var box = optionalTarget || new THREE.Box3();
 		var box = optionalTarget || new THREE.Box3();
 
 

+ 4 - 4
test/math/Box3.js

@@ -208,14 +208,14 @@ test( "isIntersectionBox", function() {
 	ok( ! b.isIntersectionBox( c ), "Passed!" );
 	ok( ! b.isIntersectionBox( c ), "Passed!" );
 });
 });
 
 
-test( "boundingSphere", function() {
+test( "getBoundingSphere", function() {
 	var a = new THREE.Box3( zero3, zero3 );
 	var a = new THREE.Box3( zero3, zero3 );
 	var b = new THREE.Box3( zero3, one3 );
 	var b = new THREE.Box3( zero3, one3 );
 	var c = new THREE.Box3( one3.clone().negate(), one3 );
 	var c = new THREE.Box3( one3.clone().negate(), one3 );
 
 
-	ok( a.boundingSphere().equals( new THREE.Sphere( zero3, 0 ) ), "Passed!" );
-	ok( b.boundingSphere().equals( new THREE.Sphere( one3.clone().multiplyScalar( 0.5 ), Math.sqrt( 3 ) * 0.5 ) ), "Passed!" );
-	ok( c.boundingSphere().equals( new THREE.Sphere( zero3, Math.sqrt( 12 ) * 0.5 ) ), "Passed!" );
+	ok( a.getBoundingSphere().equals( new THREE.Sphere( zero3, 0 ) ), "Passed!" );
+	ok( b.getBoundingSphere().equals( new THREE.Sphere( one3.clone().multiplyScalar( 0.5 ), Math.sqrt( 3 ) * 0.5 ) ), "Passed!" );
+	ok( c.getBoundingSphere().equals( new THREE.Sphere( zero3, Math.sqrt( 12 ) * 0.5 ) ), "Passed!" );
 });
 });
 
 
 test( "intersect", function() {
 test( "intersect", function() {

+ 4 - 4
test/math/Sphere.js

@@ -67,13 +67,13 @@ test( "clampPoint", function() {
 	ok( a.clampPoint( new THREE.Vector3( 1, 1, -3 ) ).equals( new THREE.Vector3( 1, 1, 0 ) ), "Passed!" );
 	ok( a.clampPoint( new THREE.Vector3( 1, 1, -3 ) ).equals( new THREE.Vector3( 1, 1, 0 ) ), "Passed!" );
 });
 });
 
 
-test( "boundingBox", function() {
+test( "getBoundingBox", function() {
 	var a = new THREE.Sphere( one3, 1 );
 	var a = new THREE.Sphere( one3, 1 );
 
 
-	ok( a.boundingBox().equals( new THREE.Box3( zero3, two3 ) ), "Passed!" );
+	ok( a.getBoundingBox().equals( new THREE.Box3( zero3, two3 ) ), "Passed!" );
 
 
 	a.set( zero3, 0 )
 	a.set( zero3, 0 )
-	ok( a.boundingBox().equals( new THREE.Box3( zero3, zero3 ) ), "Passed!" );
+	ok( a.getBoundingBox().equals( new THREE.Box3( zero3, zero3 ) ), "Passed!" );
 });
 });
 
 
 test( "transform", function() {
 test( "transform", function() {
@@ -83,7 +83,7 @@ test( "transform", function() {
 	var t1 = new THREE.Vector3( 1, -2, 1 );
 	var t1 = new THREE.Vector3( 1, -2, 1 );
 	m.makeTranslation( t1 );
 	m.makeTranslation( t1 );
 
 
-	ok( a.clone().transform( m ).boundingBox().equals( a.boundingBox().transform( m ) ), "Passed!" );
+	ok( a.clone().transform( m ).getBoundingBox().equals( a.getBoundingBox().transform( m ) ), "Passed!" );
 });
 });
 
 
 test( "translate", function() {
 test( "translate", function() {