I have a mesh at the (0, 0, 0)
and camera further away looking At that point. I want to rotate camera around the mesh, however it does not always work as expected. When camera is facing mesh from the front moving mouse up/down on X axis rotates around the mesh as expected:
However if i look at mesh from the side then moving mouse up/down on X axis rotates around mesh as if rotation was in mesh local space:
This is how i attempt rotation:
camera_->GetNode()->RotateAround(Vector3::ZERO, Quaternion(
input->GetMouseMoveY() * 0.1f * lookSensitivity_,
input->GetMouseMoveX() * 0.1f * lookSensitivity_, 0
), TS_WORLD);
Any idea how i could make it rotate so that moving mouse on X axis would make camera go up/down same way like it works when looking at model from the front?