diff --git a/src/extras/core/Curve.js b/src/extras/core/Curve.js index 64384ab4075b0d30c1ea5010e49ff99ea60270fe..b833bd7d6ff4182fe5b0d45de92f9266d25e2eac 100644 --- a/src/extras/core/Curve.js +++ b/src/extras/core/Curve.js @@ -1,6 +1,12 @@ /** * @author zz85 / http://www.lab4games.net/zz85/blog * Extensible curve object + * + * Some common of Curve methods + * .getPoint(t), getTangent(t) + * .getPointAt(u), getTagentAt(u) + * .getPoints(), .getSpacedPoints() + * .getLength() * * This file contains following classes: * @@ -237,9 +243,6 @@ THREE.Curve.prototype.getTangent = function( t ) { var pt1 = this.getPoint( t1 ); var pt2 = this.getPoint( t2 ); - - // var vec = new THREE.Vector2(); - // vec.sub( pt2, pt1 ); var vec = pt1.clone().subSelf(pt2); return vec.normalize(); @@ -247,6 +250,13 @@ THREE.Curve.prototype.getTangent = function( t ) { }; +THREE.Curve.prototype.getTangentAt = function ( u ) { + + var t = this.getUtoTmapping( u ); + return this.getTangent( t ); + +}; + /************************************************************** * Line **************************************************************/