Class QuaternionExt
Supplementary functions for Quaternion.
Namespace: UnityEngine.Animations.Rigging
Syntax
public static class QuaternionExt
Fields
zero
Zero quaternion. All quaternion channels are set to zero.
Declaration
public static readonly Quaternion zero
Field Value
Type | Description |
---|---|
Quaternion |
Methods
Add(Quaternion, Quaternion)
Adds two quaternion.
Declaration
public static Quaternion Add(Quaternion rhs, Quaternion lhs)
Parameters
Type | Name | Description |
---|---|---|
Quaternion | rhs | Quaternion value. |
Quaternion | lhs | Quaternion value. |
Returns
Type | Description |
---|---|
Quaternion | Added Quaternion. |
FromToRotation(Vector3, Vector3)
Calculates a Quaternion rotation of one vector to another.
Declaration
public static Quaternion FromToRotation(Vector3 from, Vector3 to)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | from | Starting vector. |
Vector3 | to | Destination vector. |
Returns
Type | Description |
---|---|
Quaternion | Quaternion rotation. |
NormalizeSafe(Quaternion)
Normalizes a Quaternion. Returns identity if normalized Quaternion is not finite.
Declaration
public static Quaternion NormalizeSafe(Quaternion q)
Parameters
Type | Name | Description |
---|---|---|
Quaternion | q | Quaternion value. |
Returns
Type | Description |
---|---|
Quaternion | Normalized Quaternion. |
Scale(Quaternion, Single)
Multiplies all Quaternion channels by a scale value.
Declaration
public static Quaternion Scale(Quaternion q, float scale)
Parameters
Type | Name | Description |
---|---|---|
Quaternion | q | Quaternion value. |
Single | scale | Scale value. |
Returns
Type | Description |
---|---|
Quaternion | Scaled Quaternion. |