Merge branch 'master' of github.com:andykorth/opentk
authorRobert Rouhani <robert.rouhani@gmail.com>
Sat, 26 Jan 2013 21:29:23 +0000 (16:29 -0500)
committerRobert Rouhani <robert.rouhani@gmail.com>
Sat, 26 Jan 2013 21:29:23 +0000 (16:29 -0500)
Conflicts:
Source/OpenTK/Math/Matrix3.cs
Source/OpenTK/Math/Matrix3d.cs

1  2 
Source/OpenTK/Math/Matrix3.cs
Source/OpenTK/Math/Matrix3d.cs
Source/OpenTK/Math/Matrix4d.cs

index 74b346088c06f904e75fbb2c59c90b046e9f3b12,9278e32ba7a00acb775f609b92f3d5c1c4830003..af8b4d779a19ba8afe9467e36c201eea570168ba
@@@ -203,36 -188,14 +203,39 @@@ namespace OpenT
          public float M33 { get { return Row2.Z; } set { Row2.Z = value; } }
          
          #endregion
 -        
 +
 +        #region Indexers
 +
 +        /// <summary>
 +        /// Gets or sets the value at a specified row and column.
 +        /// </summary>
 +        public float this[int rowIndex, int columnIndex]
 +        {
 +            get
 +            {
 +                if (rowIndex == 0) return Row0[columnIndex];
 +                else if (rowIndex == 1) return Row1[columnIndex];
 +                else if (rowIndex == 2) return Row2[columnIndex];
 +                throw new IndexOutOfRangeException("You tried to access this matrix at: (" + rowIndex + ", " + columnIndex + ")");
 +            }
 +            set
 +            {
 +                if (rowIndex == 0) Row0[columnIndex] = value;
 +                else if (rowIndex == 1) Row1[columnIndex] = value;
 +                else if (rowIndex == 2) Row2[columnIndex] = value;
 +                throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
 +            }
 +        }
 +
 +        #endregion
 +
          #region Instance
 -        
 +
          #region public void Invert()
  
+         /// <summary>
+         /// Converts this instance into its inverse.
+         /// </summary>
          public void Invert()
          {
              this = Matrix3.Invert(this);
          {
              return new Matrix3(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 Matrix3 mat, out Matrix3 result)
          {
 -            result.Row0 = mat.Column0;
 -            result.Row1 = mat.Column1;
 -            result.Row2 = mat.Column2;
 +            result.Row0.X = mat.Row0.X;
 +            result.Row0.Y = mat.Row1.X;
 +            result.Row0.Z = mat.Row2.X;
 +            result.Row1.X = mat.Row0.Y;
 +            result.Row1.Y = mat.Row1.Y;
 +            result.Row1.Z = mat.Row2.Y;
 +            result.Row2.X = mat.Row0.Z;
 +            result.Row2.Y = mat.Row1.Z;
 +            result.Row2.Z = mat.Row2.Z;
          }
          
          #endregion
index d5657ba5db56cd39d49fd80fa37a2c5b059a96e3,d0ed5ba657d8ee1ade747e23b0f2d8b20239d015..7a7176666e4d6c805d39544d164ac60da4e2418e
@@@ -199,36 -188,14 +199,39 @@@ namespace OpenT
          public double M33 { get { return Row2.Z; } set { Row2.Z = value; } }
          
          #endregion
 -        
 +
 +        #region Indexers
 +
 +        /// <summary>
 +        /// Gets or sets the value at a specified row and column.
 +        /// </summary>
 +        public double this[int rowIndex, int columnIndex]
 +        {
 +            get
 +            {
 +                if (rowIndex == 0) return Row0[columnIndex];
 +                else if (rowIndex == 1) return Row1[columnIndex];
 +                else if (rowIndex == 2) return Row2[columnIndex];
 +                throw new IndexOutOfRangeException("You tried to access this matrix at: (" + rowIndex + ", " + columnIndex + ")");
 +            }
 +            set
 +            {
 +                if (rowIndex == 0) Row0[columnIndex] = value;
 +                else if (rowIndex == 1) Row1[columnIndex] = value;
 +                else if (rowIndex == 2) Row2[columnIndex] = value;
 +                throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
 +            }
 +        }
 +
 +        #endregion
 +
          #region Instance
 -        
 +
          #region public void Invert()
  
+         /// <summary>
+         /// Converts this instance into its inverse.
+         /// </summary>
          public void Invert()
          {
              this = Matrix3d.Invert(this);
Simple merge