Skip to content

Commit

Permalink
properly transpose pivot to use same coordinate system as offset
Browse files Browse the repository at this point in the history
  • Loading branch information
sdumetz committed Sep 5, 2024
1 parent 342ab8f commit bb17975
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libs/ff-three/source/CameraController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bb17975

Please sign in to comment.