Minro tweaks to comments

This commit is contained in:
Wojciech Figat
2022-04-22 15:15:33 +02:00
parent 77dcc9b7a3
commit 42bb4483b3

View File

@@ -229,18 +229,16 @@ public:
} }
/// <summary> /// <summary>
/// Calculates a vector with values being absolute values of that vector /// Calculates a vector with values being absolute values of that vector.
/// </summary> /// </summary>
/// <returns>Absolute vector</returns>
Vector3 GetAbsolute() const Vector3 GetAbsolute() const
{ {
return Vector3(Math::Abs(X), Math::Abs(Y), Math::Abs(Z)); return Vector3(Math::Abs(X), Math::Abs(Y), Math::Abs(Z));
} }
/// <summary> /// <summary>
/// Calculates a vector with values being opposite to values of that vector /// Calculates a vector with values being opposite to values of that vector.
/// </summary> /// </summary>
/// <returns>Negative vector</returns>
Vector3 GetNegative() const Vector3 GetNegative() const
{ {
return Vector3(-X, -Y, -Z); return Vector3(-X, -Y, -Z);
@@ -249,7 +247,6 @@ public:
/// <summary> /// <summary>
/// Calculates a normalized vector that has length equal to 1. /// Calculates a normalized vector that has length equal to 1.
/// </summary> /// </summary>
/// <returns>The normalized vector.</returns>
Vector3 GetNormalized() const Vector3 GetNormalized() const
{ {
const float rcp = 1.0f / Length(); const float rcp = 1.0f / Length();
@@ -257,63 +254,56 @@ public:
} }
/// <summary> /// <summary>
/// Returns average arithmetic of all the components /// Returns the average arithmetic of all the components.
/// </summary> /// </summary>
/// <returns>Average arithmetic of all the components</returns>
float AverageArithmetic() const float AverageArithmetic() const
{ {
return (X + Y + Z) * 0.333333334f; return (X + Y + Z) * 0.333333334f;
} }
/// <summary> /// <summary>
/// Gets sum of all vector components values /// Gets the sum of all vector components values.
/// </summary> /// </summary>
/// <returns>Sum of X,Y and Z</returns>
float SumValues() const float SumValues() const
{ {
return X + Y + Z; return X + Y + Z;
} }
/// <summary> /// <summary>
/// Returns minimum value of all the components /// Returns the minimum value of all the components.
/// </summary> /// </summary>
/// <returns>Minimum value</returns>
float MinValue() const float MinValue() const
{ {
return Math::Min(X, Y, Z); return Math::Min(X, Y, Z);
} }
/// <summary> /// <summary>
/// Returns maximum value of all the components /// Returns the maximum value of all the components.
/// </summary> /// </summary>
/// <returns>Maximum value</returns>
float MaxValue() const float MaxValue() const
{ {
return Math::Max(X, Y, Z); return Math::Max(X, Y, Z);
} }
/// <summary> /// <summary>
/// Returns true if vector has one or more components is not a number (NaN) /// Returns true if vector has one or more components is not a number (NaN).
/// </summary> /// </summary>
/// <returns>True if one or more components is not a number (NaN)</returns>
bool IsNaN() const bool IsNaN() const
{ {
return isnan(X) || isnan(Y) || isnan(Z); return isnan(X) || isnan(Y) || isnan(Z);
} }
/// <summary> /// <summary>
/// Returns true if vector has one or more components equal to +/- infinity /// Returns true if vector has one or more components equal to +/- infinity.
/// </summary> /// </summary>
/// <returns>True if one or more components equal to +/- infinity</returns>
bool IsInfinity() const bool IsInfinity() const
{ {
return isinf(X) || isinf(Y) || isinf(Z); return isinf(X) || isinf(Y) || isinf(Z);
} }
/// <summary> /// <summary>
/// Returns true if vector has one or more components equal to +/- infinity or NaN /// Returns true if vector has one or more components equal to +/- infinity or NaN.
/// </summary> /// </summary>
/// <returns>True if one or more components equal to +/- infinity or NaN</returns>
bool IsNanOrInfinity() const bool IsNanOrInfinity() const
{ {
return IsInfinity() || IsNaN(); return IsInfinity() || IsNaN();