From adc4d1ae59b01dcbe2bb50031977179d273fef40 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Mon, 15 Nov 2010 22:34:52 +0000 Subject: [PATCH] Added 1-parameter constructors. --- Source/OpenTK/Math/Vector2.cs | 10 ++++++++++ Source/OpenTK/Math/Vector2d.cs | 10 ++++++++++ Source/OpenTK/Math/Vector2h.cs | 20 ++++++++++++++++++++ Source/OpenTK/Math/Vector3.cs | 11 +++++++++++ Source/OpenTK/Math/Vector3d.cs | 11 +++++++++++ Source/OpenTK/Math/Vector3h.cs | 22 ++++++++++++++++++++++ Source/OpenTK/Math/Vector4.cs | 12 ++++++++++++ Source/OpenTK/Math/Vector4d.cs | 12 ++++++++++++ Source/OpenTK/Math/Vector4h.cs | 24 ++++++++++++++++++++++++ 9 files changed, 132 insertions(+) diff --git a/Source/OpenTK/Math/Vector2.cs b/Source/OpenTK/Math/Vector2.cs index 5946fdd3..7c8dabf8 100644 --- a/Source/OpenTK/Math/Vector2.cs +++ b/Source/OpenTK/Math/Vector2.cs @@ -50,6 +50,16 @@ namespace OpenTK #region Constructors + /// + /// Constructs a new instance. + /// + /// The value that will initialize this instance. + public Vector2(float value) + { + X = value; + Y = value; + } + /// /// Constructs a new Vector2. /// diff --git a/Source/OpenTK/Math/Vector2d.cs b/Source/OpenTK/Math/Vector2d.cs index e0aae38e..5305a185 100644 --- a/Source/OpenTK/Math/Vector2d.cs +++ b/Source/OpenTK/Math/Vector2d.cs @@ -69,6 +69,16 @@ namespace OpenTK #region Constructors + /// + /// Constructs a new instance. + /// + /// The value that will initialize this instance. + public Vector2d(double value) + { + X = value; + Y = value; + } + /// Constructs left vector with the given coordinates. /// The X coordinate. /// The Y coordinate. diff --git a/Source/OpenTK/Math/Vector2h.cs b/Source/OpenTK/Math/Vector2h.cs index 28bc8e40..0ac6d509 100644 --- a/Source/OpenTK/Math/Vector2h.cs +++ b/Source/OpenTK/Math/Vector2h.cs @@ -46,6 +46,26 @@ namespace OpenTK #region Constructors + /// + /// Constructs a new instance. + /// + /// The value that will initialize this instance. + public Vector2h(Half value) + { + X = value; + Y = value; + } + + /// + /// Constructs a new instance. + /// + /// The value that will initialize this instance. + public Vector2h(Single value) + { + X = new Half(value); + Y = new Half(value); + } + /// /// The new Half2 instance will avoid conversion and copy directly from the Half parameters. /// diff --git a/Source/OpenTK/Math/Vector3.cs b/Source/OpenTK/Math/Vector3.cs index 9baa652e..f48d745b 100644 --- a/Source/OpenTK/Math/Vector3.cs +++ b/Source/OpenTK/Math/Vector3.cs @@ -58,6 +58,17 @@ namespace OpenTK #region Constructors + /// + /// Constructs a new instance. + /// + /// The value that will initialize this instance. + public Vector3(float value) + { + X = value; + Y = value; + Z = value; + } + /// /// Constructs a new Vector3. /// diff --git a/Source/OpenTK/Math/Vector3d.cs b/Source/OpenTK/Math/Vector3d.cs index bf2d60b9..cec1cbc8 100644 --- a/Source/OpenTK/Math/Vector3d.cs +++ b/Source/OpenTK/Math/Vector3d.cs @@ -56,6 +56,17 @@ namespace OpenTK #region Constructors + /// + /// Constructs a new instance. + /// + /// The value that will initialize this instance. + public Vector3d(double value) + { + X = value; + Y = value; + Z = value; + } + /// /// Constructs a new Vector3. /// diff --git a/Source/OpenTK/Math/Vector3h.cs b/Source/OpenTK/Math/Vector3h.cs index 973bbad8..7f417808 100644 --- a/Source/OpenTK/Math/Vector3h.cs +++ b/Source/OpenTK/Math/Vector3h.cs @@ -51,6 +51,28 @@ namespace OpenTK #region Constructors + /// + /// Constructs a new instance. + /// + /// The value that will initialize this instance. + public Vector3h(Half value) + { + X = value; + Y = value; + Z = value; + } + + /// + /// Constructs a new instance. + /// + /// The value that will initialize this instance. + public Vector3h(Single value) + { + X = new Half(value); + Y = new Half(value); + Z = new Half(value); + } + /// /// The new Half3 instance will avoid conversion and copy directly from the Half parameters. /// diff --git a/Source/OpenTK/Math/Vector4.cs b/Source/OpenTK/Math/Vector4.cs index f13a6fe0..29d771bd 100644 --- a/Source/OpenTK/Math/Vector4.cs +++ b/Source/OpenTK/Math/Vector4.cs @@ -96,6 +96,18 @@ namespace OpenTK #region Constructors + /// + /// Constructs a new instance. + /// + /// The value that will initialize this instance. + public Vector4(float value) + { + X = value; + Y = value; + Z = value; + W = value; + } + /// /// Constructs a new Vector4. /// diff --git a/Source/OpenTK/Math/Vector4d.cs b/Source/OpenTK/Math/Vector4d.cs index 246191d0..14bd402a 100644 --- a/Source/OpenTK/Math/Vector4d.cs +++ b/Source/OpenTK/Math/Vector4d.cs @@ -94,6 +94,18 @@ namespace OpenTK #region Constructors + /// + /// Constructs a new instance. + /// + /// The value that will initialize this instance. + public Vector4d(double value) + { + X = value; + Y = value; + Z = value; + W = value; + } + /// /// Constructs a new Vector4d. /// diff --git a/Source/OpenTK/Math/Vector4h.cs b/Source/OpenTK/Math/Vector4h.cs index 744c1436..4a7f83a6 100644 --- a/Source/OpenTK/Math/Vector4h.cs +++ b/Source/OpenTK/Math/Vector4h.cs @@ -54,6 +54,30 @@ namespace OpenTK #region Constructors + /// + /// Constructs a new instance. + /// + /// The value that will initialize this instance. + public Vector4h(Half value) + { + X = value; + Y = value; + Z = value; + W = value; + } + + /// + /// Constructs a new instance. + /// + /// The value that will initialize this instance. + public Vector4h(Single value) + { + X = new Half(value); + Y = new Half(value); + Z = new Half(value); + W = new Half(value); + } + /// /// The new Half4 instance will avoid conversion and copy directly from the Half parameters. ///