提交 0513ed03 编写于 作者: M Mr.doob

Clean up.

上级 4d1b731b
......@@ -20,18 +20,22 @@ CubicBezierCurve.prototype.constructor = CubicBezierCurve;
CubicBezierCurve.prototype.getPoint = function ( t ) {
var v0 = this.v0, v1 = this.v1, v2 = this.v2, v3 = this.v3;
return new Vector2(
CubicBezier( t, this.v0.x, this.v1.x, this.v2.x, this.v3.x ),
CubicBezier( t, this.v0.y, this.v1.y, this.v2.y, this.v3.y )
CubicBezier( t, v0.x, v1.x, v2.x, v3.x ),
CubicBezier( t, v0.y, v1.y, v2.y, v3.y )
);
};
CubicBezierCurve.prototype.getTangent = function ( t ) {
var v0 = this.v0, v1 = this.v1, v2 = this.v2, v3 = this.v3;
return new Vector2(
TangentCubicBezier( t, this.v0.x, this.v1.x, this.v2.x, this.v3.x ),
TangentCubicBezier( t, this.v0.y, this.v1.y, this.v2.y, this.v3.y )
TangentCubicBezier( t, v0.x, v1.x, v2.x, v3.x ),
TangentCubicBezier( t, v0.y, v1.y, v2.y, v3.y )
).normalize();
};
......
......@@ -19,10 +19,12 @@ var CubicBezierCurve3 = Curve.create(
function ( t ) {
var v0 = this.v0, v1 = this.v1, v2 = this.v2, v3 = this.v3;
return new Vector3(
CubicBezier( t, this.v0.x, this.v1.x, this.v2.x, this.v3.x ),
CubicBezier( t, this.v0.y, this.v1.y, this.v2.y, this.v3.y ),
CubicBezier( t, this.v0.z, this.v1.z, this.v2.z, this.v3.z )
CubicBezier( t, v0.x, v1.x, v2.x, v3.x ),
CubicBezier( t, v0.y, v1.y, v2.y, v3.y ),
CubicBezier( t, v0.z, v1.z, v2.z, v3.z )
);
}
......
......@@ -18,12 +18,13 @@ function QuadraticBezierCurve( v0, v1, v2 ) {
QuadraticBezierCurve.prototype = Object.create( Curve.prototype );
QuadraticBezierCurve.prototype.constructor = QuadraticBezierCurve;
QuadraticBezierCurve.prototype.getPoint = function ( t ) {
var v0 = this.v0, v1 = this.v1, v2 = this.v2;
return new Vector2(
QuadraticBezier( t, this.v0.x, this.v1.x, this.v2.x ),
QuadraticBezier( t, this.v0.y, this.v1.y, this.v2.y )
QuadraticBezier( t, v0.x, v1.x, v2.x ),
QuadraticBezier( t, v0.y, v1.y, v2.y )
);
};
......@@ -31,9 +32,11 @@ QuadraticBezierCurve.prototype.getPoint = function ( t ) {
QuadraticBezierCurve.prototype.getTangent = function ( t ) {
var v0 = this.v0, v1 = this.v1, v2 = this.v2;
return new Vector2(
TangentQuadraticBezier( t, this.v0.x, this.v1.x, this.v2.x ),
TangentQuadraticBezier( t, this.v0.y, this.v1.y, this.v2.y )
TangentQuadraticBezier( t, v0.x, v1.x, v2.x ),
TangentQuadraticBezier( t, v0.y, v1.y, v2.y )
).normalize();
};
......
......@@ -18,10 +18,12 @@ var QuadraticBezierCurve3 = Curve.create(
function ( t ) {
var v0 = this.v0, v1 = this.v1, v2 = this.v2;
return new Vector3(
QuadraticBezier( t, this.v0.x, this.v1.x, this.v2.x ),
QuadraticBezier( t, this.v0.y, this.v1.y, this.v2.y ),
QuadraticBezier( t, this.v0.z, this.v1.z, this.v2.z )
QuadraticBezier( t, v0.x, v1.x, v2.x ),
QuadraticBezier( t, v0.y, v1.y, v2.y ),
QuadraticBezier( t, v0.z, v1.z, v2.z )
);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册