Class Mathematics
Mathematics helper methods
Inherited Members
Namespace: Unity.Cloud.Gltfast
Assembly: Unity.Cloud.Gltfast.dll
Syntax
[MovedFrom(true, "GLTFast", "glTFast", null)]
public static class Mathematics
Methods
Decompose(double4x4, out double3, out double4, out double3)
Decomposes a 4x4 TRS matrix into separate transforms (translation * rotation * scale) Matrix may not contain skew
Declaration
public static void Decompose(this double4x4 m, out double3 translation, out double4 rotation, out double3 scale)
Parameters
| Type | Name | Description |
|---|---|---|
| double4x4 | m | Input matrix |
| double3 | translation | Translation |
| double4 | rotation | Rotation |
| double3 | scale | Scale |
Normalize(float2, out float2)
Normalizes a vector
Declaration
public static float Normalize(float2 input, out float2 output)
Parameters
| Type | Name | Description |
|---|---|---|
| float2 | input | Input vector |
| float2 | output | Normalized output vector |
Returns
| Type | Description |
|---|---|
| float | Length/magnitude of input vector |
RotateY(double)
Returns double4 quaternion values that rotates around the y-axis by a given number of radians.
Declaration
public static double4 RotateY(double angle)
Parameters
| Type | Name | Description |
|---|---|---|
| double | angle | The clockwise rotation angle when looking along the y-axis towards the origin in radians. |
Returns
| Type | Description |
|---|---|
| double4 | Quaternion values representing a rotation around the y-axis. |