Browse Source

Merge pull request #11366 from Mugen87/dev

CatmullRomCurve3: Cleanup
Mr.doob 8 years ago
parent
commit
216b2a119d
1 changed files with 4 additions and 4 deletions
  1. 4 4
      src/extras/curves/CatmullRomCurve3.js

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

@@ -83,11 +83,13 @@ function CubicPoly() {
 var tmp = new Vector3();
 var px = new CubicPoly(), py = new CubicPoly(), pz = new CubicPoly();
 
-function CatmullRomCurve3( p /* array of Vector3 */ ) {
+function CatmullRomCurve3( points ) {
 
 	Curve.call( this );
 
-	this.points = p || [];
+	if ( points.length < 2 ) console.warn( 'THREE.CatmullRomCurve3: Points array needs at least two entries.' );
+
+	this.points = points || [];
 	this.closed = false;
 
 }
@@ -100,8 +102,6 @@ CatmullRomCurve3.prototype.getPoint = function ( t ) {
 	var points = this.points;
 	var l = points.length;
 
-	if ( l < 2 ) console.log( 'duh, you need at least 2 points' );
-
 	var point = ( l - ( this.closed ? 0 : 1 ) ) * t;
 	var intPoint = Math.floor( point );
 	var weight = point - intPoint;