Download

Quaternion math in BPs

I think it would be great if we could get some more Quaternion math in blueprints such as Quat*Quat, it is a pain to manually multiply them.

Absolutely! This is really overdue. The Euler angles right now with all the sign flips and so on are very painful. Unity merges Euler/Quats. It makes a huge difference.
At least for me right now, when I know I have some work to do with UE4/Blueprints and rotations, I really feel demotivated before even beginning.
In Unity you can rotate something by 0…360degrees and more just using actually 0…360 as numbers. In UE4 such a simple thing is already a pain.

YES! 3D engine without quats is like coffee without caffeine.

Eulers are a PITA for rotation calculation.

I don’t know who is against this at Epic and why (there have been multiple requests already, on answerhub and the forum).

Look at this thread: Quaternion in blueprint - Feedback for Unreal Engine team - Unreal Engine Forums, according to this, they took out/didn’t add at quaternions to reduce complexity.

yes, but this is a f-ine 3d game engine - the rocket science of software development.
nobody is forced to use quats. Eulers and rotators will still be there for “reduced complexity”. nobody said we want Eulers removed. just that we want quats added!

Unfortunately, the “reduced complexity” of not having quaternions available has made a flying character with 6DOF “Super Complicated”. We really need an answer to this. Even the flying template suffers from gimbal lock. So… yeah, this makes a couple of my prototypes pretty much useless. Please listen to us on this.

You can still do 6 DOF pawns by rotating around axes instead of applying rotation directly - which is frankly easier and not prone to gimbal lock.

Nevertheless, I too would like to see FQuats in Blueprint.

you said: “rotating around axes instead of applying rotation directly”. I guess I’m not understanding what the difference is. Is there somewhere that details this workaround? It would really help me out. it’s the one thing keeping a couple of my prototypes from feeling awesome.

I’ve seen several threads referencing “6DOF_UnrealScript_Tutorial_ini.pdf” for a better understanding of the solutions, but the links all seem to point to the home page for sol-contingency and i can’t seem to find any working links for it.

Made a quick demo project for you, link and pics below :slight_smile:

No Gimbal lock with this method, I wouldn’t usually do it so crudely but I only wanted to demonstrate how easy it is. Forward, Right and Up vectors of any actor are always guaranteed to be orthogonality correct (since they are vectors rotated by the actor quat under the hood).

What I would usually do is create one Rotator from all three axes at once, and use the tick event to drive it. (Swap the Axes & Rotation node for a Multiply Node, and use 'Make Rotator From Axes) - but for whatever reason my brain wasn’t working this morning.

Project Link (431Kb)

9d06b05976ac191612bae58f0791e7424eed1c0a.jpeg

Thanks for taking the time to reply with this setup. Much appreciated! I’ll give it a go and see if I can’t pull off some loop-de-loops. Hopefully I can figure out the “create one Rotator from all three axes at once” method while drinking this darned decaf…

Edit: It seems that the example link requires permission to view.

Ah sorry! Will change that just now!

EDIT: Try now, changed the folder settings :slight_smile:

Works, downloading now, Thanks again!