浏览代码

Rename back LineSegment to Line3 per @mrdoob's preference.

Ben Houston 12 年之前
父节点
当前提交
a6357d9f45

+ 3 - 3
src/math/LineSegment.js → src/math/Line3.js

@@ -2,14 +2,14 @@
  * @author bhouston / http://exocortex.com
  */
 
-THREE.LineSegment = function ( start, end ) {
+THREE.Line3 = function ( start, end ) {
 
 	this.start = ( start !== undefined ) ? start : new THREE.Vector3();
 	this.end = ( end !== undefined ) ? end : new THREE.Vector3();
 
 };
 
-THREE.extend( THREE.LineSegment.prototype, {
+THREE.extend( THREE.Line3.prototype, {
 
 	set: function ( start, end ) {
 
@@ -117,7 +117,7 @@ THREE.extend( THREE.LineSegment.prototype, {
 
 	clone: function () {
 
-		return new THREE.LineSegment().copy( this );
+		return new THREE.Line3().copy( this );
 
 	}
 

+ 8 - 8
test/unit/math/LineSegment.js → test/unit/math/Line3.js

@@ -2,21 +2,21 @@
  * @author bhouston / http://exocortex.com
  */
 
-module( "LineSegment" );
+module( "Line3" );
 
 test( "constructor/equals", function() {
-	var a = new THREE.LineSegment();
+	var a = new THREE.Line3();
 	ok( a.start.equals( zero3 ), "Passed!" );
 	ok( a.end.equals( zero3 ), "Passed!" );
 
-	a = new THREE.LineSegment( two3.clone(), one3.clone() );
+	a = new THREE.Line3( two3.clone(), one3.clone() );
 	ok( a.start.equals( two3 ), "Passed!" );
 	ok( a.end.equals( one3 ), "Passed!" );
 });
 
 test( "copy/equals", function() {
-	var a = new THREE.LineSegment( zero3.clone(), one3.clone() );
-	var b = new THREE.LineSegment().copy( a );
+	var a = new THREE.Line3( zero3.clone(), one3.clone() );
+	var b = new THREE.Line3().copy( a );
 	ok( b.start.equals( zero3 ), "Passed!" );
 	ok( b.end.equals( one3 ), "Passed!" );
 
@@ -28,7 +28,7 @@ test( "copy/equals", function() {
 });
 
 test( "set", function() {
-	var a = new THREE.LineSegment();
+	var a = new THREE.Line3();
 
 	a.set( one3, one3 );
 	ok( a.start.equals( one3 ), "Passed!" );
@@ -36,7 +36,7 @@ test( "set", function() {
 });
 
 test( "at", function() {
-	var a = new THREE.LineSegment( one3.clone(), new THREE.Vector3( 1, 1, 2 ) );
+	var a = new THREE.Line3( one3.clone(), new THREE.Vector3( 1, 1, 2 ) );
 
 	ok( a.at( -1 ).distanceTo( new THREE.Vector3( 1, 1, 0 ) ) < 0.0001, "Passed!" );
 	ok( a.at( 0 ).distanceTo( one3.clone() ) < 0.0001, "Passed!" );
@@ -45,7 +45,7 @@ test( "at", function() {
 });
 
 test( "closestPointToPoint/closestPointToPointParameter", function() {
-	var a = new THREE.LineSegment( one3.clone(), new THREE.Vector3( 1, 1, 2 ) );
+	var a = new THREE.Line3( one3.clone(), new THREE.Vector3( 1, 1, 2 ) );
 
 	// nearby the ray
 	ok( a.closestPointToPointParameter( zero3.clone(), true ) == 0, "Passed!" );

+ 1 - 1
test/unit/math/Plane.js

@@ -131,7 +131,7 @@ test( "distanceToSphere", function() {
 test( "isInterestionLine/intersectLine", function() {
 	var a = new THREE.Plane( new THREE.Vector3( 1, 0, 0 ), 0 );
 
-	var l1 = new THREE.LineSegment( new THREE.Vector3( -10, 0, 0 ), new THREE.Vector3( 10, 0, 0 ) );
+	var l1 = new THREE.Line3( new THREE.Vector3( -10, 0, 0 ), new THREE.Vector3( 10, 0, 0 ) );
 	ok( a.isIntersectionLine( l1 ), "Passed!" );
 	ok( a.intersectLine( l1 ).equals( new THREE.Vector3( 0, 0, 0 ) ), "Passed!" );
 

+ 2 - 2
test/unit/unittests_sources.html

@@ -17,7 +17,7 @@
   <script src="../../src/math/Vector2.js"></script>
   <script src="../../src/math/Vector3.js"></script>
   <script src="../../src/math/Vector4.js"></script>
-  <script src="../../src/math/LineSegment.js"></script>
+  <script src="../../src/math/Line3.js"></script>
   <script src="../../src/math/Box2.js"></script>
   <script src="../../src/math/Box3.js"></script>
   <script src="../../src/math/Matrix3.js"></script>
@@ -41,7 +41,7 @@
   <script src="math/Vector2.js"></script>
   <script src="math/Vector3.js"></script>
   <script src="math/Vector4.js"></script>
-  <script src="math/LineSegment.js"></script>
+  <script src="math/Line3.js"></script>
   <script src="math/Quaternion.js"></script>
   <script src="math/Matrix3.js"></script>
   <script src="math/Matrix4.js"></script>

+ 1 - 1
test/unit/unittests_three-math.html

@@ -25,7 +25,7 @@
   <script src="math/Vector2.js"></script>
   <script src="math/Vector3.js"></script>
   <script src="math/Vector4.js"></script>
-  <script src="math/LineSegment.js"></script>
+  <script src="math/Line3.js"></script>
   <script src="math/Quaternion.js"></script>
   <script src="math/Matrix3.js"></script>
   <script src="math/Matrix4.js"></script>

+ 1 - 1
test/unit/unittests_three.html

@@ -25,7 +25,7 @@
   <script src="math/Vector2.js"></script>
   <script src="math/Vector3.js"></script>
   <script src="math/Vector4.js"></script>
-  <script src="math/LineSegment.js"></script>
+  <script src="math/Line3.js"></script>
   <script src="math/Quaternion.js"></script>
   <script src="math/Matrix3.js"></script>
   <script src="math/Matrix4.js"></script>

+ 1 - 1
test/unit/unittests_three.min.html

@@ -25,7 +25,7 @@
   <script src="math/Vector2.js"></script>
   <script src="math/Vector3.js"></script>
   <script src="math/Vector4.js"></script>
-  <script src="math/LineSegment.js"></script>
+  <script src="math/Line3.js"></script>
   <script src="math/Quaternion.js"></script>
   <script src="math/Matrix3.js"></script>
   <script src="math/Matrix4.js"></script>

+ 1 - 1
utils/build/includes/math.json

@@ -5,7 +5,7 @@
 	"src/math/Vector2.js",
 	"src/math/Vector3.js",
 	"src/math/Vector4.js",
-	"src/math/LineSegment.js",
+	"src/math/Line3.js",
 	"src/math/Box2.js",
 	"src/math/Box3.js",
 	"src/math/Matrix3.js",