Axiom.Math.Matrix4.Transpose C# (CSharp) Method

Transpose() public method

Swap the rows of the matrix with the columns.
public Transpose ( ) : Matrix4
return Matrix4
		public Matrix4 Transpose()
		{
			return new Matrix4( this.m00, this.m10, this.m20, this.m30,
				this.m01, this.m11, this.m21, this.m31,
				this.m02, this.m12, this.m22, this.m32,
				this.m03, this.m13, this.m23, this.m33 );
		}

Usage Example

		/// <summary>
		///    Sends a multiple value constant floating-point parameter to the program.
		/// </summary>
		/// <remarks>
		///     This method is made virtual to allow GpuProgramManagers, or even individual
		///     GpuProgram implementations to supply their own implementation if need be.
		///     An example would be where a Matrix needs to be transposed to row-major format
		///     before passing to the hardware.
		/// </remarks>
		/// <param name="index">Index of the contant register.</param>
		/// <param name="val">Structure containing 3 packed float values.</param>
		public void SetConstant( int index, Matrix4 val )
		{
			Matrix4 mat;

			// transpose the matrix if need be
			if ( transposeMatrices )
			{
				mat = val.Transpose();
			}
			else
			{
				mat = val;
			}

			SetConstant( index++, mat.m00, mat.m01, mat.m02, mat.m03 );
			SetConstant( index++, mat.m10, mat.m11, mat.m12, mat.m13 );
			SetConstant( index++, mat.m20, mat.m21, mat.m22, mat.m23 );
			SetConstant( index, mat.m30, mat.m31, mat.m32, mat.m33 );
		}
All Usage Examples Of Axiom.Math.Matrix4::Transpose