From 0cd69a04c9f9dc5c271b58fab8d6b874bf4df5e0 Mon Sep 17 00:00:00 2001 From: Michal Dybizbanski Date: Wed, 16 Oct 2024 12:35:26 +0200 Subject: [PATCH] Make SceneModel::matrix setter decompose to other transformation properties --- src/viewer/scene/model/SceneModel.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/viewer/scene/model/SceneModel.js b/src/viewer/scene/model/SceneModel.js index df3c1971a..5c7ea90ba 100644 --- a/src/viewer/scene/model/SceneModel.js +++ b/src/viewer/scene/model/SceneModel.js @@ -1562,13 +1562,7 @@ export class SceneModel extends Component { */ set matrix(value) { this._matrix.set(value || DEFAULT_MATRIX); - - math.quaternionToRotationMat4(this._quaternion, this._worldRotationMatrix); - math.conjugateQuaternion(this._quaternion, this._conjugateQuaternion); - math.quaternionToRotationMat4(this._quaternion, this._worldRotationMatrixConjugate); - this._matrix.set(this._worldRotationMatrix); - math.translateMat4v(this._position, this._matrix); - + math.decomposeMat4(this._matrix, this._position, this._quaternion, this._scale); this._matrixDirty = false; this._setWorldMatrixDirty(); this._sceneModelDirty();