Quaternions sound intimidating, but they are extremely easy to use. You may want to review the theoretical math behind them using the following videos:
Fantastic Quaternions by Numberphile – https://www.youtube.com/watch?v=3BR8tK-LuB0
Understanding Quaternions by Jim Van Verth – http://gdcvault.com/play/1017653/Math-for-Game-Programmers-Understanding
However, we won't cover the math background here! In fact, you don't need to understand much about the math background quaternions to use them extremely effectively.
Have a project ready and an Actor
with an override ::Tick()
function that we can enter the C++ code into.
To construct a quaternion, the best constructor to use is as follows:
FQuat( FVector Axis, float AngleRad );