FromToRotationSafe(float3, float3)
Returns a quaternion that rotates the direction from onto the direction to. The two input vectors are not assumed to be unit length. If the magnitude of either of the vectors is so extreme that the calculation cannot be carried out reliably, the identity will be returned instead. If the vectors are within about 1.4e-3 radians of pointing in opposite directions, the result is a half turn around an axis perpendicular to from.
Read time 1 minuteLast updated 6 days ago
Definition
- Type: Method
- Namespace: Unity.Mathematics
- Assembly: UnityEngine.MathematicsModule
public static quaternion FromToRotationSafe(float3 from, float3 to)
Parameters
Returns
Type | Description |
|---|---|
| quaternion | The unit quaternion that rotates from onto to, or the identity quaternion. |