Class VectorExtensionMethods
- Namespace
- CodeBase
- Assembly
- 4Experience.CodeBase.Core.Runtime.dll
public static class VectorExtensionMethods
- Inheritance
-
VectorExtensionMethods
Methods
AddX(Vector3, float)
public static Vector3 AddX(this Vector3 target, float value)
Parameters
targetVector3valuefloat
Returns
- Vector3
AddY(Vector3, float)
public static Vector3 AddY(this Vector3 target, float value)
Parameters
targetVector3valuefloat
Returns
- Vector3
AddZ(Vector3, float)
public static Vector3 AddZ(this Vector3 target, float value)
Parameters
targetVector3valuefloat
Returns
- Vector3
IsNearZero(Vector2)
Check if target Vector2 is near zero point. Based on Vector2.sqrMagnitude which is faster then simple Vector2.magnitude. The comparison is made to the smallest possible value for the float type (const float.Epsilon).
public static bool IsNearZero(this Vector2 vector)
Parameters
vectorVector2
Returns
IsNearZero(Vector3)
Check if target Vector3 is near zero point. Based on Vector3.sqrMagnitude which is faster then simple Vector3.magnitude. The comparison is made to the smallest possible value for the float type (const float.Epsilon).
public static bool IsNearZero(this Vector3 vector)
Parameters
vectorVector3
Returns
IsNotZero(Vector2)
Check if target Vector2 is not at zero point. Based on Vector2.sqrMagnitude which is faster then simple Vector2.magnitude. The comparison is made to the smallest possible value for the float type (const float.Epsilon).
public static bool IsNotZero(this Vector2 vector)
Parameters
vectorVector2
Returns
IsNotZero(Vector3)
Check if target Vector3 is not at zero point. Based on Vector3.sqrMagnitude which is faster then simple Vector3.magnitude. The comparison is made to the smallest possible value for the float type (const float.Epsilon).
public static bool IsNotZero(this Vector3 vector)
Parameters
vectorVector3
Returns
Set(Vector2, float, float)
Set x, y values of target Vector2 at once.
public static Vector2 Set(this Vector2 target, float valueX, float valueY)
Parameters
Returns
- Vector2
Set(Vector3, float, float, float)
Set x, y, z values of target Vector3 at once.
public static Vector3 Set(this Vector3 target, float valueX, float valueY, float valueZ)
Parameters
Returns
- Vector3
SetX(Vector2, float)
public static Vector2 SetX(this Vector2 target, float value)
Parameters
targetVector2valuefloat
Returns
- Vector2
SetX(Vector3, float)
public static Vector3 SetX(this Vector3 target, float value)
Parameters
targetVector3valuefloat
Returns
- Vector3
SetY(Vector2, float)
public static Vector2 SetY(this Vector2 target, float value)
Parameters
targetVector2valuefloat
Returns
- Vector2
SetY(Vector3, float)
public static Vector3 SetY(this Vector3 target, float value)
Parameters
targetVector3valuefloat
Returns
- Vector3
SetZ(Vector3, float)
public static Vector3 SetZ(this Vector3 target, float value)
Parameters
targetVector3valuefloat
Returns
- Vector3
ToVector2XY(Vector3)
Convert Vector3 to Vector2. Uses x value of Vector3 as x value of Vector2 and y value of Vector3 as y value of Vector2.
public static Vector2 ToVector2XY(this Vector3 vectorToConvert)
Parameters
vectorToConvertVector3
Returns
- Vector2
ToVector2XZ(Vector3)
Convert Vector3 to Vector2. Uses x value of Vector3 as x value of Vector2 and z value of Vector3 as y value of Vector2.
public static Vector2 ToVector2XZ(this Vector3 vectorToConvert)
Parameters
vectorToConvertVector3
Returns
- Vector2
ToVector2YZ(Vector3)
Convert Vector3 to Vector2. Uses y value of Vector3 as x value of Vector2 and z value of Vector3 as y value of Vector2.
public static Vector2 ToVector2YZ(this Vector3 vectorToConvert)
Parameters
vectorToConvertVector3
Returns
- Vector2