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

EllipseCurve code clean up.

上级 4d4bdcb7
......@@ -2,9 +2,7 @@
* Ellipse curve
**************************************************************/
THREE.EllipseCurve = function ( aX, aY, xRadius, yRadius,
aStartAngle, aEndAngle,
aClockwise ) {
THREE.EllipseCurve = function ( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise ) {
this.aX = aX;
this.aY = aY;
......@@ -23,20 +21,22 @@ THREE.EllipseCurve.prototype = Object.create( THREE.Curve.prototype );
THREE.EllipseCurve.prototype.getPoint = function ( t ) {
var deltaAngle = this.aEndAngle - this.aStartAngle;
var angle;
var deltaAngle = this.aEndAngle - this.aStartAngle;
if ( this.aClockwise === true ) {
angle = this.aEndAngle + ( 1 - t ) * ( Math.PI * 2 - deltaAngle );
} else {
angle = this.aStartAngle + t * deltaAngle;
if ( this.aClockwise ) {
t = 1 - t;
deltaAngle = Math.PI*2 - deltaAngle;
var angle = this.aEndAngle + t * deltaAngle;
}
else {
var angle = this.aStartAngle + t * deltaAngle;
}
var tx = this.aX + this.xRadius * Math.cos( angle );
var ty = this.aY + this.yRadius * Math.sin( angle );
return new THREE.Vector2( tx, ty );
};
};
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册