Core/Math API – Rotation using FQuat
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.
Getting ready
Have a project ready and an Actor
with an override ::Tick()
function that we can enter the C++ code into.
How to do it…
- To construct a quaternion, the best constructor to use is as follows: ...
Get Unreal Engine 4 Scripting with C++ Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.