It appears to me that there was a small typo in the definition in of this function. It reads:
/// Returns quaternion based on the rotation from one vector to another.
pub fn from_vec3_pair(from: Vector3, to: Vector3) -> Quaternion {
let cross = from.cross(to);
Quaternion {
x: cross.x,
y: cross.y,
z: cross.y,
w: 1.0 + from.dot(to),
}
.normalized()
}
Notice that the z component uses cross.y instead of cross.z.
It appears to me that there was a small typo in the definition in of this function. It reads:
Notice that the z component uses
cross.y
instead ofcross.z
.