Hi, I am currently changing my FRotator based flight simulator to a Quat based system due to many problems I encountered .
I don’t have much experience in working with quats and I am getting the same errors with quats with the ones I encountered with FRotators.
I want to change the Yaw and Pitch of an actor at the same time without changing the Pitch. In FRotators, when a Yaw and Roll value is added to an actor, a value of pitch is also added to it automatically. I don’t want that to happen.
But the same thing is also happening with quats.
Here is my code
FRotator NewRot = FRotator(Rotation2D.X, Rotation2D.Y, Rotation2D.Y*0.5); FQuat NewQuat(NewRot); FRotator CurrentRot = GetActorRotation(); FQuat CurrentQuat(CurrentRot); CurrentQuat = CurrentQuat * NewQuat; //CurrentQuat.Normalize(); SetActorRotation(CurrentQuat.Rotator());
Also I want to know if this is the best method to do Quat based calculations?