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:

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…

  1. 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.