Class VectorExtensions
- Namespace
- SimulationFramework
- Assembly
- SimulationFramework.dll
Provides small utility extensions onto the System.Numerics Vector types.
public static class VectorExtensions
- Inheritance
-
VectorExtensions
- Inherited Members
Methods
Deconstruct(Vector2, out float, out float)
Deconstructs this vector into its components.
public static void Deconstruct(this Vector2 vector, out float x, out float y)
Parameters
vector
Vector2The vector to deconstruct.
x
floatThe value of the vector's x component.
y
floatThe value of the vector's y component.
Deconstruct(Vector3, out float, out float, out float)
Deconstructs this vector into its components.
public static void Deconstruct(this Vector3 vector, out float x, out float y, out float z)
Parameters
vector
Vector3The vector to deconstruct.
x
floatThe value of the vector's x component.
y
floatThe value of the vector's y component.
z
floatThe value of the vector's y component.
Deconstruct(Vector4, out float, out float, out float, out float)
Deconstructs this vector into its components.
public static void Deconstruct(this Vector4 vector, out float x, out float y, out float z, out float w)
Parameters
vector
Vector4The vector to deconstruct.
x
floatThe value of the vector's x component.
y
floatThe value of the vector's y component.
z
floatThe value of the vector's z component.
w
floatThe value of the vector's w component.
Normalized(Vector2)
Returns this vector with a length of 1.
When provided a zero-length vector, this method returns a zero-length vector,
unlike Normalize(Vector2), which returns (NaN, NaN)
.
public static Vector2 Normalized(this Vector2 vector)
Parameters
vector
Vector2
Returns
Normalized(Vector3)
Returns this vector with a length of 1.
When provided a zero-length vector, this method returns a zero-length vector,
unlike Normalize(Vector3), which returns (NaN, NaN, NaN)
.
public static Vector3 Normalized(this Vector3 vector)
Parameters
vector
Vector3
Returns
Normalized(Vector4)
Returns this vector with a length of 1.
When provided a zero-length vector, this method returns a zero-length vector,
unlike Normalize(Vector4), which returns (NaN, NaN, NaN, NaN)
.
public static Vector4 Normalized(this Vector4 vector)
Parameters
vector
Vector4