A function to interpolate rotations would be amazing, unfortunately there is not too much stuff about it in the internet and looking in https://en.wikipedia.org/wiki/Slerp i don't get nothing in mind.
========================
In the blend file trackto.zip, i try to lock the Suzanne coordinates in a circular way around the cone to make it don't turn back immediately, but even using a curve, it does not work (except for the mesh).
This probably also have problems because the nearest angle to interpolate. I said about this because we would take advantage of Mix Vector and Look At to interpolate the rotations if there is some way to put the "linear" coordinates in a circular field (just putting the result of Mix Vector in another coordinate around the 0, 0, 0 coords based in the distance between the point A and B.
This is not what you are looking for?
https://github.com/Kode/Kha/blob/e443f154bd980a191b84d70396cc76c15650b70c/Sources/kha/math/Quaternion.hx#L29
Using the Mix Vector to interpolate rotations does not consider things like nearest angle and can't be "locked" in one axis (even if the two rotations are in the same axis, the rotation between the two given rotations will turn around all axis).
I have no idea about what this function does. In iron/math/Quat.hx there is a lerp function that requires from: Quat, to: Quat, s: FastFloat. I wonder what this Kha function can do what with one single quat? I will test it sometime to find out, thanks!
I wonder what this Kha function can do what with one single quat?
Why alone?
The dot() (line 32) and scaled() functions (line 45 and line 48) are executed by an instance of the class and use the data of that instance (i.e. one of the quaternions specified by the current quaterion).
In Iron, the lerp() function is executed only on the passed data, it does not use the current quaternion.
Most helpful comment
Why alone?
The
dot()(line 32) andscaled()functions (line 45 and line 48) are executed by an instance of the class and use the data of that instance (i.e. one of the quaternions specified by the current quaterion).In Iron, the
lerp()function is executed only on the passed data, it does not use the current quaternion.