Are quaternions supposed to be normalized?
Are quaternions supposed to be normalized?
I tried finding an answer to this in the doc. I am working on writing an importer for anim8or files. I am bringing objects in as CSkinnedMesh objects and wanted to know if the rotation keys in irrlicht are expected to be normalized.
Re: Are quaternions supposed to be normalized?
Depends - most functions by now seem to normalize(). Aside from getMatrixFast which doesn't do that (by design). Sadly never got defined if it's functions expect it to be normalized and if/or the results should be normalized. Someone seems to have added normalize calls to functions in 2017 and I added lerpN and some point to have a lerp which returns a normalized quaternion. And when doing that I wrote most functions would expect that - except now I look at it most functions seem to already normalize themself and my commit didn't mention which function would go wrong :-(
So.. .uhm, guess I have to go over the list once more at some point and find out if there are any more which expect normalized input.
For importer - just be safe and normalize. Won't be the biggest cost for an importer I guess.
So.. .uhm, guess I have to go over the list once more at some point and find out if there are any more which expect normalized input.
For importer - just be safe and normalize. Won't be the biggest cost for an importer I guess.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: Are quaternions supposed to be normalized?
Thanks for the quick reply. I will normalize when building my custom mesh.