Documented static public fields.

Added missing SizeInBytes field to Vector2 and Vector4.
This commit is contained in:
the_fiddler 2008-11-15 21:36:46 +00:00
parent 39d1bea45f
commit 57ff9428d6
3 changed files with 59 additions and 1 deletions

View file

@ -35,10 +35,26 @@ namespace OpenTK.Math
/// </summary>
public float Y;
/// <summary>
/// Defines a unit-length Vector2 that points towards the X-axis.
/// </summary>
public static Vector2 UnitX = new Vector2(1, 0);
/// <summary>
/// Defines a unit-length Vector2 that points towards the Y-axis.
/// </summary>
public static Vector2 UnitY = new Vector2(0, 1);
/// <summary>
/// Defines a zero-length Vector2.
/// </summary>
public static Vector2 Zero = new Vector2(0, 0);
/// <summary>
/// Defines the size of the Vector2 struct in bytes.
/// </summary>
public static readonly int SizeInBytes = Marshal.SizeOf(new Vector2());
#endregion
#region Constructors

View file

@ -37,11 +37,29 @@ namespace OpenTK.Math
/// </summary>
public float Z;
/// <summary>
/// Defines a unit-length Vector3 that points towards the X-axis.
/// </summary>
public static readonly Vector3 UnitX = new Vector3(1, 0, 0);
/// <summary>
/// Defines a unit-length Vector3 that points towards the Y-axis.
/// </summary>
public static readonly Vector3 UnitY = new Vector3(0, 1, 0);
/// <summary>
/// /// Defines a unit-length Vector3 that points towards the Z-axis.
/// </summary>
public static readonly Vector3 UnitZ = new Vector3(0, 0, 1);
/// <summary>
/// Defines a zero-length Vector3.
/// </summary>
public static readonly Vector3 Zero = new Vector3(0, 0, 0);
/// <summary>
/// Defines the size of the Vector3 struct in bytes.
/// </summary>
public static readonly int SizeInBytes = Marshal.SizeOf(new Vector3());
#endregion

View file

@ -42,12 +42,36 @@ namespace OpenTK.Math
/// </summary>
public float W;
/// <summary>
/// Defines a unit-length Vector4 that points towards the X-axis.
/// </summary>
public static Vector4 UnitX = new Vector4(1, 0, 0, 0);
public static Vector4 UnitY = new Vector4(0, 1, 0, 0);
/// <summary>
/// Defines a unit-length Vector4 that points towards the Y-axis.
/// </summary>
public static Vector4 UnitY = new Vector4(0, 1, 0, 0);
/// <summary>
/// Defines a unit-length Vector4 that points towards the Z-axis.
/// </summary>
public static Vector4 UnitZ = new Vector4(0, 0, 1, 0);
/// <summary>
/// Defines a unit-length Vector4 that points towards the W-axis.
/// </summary>
public static Vector4 UnitW = new Vector4(0, 0, 0, 1);
/// <summary>
/// Defines a zero-length Vector4.
/// </summary>
public static Vector4 Zero = new Vector4(0, 0, 0, 0);
/// <summary>
/// Defines the size of the Vector4 struct in bytes.
/// </summary>
public static readonly int SizeInBytes = Marshal.SizeOf(new Vector4());
#endregion
#region Constructors