So, I’m doing a third-person view in space and to avoid gimbal-lock when SpringArm rotates, I use quaternions. My code looks pretty unambiguous:
void APRBaseChar::CameraUp(float Value)
{
if ((Controller != nullptr) && (Value != 0.0f))
{
FRotator NewRotation {(Value * ControllerSensetivity), (0.0f), (0.0f)};
SpringArm->AddLocalRotation(FQuat(NewRotation));
}
}
void APRBaseChar::CameraRight(float Value)
{
if ((Controller != nullptr) && (Value != 0.0f))
{
FRotator NewRotation {(0.0f), (Value * ControllerSensetivity), (0.0f)};
SpringArm->AddLocalRotation(FQuat(NewRotation));
}
}
I don’t want to add any roll rotation to a spring arm, but…
So: Is there any workaround or another way to do what I want? I mean: rotate camera around pawn without gimbal lock AND without this weird roll rotation?