getTangent method

dynamic getTangent(
  1. dynamic t, [
  2. dynamic optionalTarget
])
override

Implementation

getTangent( t, [optionalTarget]) {

	var tangent = optionalTarget ?? new Vector3() ;

	var u = this.knots[ 0 ] + t * ( this.knots[ this.knots.length - 1 ] - this.knots[ 0 ] );
	var ders = NURBSUtils.calcNURBSDerivatives( this.degree, this.knots, this.controlPoints, u, 1 );
	tangent.copy( ders[ 1 ] ).normalize();

	return tangent;

}