Merge pull request #2388 from pandamicro/next

Fix quat not initialized issue
This commit is contained in:
pandamicro
2018-03-02 15:50:13 +08:00
committed by GitHub
+8 -4
View File
@@ -1055,10 +1055,14 @@ var Node = cc.Class({
this._scale.y = this._scaleY;
this._scaleY = undefined;
}
// Upgrade rotationX, rotationY from v1.x
// TODO: remove in future version, 3.0 ?
// TODO: remove _rotationX & _rotationY in future version, 3.0 ?
// Update quaternion from rotation
if (this._rotationX === this._rotationY) {
math.quat.fromEuler(this._quat, 0, 0, -this._rotationX);
}
else {
math.quat.fromEuler(this._quat, this._rotationX, this._rotationY, 0);
}
var prefabInfo = this._prefab;
if (prefabInfo && prefabInfo.sync && prefabInfo.root === this) {