From bb179755f418ca45c5686ab754890a19632419ea Mon Sep 17 00:00:00 2001 From: Sebastien DUMETZ Date: Thu, 5 Sep 2024 11:24:47 +0200 Subject: [PATCH] properly transpose pivot to use same coordinate system as offset --- libs/ff-three/source/CameraController.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/ff-three/source/CameraController.ts b/libs/ff-three/source/CameraController.ts index c68ed53a..c78b46a5 100644 --- a/libs/ff-three/source/CameraController.ts +++ b/libs/ff-three/source/CameraController.ts @@ -242,7 +242,8 @@ export default class CameraController implements IManip _eua.setFromVector3(_vec3a, "YXZ"); _quat.setFromEuler(_eua); //Position, relative to pivot point - _vec3b.copy(this.offset).applyEuler(_eua).add(this.pivot); + _vec3a.set(this.pivot.z, this.pivot.y, this.pivot.x) //transpose pivot to camera space (Z-forward) + _vec3b.copy(this.offset).applyEuler(_eua).add(_vec3a); //Keep scale _vec3c.setFromMatrixScale(object.matrix); //Compose everything