From 57ff9428d6e645208eca07c760304a91bead73ae Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Sat, 15 Nov 2008 21:36:46 +0000 Subject: [PATCH] Documented static public fields. Added missing SizeInBytes field to Vector2 and Vector4. --- Source/OpenTK/Math/Vector2.cs | 16 ++++++++++++++++ Source/OpenTK/Math/Vector3.cs | 18 ++++++++++++++++++ Source/OpenTK/Math/Vector4.cs | 26 +++++++++++++++++++++++++- 3 files changed, 59 insertions(+), 1 deletion(-) diff --git a/Source/OpenTK/Math/Vector2.cs b/Source/OpenTK/Math/Vector2.cs index 59f888f1..0af1ce9f 100644 --- a/Source/OpenTK/Math/Vector2.cs +++ b/Source/OpenTK/Math/Vector2.cs @@ -35,10 +35,26 @@ namespace OpenTK.Math /// public float Y; + /// + /// Defines a unit-length Vector2 that points towards the X-axis. + /// public static Vector2 UnitX = new Vector2(1, 0); + + /// + /// Defines a unit-length Vector2 that points towards the Y-axis. + /// public static Vector2 UnitY = new Vector2(0, 1); + + /// + /// Defines a zero-length Vector2. + /// public static Vector2 Zero = new Vector2(0, 0); + /// + /// Defines the size of the Vector2 struct in bytes. + /// + public static readonly int SizeInBytes = Marshal.SizeOf(new Vector2()); + #endregion #region Constructors diff --git a/Source/OpenTK/Math/Vector3.cs b/Source/OpenTK/Math/Vector3.cs index 47fedf3e..d62b2835 100644 --- a/Source/OpenTK/Math/Vector3.cs +++ b/Source/OpenTK/Math/Vector3.cs @@ -37,11 +37,29 @@ namespace OpenTK.Math /// public float Z; + /// + /// Defines a unit-length Vector3 that points towards the X-axis. + /// public static readonly Vector3 UnitX = new Vector3(1, 0, 0); + + /// + /// Defines a unit-length Vector3 that points towards the Y-axis. + /// public static readonly Vector3 UnitY = new Vector3(0, 1, 0); + + /// + /// /// Defines a unit-length Vector3 that points towards the Z-axis. + /// public static readonly Vector3 UnitZ = new Vector3(0, 0, 1); + + /// + /// Defines a zero-length Vector3. + /// public static readonly Vector3 Zero = new Vector3(0, 0, 0); + /// + /// Defines the size of the Vector3 struct in bytes. + /// public static readonly int SizeInBytes = Marshal.SizeOf(new Vector3()); #endregion diff --git a/Source/OpenTK/Math/Vector4.cs b/Source/OpenTK/Math/Vector4.cs index 086236b3..2227c8ba 100644 --- a/Source/OpenTK/Math/Vector4.cs +++ b/Source/OpenTK/Math/Vector4.cs @@ -42,12 +42,36 @@ namespace OpenTK.Math /// public float W; + /// + /// Defines a unit-length Vector4 that points towards the X-axis. + /// public static Vector4 UnitX = new Vector4(1, 0, 0, 0); - public static Vector4 UnitY = new Vector4(0, 1, 0, 0); + + /// + /// Defines a unit-length Vector4 that points towards the Y-axis. + /// + public static Vector4 UnitY = new Vector4(0, 1, 0, 0); + + /// + /// Defines a unit-length Vector4 that points towards the Z-axis. + /// public static Vector4 UnitZ = new Vector4(0, 0, 1, 0); + + /// + /// Defines a unit-length Vector4 that points towards the W-axis. + /// public static Vector4 UnitW = new Vector4(0, 0, 0, 1); + + /// + /// Defines a zero-length Vector4. + /// public static Vector4 Zero = new Vector4(0, 0, 0, 0); + /// + /// Defines the size of the Vector4 struct in bytes. + /// + public static readonly int SizeInBytes = Marshal.SizeOf(new Vector4()); + #endregion #region Constructors