Browse Source

Curve.Utils and Shape.Utils to CurveUtils and ShapeUtils.

Mr.doob 9 years ago
parent
commit
dff36c0e03

+ 4 - 4
src/extras/FontUtils.js

@@ -174,8 +174,8 @@ THREE.FontUtils = {
 						for ( i2 = 1, divisions = this.divisions; i2 <= divisions; i2 ++ ) {
 
 							var t = i2 / divisions;
-							THREE.Shape.Utils.b2( t, cpx0, cpx1, cpx );
-							THREE.Shape.Utils.b2( t, cpy0, cpy1, cpy );
+							THREE.ShapeUtils.b2( t, cpx0, cpx1, cpx );
+							THREE.ShapeUtils.b2( t, cpy0, cpy1, cpy );
 
 						}
 
@@ -206,8 +206,8 @@ THREE.FontUtils = {
 						for ( i2 = 1, divisions = this.divisions; i2 <= divisions; i2 ++ ) {
 
 							var t = i2 / divisions;
-							THREE.Shape.Utils.b3( t, cpx0, cpx1, cpx2, cpx );
-							THREE.Shape.Utils.b3( t, cpy0, cpy1, cpy2, cpy );
+							THREE.ShapeUtils.b3( t, cpx0, cpx1, cpx2, cpx );
+							THREE.ShapeUtils.b3( t, cpy0, cpy1, cpy2, cpy );
 
 						}
 

+ 4 - 4
src/extras/core/Path.js

@@ -253,8 +253,8 @@ THREE.Path.prototype.getPoints = function( divisions, closedPath ) {
 
 				var t = j / divisions;
 
-				tx = THREE.Shape.Utils.b2( t, cpx0, cpx1, cpx );
-				ty = THREE.Shape.Utils.b2( t, cpy0, cpy1, cpy );
+				tx = THREE.ShapeUtils.b2( t, cpx0, cpx1, cpx );
+				ty = THREE.ShapeUtils.b2( t, cpy0, cpy1, cpy );
 
 				points.push( new THREE.Vector2( tx, ty ) );
 
@@ -591,7 +591,7 @@ THREE.Path.prototype.toShapes = function( isCCW, noHoles ) {
 
 	}
 
-	var holesFirst = ! THREE.Shape.Utils.isClockWise( subPaths[ 0 ].getPoints() );
+	var holesFirst = ! THREE.ShapeUtils.isClockWise( subPaths[ 0 ].getPoints() );
 	holesFirst = isCCW ? ! holesFirst : holesFirst;
 
 	// console.log("Holes first", holesFirst);
@@ -609,7 +609,7 @@ THREE.Path.prototype.toShapes = function( isCCW, noHoles ) {
 
 		tmpPath = subPaths[ i ];
 		tmpPoints = tmpPath.getPoints();
-		solid = THREE.Shape.Utils.isClockWise( tmpPoints );
+		solid = THREE.ShapeUtils.isClockWise( tmpPoints );
 		solid = isCCW ? ! solid : solid;
 
 		if ( solid ) {

+ 3 - 3
src/extras/curves/ClosedSplineCurve3.js

@@ -28,9 +28,9 @@ THREE.ClosedSplineCurve3 = THREE.Curve.create(
 
 		var vector = new THREE.Vector3();
 
-		vector.x = THREE.Curve.Utils.interpolate( point0.x, point1.x, point2.x, point3.x, weight );
-		vector.y = THREE.Curve.Utils.interpolate( point0.y, point1.y, point2.y, point3.y, weight );
-		vector.z = THREE.Curve.Utils.interpolate( point0.z, point1.z, point2.z, point3.z, weight );
+		vector.x = THREE.CurveUtils.interpolate( point0.x, point1.x, point2.x, point3.x, weight );
+		vector.y = THREE.CurveUtils.interpolate( point0.y, point1.y, point2.y, point3.y, weight );
+		vector.z = THREE.CurveUtils.interpolate( point0.z, point1.z, point2.z, point3.z, weight );
 
 		return vector;
 

+ 4 - 4
src/extras/curves/CubicBezierCurve.js

@@ -18,8 +18,8 @@ THREE.CubicBezierCurve.prototype.getPoint = function ( t ) {
 
 	var tx, ty;
 
-	tx = THREE.Shape.Utils.b3( t, this.v0.x, this.v1.x, this.v2.x, this.v3.x );
-	ty = THREE.Shape.Utils.b3( t, this.v0.y, this.v1.y, this.v2.y, this.v3.y );
+	tx = THREE.ShapeUtils.b3( t, this.v0.x, this.v1.x, this.v2.x, this.v3.x );
+	ty = THREE.ShapeUtils.b3( t, this.v0.y, this.v1.y, this.v2.y, this.v3.y );
 
 	return new THREE.Vector2( tx, ty );
 
@@ -29,8 +29,8 @@ THREE.CubicBezierCurve.prototype.getTangent = function( t ) {
 
 	var tx, ty;
 
-	tx = THREE.Curve.Utils.tangentCubicBezier( t, this.v0.x, this.v1.x, this.v2.x, this.v3.x );
-	ty = THREE.Curve.Utils.tangentCubicBezier( t, this.v0.y, this.v1.y, this.v2.y, this.v3.y );
+	tx = THREE.CurveUtils.tangentCubicBezier( t, this.v0.x, this.v1.x, this.v2.x, this.v3.x );
+	ty = THREE.CurveUtils.tangentCubicBezier( t, this.v0.y, this.v1.y, this.v2.y, this.v3.y );
 
 	var tangent = new THREE.Vector2( tx, ty );
 	tangent.normalize();

+ 3 - 3
src/extras/curves/CubicBezierCurve3.js

@@ -17,9 +17,9 @@ THREE.CubicBezierCurve3 = THREE.Curve.create(
 
 		var vector = new THREE.Vector3();
 
-		vector.x = THREE.Shape.Utils.b3( t, this.v0.x, this.v1.x, this.v2.x, this.v3.x );
-		vector.y = THREE.Shape.Utils.b3( t, this.v0.y, this.v1.y, this.v2.y, this.v3.y );
-		vector.z = THREE.Shape.Utils.b3( t, this.v0.z, this.v1.z, this.v2.z, this.v3.z );
+		vector.x = THREE.ShapeUtils.b3( t, this.v0.x, this.v1.x, this.v2.x, this.v3.x );
+		vector.y = THREE.ShapeUtils.b3( t, this.v0.y, this.v1.y, this.v2.y, this.v3.y );
+		vector.z = THREE.ShapeUtils.b3( t, this.v0.z, this.v1.z, this.v2.z, this.v3.z );
 
 		return vector;
 

+ 4 - 4
src/extras/curves/QuadraticBezierCurve.js

@@ -19,8 +19,8 @@ THREE.QuadraticBezierCurve.prototype.getPoint = function ( t ) {
 
 	var vector = new THREE.Vector2();
 
-	vector.x = THREE.Shape.Utils.b2( t, this.v0.x, this.v1.x, this.v2.x );
-	vector.y = THREE.Shape.Utils.b2( t, this.v0.y, this.v1.y, this.v2.y );
+	vector.x = THREE.ShapeUtils.b2( t, this.v0.x, this.v1.x, this.v2.x );
+	vector.y = THREE.ShapeUtils.b2( t, this.v0.y, this.v1.y, this.v2.y );
 
 	return vector;
 
@@ -31,8 +31,8 @@ THREE.QuadraticBezierCurve.prototype.getTangent = function( t ) {
 
 	var vector = new THREE.Vector2();
 
-	vector.x = THREE.Curve.Utils.tangentQuadraticBezier( t, this.v0.x, this.v1.x, this.v2.x );
-	vector.y = THREE.Curve.Utils.tangentQuadraticBezier( t, this.v0.y, this.v1.y, this.v2.y );
+	vector.x = THREE.CurveUtils.tangentQuadraticBezier( t, this.v0.x, this.v1.x, this.v2.x );
+	vector.y = THREE.CurveUtils.tangentQuadraticBezier( t, this.v0.y, this.v1.y, this.v2.y );
 
 	// returns unit vector
 

+ 3 - 3
src/extras/curves/QuadraticBezierCurve3.js

@@ -16,9 +16,9 @@ THREE.QuadraticBezierCurve3 = THREE.Curve.create(
 
 		var vector = new THREE.Vector3();
 
-		vector.x = THREE.Shape.Utils.b2( t, this.v0.x, this.v1.x, this.v2.x );
-		vector.y = THREE.Shape.Utils.b2( t, this.v0.y, this.v1.y, this.v2.y );
-		vector.z = THREE.Shape.Utils.b2( t, this.v0.z, this.v1.z, this.v2.z );
+		vector.x = THREE.ShapeUtils.b2( t, this.v0.x, this.v1.x, this.v2.x );
+		vector.y = THREE.ShapeUtils.b2( t, this.v0.y, this.v1.y, this.v2.y );
+		vector.z = THREE.ShapeUtils.b2( t, this.v0.z, this.v1.z, this.v2.z );
 
 		return vector;
 

+ 2 - 2
src/extras/curves/SplineCurve.js

@@ -26,8 +26,8 @@ THREE.SplineCurve.prototype.getPoint = function ( t ) {
 
 	var vector = new THREE.Vector2();
 
-	vector.x = THREE.Curve.Utils.interpolate( point0.x, point1.x, point2.x, point3.x, weight );
-	vector.y = THREE.Curve.Utils.interpolate( point0.y, point1.y, point2.y, point3.y, weight );
+	vector.x = THREE.CurveUtils.interpolate( point0.x, point1.x, point2.x, point3.x, weight );
+	vector.y = THREE.CurveUtils.interpolate( point0.y, point1.y, point2.y, point3.y, weight );
 
 	return vector;
 

+ 3 - 3
src/extras/curves/SplineCurve3.js

@@ -27,9 +27,9 @@ THREE.SplineCurve3 = THREE.Curve.create(
 
 		var vector = new THREE.Vector3();
 
-		vector.x = THREE.Curve.Utils.interpolate( point0.x, point1.x, point2.x, point3.x, weight );
-		vector.y = THREE.Curve.Utils.interpolate( point0.y, point1.y, point2.y, point3.y, weight );
-		vector.z = THREE.Curve.Utils.interpolate( point0.z, point1.z, point2.z, point3.z, weight );
+		vector.x = THREE.CurveUtils.interpolate( point0.x, point1.x, point2.x, point3.x, weight );
+		vector.y = THREE.CurveUtils.interpolate( point0.y, point1.y, point2.y, point3.y, weight );
+		vector.z = THREE.CurveUtils.interpolate( point0.z, point1.z, point2.z, point3.z, weight );
 
 		return vector;
 

+ 3 - 3
src/extras/geometries/ExtrudeGeometry.js

@@ -135,7 +135,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
 	var vertices = shapePoints.shape;
 	var holes = shapePoints.holes;
 
-	var reverse = ! THREE.Shape.Utils.isClockWise( vertices );
+	var reverse = ! THREE.ShapeUtils.isClockWise( vertices );
 
 	if ( reverse ) {
 
@@ -147,7 +147,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
 
 			ahole = holes[ h ];
 
-			if ( THREE.Shape.Utils.isClockWise( ahole ) ) {
+			if ( THREE.ShapeUtils.isClockWise( ahole ) ) {
 
 				holes[ h ] = ahole.reverse();
 
@@ -160,7 +160,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
 	}
 
 
-	var faces = THREE.Shape.Utils.triangulateShape ( vertices, holes );
+	var faces = THREE.ShapeUtils.triangulateShape( vertices, holes );
 
 	/* Vertices */
 

+ 3 - 3
src/extras/geometries/ShapeGeometry.js

@@ -67,7 +67,7 @@ THREE.ShapeGeometry.prototype.addShape = function ( shape, options ) {
 	var vertices = shapePoints.shape;
 	var holes = shapePoints.holes;
 
-	var reverse = ! THREE.Shape.Utils.isClockWise( vertices );
+	var reverse = ! THREE.ShapeUtils.isClockWise( vertices );
 
 	if ( reverse ) {
 
@@ -79,7 +79,7 @@ THREE.ShapeGeometry.prototype.addShape = function ( shape, options ) {
 
 			hole = holes[ i ];
 
-			if ( THREE.Shape.Utils.isClockWise( hole ) ) {
+			if ( THREE.ShapeUtils.isClockWise( hole ) ) {
 
 				holes[ i ] = hole.reverse();
 
@@ -91,7 +91,7 @@ THREE.ShapeGeometry.prototype.addShape = function ( shape, options ) {
 
 	}
 
-	var faces = THREE.Shape.Utils.triangulateShape( vertices, holes );
+	var faces = THREE.ShapeUtils.triangulateShape( vertices, holes );
 
 	// Vertices