提交 216b2a11 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #11366 from Mugen87/dev

CatmullRomCurve3: Cleanup
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册