Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added missing XML comments for Matrix3d

Fixed a few small issues in XML comments for Matrix4d

--HG--
extra : rebase_source : 18595a2fc57dcf7ff0f61d699e092be036d65157
  • Loading branch information...
commit 56430c7751710b06dba8e22d5cc3b05699ad1672 1 parent f0a9afa
@Tamschi Tamschi authored
Showing with 129 additions and 28 deletions.
  1. +121 −20 Source/OpenTK/Math/Matrix3d.cs
  2. +8 −8 Source/OpenTK/Math/Matrix4d.cs
View
141 Source/OpenTK/Math/Matrix3d.cs
@@ -192,7 +192,10 @@ public Vector3d Column2
#region Instance
#region public void Invert()
-
+
+ /// <summary>
+ /// Converts this instance into its inverse.
+ /// </summary>
public void Invert()
{
this = Matrix3d.Invert(this);
@@ -201,7 +204,10 @@ public void Invert()
#endregion
#region public void Transpose()
-
+
+ /// <summary>
+ /// Converts this instance into its transpose.
+ /// </summary>
public void Transpose()
{
this = Matrix3d.Transpose(this);
@@ -214,7 +220,13 @@ public void Transpose()
#region Static
#region CreateFromAxisAngle
-
+
+ /// <summary>
+ /// Build a rotation matrix from the specified axis/angle rotation.
+ /// </summary>
+ /// <param name="axis">The axis to rotate about.</param>
+ /// <param name="angle">Angle in radians to rotate counter-clockwise (looking in the direction of the given axis).</param>
+ /// <param name="result">A matrix instance.</param>
public static void CreateFromAxisAngle(Vector3d axis, double angle, out Matrix3d result)
{
//normalize and create a local copy of the vector.
@@ -248,7 +260,13 @@ public static void CreateFromAxisAngle(Vector3d axis, double angle, out Matrix3d
result.Row2.Y = tYZ + sinX;
result.Row2.Z = tZZ + cos;
}
-
+
+ /// <summary>
+ /// Build a rotation matrix from the specified axis/angle rotation.
+ /// </summary>
+ /// <param name="axis">The axis to rotate about.</param>
+ /// <param name="angle">Angle in radians to rotate counter-clockwise (looking in the direction of the given axis).</param>
+ /// <returns>A matrix instance.</returns>
public static Matrix3d CreateFromAxisAngle(Vector3d axis, double angle)
{
Matrix3d result;
@@ -259,7 +277,12 @@ public static Matrix3d CreateFromAxisAngle(Vector3d axis, double angle)
#endregion
#region CreateFromQuaternion
-
+
+ /// <summary>
+ /// Build a rotation matrix from the specified quaternion.
+ /// </summary>
+ /// <param name="q">Quaternion to translate.</param>
+ /// <param name="result">Matrix result.</param>
public static void CreateFromQuaternion(ref Quaterniond q, out Matrix3d result)
{
Vector3d axis;
@@ -267,7 +290,12 @@ public static void CreateFromQuaternion(ref Quaterniond q, out Matrix3d result)
q.ToAxisAngle(out axis, out angle);
CreateFromAxisAngle(axis, angle, out result);
}
-
+
+ /// <summary>
+ /// Build a rotation matrix from the specified quaternion.
+ /// </summary>
+ /// <param name="q">Quaternion to translate.</param>
+ /// <returns>A matrix instance.</returns>
public static Matrix3d CreateFromQuaternion(Quaterniond q)
{
Matrix3d result;
@@ -278,7 +306,12 @@ public static Matrix3d CreateFromQuaternion(Quaterniond q)
#endregion
#region CreateRotation[XYZ]
-
+
+ /// <summary>
+ /// Builds a rotation matrix for a rotation around the x-axis.
+ /// </summary>
+ /// <param name="angle">The counter-clockwise angle in radians.</param>
+ /// <param name="result">The resulting Matrix3d instance.</param>
public static void CreateRotationX(double angle, out Matrix3d result)
{
double cos = System.Math.Cos(angle);
@@ -290,14 +323,24 @@ public static void CreateRotationX(double angle, out Matrix3d result)
result.Row2.Y = -sin;
result.Row2.Z = cos;
}
-
+
+ /// <summary>
+ /// Builds a rotation matrix for a rotation around the x-axis.
+ /// </summary>
+ /// <param name="angle">The counter-clockwise angle in radians.</param>
+ /// <returns>The resulting Matrix3d instance.</returns>
public static Matrix3d CreateRotationX(double angle)
{
Matrix3d result;
CreateRotationX(angle, out result);
return result;
}
-
+
+ /// <summary>
+ /// Builds a rotation matrix for a rotation around the y-axis.
+ /// </summary>
+ /// <param name="angle">The counter-clockwise angle in radians.</param>
+ /// <param name="result">The resulting Matrix3d instance.</param>
public static void CreateRotationY(double angle, out Matrix3d result)
{
double cos = System.Math.Cos(angle);
@@ -309,14 +352,24 @@ public static void CreateRotationY(double angle, out Matrix3d result)
result.Row2.X = sin;
result.Row2.Z = cos;
}
-
+
+ /// <summary>
+ /// Builds a rotation matrix for a rotation around the y-axis.
+ /// </summary>
+ /// <param name="angle">The counter-clockwise angle in radians.</param>
+ /// <returns>The resulting Matrix3d instance.</returns>
public static Matrix3d CreateRotationY(double angle)
{
Matrix3d result;
CreateRotationY(angle, out result);
return result;
}
-
+
+ /// <summary>
+ /// Builds a rotation matrix for a rotation around the z-axis.
+ /// </summary>
+ /// <param name="angle">The counter-clockwise angle in radians.</param>
+ /// <param name="result">The resulting Matrix3d instance.</param>
public static void CreateRotationZ(double angle, out Matrix3d result)
{
double cos = System.Math.Cos(angle);
@@ -328,7 +381,12 @@ public static void CreateRotationZ(double angle, out Matrix3d result)
result.Row1.X = -sin;
result.Row1.Y = cos;
}
-
+
+ /// <summary>
+ /// Builds a rotation matrix for a rotation around the z-axis.
+ /// </summary>
+ /// <param name="angle">The counter-clockwise angle in radians.</param>
+ /// <returns>The resulting Matrix3d instance.</returns>
public static Matrix3d CreateRotationZ(double angle)
{
Matrix3d result;
@@ -422,14 +480,26 @@ public static void CreateScale(double x, double y, double z, out Matrix3d result
#endregion
#region Multiply Functions
-
+
+ /// <summary>
+ /// Multiplies two instances.
+ /// </summary>
+ /// <param name="left">The left operand of the multiplication.</param>
+ /// <param name="right">The right operand of the multiplication.</param>
+ /// <returns>A new instance that is the result of the multiplication</returns>
public static Matrix3d Mult(Matrix3d left, Matrix3d right)
{
Matrix3d result;
Mult(ref left, ref right, out result);
return result;
}
-
+
+ /// <summary>
+ /// Multiplies two instances.
+ /// </summary>
+ /// <param name="left">The left operand of the multiplication.</param>
+ /// <param name="right">The right operand of the multiplication.</param>
+ /// <param name="result">A new instance that is the result of the multiplication</param>
public static void Mult(ref Matrix3d left, ref Matrix3d right, out Matrix3d result)
{
double lM11 = left.Row0.X, lM12 = left.Row0.Y, lM13 = left.Row0.Z,
@@ -578,12 +648,22 @@ public static Matrix3d Invert(Matrix3d mat)
#endregion
#region Transpose
-
+
+ /// <summary>
+ /// Calculate the transpose of the given matrix
+ /// </summary>
+ /// <param name="mat">The matrix to transpose</param>
+ /// <returns>The transpose of the given matrix</returns>
public static Matrix3d Transpose(Matrix3d mat)
{
return new Matrix3d(mat.Column0, mat.Column1, mat.Column2);
}
-
+
+ /// <summary>
+ /// Calculate the transpose of the given matrix
+ /// </summary>
+ /// <param name="mat">The matrix to transpose</param>
+ /// <param name="result">The result of the calculation</param>
public static void Transpose(ref Matrix3d mat, out Matrix3d result)
{
result.Row0 = mat.Column0;
@@ -596,17 +676,35 @@ public static void Transpose(ref Matrix3d mat, out Matrix3d result)
#endregion
#region Operators
-
+
+ /// <summary>
+ /// Matrix multiplication
+ /// </summary>
+ /// <param name="left">left-hand operand</param>
+ /// <param name="right">right-hand operand</param>
+ /// <returns>A new Matrix3d which holds the result of the multiplication</returns>
public static Matrix3d operator *(Matrix3d left, Matrix3d right)
{
return Matrix3d.Mult(left, right);
}
-
+
+ /// <summary>
+ /// Compares two instances for equality.
+ /// </summary>
+ /// <param name="left">The first instance.</param>
+ /// <param name="right">The second instance.</param>
+ /// <returns>True, if left equals right; false otherwise.</returns>
public static bool operator ==(Matrix3d left, Matrix3d right)
{
return left.Equals(right);
}
-
+
+ /// <summary>
+ /// Compares two instances for inequality.
+ /// </summary>
+ /// <param name="left">The first instance.</param>
+ /// <param name="right">The second instance.</param>
+ /// <returns>True, if left does not equal right; false otherwise.</returns>
public static bool operator !=(Matrix3d left, Matrix3d right)
{
return !left.Equals(right);
@@ -664,7 +762,10 @@ public override bool Equals(object obj)
#endregion
#region IEquatable<Matrix3d> Members
-
+
+ /// <summary>Indicates whether the current matrix is equal to another matrix.</summary>
+ /// <param name="other">A matrix to compare with this matrix.</param>
+ /// <returns>true if the current matrix is equal to the matrix parameter; otherwise, false.</returns>
public bool Equals(Matrix3d other)
{
return
View
16 Source/OpenTK/Math/Matrix4d.cs
@@ -336,7 +336,7 @@ public static Matrix4d CreateFromAxisAngle(Vector3d axis, double angle)
/// Builds a rotation matrix for a rotation around the x-axis.
/// </summary>
/// <param name="angle">The counter-clockwise angle in radians.</param>
- /// <param name="result">The resulting Matrix4 instance.</param>
+ /// <param name="result">The resulting Matrix4d instance.</param>
public static void CreateRotationX(double angle, out Matrix4d result)
{
double cos = System.Math.Cos(angle);
@@ -352,7 +352,7 @@ public static void CreateRotationX(double angle, out Matrix4d result)
/// Builds a rotation matrix for a rotation around the x-axis.
/// </summary>
/// <param name="angle">The counter-clockwise angle in radians.</param>
- /// <returns>The resulting Matrix4 instance.</returns>
+ /// <returns>The resulting Matrix4d instance.</returns>
public static Matrix4d CreateRotationX(double angle)
{
Matrix4d result;
@@ -364,7 +364,7 @@ public static Matrix4d CreateRotationX(double angle)
/// Builds a rotation matrix for a rotation around the y-axis.
/// </summary>
/// <param name="angle">The counter-clockwise angle in radians.</param>
- /// <param name="result">The resulting Matrix4 instance.</param>
+ /// <param name="result">The resulting Matrix4d instance.</param>
public static void CreateRotationY(double angle, out Matrix4d result)
{
double cos = System.Math.Cos(angle);
@@ -380,7 +380,7 @@ public static void CreateRotationY(double angle, out Matrix4d result)
/// Builds a rotation matrix for a rotation around the y-axis.
/// </summary>
/// <param name="angle">The counter-clockwise angle in radians.</param>
- /// <returns>The resulting Matrix4 instance.</returns>
+ /// <returns>The resulting Matrix4d instance.</returns>
public static Matrix4d CreateRotationY(double angle)
{
Matrix4d result;
@@ -392,7 +392,7 @@ public static Matrix4d CreateRotationY(double angle)
/// Builds a rotation matrix for a rotation around the z-axis.
/// </summary>
/// <param name="angle">The counter-clockwise angle in radians.</param>
- /// <param name="result">The resulting Matrix4 instance.</param>
+ /// <param name="result">The resulting Matrix4d instance.</param>
public static void CreateRotationZ(double angle, out Matrix4d result)
{
double cos = System.Math.Cos(angle);
@@ -408,7 +408,7 @@ public static void CreateRotationZ(double angle, out Matrix4d result)
/// Builds a rotation matrix for a rotation around the z-axis.
/// </summary>
/// <param name="angle">The counter-clockwise angle in radians.</param>
- /// <returns>The resulting Matrix4 instance.</returns>
+ /// <returns>The resulting Matrix4d instance.</returns>
public static Matrix4d CreateRotationZ(double angle)
{
Matrix4d result;
@@ -1220,7 +1220,7 @@ public static void Transpose(ref Matrix4d mat, out Matrix4d result)
/// </summary>
/// <param name="left">left-hand operand</param>
/// <param name="right">right-hand operand</param>
- /// <returns>A new Matrix44 which holds the result of the multiplication</returns>
+ /// <returns>A new Matrix4d which holds the result of the multiplication</returns>
public static Matrix4d operator *(Matrix4d left, Matrix4d right)
{
return Matrix4d.Mult(left, right);
@@ -1302,7 +1302,7 @@ public override bool Equals(object obj)
#region IEquatable<Matrix4d> Members
/// <summary>Indicates whether the current matrix is equal to another matrix.</summary>
- /// <param name="other">An matrix to compare with this matrix.</param>
+ /// <param name="other">A matrix to compare with this matrix.</param>
/// <returns>true if the current matrix is equal to the matrix parameter; otherwise, false.</returns>
public bool Equals(Matrix4d other)
{
Please sign in to comment.
Something went wrong with that request. Please try again.