Quaternion Up Vector Intersect Issue

Dear Community,

I run into an issue since months : Rotation snap + jitter on the Pitch axis at 90 and -90 degrees with rotation matrix or quaternions!

The situation : I rotate a Pawn around a Sphere. The location of the Pawn and the Sphere are the same. My keyboard keys are used to move (Up/Down and Left/Right). The Pawn is composed of these hierarchical elements : Collision Box (root) > Scene > Spring Arm (with Lag) > Camera.

Here is a video of the problem : https://drive.google.com/file/d/1GIroYocDp3GmvCfBf7hJfMmhYlU_DHm4/view?usp=sharing

The last and best code currently (in Pawn) :

FQuat Old = this->GetActorRotation().Quaternion();

FQuat Delta;
(iMoveX) ? Delta = FQuat::MakeFromEuler(FVector(0.0f, Calculation, 0.0f)) : Delta = FQuat::MakeFromEuler(FVector(0.0f, 0.0f, Calculation));

FQuat New = Old * Delta;

this->SetActorRotation(New);

I tried a lot of different methods with matrix and quaternions, in local or world space, with or without FRotators… But I always encounter this issue only on the pitch axis.

Thank you for help!

Dear Community,

I created a blank project to try if the problem exists out of box, and it is.

You can dowload this project out there : QuatTest_426.zip - Google Drive

Hit Play then F1 to see the sphere wireframe. Use Z to move up (S for down) and try to align with 90 degrees (open Output Log to see the pitch value). You can notice that the pawn stops and locks on the 90 degree. Warning : It’s very subtle, and if you go too fast it won’t stop. I use a lot of rotations in my space game and I often reach 90 degrees’ pitch, so it’s really painful :confused:

This problem occurs with FRotator, FRotationMatrix and Quaternions. In local and world spaces. And with AddLocationRotation or SetActorRotation functions (MoveComponent related).

I upvoted the case UE-58446 which seems to be the same.

I hope someone can confirm or even take a look in the engine.

Thanks!