Added Xy and Xyz swizzle operators.

This commit is contained in:
the_fiddler 2009-02-13 19:51:35 +00:00
parent db690b144f
commit e187ed5a18
6 changed files with 52 additions and 0 deletions

View file

@ -1004,6 +1004,15 @@ namespace OpenTK.Math
#endregion
#region Swizzle
/// <summary>
/// Gets or sets an OpenTK.Math.Vector2 with the X and Y components of this instance.
/// </summary>
public Vector2 Xy { get { return new Vector2(X, Y); } set { X = value.X; Y = value.Y; } }
#endregion
#region Operators
public static Vector3 operator +(Vector3 left, Vector3 right)

Binary file not shown.

View file

@ -189,6 +189,15 @@ namespace OpenTK.Math
#endregion Constructors
#region Swizzle
/// <summary>
/// Gets or sets an OpenTK.Math.Vector2h with the X and Y components of this instance.
/// </summary>
public Vector2h Xy { get { return new Vector2h(X, Y); } set { X = value.X; Y = value.Y; } }
#endregion
#region Half -> Single
/// <summary>

View file

@ -827,8 +827,14 @@ namespace OpenTK.Math
#region Swizzle
/// <summary>
/// Gets or sets an OpenTK.Math.Vector2 with the X and Y components of this instance.
/// </summary>
public Vector2 Xy { get { return new Vector2(X, Y); } set { X = value.X; Y = value.Y; } }
/// <summary>
/// Gets or sets an OpenTK.Math.Vector3 with the X, Y and Z components of this instance.
/// </summary>
public Vector3 Xyz { get { return new Vector3(X, Y, Z); } set { X = value.X; Y = value.Y; Z = value.Z; } }
#endregion

View file

@ -822,6 +822,20 @@ namespace OpenTK.Math
#endregion
#region Swizzle
/// <summary>
/// Gets or sets an OpenTK.Math.Vector2d with the X and Y components of this instance.
/// </summary>
public Vector2d Xy { get { return new Vector2d(X, Y); } set { X = value.X; Y = value.Y; } }
/// <summary>
/// Gets or sets an OpenTK.Math.Vector3d with the X, Y and Z components of this instance.
/// </summary>
public Vector3d Xyz { get { return new Vector3d(X, Y, Z); } set { X = value.X; Y = value.Y; Z = value.Z; } }
#endregion
#region Operators
public static Vector4d operator +(Vector4d left, Vector4d right)

View file

@ -206,6 +206,20 @@ namespace OpenTK.Math
#endregion Constructors
#region Swizzle
/// <summary>
/// Gets or sets an OpenTK.Math.Vector2h with the X and Y components of this instance.
/// </summary>
public Vector2h Xy { get { return new Vector2h(X, Y); } set { X = value.X; Y = value.Y; } }
/// <summary>
/// Gets or sets an OpenTK.Math.Vector3h with the X, Y and Z components of this instance.
/// </summary>
public Vector3h Xyz { get { return new Vector3h(X, Y, Z); } set { X = value.X; Y = value.Y; Z = value.Z; } }
#endregion
#region Half -> Single
/// <summary>