Sharing some quaternion functions in APEX

   796   2   1
User Avatar
Member
213 posts
Joined: June 2023
Offline
I'm not sure if it's simply I don't know their names, or APEX is lacking some important quaternion functions.

Anyway, I've made some for myself. I'm sure SideFX will add them later, but if you need them right now feel free to take mine.

Length<Vector4>: return the norm of a quaternion.
Normalize<Vector4>: normalize a quaternion.
QAngleAxis: convert angle/axis to a quaternion.
QToAngleAxis: convert a quaternion to angel/axis.
QMultiply: multiply two quaternions
QInvert: invert a quaternion
QRotate: rotate a vector3 by a quaternion
SwingTwistDecomp: decompose a quaternion into two perpendicular quaternions
SwingTwistDecomp2: same as above but different signature

Edit: Since SideFX'll probably add these features soon, it's probably better to wait for their implementation. File removed.
Edited by kodra - Feb. 1, 2024 19:44:35
User Avatar
Member
25 posts
Joined: Jan. 2017
Offline
That's awesome thanks kodra! Have you added RFEs for these too? I added an RFE for a few utility bits in APEX and SideFX were pretty quick to add them (maybe mine were simpler to implement than these though).
https://www.noad.co [www.noad.co]
User Avatar
Staff
64 posts
Joined: May 2021
Offline
Ah cool. I will have a look and I will see that we add them to our callback todo list
  • Quick Links