提交 31958f79 编写于 作者: Z zz85

add getTangentAt()

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