@cocosine 写道:
如果我传了大于
360
的数给rotateTo
,动作效果就不对了
看了下引擎实现/* * CCActionInterval.js */ startWithTarget:function (target) { cc.ActionInterval.prototype.startWithTarget.call(this, target); // Calculate X var locStartAngleX = target.rotationX % 360.0; var locDiffAngleX = this._dstAngleX - locStartAngleX; if (locDiffAngleX > 180) locDiffAngleX -= 360; if (locDiffAngleX < -180) locDiffAngleX += 360; this._startAngleX = locStartAngleX; this._diffAngleX = locDiffAngleX; // Calculate Y It's duplicated from calculating X since the rotation wrap should be the same this._startAngleY = target.rotationY % 360.0; var locDiffAngleY = this._dstAngleY - this._startAngleY; if (locDiffAngleY > 180) locDiffAngleY -= 360; if (locDiffAngleY < -180) locDiffAngleY += 360; this._diffAngleY = locDiffAngleY; },
那个
locDiffAngleX
是不是也应该% 360.0
帖子: 2
参与者: 1