// - edit Vector.swizzle.tt to modify
#nullable enable
namespace Brutal.Numerics;
public partial struct float2
{
///
/// Swizzle readonly getter/setter for the X and Y components of the vector.
///
[XmlIgnore]
public float2 XY
{
readonly get => this;
set => this = value;
}
///
/// Swizzle readonly getter/setter for the Y and X components of the vector.
///
[XmlIgnore]
public float2 YX
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
readonly get => new(Y, X);
set
{
Y = value.X;
X = value.Y;
}
}
}
public partial struct float2
{
///
/// The Red component of the vector (synonym for X).
///
[XmlIgnore]
public float R
{
readonly get => X;
set => X = value;
}
///
/// The Green component of the vector (synonym for Y).
///
[XmlIgnore]
public float G
{
readonly get => Y;
set => Y = value;
}
///
/// Swizzle readonly getter/setter for the Red and Green components of the vector.
///
[XmlIgnore]
public float2 RG
{
readonly get => this;
set => this = value;
}
///
/// Swizzle readonly getter/setter for the Green and Red components of the vector.
///
[XmlIgnore]
public float2 GR
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
readonly get => new(Y, X);
set
{
G = value.R;
R = value.G;
}
}
}