@onerjs/core 8.49.4 → 8.49.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -83,22 +83,22 @@ export class TransformNode extends Node {
83
83
  this._absoluteRotationQuaternion = Quaternion.Identity();
84
84
  this._pivotMatrix = Matrix.Identity();
85
85
  /** @internal */
86
- // private _eulerCacheRotation = new Vector3(0, 0, 0, (res, vector) => {
87
- // if (this._rotationQuaternion) {
88
- // if ("x" in res) {
89
- // vector._x = res.x!;
90
- // }
91
- // if ("y" in res) {
92
- // vector._y = res.y!;
93
- // }
94
- // if ("z" in res) {
95
- // vector._z = res.z!;
96
- // }
97
- // Quaternion.FromEulerVectorToRef(vector, this._rotationQuaternion);
98
- // return true;
99
- // }
100
- // return false;
101
- // });
86
+ this._eulerCacheRotation = new Vector3(0, 0, 0, (res, vector) => {
87
+ if (this._rotationQuaternion) {
88
+ if ("x" in res) {
89
+ vector._x = res.x;
90
+ }
91
+ if ("y" in res) {
92
+ vector._y = res.y;
93
+ }
94
+ if ("z" in res) {
95
+ vector._z = res.z;
96
+ }
97
+ Quaternion.FromEulerVectorToRef(vector, this._rotationQuaternion);
98
+ return true;
99
+ }
100
+ return false;
101
+ });
102
102
  /** @internal */
103
103
  this._postMultiplyPivotMatrix = false;
104
104
  this._isWorldMatrixFrozen = false;
@@ -149,15 +149,15 @@ export class TransformNode extends Node {
149
149
  */
150
150
  get rotation() {
151
151
  if (this._rotationQuaternion) {
152
- // this._rotationQuaternion.toEulerAnglesToRef(this._eulerCacheRotation);
153
- // return this._eulerCacheRotation;
152
+ this._rotationQuaternion.toEulerAnglesToRef(this._eulerCacheRotation);
153
+ return this._eulerCacheRotation;
154
154
  }
155
155
  return this._rotation;
156
156
  }
157
157
  set rotation(newRotation) {
158
158
  if (this._rotationQuaternion) {
159
- // Quaternion.FromEulerVectorToRef(newRotation, this._rotationQuaternion);
160
- // this._eulerCacheRotation.copyFrom(newRotation);
159
+ Quaternion.FromEulerVectorToRef(newRotation, this._rotationQuaternion);
160
+ this._eulerCacheRotation.copyFrom(newRotation);
161
161
  return;
162
162
  }
163
163
  this._rotation = newRotation;
@@ -186,8 +186,8 @@ export class TransformNode extends Node {
186
186
  //reset the rotation vector.
187
187
  if (quaternion) {
188
188
  this._rotation.setAll(0.0);
189
- // quaternion.toEulerAnglesToRef(this._eulerCacheRotation);
190
- // this._eulerCacheRotation._isDirty = false;
189
+ quaternion.toEulerAnglesToRef(this._eulerCacheRotation);
190
+ this._eulerCacheRotation._isDirty = false;
191
191
  }
192
192
  this._markAsDirtyInternal();
193
193
  }
@@ -950,9 +950,9 @@ export class TransformNode extends Node {
950
950
  if (this._infiniteDistance) {
951
951
  if (!this.parent && camera) {
952
952
  const cameraWorldMatrix = camera.getWorldMatrix();
953
- const cameraGlobalPosition = new Vector3(cameraWorldMatrix.m[12], cameraWorldMatrix.m[13], cameraWorldMatrix.m[14]);
953
+ const m = cameraWorldMatrix.m;
954
954
  translation = TransformNode._TmpTranslation;
955
- translation.copyFromFloats(this._position.x + cameraGlobalPosition.x, this._position.y + cameraGlobalPosition.y, this._position.z + cameraGlobalPosition.z);
955
+ translation.copyFromFloats(this._position.x + m[12], this._position.y + m[13], this._position.z + m[14]);
956
956
  }
957
957
  }
958
958
  // Scaling
@@ -971,8 +971,8 @@ export class TransformNode extends Node {
971
971
  }
972
972
  }
973
973
  if (isDirty) {
974
- // this._rotationQuaternion.toEulerAnglesToRef(this._eulerCacheRotation);
975
- // this._eulerCacheRotation._isDirty = false;
974
+ this._rotationQuaternion.toEulerAnglesToRef(this._eulerCacheRotation);
975
+ this._eulerCacheRotation._isDirty = false;
976
976
  }
977
977
  }
978
978
  else {