Unity.Mathematics alternative for Quaternion.FromToRotation()

Does someone know a math. alternative for Quaternion.FromToRotation?
I have this code:
Quaternion.FromToRotation(Vector3.up, (v0 - v1).normalized)
which uses both the Quaternion.FromToRotation and Vector3.normalized.
I can replace Vector3.normalized with math.normalize((v0 - v1)) and replace Vector3.up with new float3(0f,1f,0f) but the math.quaternion does not contain an alternative for Quaternion.FromToRotation.
I don’t know the math behind this function but it was the only method I found that could rotate the object correctly.

Kind regards,

It’s been two months. Any solutions?

This might be helpful: Whats the source code of Quaternion.FromToRotation? - Questions & Answers - Unity Discussions

2 Likes

Thanks! Why didn’t it show up in my google results…

1 Like