Added new matrix constructors that take 16 distinct matrix elements.

This commit is contained in:
the_fiddler 2009-04-12 16:34:35 +00:00
parent c189bf7e75
commit dd84fddf19
2 changed files with 70 additions and 8 deletions

View file

@ -63,12 +63,12 @@ namespace OpenTK.Math
#region Constructors #region Constructors
/// <summary> /// <summary>
/// Construct a new matrix from 4 vectors representing each row /// Constructs a new instance.
/// </summary> /// </summary>
/// <param name="row0">Top row of the matrix</param> /// <param name="row0">Top row of the matrix</param>
/// <param name="row1">2nd row of the matrix</param> /// <param name="row1">Second row of the matrix</param>
/// <param name="row2">3rd row of the matrix</param> /// <param name="row2">Third row of the matrix</param>
/// <param name="row3">Bottom row of the matrix</param> /// <param name="row3">Bottom row of the matrix</param>
public Matrix4(Vector4 row0, Vector4 row1, Vector4 row2, Vector4 row3) public Matrix4(Vector4 row0, Vector4 row1, Vector4 row2, Vector4 row3)
{ {
Row0 = row0; Row0 = row0;
@ -77,6 +77,37 @@ namespace OpenTK.Math
Row3 = row3; Row3 = row3;
} }
/// <summary>
/// Constructs a new instance.
/// </summary>
/// <param name="m00">First item of the first row of the matrix.</param>
/// <param name="m01">Second item of the first row of the matrix.</param>
/// <param name="m02">Third item of the first row of the matrix.</param>
/// <param name="m03">Fourth item of the first row of the matrix.</param>
/// <param name="m10">First item of the second row of the matrix.</param>
/// <param name="m11">Second item of the second row of the matrix.</param>
/// <param name="m12">Third item of the second row of the matrix.</param>
/// <param name="m13">Fourth item of the second row of the matrix.</param>
/// <param name="m20">First item of the third row of the matrix.</param>
/// <param name="m21">Second item of the third row of the matrix.</param>
/// <param name="m22">Third item of the third row of the matrix.</param>
/// <param name="m23">First item of the third row of the matrix.</param>
/// <param name="m30">Fourth item of the fourth row of the matrix.</param>
/// <param name="m31">Second item of the fourth row of the matrix.</param>
/// <param name="m32">Third item of the fourth row of the matrix.</param>
/// <param name="m33">Fourth item of the fourth row of the matrix.</param>
public Matrix4(
float m00, float m01, float m02, float m03,
float m10, float m11, float m12, float m13,
float m20, float m21, float m22, float m23,
float m30, float m31, float m32, float m33)
{
Row0 = new Vector4(m00, m01, m02, m03);
Row1 = new Vector4(m10, m11, m12, m13);
Row2 = new Vector4(m20, m21, m22, m23);
Row3 = new Vector4(m30, m31, m32, m33);
}
#endregion #endregion
#region Public Members #region Public Members

View file

@ -63,11 +63,11 @@ namespace OpenTK.Math
#region Constructors #region Constructors
/// <summary> /// <summary>
/// Construct a new matrix from 4 vectors representing each row. /// Constructs a new instance.
/// </summary> /// </summary>
/// <param name="row0">Top row of the matrix</param> /// <param name="row0">Top row of the matrix</param>
/// <param name="row1">2nd row of the matrix</param> /// <param name="row1">Second row of the matrix</param>
/// <param name="row2">3rd row of the matrix</param> /// <param name="row2">Third row of the matrix</param>
/// <param name="row3">Bottom row of the matrix</param> /// <param name="row3">Bottom row of the matrix</param>
public Matrix4d(Vector4d row0, Vector4d row1, Vector4d row2, Vector4d row3) public Matrix4d(Vector4d row0, Vector4d row1, Vector4d row2, Vector4d row3)
{ {
@ -77,6 +77,37 @@ namespace OpenTK.Math
Row3 = row3; Row3 = row3;
} }
/// <summary>
/// Constructs a new instance.
/// </summary>
/// <param name="m00">First item of the first row.</param>
/// <param name="m01">Second item of the first row.</param>
/// <param name="m02">Third item of the first row.</param>
/// <param name="m03">Fourth item of the first row.</param>
/// <param name="m10">First item of the second row.</param>
/// <param name="m11">Second item of the second row.</param>
/// <param name="m12">Third item of the second row.</param>
/// <param name="m13">Fourth item of the second row.</param>
/// <param name="m20">First item of the third row.</param>
/// <param name="m21">Second item of the third row.</param>
/// <param name="m22">Third item of the third row.</param>
/// <param name="m23">First item of the third row.</param>
/// <param name="m30">Fourth item of the fourth row.</param>
/// <param name="m31">Second item of the fourth row.</param>
/// <param name="m32">Third item of the fourth row.</param>
/// <param name="m33">Fourth item of the fourth row.</param>
public Matrix4d(
float m00, float m01, float m02, float m03,
float m10, float m11, float m12, float m13,
float m20, float m21, float m22, float m23,
float m30, float m31, float m32, float m33)
{
Row0 = new Vector4d(m00, m01, m02, m03);
Row1 = new Vector4d(m10, m11, m12, m13);
Row2 = new Vector4d(m20, m21, m22, m23);
Row3 = new Vector4d(m30, m31, m32, m33);
}
#endregion #endregion
#region Public Members #region Public Members