content/hifi-content/dave/walk-tools/walkTools/libraries/three.js/extras/curves/QuadraticBezierCurve3.js
2022-02-13 22:49:05 +01:00

27 lines
593 B
JavaScript

/**************************************************************
* Quadratic Bezier 3D curve
**************************************************************/
THREE.QuadraticBezierCurve3 = THREE.Curve.create(
function ( v0, v1, v2 ) {
this.v0 = v0;
this.v1 = v1;
this.v2 = v2;
},
function ( t ) {
var vector = new THREE.Vector3();
vector.x = THREE.Shape.Utils.b2( t, this.v0.x, this.v1.x, this.v2.x );
vector.y = THREE.Shape.Utils.b2( t, this.v0.y, this.v1.y, this.v2.y );
vector.z = THREE.Shape.Utils.b2( t, this.v0.z, this.v1.z, this.v2.z );
return vector;
}
);