[Serializable] public struct
Vector representation of coordinates and points with three-dimensions.
public const float
kEpsilon
Vector floating-point precision.
public readonly MVector
YZ
A new MVector ignoring the X component.
public readonly MVector
XZ
A new MVector ignoring the Y component.
public readonly MVector
XY
A new MVector ignoring the Z component.
Summary:
Construct all components to U.
Params:
U:
Uniform component.
Summary:
Construct with X and Y components only.
Params:
X:
X Component.
Y:
Y Component.
Summary:
Construct an MVector with X, Y, and Z components.
Params:
X:
X Component.
Y:
Y Component.
Z:
Z Component.
Summary:
Construct an MVector with respect to a Vector3.
Params:
xyz:
The Vector3's Components to set this MVector.
Summary:
Construct an MVector with respect to a
Params:
xy:
The Vector2's Components to set this MVector.
public static readonly MVector
Zero
Short for writing MVector(0).
public static readonly MVector
Right
Short for writing MVector(1, 0, 0).
public static readonly MVector
Up
Short for writing MVector(0, 1, 0).
public static readonly MVector
Forward
Short for writing MVector(0, 0, 1).
public static readonly MVector
One
Short for writing MVector(1).
public static readonly MVector
_2D
1 on XY components. 2D MVector Flag.
public static readonly MVector
_3D
1 on XZ components. 3D MVector Flag.
public static readonly MVector
NaN
NaN on all components.
public static Vector3
Summary:
Converts an MVector to a Vector3.
Params:
M:
The MVector to convert.
public static MVector
Summary:
Converts a Vector3 to an MVector.
Params:
V:
The Vector3 to convert.
public static MVector
Summary:
Normalises V.
public static MVector
Summary:
The vector cross ^ product of Left and Right.
public static float
Summary:
The vector dot | product of Left and Right.
Remarks:
Does not assume Left and Right are normalised.
public static bool
Summary:
Whether left and right are Mathematics.Parallel(MVector, MVector, float) to each other.
[Obsolete] public static MVector
Summary:
A normalised MVector at Degrees, relative to Forward.
Params:
Degrees:
The angle offset.
Forward:
The forward direction.
public static float
Summary:
The angle between two vectors in degrees.
Returns:
An approximation of the angle between L and R in degrees, accurate to +-.1 degrees.
public static float
Summary:
The distance between Left and Right.
Params:
Left:
Source of the distance.
Right:
Distance from source.
public static float
Summary:
Square Euclidean distance between Left and Right.
public static MVector
Summary:
Clamps Vector to a maximum Magnitude.
Params:
Vector:
The Vector to clamp.
Magnitude:
The maximum magnitude.
Returns:
The clamped Vector.
public static MVector
Summary:
Scale Normal to reach the point defined by Vector in 2D space.
Params:
Vector:
The point to scale Normal by.
Normal:
The direction to scale towards Vector in 2D space.
Returns:
Vector projected onto Normal.
public static bool
Summary:
Checks V's components for NaN.
Params:
V:
The vector to check.
Returns:
True if V contains NaN.
public static bool
Summary:
Checks V's components for +- Infinity.
Params:
V:
The vector to check.
Returns:
True if V contains +- Infinity.
public static bool
Summary:
Check V's components for NaN of +-Infinity.
Params:
V:
The vector to check.
Returns:
True if V contains any illegal components.
public float
SqrMagnitude
The square magnitude of this MVector.
public float
Magnitude
The magnitude of this MVector.
public MVector
Abs
The FMath.Abs(float) of this MVector's components.
public MVector
Normalised
The normalised version of this MVector.
public MVector
Summary:
Normalises this MVector.
public void
Summary:
Sets this MVector's components.
public void
Summary:
Sets the magnitude of this MVector.
Params:
InMagnitude:
The magnitude to set.
public bool
Summary:
Whether this MVector is a unit vector. (If this MVector is Mathematics.IsNormalised(MVector).
Returns:
True if this MVector has a magnitude of one.
public MVector
Summary:
This MVector's reflection among Normal.
Params:
Normal:
The normal vector to mirror.
public MVector
Summary:
Rotates this MVector at an angle of AngleDegrees around Axis.
Remarks:
While looking in the direction of Axis:
+ Angle is CW. - Angle is CCW.
Params:
AngleDegrees:
The degrees at which to rotate this MVector.
Axis:
The axis to rotate this MVector around.
public MRotator
Summary:
Converts a normalised vector to a Pitch, Yaw rotation.
Remarks:
Roll is zero.
Returns:
An MRotator defining the pitch and yaw of this direction vector.
public void
Summary:
The direction and length of this MVector.
public MVector
Summary:
This MVector's projection.
public static MVector
Summary:
Scale Normal to reach the point defined by this vector in 2D space.
Params:
Normal:
The direction to scale towards this vector in 2D space.
Returns:
This vector projected onto Normal.
public MVector
Summary:
Ignores the X component of this MVector.
Remarks:
Modifies this MVector.
Returns:
This MVector with a zeroed X component.
public MVector
Summary:
Ignores the Y component of this MVector.
Remarks:
Modifies this MVector.
Returns:
This MVector with a zeroed Y component.
public MVector
Summary:
Ignores the Z component of this MVector.
Remarks:
Modifies this MVector.
Returns:
This MVector with a zeroed Z component.
public MVector
Summary:
Ignores a set of Components on this MVector.
Params:
Components:
The vector components to ignore.
Returns:
This MVector zeroed over Components.
public float
Summary:
Euclidean distance between this MVector and another V.
Params:
V:
The MVector to find distance.
Returns:
The Euclidean distance between this MVector and V.
public float
Summary:
The Euclidean distance, but without the square root calculation.
Params:
V:
The MVector to find square distance.
Returns:
The square distance between this MVector and V.
public void
Summary:
Clamps this Vector's magnitude to ClampedMagnitude.
Params:
ClampedMagnitude:
The maximum magnitude of this Vector.
public static float operator~
Summary:
Get the SqrMagnitude of M.
Params:
M:
The MVector.
Returns:
The SquMagnitude of M.
public static MVector operator+
Summary:
Adds two MVectors together.
Params:
Left:
Left-side MVector.
Right:
Right-side MVector.
Returns:
(MVector Left, MVector Right) => new MVector(Left.X + Right.X, Left.Y + Right.Y, Left.Z + Right.Z)
public static MVector operator+
Summary:
Adds a Vector3 to an MVector.
Params:
Left:
The MVector.
Right:
The Vector3.
Returns:
(MVector Left, Vector3 Right) => Left + (MVector)Right
public static MVector operator+
Summary:
Adds an MVector to a Vector3.
Params:
Left:
The Vector3.
Right:
The MVector.
Returns:
(Vector3 Left, MVector Right) => (MVector)Left + Right
public static MVector operator-
Summary:
Subtracts two MVectors.
Params:
Left:
Left-side MVector.
Right:
Right-side MVector.
Returns:
(MVector Left, MVector Right) => new MVector(Left.X - Right.X, Left.Y - Right.Y, Left.Z - Right.Z)
public static MVector operator-
Summary:
Negates an MVector.
Params:
V:
The MVector to negate all components.
Returns:
(MVector V) => V *= -1f
public static MVector operator*
Summary:
Multiplies an MVector by a scalar on all components.
Params:
S:
The Scalar to multiply.
V:
The MVector.
Returns:
(MVector V, float S) => new MVector(V.X * S, V.Y * S, V.Z * S)
public static MVector operator/
Summary:
Divides an MVector by a scalar on all components.
Remarks:
If d == 0, this will throw a DivideByZeroException.
Params:
V:
The MVector.
D:
The denominator under all components.
Returns:
(MVector V, float D) => float S = 1 / D; return S * V
public static MVector operator^
Summary:
The vector cross ^ product.
Returns:
(MVector Left, MVector Right) => new MVector(Left.Y * Right.Z - Left.Z * Right.Y, Left.Z * Right.X - Left.X * Right.Z, Left.X * Right.Y - Left.Y * Right.X)
public static float operator|
Summary:
The vector dot | product.
Remarks:
Does not assume Left and Right are normalised.
Returns:
(MVector Left, MVector Right) => Left.X * Right.X + Left.Y * Right.Y + Left.Z * Right.Z
public static MVector operator>
Summary:
Normalised direction from to.
Returns:
(MVector From, MVector To) => (To - From).Normalised
public static MVector operator<
Summary:
Normalised direction from to.
Returns:
(MVector To, MVector From) => From > To
public static MVector operator>>
Summary:
Shifts all components to the right.
Params:
V:
The MVector to shift.
I:
The number of times to shift right.
Returns:
X = Y, Y = Z, Z = X.
public static MVector operator<<
Summary:
Shifts all components to the left.
Params:
V:
The MVector to shift.
I:
The number of times to shift left.
Returns:
X = Z, Y = X, Z = Y.
public static bool operator==
Summary:
Compares two MVectors for equality.
Params:
Left:
Left-side comparison.
Right:
Right-side comparison.
Returns:
True if the square distance between Left and Right is less than kEpsilon ^ 2.
public static bool operator!=
Summary:
Compares two MVectors for inequality.
Params:
Left:
Left-side comparison.
Right:
Right-side comparison.
Returns:
The opposite of operator ==.
public static bool operator true
Summary:
if the MVector is non-zero.
Params:
M:
The Vector to check.
Returns:
M != MVector(NaN) && M != MVector.Zero && M.SqrMagnitude > MVector.kEpsilon && !ComponentsCheckNaN(M).
public static bool operator false
Summary:
if the MVector is zero or considered zero.
Params:
M:
The Vector to check.
Returns:
M == MVector(NaN) || M == MVector.Zero || M.SqrMagnitude < MVector.kEpsilon || ComponentsCheckNaNInf(M).
public static implicit operator Vector3
Summary:
Automatic conversion from an MVector to a Vector3.
public static implicit operator Vector2
Summary:
Automatic conversion from an MVector to a Vector2.
Remarks:
Only the X and Y components are considered. The Z component is ignored.
public static implicit operator MVector
Summary:
Automatic conversion from a Vector3 to an MVector.
public static implicit operator MVector
Summary:
Automatic conversion from a Vector2 to an MVector.
Remarks:
The resulting MVector will have a Z equal to zero.
public static implicit operator Color
Summary:
The Colour representation of this MVector, in 0-255 XYZ/RGB.
public static implicit operator MVector
Summary:
The MVector representation of a Colour ranged from 0 - 255 RGB/XYZ.
public override int
Summary:
Hash code for use in Maps, Sets, MArrays, etc.
Returns:
GetHashCode() => X.GetHashCode() ^ (Y.GetHashCode() << 2) ^ (Z.GetHashCode() >> 2)
public override string
Summary:
A human-readable MVector.
Returns:
ToString() => "X: " + X + " Y: " + Y + " Z: " + Z
public string
Summary:
A human-readable MVector with formatting.
Params:
Format:
The format to present float values.
Returns:
A string with X, Y, and Z formatted according to Format.
public string
Summary:
A human-readable MVector with formatting and a format provider.
Params:
Format:
The format to present the float values.
Provider:
The format provider to present the float values.
Returns:
A string with X, Y, and Z formatting according to Format and Provider.