Class Vector3Extensions
Extension methods for the Vector3 type
Namespace: Unity.XRTools.Utils
Syntax
public static class Vector3Extensions
Methods
Abs(Vector3)
Returns a vector where each component is the absolute value of the original (abs(x))
Declaration
public static Vector3 Abs(this Vector3 vector)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | vector | The vector whose absolute value will be returned |
Returns
Type | Description |
---|---|
Vector3 | The absolute value vector |
Inverse(Vector3)
Returns a vector where each component is inverted (1/x)
Declaration
public static Vector3 Inverse(this Vector3 vector)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | vector | The vector which will be inverted |
Returns
Type | Description |
---|---|
Vector3 | The inverted vector |
MaxComponent(Vector3)
Returns the maximum of all vector components
Declaration
public static float MaxComponent(this Vector3 vector)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | vector | The vector whose maximum component will be returned |
Returns
Type | Description |
---|---|
Single | The maximum value |
MinComponent(Vector3)
Returns the minimum of all vector components
Declaration
public static float MinComponent(this Vector3 vector)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | vector | The vector whose minimum component will be returned |
Returns
Type | Description |
---|---|
Single | The minimum value |