Added 1-parameter constructors.

This commit is contained in:
the_fiddler 2010-11-15 22:34:52 +00:00
parent e91af6c70b
commit adc4d1ae59
9 changed files with 132 additions and 0 deletions

View file

@ -50,6 +50,16 @@ namespace OpenTK
#region Constructors
/// <summary>
/// Constructs a new instance.
/// </summary>
/// <param name="value">The value that will initialize this instance.</param>
public Vector2(float value)
{
X = value;
Y = value;
}
/// <summary>
/// Constructs a new Vector2.
/// </summary>

View file

@ -69,6 +69,16 @@ namespace OpenTK
#region Constructors
/// <summary>
/// Constructs a new instance.
/// </summary>
/// <param name="value">The value that will initialize this instance.</param>
public Vector2d(double value)
{
X = value;
Y = value;
}
/// <summary>Constructs left vector with the given coordinates.</summary>
/// <param name="x">The X coordinate.</param>
/// <param name="y">The Y coordinate.</param>

View file

@ -46,6 +46,26 @@ namespace OpenTK
#region Constructors
/// <summary>
/// Constructs a new instance.
/// </summary>
/// <param name="value">The value that will initialize this instance.</param>
public Vector2h(Half value)
{
X = value;
Y = value;
}
/// <summary>
/// Constructs a new instance.
/// </summary>
/// <param name="value">The value that will initialize this instance.</param>
public Vector2h(Single value)
{
X = new Half(value);
Y = new Half(value);
}
/// <summary>
/// The new Half2 instance will avoid conversion and copy directly from the Half parameters.
/// </summary>

View file

@ -58,6 +58,17 @@ namespace OpenTK
#region Constructors
/// <summary>
/// Constructs a new instance.
/// </summary>
/// <param name="value">The value that will initialize this instance.</param>
public Vector3(float value)
{
X = value;
Y = value;
Z = value;
}
/// <summary>
/// Constructs a new Vector3.
/// </summary>

View file

@ -56,6 +56,17 @@ namespace OpenTK
#region Constructors
/// <summary>
/// Constructs a new instance.
/// </summary>
/// <param name="value">The value that will initialize this instance.</param>
public Vector3d(double value)
{
X = value;
Y = value;
Z = value;
}
/// <summary>
/// Constructs a new Vector3.
/// </summary>

View file

@ -51,6 +51,28 @@ namespace OpenTK
#region Constructors
/// <summary>
/// Constructs a new instance.
/// </summary>
/// <param name="value">The value that will initialize this instance.</param>
public Vector3h(Half value)
{
X = value;
Y = value;
Z = value;
}
/// <summary>
/// Constructs a new instance.
/// </summary>
/// <param name="value">The value that will initialize this instance.</param>
public Vector3h(Single value)
{
X = new Half(value);
Y = new Half(value);
Z = new Half(value);
}
/// <summary>
/// The new Half3 instance will avoid conversion and copy directly from the Half parameters.
/// </summary>

View file

@ -96,6 +96,18 @@ namespace OpenTK
#region Constructors
/// <summary>
/// Constructs a new instance.
/// </summary>
/// <param name="value">The value that will initialize this instance.</param>
public Vector4(float value)
{
X = value;
Y = value;
Z = value;
W = value;
}
/// <summary>
/// Constructs a new Vector4.
/// </summary>

View file

@ -94,6 +94,18 @@ namespace OpenTK
#region Constructors
/// <summary>
/// Constructs a new instance.
/// </summary>
/// <param name="value">The value that will initialize this instance.</param>
public Vector4d(double value)
{
X = value;
Y = value;
Z = value;
W = value;
}
/// <summary>
/// Constructs a new Vector4d.
/// </summary>

View file

@ -54,6 +54,30 @@ namespace OpenTK
#region Constructors
/// <summary>
/// Constructs a new instance.
/// </summary>
/// <param name="value">The value that will initialize this instance.</param>
public Vector4h(Half value)
{
X = value;
Y = value;
Z = value;
W = value;
}
/// <summary>
/// Constructs a new instance.
/// </summary>
/// <param name="value">The value that will initialize this instance.</param>
public Vector4h(Single value)
{
X = new Half(value);
Y = new Half(value);
Z = new Half(value);
W = new Half(value);
}
/// <summary>
/// The new Half4 instance will avoid conversion and copy directly from the Half parameters.
/// </summary>