fix euler data problem (#4486)

* fix euler data problem

* update euler before serialize
This commit is contained in:
gameu3d
2019-05-24 16:58:35 +08:00
committed by pandamicro
parent 0d0838770b
commit abe97e390d
+6 -1
View File
@@ -193,7 +193,7 @@ class Node extends BaseNode {
vec3.copy(this._pos, this._lpos);
quat.copy(this._rot, this._lrot);
vec3.copy(this._scale, this._lscale);
this._eulerDirty = this._dirty = this._hasChanged = true;
this._dirty = this._hasChanged = true;
this._eventMask = 0;
for (const child of this._children) {
child._onBatchCreated();
@@ -204,6 +204,11 @@ class Node extends BaseNode {
this._onBatchCreated();
}
public _onBeforeSerialize () {
// tslint:disable-next-line: no-unused-expression
this.eulerAngles; // make sure we save the correct eulerAngles
}
// ===============================
// transform helper, convenient but not the most efficient
// ===============================