diff --git a/Source/Engine/Core/Math/Mathf.cs b/Source/Engine/Core/Math/Mathf.cs
index 52424fa33..fb4020b2e 100644
--- a/Source/Engine/Core/Math/Mathf.cs
+++ b/Source/Engine/Core/Math/Mathf.cs
@@ -983,9 +983,7 @@ namespace FlaxEngine
/// The value.
/// The minimum.
/// The maximum.
- ///
- /// true if the specified value is in a given range; otherwise, false.
- ///
+ /// true if the specified value is in a given range; otherwise, false.
public static bool IsInRange(float value, float min, float max)
{
return value >= min && value <= max;
@@ -997,9 +995,7 @@ namespace FlaxEngine
/// The value.
/// The minimum.
/// The maximum.
- ///
- /// true if the specified value is NOT in a given range; otherwise, false.
- ///
+ /// true if the specified value is NOT in a given range; otherwise, false.
public static bool IsNotInRange(float value, float min, float max)
{
return value < min || value > max;
@@ -1011,9 +1007,7 @@ namespace FlaxEngine
/// The value.
/// The minimum.
/// The maximum.
- ///
- /// true if the specified value is in a given range; otherwise, false.
- ///
+ /// true if the specified value is in a given range; otherwise, false.
public static bool IsInRange(int value, int min, int max)
{
return value >= min && value <= max;
@@ -1025,9 +1019,7 @@ namespace FlaxEngine
/// The value.
/// The minimum.
/// The maximum.
- ///
- /// true if the specified value is NOT in a given range; otherwise, false.
- ///
+ /// true if the specified value is NOT in a given range; otherwise, false.
public static bool IsNotInRange(int value, int min, int max)
{
return value < min || value > max;
diff --git a/Source/Engine/Core/Math/Vector2.cs b/Source/Engine/Core/Math/Vector2.cs
index c93c0c275..530a36f80 100644
--- a/Source/Engine/Core/Math/Vector2.cs
+++ b/Source/Engine/Core/Math/Vector2.cs
@@ -147,22 +147,15 @@ namespace FlaxEngine
///
/// Initializes a new instance of the struct.
///
- ///
- /// The values to assign to the X and Y components of the vector. This must be an array with two
- /// elements.
- ///
+ /// The values to assign to the X and Y components of the vector. This must be an array with two elements.
/// Thrown when is null.
- ///
- /// Thrown when contains more or less than two
- /// elements.
- ///
+ /// Thrown when contains more or less than two elements.
public Vector2(float[] values)
{
if (values == null)
throw new ArgumentNullException(nameof(values));
if (values.Length != 2)
throw new ArgumentOutOfRangeException(nameof(values), "There must be two and only two input values for Vector2.");
-
X = values[0];
Y = values[1];
}
@@ -213,10 +206,7 @@ namespace FlaxEngine
/// The value of the X or Y component, depending on the index.
/// The index of the component to access. Use 0 for the X component and 1 for the Y component.
/// The value of the component at the specified index.
- ///
- /// Thrown when the is out of the range [0,
- /// 1].
- ///
+ /// Thrown when the is out of the range [0,1].
public float this[int index]
{
get
@@ -226,7 +216,6 @@ namespace FlaxEngine
case 0: return X;
case 1: return Y;
}
-
throw new ArgumentOutOfRangeException(nameof(index), "Indices for Vector2 run from 0 to 1, inclusive.");
}
@@ -249,20 +238,14 @@ namespace FlaxEngine
/// Calculates the length of the vector.
///
/// The length of the vector.
- ///
- /// may be preferred when only the relative length is needed
- /// and speed is of the essence.
- ///
+ /// may be preferred when only the relative length is needed and speed is of the essence.
public float Length => (float)Math.Sqrt(X * X + Y * Y);
///
/// Calculates the squared length of the vector.
///
/// The squared length of the vector.
- ///
- /// This method may be preferred to when only a relative length is needed
- /// and speed is of the essence.
- ///
+ /// This method may be preferred to when only a relative length is needed and speed is of the essence.
public float LengthSquared => X * X + Y * Y;
///
@@ -282,7 +265,6 @@ namespace FlaxEngine
///
/// Creates an array containing the elements of the vector.
///
- /// A two-element array containing the components of the vector.
public float[] ToArray()
{
return new[]
@@ -517,14 +499,8 @@ namespace FlaxEngine
/// A containing the 2D Cartesian coordinates of vertex 1 of the triangle.
/// A containing the 2D Cartesian coordinates of vertex 2 of the triangle.
/// A containing the 2D Cartesian coordinates of vertex 3 of the triangle.
- ///
- /// Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in
- /// ).
- ///
- ///
- /// Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in
- /// ).
- ///
+ /// Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in ).
+ /// Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in ).
/// When the method completes, contains the 2D Cartesian coordinates of the specified point.
public static void Barycentric(ref Vector2 value1, ref Vector2 value2, ref Vector2 value3, float amount1, float amount2, out Vector2 result)
{
@@ -539,14 +515,8 @@ namespace FlaxEngine
/// A containing the 2D Cartesian coordinates of vertex 1 of the triangle.
/// A containing the 2D Cartesian coordinates of vertex 2 of the triangle.
/// A containing the 2D Cartesian coordinates of vertex 3 of the triangle.
- ///
- /// Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in
- /// ).
- ///
- ///
- /// Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in
- /// ).
- ///
+ /// Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in ).
+ /// Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in ).
/// A new containing the 2D Cartesian coordinates of the specified point.
public static Vector2 Barycentric(Vector2 value1, Vector2 value2, Vector2 value3, float amount1, float amount2)
{
@@ -588,7 +558,7 @@ namespace FlaxEngine
}
///
- /// Saturates this instance in the range [0,1]
+ /// Saturates this instance in the range [0,1].
///
public void Saturate()
{
@@ -614,16 +584,11 @@ namespace FlaxEngine
/// The first vector.
/// The second vector.
/// When the method completes, contains the distance between the two vectors.
- ///
- /// may be preferred when only the relative
- /// distance is needed
- /// and speed is of the essence.
- ///
+ /// may be preferred when only the relative distance is needed and speed is of the essence.
public static void Distance(ref Vector2 value1, ref Vector2 value2, out float result)
{
float x = value1.X - value2.X;
float y = value1.Y - value2.Y;
-
result = (float)Math.Sqrt(x * x + y * y);
}
@@ -633,15 +598,11 @@ namespace FlaxEngine
/// The first vector.
/// The second vector.
/// The distance between the two vectors.
- ///
- /// may be preferred when only the relative distance is needed
- /// and speed is of the essence.
- ///
+ /// may be preferred when only the relative distance is needed and speed is of the essence.
public static float Distance(Vector2 value1, Vector2 value2)
{
float x = value1.X - value2.X;
float y = value1.Y - value2.Y;
-
return (float)Math.Sqrt(x * x + y * y);
}
@@ -651,16 +612,11 @@ namespace FlaxEngine
/// The first vector.
/// The second vector.
/// The distance between the two vectors.
- ///
- /// may be preferred when only the relative
- /// distance is needed
- /// and speed is of the essence.
- ///
+ /// may be preferred when only the relative distance is needed and speed is of the essence.
public static float Distance(ref Vector2 value1, ref Vector2 value2)
{
float x = value1.X - value2.X;
float y = value1.Y - value2.Y;
-
return (float)Math.Sqrt(x * x + y * y);
}
@@ -682,7 +638,6 @@ namespace FlaxEngine
{
float x = value1.X - value2.X;
float y = value1.Y - value2.Y;
-
result = x * x + y * y;
}
@@ -704,7 +659,6 @@ namespace FlaxEngine
{
float x = value1.X - value2.X;
float y = value1.Y - value2.Y;
-
return x * x + y * y;
}
@@ -726,7 +680,6 @@ namespace FlaxEngine
{
float x = value1.X - value2.X;
float y = value1.Y - value2.Y;
-
return x * x + y * y;
}
@@ -751,8 +704,7 @@ namespace FlaxEngine
/// true if left and right are near another, false otherwise
public static bool NearEqual(ref Vector2 left, ref Vector2 right, float epsilon = Mathf.Epsilon)
{
- return Mathf.WithinEpsilon(left.X, right.X, epsilon) &&
- Mathf.WithinEpsilon(left.Y, right.Y, epsilon);
+ return Mathf.WithinEpsilon(left.X, right.X, epsilon) && Mathf.WithinEpsilon(left.Y, right.Y, epsilon);
}
///
@@ -929,10 +881,7 @@ namespace FlaxEngine
/// End vector.
/// Value between 0 and 1 indicating the weight of .
/// When the method completes, contains the linear interpolation of the two vectors.
- ///
- /// Passing a value of 0 will cause to be returned; a value of 1
- /// will cause to be returned.
- ///
+ /// Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned.
public static void Lerp(ref Vector2 start, ref Vector2 end, float amount, out Vector2 result)
{
result.X = Mathf.Lerp(start.X, end.X, amount);
@@ -946,10 +895,7 @@ namespace FlaxEngine
/// End vector.
/// Value between 0 and 1 indicating the weight of .
/// The linear interpolation of the two vectors.
- ///
- /// Passing a value of 0 will cause to be returned; a value of 1
- /// will cause to be returned.
- ///
+ /// Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned.
public static Vector2 Lerp(Vector2 start, Vector2 end, float amount)
{
Lerp(ref start, ref end, amount, out Vector2 result);
@@ -963,10 +909,7 @@ namespace FlaxEngine
/// End vector.
/// Value between 0 and 1 indicating the weight of .
/// When the method completes, contains the linear interpolation of the two vectors.
- ///
- /// Passing a value of 0 will cause to be returned; a value of 1
- /// will cause to be returned.
- ///
+ /// Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned.
public static void Lerp(ref Vector2 start, ref Vector2 end, ref Vector2 amount, out Vector2 result)
{
result.X = Mathf.Lerp(start.X, end.X, amount.X);
@@ -980,10 +923,7 @@ namespace FlaxEngine
/// End vector.
/// Value between 0 and 1 indicating the weight of .
/// The linear interpolation of the two vectors.
- ///
- /// Passing a value of 0 will cause to be returned; a value of 1
- /// will cause to be returned.
- ///
+ /// Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned.
public static Vector2 Lerp(Vector2 start, Vector2 end, Vector2 amount)
{
Lerp(ref start, ref end, ref amount, out Vector2 result);
@@ -1116,10 +1056,7 @@ namespace FlaxEngine
///
/// The first source vector.
/// The second source vector.
- ///
- /// When the method completes, contains an new vector composed of the largest components of the source
- /// vectors.
- ///
+ /// When the method completes, contains an new vector composed of the largest components of the source vectors.
public static void Max(ref Vector2 left, ref Vector2 right, out Vector2 result)
{
result.X = left.X > right.X ? left.X : right.X;
@@ -1143,10 +1080,7 @@ namespace FlaxEngine
///
/// The first source vector.
/// The second source vector.
- ///
- /// When the method completes, contains an new vector composed of the smallest components of the
- /// source vectors.
- ///
+ /// When the method completes, contains an new vector composed of the smallest components of the source vectors.
public static void Min(ref Vector2 left, ref Vector2 right, out Vector2 result)
{
result.X = left.X < right.X ? left.X : right.X;
@@ -1181,10 +1115,7 @@ namespace FlaxEngine
/// The source vector.
/// Normal of the surface.
/// When the method completes, contains the reflected vector.
- ///
- /// Reflect only gives the direction of a reflection off a surface, it does not determine
- /// whether the original vector was close enough to the surface to hit it.
- ///
+ /// Reflect only gives the direction of a reflection off a surface, it does not determine whether the original vector was close enough to the surface to hit it.
public static void Reflect(ref Vector2 vector, ref Vector2 normal, out Vector2 result)
{
float dot = vector.X * normal.X + vector.Y * normal.Y;
@@ -1199,10 +1130,7 @@ namespace FlaxEngine
/// The source vector.
/// Normal of the surface.
/// The reflected vector.
- ///
- /// Reflect only gives the direction of a reflection off a surface, it does not determine
- /// whether the original vector was close enough to the surface to hit it.
- ///
+ /// Reflect only gives the direction of a reflection off a surface, it does not determine whether the original vector was close enough to the surface to hit it.
public static Vector2 Reflect(Vector2 vector, Vector2 normal)
{
Reflect(ref vector, ref normal, out Vector2 result);
@@ -1227,14 +1155,8 @@ namespace FlaxEngine
/// least stable.
///
///
- ///
- /// Thrown when or is
- /// null.
- ///
- ///
- /// Thrown when is shorter in length than
- /// .
- ///
+ /// Thrown when or is null.
+ /// Thrown when is shorter in length than .
public static void Orthogonalize(Vector2[] destination, params Vector2[] source)
{
//Uses the modified Gram-Schmidt process.
@@ -1254,10 +1176,8 @@ namespace FlaxEngine
for (var i = 0; i < source.Length; ++i)
{
Vector2 newvector = source[i];
-
for (var r = 0; r < i; ++r)
newvector -= Dot(destination[r], newvector) / Dot(destination[r], destination[r]) * destination[r];
-
destination[i] = newvector;
}
}
@@ -1280,14 +1200,8 @@ namespace FlaxEngine
/// least stable.
///
///
- ///
- /// Thrown when or is
- /// null.
- ///
- ///
- /// Thrown when is shorter in length than
- /// .
- ///
+ /// Thrown when or is null.
+ /// Thrown when is shorter in length than.
public static void Orthonormalize(Vector2[] destination, params Vector2[] source)
{
//Uses the modified Gram-Schmidt process.
@@ -1301,20 +1215,16 @@ namespace FlaxEngine
if (source == null)
throw new ArgumentNullException(nameof(source));
-
if (destination == null)
throw new ArgumentNullException(nameof(destination));
-
if (destination.Length < source.Length)
throw new ArgumentOutOfRangeException(nameof(destination), "The destination array must be of same length or larger length than the source array.");
for (var i = 0; i < source.Length; ++i)
{
Vector2 newvector = source[i];
-
for (var r = 0; r < i; ++r)
newvector -= Dot(destination[r], newvector) * destination[r];
-
newvector.Normalize();
destination[i] = newvector;
}
@@ -1336,7 +1246,6 @@ namespace FlaxEngine
float xy = rotation.X * y;
float yy = rotation.Y * y;
float zz = rotation.Z * z;
-
result = new Vector2(vector.X * (1.0f - yy - zz) + vector.Y * (xy - wz), vector.X * (xy + wz) + vector.Y * (1.0f - xx - zz));
}
@@ -1357,26 +1266,15 @@ namespace FlaxEngine
///
/// The array of vectors to transform.
/// The rotation to apply.
- ///
- /// The array for which the transformed vectors are stored.
- /// This array may be the same array as .
- ///
- ///
- /// Thrown when or is
- /// null.
- ///
- ///
- /// Thrown when is shorter in length than
- /// .
- ///
+ /// The array for which the transformed vectors are stored. This array may be the same array as .
+ /// Thrown when or is null.
+ /// Thrown when is shorter in length than .
public static void Transform(Vector2[] source, ref Quaternion rotation, Vector2[] destination)
{
if (source == null)
throw new ArgumentNullException(nameof(source));
-
if (destination == null)
throw new ArgumentNullException(nameof(destination));
-
if (destination.Length < source.Length)
throw new ArgumentOutOfRangeException(nameof(destination), "The destination array must be of same length or larger length than the source array.");
@@ -1433,25 +1331,16 @@ namespace FlaxEngine
/// The array of vectors to transform.
/// The transformation .
/// The array for which the transformed vectors are stored.
- ///
- /// Thrown when or is
- /// null.
- ///
- ///
- /// Thrown when is shorter in length than
- /// .
- ///
+ /// Thrown when or is null.
+ /// Thrown when is shorter in length than .
public static void Transform(Vector2[] source, ref Matrix transform, Vector4[] destination)
{
if (source == null)
throw new ArgumentNullException(nameof(source));
-
if (destination == null)
throw new ArgumentNullException(nameof(destination));
-
if (destination.Length < source.Length)
throw new ArgumentOutOfRangeException(nameof(destination), "The destination array must be of same length or larger length than the source array.");
-
for (var i = 0; i < source.Length; ++i)
Transform(ref source[i], ref transform, out destination[i]);
}
@@ -1478,7 +1367,6 @@ namespace FlaxEngine
Z = coordinate.X * transform.M13 + coordinate.Y * transform.M23 + transform.M43,
W = 1f / (coordinate.X * transform.M14 + coordinate.Y * transform.M24 + transform.M44)
};
-
result = new Vector2(vector.X * vector.W, vector.Y * vector.W);
}
@@ -1506,18 +1394,9 @@ namespace FlaxEngine
///
/// The array of coordinate vectors to transform.
/// The transformation .
- ///
- /// The array for which the transformed vectors are stored.
- /// This array may be the same array as .
- ///
- ///
- /// Thrown when or is
- /// null.
- ///
- ///
- /// Thrown when is shorter in length than
- /// .
- ///
+ /// The array for which the transformed vectors are stored. This array may be the same array as .
+ /// Thrown when or is null.
+ /// Thrown when is shorter in length than .
///
/// A coordinate transform performs the transformation with the assumption that the w component
/// is one. The four dimensional vector obtained from the transformation operation has each
@@ -1529,13 +1408,10 @@ namespace FlaxEngine
{
if (source == null)
throw new ArgumentNullException(nameof(source));
-
if (destination == null)
throw new ArgumentNullException(nameof(destination));
-
if (destination.Length < source.Length)
throw new ArgumentOutOfRangeException(nameof(destination), "The destination array must be of same length or larger length than the source array.");
-
for (var i = 0; i < source.Length; ++i)
TransformCoordinate(ref source[i], ref transform, out destination[i]);
}
@@ -1584,18 +1460,9 @@ namespace FlaxEngine
///
/// The array of normal vectors to transform.
/// The transformation .
- ///
- /// The array for which the transformed vectors are stored.
- /// This array may be the same array as .
- ///
- ///
- /// Thrown when or is
- /// null.
- ///
- ///
- /// Thrown when is shorter in length than
- /// .
- ///
+ /// The array for which the transformed vectors are stored. This array may be the same array as .
+ /// Thrown when or is null.
+ /// Thrown when is shorter in length than .
///
/// A normal transform performs the transformation with the assumption that the w component
/// is zero. This causes the fourth row and fourth column of the matrix to be unused. The
@@ -1630,8 +1497,7 @@ namespace FlaxEngine
}
///
- /// Multiplies a vector with another by performing component-wise multiplication equivalent to
- /// .
+ /// Multiplies a vector with another by performing component-wise multiplication equivalent to .
///
/// The first vector to multiply.
/// The second vector to multiply.
@@ -1809,10 +1675,7 @@ namespace FlaxEngine
///
/// The first value to compare.
/// The second value to compare.
- ///
- /// true if has the same value as ; otherwise,
- /// false.
- ///
+ /// true if has the same value as ; otherwise,false.
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator ==(Vector2 left, Vector2 right)
{
@@ -1824,10 +1687,7 @@ namespace FlaxEngine
///
/// The first value to compare.
/// The second value to compare.
- ///
- /// true if has a different value than ; otherwise,
- /// false.
- ///
+ /// true if has a different value than ; otherwise,false.
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator !=(Vector2 left, Vector2 right)
{
@@ -1857,9 +1717,7 @@ namespace FlaxEngine
///
/// Returns a that represents this instance.
///
- ///
- /// A that represents this instance.
- ///
+ /// A that represents this instance.
public override string ToString()
{
return string.Format(CultureInfo.CurrentCulture, "X:{0} Y:{1}", X, Y);
@@ -1869,14 +1727,11 @@ namespace FlaxEngine
/// Returns a that represents this instance.
///
/// The format.
- ///
- /// A that represents this instance.
- ///
+ /// A that represents this instance.
public string ToString(string format)
{
if (format == null)
return ToString();
-
return string.Format(CultureInfo.CurrentCulture, _formatString, X.ToString(format, CultureInfo.CurrentCulture), Y.ToString(format, CultureInfo.CurrentCulture));
}
@@ -1884,9 +1739,7 @@ namespace FlaxEngine
/// Returns a that represents this instance.
///
/// The format provider.
- ///
- /// A that represents this instance.
- ///
+ /// A that represents this instance.
public string ToString(IFormatProvider formatProvider)
{
return string.Format(formatProvider, _formatString, X, Y);
@@ -1897,23 +1750,17 @@ namespace FlaxEngine
///
/// The format.
/// The format provider.
- ///
- /// A that represents this instance.
- ///
+ /// A that represents this instance.
public string ToString(string format, IFormatProvider formatProvider)
{
if (format == null)
return ToString(formatProvider);
-
return string.Format(formatProvider, _formatString, X.ToString(format, formatProvider), Y.ToString(format, formatProvider));
}
///
/// Returns a hash code for this instance.
///
- ///
- /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
- ///
public override int GetHashCode()
{
unchecked
@@ -1926,9 +1773,7 @@ namespace FlaxEngine
/// Determines whether the specified is equal to this instance.
///
/// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
+ /// true if the specified is equal to this instance; otherwise, false.
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(ref Vector2 other)
{
@@ -1947,9 +1792,7 @@ namespace FlaxEngine
/// Determines whether the specified is equal to this instance.
///
/// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
+ /// true if the specified is equal to this instance; otherwise, false.
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(Vector2 other)
{
@@ -1960,9 +1803,7 @@ namespace FlaxEngine
/// Determines whether the specified is equal to this instance.
///
/// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
+ /// true if the specified is equal to this instance; otherwise, false.
public override bool Equals(object value)
{
if (!(value is Vector2 other))
diff --git a/Source/Engine/Core/Math/Vector3.cs b/Source/Engine/Core/Math/Vector3.cs
index 7ef13c344..e365f6666 100644
--- a/Source/Engine/Core/Math/Vector3.cs
+++ b/Source/Engine/Core/Math/Vector3.cs
@@ -277,7 +277,6 @@ namespace FlaxEngine
case 1: return Y;
case 2: return Z;
}
-
throw new ArgumentOutOfRangeException(nameof(index), "Indices for Vector3 run from 0 to 2, inclusive.");
}
@@ -303,18 +302,14 @@ namespace FlaxEngine
/// Calculates the length of the vector.
///
/// The length of the vector.
- ///
- /// may be preferred when only the relative length is needed and speed is of the essence.
- ///
+ /// may be preferred when only the relative length is needed and speed is of the essence.
public float Length => (float)Math.Sqrt(X * X + Y * Y + Z * Z);
///
/// Calculates the squared length of the vector.
///
/// The squared length of the vector.
- ///
- /// This method may be preferred to when only a relative length is needed and speed is of the essence.
- ///
+ /// This method may be preferred to when only a relative length is needed and speed is of the essence.
public float LengthSquared => X * X + Y * Y + Z * Z;
///
@@ -707,17 +702,12 @@ namespace FlaxEngine
/// The first vector.
/// The second vector.
/// When the method completes, contains the distance between the two vectors.
- ///
- /// may be preferred when only the relative
- /// distance is needed
- /// and speed is of the essence.
- ///
+ /// may be preferred when only the relative distance is needed and speed is of the essence.
public static void Distance(ref Vector3 value1, ref Vector3 value2, out float result)
{
float x = value1.X - value2.X;
float y = value1.Y - value2.Y;
float z = value1.Z - value2.Z;
-
result = (float)Math.Sqrt(x * x + y * y + z * z);
}
@@ -727,17 +717,12 @@ namespace FlaxEngine
/// The first vector.
/// The second vector.
/// The distance between the two vectors.
- ///
- /// may be preferred when only the relative
- /// distance is needed
- /// and speed is of the essence.
- ///
+ /// may be preferred when only the relative distance is needed and speed is of the essence.
public static float Distance(ref Vector3 value1, ref Vector3 value2)
{
float x = value1.X - value2.X;
float y = value1.Y - value2.Y;
float z = value1.Z - value2.Z;
-
return (float)Math.Sqrt(x * x + y * y + z * z);
}
@@ -747,16 +732,12 @@ namespace FlaxEngine
/// The first vector.
/// The second vector.
/// The distance between the two vectors.
- ///
- /// may be preferred when only the relative distance is needed
- /// and speed is of the essence.
- ///
+ /// may be preferred when only the relative distance is needed and speed is of the essence.
public static float Distance(Vector3 value1, Vector3 value2)
{
float x = value1.X - value2.X;
float y = value1.Y - value2.Y;
float z = value1.Z - value2.Z;
-
return (float)Math.Sqrt(x * x + y * y + z * z);
}
@@ -779,7 +760,6 @@ namespace FlaxEngine
float x = value1.X - value2.X;
float y = value1.Y - value2.Y;
float z = value1.Z - value2.Z;
-
result = x * x + y * y + z * z;
}
@@ -802,7 +782,6 @@ namespace FlaxEngine
float x = value1.X - value2.X;
float y = value1.Y - value2.Y;
float z = value1.Z - value2.Z;
-
return x * x + y * y + z * z;
}
@@ -825,7 +804,6 @@ namespace FlaxEngine
float x = value1.X - value2.X;
float y = value1.Y - value2.Y;
float z = value1.Z - value2.Z;
-
return x * x + y * y + z * z;
}
@@ -839,7 +817,6 @@ namespace FlaxEngine
{
float x = value1.X - value2.X;
float y = value1.Y - value2.Y;
-
result = (float)Math.Sqrt(x * x + y * y);
}
@@ -853,7 +830,6 @@ namespace FlaxEngine
{
float x = value1.X - value2.X;
float y = value1.Y - value2.Y;
-
result = x * x + y * y;
}
@@ -867,7 +843,6 @@ namespace FlaxEngine
{
float x = value1.X - value2.X;
float z = value1.Z - value2.Z;
-
result = (float)Math.Sqrt(x * x + z * z);
}
@@ -881,7 +856,6 @@ namespace FlaxEngine
{
float x = value1.X - value2.X;
float z = value1.Z - value2.Z;
-
result = x * x + z * z;
}
@@ -895,7 +869,6 @@ namespace FlaxEngine
{
float y = value1.Y - value2.Y;
float z = value1.Z - value2.Z;
-
result = (float)Math.Sqrt(y * y + z * z);
}
@@ -909,7 +882,6 @@ namespace FlaxEngine
{
float y = value1.Y - value2.Y;
float z = value1.Z - value2.Z;
-
result = y * y + z * z;
}
@@ -1051,10 +1023,7 @@ namespace FlaxEngine
/// End vector.
/// Value between 0 and 1 indicating the weight of .
/// When the method completes, contains the linear interpolation of the two vectors.
- ///
- /// Passing a value of 0 will cause to be returned; a value of 1
- /// will cause to be returned.
- ///
+ /// Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned.
public static void Lerp(ref Vector3 start, ref Vector3 end, float amount, out Vector3 result)
{
result.X = Mathf.Lerp(start.X, end.X, amount);
@@ -1069,10 +1038,7 @@ namespace FlaxEngine
/// End vector.
/// Value between 0 and 1 indicating the weight of .
/// The linear interpolation of the two vectors.
- ///
- /// Passing a value of 0 will cause to be returned; a value of 1
- /// will cause to be returned.
- ///
+ /// Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned.
public static Vector3 Lerp(Vector3 start, Vector3 end, float amount)
{
Lerp(ref start, ref end, amount, out var result);
@@ -1388,10 +1354,7 @@ namespace FlaxEngine
/// The source vector.
/// Normal of the surface.
/// The reflected vector.
- ///
- /// Reflect only gives the direction of a reflection off a surface, it does not determine
- /// whether the original vector was close enough to the surface to hit it.
- ///
+ /// Reflect only gives the direction of a reflection off a surface, it does not determine whether the original vector was close enough to the surface to hit it.
public static Vector3 Reflect(Vector3 vector, Vector3 normal)
{
Reflect(ref vector, ref normal, out var result);
@@ -1416,14 +1379,8 @@ namespace FlaxEngine
/// least stable.
///
///
- ///
- /// Thrown when or is
- /// null.
- ///
- ///
- /// Thrown when is shorter in length than
- /// .
- ///
+ /// Thrown when or is null.
+ /// Thrown when is shorter in length than .
public static void Orthogonalize(Vector3[] destination, params Vector3[] source)
{
//Uses the modified Gram-Schmidt process.
@@ -1469,14 +1426,8 @@ namespace FlaxEngine
/// least stable.
///
///
- ///
- /// Thrown when or is
- /// null.
- ///
- ///
- /// Thrown when is shorter in length than
- /// .
- ///
+ /// Thrown when or is null.
+ /// Thrown when is shorter in length than .
public static void Orthonormalize(Vector3[] destination, params Vector3[] source)
{
//Uses the modified Gram-Schmidt process.
@@ -1551,14 +1502,8 @@ namespace FlaxEngine
/// The array of vectors to transform.
/// The rotation to apply.
/// The array for which the transformed vectors are stored. This array may be the same array as .
- ///
- /// Thrown when or is
- /// null.
- ///
- ///
- /// Thrown when is shorter in length than
- /// .
- ///
+ /// Thrown when or is null.
+ /// Thrown when is shorter in length than .
public static void Transform(Vector3[] source, ref Quaternion rotation, Vector3[] destination)
{
if (source == null)
@@ -1669,14 +1614,8 @@ namespace FlaxEngine
/// The array of vectors to transform.
/// The transformation .
/// The array for which the transformed vectors are stored.
- ///
- /// Thrown when or is
- /// null.
- ///
- ///
- /// Thrown when is shorter in length than
- /// .
- ///
+ /// Thrown when or is null.
+ /// Thrown when is shorter in length than .
public static void Transform(Vector3[] source, ref Matrix transform, Vector4[] destination)
{
if (source == null)
@@ -1741,12 +1680,8 @@ namespace FlaxEngine
/// The array of coordinate vectors to transform.
/// The transformation .
/// The array for which the transformed vectors are stored. This array may be the same array as .
- ///
- /// Thrown when or is
- /// null.
- ///
- ///
- /// Thrown when is shorter in length than
+ /// Thrown when or is null.
+ /// Thrown when is shorter in length than
/// .
///
///
@@ -1814,14 +1749,8 @@ namespace FlaxEngine
/// The array of normal vectors to transform.
/// The transformation .
/// The array for which the transformed vectors are stored. This array may be the same array as .
- ///
- /// Thrown when or is
- /// null.
- ///
- ///
- /// Thrown when is shorter in length than
- /// .
- ///
+ /// Thrown when or is null.
+ /// Thrown when is shorter in length than .
///
/// A normal transform performs the transformation with the assumption that the w component
/// is zero. This causes the fourth row and fourth column of the matrix to be unused. The
@@ -2131,7 +2060,6 @@ namespace FlaxEngine
///
/// Returns a hash code for this instance.
///
- /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
public override int GetHashCode()
{
unchecked
diff --git a/Source/Engine/Core/Math/Vector4.cs b/Source/Engine/Core/Math/Vector4.cs
index f7d605a8f..1aaed195c 100644
--- a/Source/Engine/Core/Math/Vector4.cs
+++ b/Source/Engine/Core/Math/Vector4.cs
@@ -183,22 +183,15 @@ namespace FlaxEngine
///
/// Initializes a new instance of the struct.
///
- ///
- /// The values to assign to the X, Y, Z, and W components of the vector. This must be an array with
- /// four elements.
- ///
+ /// The values to assign to the X, Y, Z, and W components of the vector. This must be an array with four elements.
/// Thrown when is null.
- ///
- /// Thrown when contains more or less than four
- /// elements.
- ///
+ /// Thrown when contains more or less than four elements.
public Vector4(float[] values)
{
if (values == null)
throw new ArgumentNullException(nameof(values));
if (values.Length != 4)
throw new ArgumentOutOfRangeException(nameof(values), "There must be four and only four input values for Vector4.");
-
X = values[0];
Y = values[1];
Z = values[2];
@@ -254,15 +247,9 @@ namespace FlaxEngine
/// Gets or sets the component at the specified index.
///
/// The value of the X, Y, Z, or W component, depending on the index.
- ///
- /// The index of the component to access. Use 0 for the X component, 1 for the Y component, 2 for the Z
- /// component, and 3 for the W component.
- ///
+ /// The index of the component to access. Use 0 for the X component, 1 for the Y component, 2 for the Z component, and 3 for the W component.
/// The value of the component at the specified index.
- ///
- /// Thrown when the is out of the range [0,
- /// 3].
- ///
+ /// Thrown when the is out of the range [0,3].
public float this[int index]
{
get
@@ -274,7 +261,6 @@ namespace FlaxEngine
case 2: return Z;
case 3: return W;
}
-
throw new ArgumentOutOfRangeException(nameof(index), "Indices for Vector4 run from 0 to 3, inclusive.");
}
@@ -303,20 +289,14 @@ namespace FlaxEngine
/// Calculates the length of the vector.
///
/// The length of the vector.
- ///
- /// may be preferred when only the relative length is needed
- /// and speed is of the essence.
- ///
+ /// may be preferred when only the relative length is needed and speed is of the essence.
public float Length => (float)Math.Sqrt(X * X + Y * Y + Z * Z + W * W);
///
/// Calculates the squared length of the vector.
///
/// The squared length of the vector.
- ///
- /// This method may be preferred to when only a relative length is needed
- /// and speed is of the essence.
- ///
+ /// This method may be preferred to when only a relative length is needed and speed is of the essence.
public float LengthSquared => X * X + Y * Y + Z * Z + W * W;
///
@@ -569,20 +549,13 @@ namespace FlaxEngine
}
///
- /// Returns a containing the 4D Cartesian coordinates of a point specified in Barycentric
- /// coordinates relative to a 4D triangle.
+ /// Returns a containing the 4D Cartesian coordinates of a point specified in Barycentric coordinates relative to a 4D triangle.
///
/// A containing the 4D Cartesian coordinates of vertex 1 of the triangle.
/// A containing the 4D Cartesian coordinates of vertex 2 of the triangle.
/// A containing the 4D Cartesian coordinates of vertex 3 of the triangle.
- ///
- /// Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in
- /// ).
- ///
- ///
- /// Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in
- /// ).
- ///
+ /// Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in ).
+ /// Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in ).
/// When the method completes, contains the 4D Cartesian coordinates of the specified point.
public static void Barycentric(ref Vector4 value1, ref Vector4 value2, ref Vector4 value3, float amount1, float amount2, out Vector4 result)
{
@@ -593,20 +566,13 @@ namespace FlaxEngine
}
///
- /// Returns a containing the 4D Cartesian coordinates of a point specified in Barycentric
- /// coordinates relative to a 4D triangle.
+ /// Returns a containing the 4D Cartesian coordinates of a point specified in Barycentric coordinates relative to a 4D triangle.
///
/// A containing the 4D Cartesian coordinates of vertex 1 of the triangle.
/// A containing the 4D Cartesian coordinates of vertex 2 of the triangle.
/// A containing the 4D Cartesian coordinates of vertex 3 of the triangle.
- ///
- /// Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in
- /// ).
- ///
- ///
- /// Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in
- /// ).
- ///
+ /// Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in ).
+ /// Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in ).
/// A new containing the 4D Cartesian coordinates of the specified point.
public static Vector4 Barycentric(Vector4 value1, Vector4 value2, Vector4 value3, float amount1, float amount2)
{
@@ -661,18 +627,13 @@ namespace FlaxEngine
/// The first vector.
/// The second vector.
/// When the method completes, contains the distance between the two vectors.
- ///
- /// may be preferred when only the relative
- /// distance is needed
- /// and speed is of the essence.
- ///
+ /// may be preferred when only the relative distance is needed and speed is of the essence.
public static void Distance(ref Vector4 value1, ref Vector4 value2, out float result)
{
float x = value1.X - value2.X;
float y = value1.Y - value2.Y;
float z = value1.Z - value2.Z;
float w = value1.W - value2.W;
-
result = (float)Math.Sqrt(x * x + y * y + z * z + w * w);
}
@@ -682,17 +643,13 @@ namespace FlaxEngine
/// The first vector.
/// The second vector.
/// The distance between the two vectors.
- ///
- /// may be preferred when only the relative distance is needed
- /// and speed is of the essence.
- ///
+ /// may be preferred when only the relative distance is needed and speed is of the essence.
public static float Distance(Vector4 value1, Vector4 value2)
{
float x = value1.X - value2.X;
float y = value1.Y - value2.Y;
float z = value1.Z - value2.Z;
float w = value1.W - value2.W;
-
return (float)Math.Sqrt(x * x + y * y + z * z + w * w);
}
@@ -716,7 +673,6 @@ namespace FlaxEngine
float y = value1.Y - value2.Y;
float z = value1.Z - value2.Z;
float w = value1.W - value2.W;
-
result = x * x + y * y + z * z + w * w;
}
@@ -740,7 +696,6 @@ namespace FlaxEngine
float y = value1.Y - value2.Y;
float z = value1.Z - value2.Z;
float w = value1.W - value2.W;
-
return x * x + y * y + z * z + w * w;
}
@@ -877,10 +832,7 @@ namespace FlaxEngine
/// End vector.
/// Value between 0 and 1 indicating the weight of .
/// When the method completes, contains the linear interpolation of the two vectors.
- ///
- /// Passing a value of 0 will cause to be returned; a value of 1
- /// will cause to be returned.
- ///
+ /// Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned.
public static void Lerp(ref Vector4 start, ref Vector4 end, float amount, out Vector4 result)
{
result.X = Mathf.Lerp(start.X, end.X, amount);
@@ -896,10 +848,7 @@ namespace FlaxEngine
/// End vector.
/// Value between 0 and 1 indicating the weight of .
/// The linear interpolation of the two vectors.
- ///
- /// Passing a value of 0 will cause to be returned; a value of 1
- /// will cause to be returned.
- ///
+ /// Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned.
public static Vector4 Lerp(Vector4 start, Vector4 end, float amount)
{
Lerp(ref start, ref end, amount, out Vector4 result);
@@ -1011,10 +960,7 @@ namespace FlaxEngine
///
/// The first source vector.
/// The second source vector.
- ///
- /// When the method completes, contains an new vector composed of the largest components of the source
- /// vectors.
- ///
+ /// When the method completes, contains an new vector composed of the largest components of the source vectors.
public static void Max(ref Vector4 left, ref Vector4 right, out Vector4 result)
{
result.X = left.X > right.X ? left.X : right.X;
@@ -1040,10 +986,7 @@ namespace FlaxEngine
///
/// The first source vector.
/// The second source vector.
- ///
- /// When the method completes, contains an new vector composed of the smallest components of the
- /// source vectors.
- ///
+ /// When the method completes, contains an new vector composed of the smallest components of the source vectors.
public static void Min(ref Vector4 left, ref Vector4 right, out Vector4 result)
{
result.X = left.X < right.X ? left.X : right.X;
@@ -1092,14 +1035,8 @@ namespace FlaxEngine
/// least stable.
///
///
- ///
- /// Thrown when or is
- /// null.
- ///
- ///
- /// Thrown when is shorter in length than
- /// .
- ///
+ /// Thrown when or is null.
+ /// Thrown when is shorter in length than .
public static void Orthogonalize(Vector4[] destination, params Vector4[] source)
{
//Uses the modified Gram-Schmidt process.
@@ -1111,10 +1048,8 @@ namespace FlaxEngine
if (source == null)
throw new ArgumentNullException(nameof(source));
-
if (destination == null)
throw new ArgumentNullException(nameof(destination));
-
if (destination.Length < source.Length)
throw new ArgumentOutOfRangeException(nameof(destination), "The destination array must be of same length or larger length than the source array.");
@@ -1147,14 +1082,8 @@ namespace FlaxEngine
/// least stable.
///
///
- ///
- /// Thrown when or is
- /// null.
- ///
- ///
- /// Thrown when is shorter in length than
- /// .
- ///
+ /// Thrown when or is null.
+ /// Thrown when is shorter in length than .
public static void Orthonormalize(Vector4[] destination, params Vector4[] source)
{
//Uses the modified Gram-Schmidt process.
@@ -1168,10 +1097,8 @@ namespace FlaxEngine
if (source == null)
throw new ArgumentNullException(nameof(source));
-
if (destination == null)
throw new ArgumentNullException(nameof(destination));
-
if (destination.Length < source.Length)
throw new ArgumentOutOfRangeException(nameof(destination), "The destination array must be of same length or larger length than the source array.");
@@ -1232,26 +1159,15 @@ namespace FlaxEngine
///
/// The array of vectors to transform.
/// The rotation to apply.
- ///
- /// The array for which the transformed vectors are stored.
- /// This array may be the same array as .
- ///
- ///
- /// Thrown when or is
- /// null.
- ///
- ///
- /// Thrown when is shorter in length than
- /// .
- ///
+ /// The array for which the transformed vectors are stored. This array may be the same array as .
+ /// Thrown when or is null.
+ /// Thrown when is shorter in length than .
public static void Transform(Vector4[] source, ref Quaternion rotation, Vector4[] destination)
{
if (source == null)
throw new ArgumentNullException(nameof(source));
-
if (destination == null)
throw new ArgumentNullException(nameof(destination));
-
if (destination.Length < source.Length)
throw new ArgumentOutOfRangeException(nameof(destination), "The destination array must be of same length or larger length than the source array.");
@@ -1318,26 +1234,15 @@ namespace FlaxEngine
///
/// The array of vectors to transform.
/// The transformation .
- ///
- /// The array for which the transformed vectors are stored.
- /// This array may be the same array as .
- ///
- ///
- /// Thrown when or is
- /// null.
- ///
- ///
- /// Thrown when is shorter in length than
- /// .
- ///
+ /// The array for which the transformed vectors are stored. This array may be the same array as .
+ /// Thrown when or is null.
+ /// Thrown when is shorter in length than .
public static void Transform(Vector4[] source, ref Matrix transform, Vector4[] destination)
{
if (source == null)
throw new ArgumentNullException(nameof(source));
-
if (destination == null)
throw new ArgumentNullException(nameof(destination));
-
if (destination.Length < source.Length)
throw new ArgumentOutOfRangeException(nameof(destination), "The destination array must be of same length or larger length than the source array.");
@@ -1536,10 +1441,7 @@ namespace FlaxEngine
///
/// The first value to compare.
/// The second value to compare.
- ///
- /// true if has the same value as ; otherwise,
- /// false.
- ///
+ /// true if has the same value as ; otherwise, false.
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator ==(Vector4 left, Vector4 right)
{
@@ -1551,10 +1453,7 @@ namespace FlaxEngine
///
/// The first value to compare.
/// The second value to compare.
- ///
- /// true if has a different value than ; otherwise,
- /// false.
- ///
+ /// true if has a different value than ; otherwise, false.
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator !=(Vector4 left, Vector4 right)
{
@@ -1584,9 +1483,7 @@ namespace FlaxEngine
///
/// Returns a that represents this instance.
///
- ///
- /// A that represents this instance.
- ///
+ /// A that represents this instance.
public override string ToString()
{
return string.Format(CultureInfo.CurrentCulture, _formatString, X, Y, Z, W);
@@ -1596,25 +1493,19 @@ namespace FlaxEngine
/// Returns a that represents this instance.
///
/// The format.
- ///
- /// A that represents this instance.
- ///
+ /// A that represents this instance.
public string ToString(string format)
{
if (format == null)
return ToString();
-
- return string.Format(CultureInfo.CurrentCulture, _formatString, X.ToString(format, CultureInfo.CurrentCulture),
- Y.ToString(format, CultureInfo.CurrentCulture), Z.ToString(format, CultureInfo.CurrentCulture), W.ToString(format, CultureInfo.CurrentCulture));
+ return string.Format(CultureInfo.CurrentCulture, _formatString, X.ToString(format, CultureInfo.CurrentCulture), Y.ToString(format, CultureInfo.CurrentCulture), Z.ToString(format, CultureInfo.CurrentCulture), W.ToString(format, CultureInfo.CurrentCulture));
}
///
/// Returns a that represents this instance.
///
/// The format provider.
- ///
- /// A that represents this instance.
- ///
+ /// A that represents this instance.
public string ToString(IFormatProvider formatProvider)
{
return string.Format(formatProvider, _formatString, X, Y, Z, W);
@@ -1625,24 +1516,17 @@ namespace FlaxEngine
///
/// The format.
/// The format provider.
- ///
- /// A that represents this instance.
- ///
+ /// A that represents this instance.
public string ToString(string format, IFormatProvider formatProvider)
{
if (format == null)
return ToString(formatProvider);
-
- return string.Format(formatProvider, "X:{0} Y:{1} Z:{2} W:{3}", X.ToString(format, formatProvider),
- Y.ToString(format, formatProvider), Z.ToString(format, formatProvider), W.ToString(format, formatProvider));
+ return string.Format(formatProvider, "X:{0} Y:{1} Z:{2} W:{3}", X.ToString(format, formatProvider), Y.ToString(format, formatProvider), Z.ToString(format, formatProvider), W.ToString(format, formatProvider));
}
///
/// Returns a hash code for this instance.
///
- ///
- /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
- ///
public override int GetHashCode()
{
unchecked
@@ -1659,24 +1543,17 @@ namespace FlaxEngine
/// Determines whether the specified is equal to this instance.
///
/// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
+ /// true if the specified is equal to this instance; otherwise, false.
public bool Equals(ref Vector4 other)
{
- return Mathf.NearEqual(other.X, X) &&
- Mathf.NearEqual(other.Y, Y) &&
- Mathf.NearEqual(other.Z, Z) &&
- Mathf.NearEqual(other.W, W);
+ return Mathf.NearEqual(other.X, X) && Mathf.NearEqual(other.Y, Y) && Mathf.NearEqual(other.Z, Z) && Mathf.NearEqual(other.W, W);
}
///
/// Determines whether the specified is equal to this instance.
///
/// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
+ /// true if the specified is equal to this instance; otherwise, false.
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(Vector4 other)
{
@@ -1687,9 +1564,7 @@ namespace FlaxEngine
/// Determines whether the specified is equal to this instance.
///
/// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
+ /// true if the specified is equal to this instance; otherwise, false.
public override bool Equals(object value)
{
if (!(value is Vector4 other))
diff --git a/Source/Engine/UI/GUI/Panels/Panel.cs b/Source/Engine/UI/GUI/Panels/Panel.cs
index 946e3e9e4..2d54b43e1 100644
--- a/Source/Engine/UI/GUI/Panels/Panel.cs
+++ b/Source/Engine/UI/GUI/Panels/Panel.cs
@@ -157,7 +157,6 @@ namespace FlaxEngine.GUI
///
/// Initializes a new instance of the class.
///
- ///
public Panel()
: this(ScrollBars.None)
{