Table of Contents

Struct Float2

Namespace
Xui.GPU.Shaders.Types
Assembly
Xui.Core.dll

A 2-component vector of 32-bit floats.

public struct Float2
Inherited Members

Constructors

Float2(F32)

Initializes a new instance with both components set to the same value.

public Float2(F32 value)

Parameters

value F32

Float2(F32, F32)

Initializes a new instance of the Float2 struct.

public Float2(F32 x, F32 y)

Parameters

x F32
y F32

Fields

X

The X component.

public F32 X

Field Value

F32

Y

The Y component.

public F32 Y

Field Value

F32

Properties

One

Gets the one vector.

public static Float2 One { get; }

Property Value

Float2

XX

Gets the XX swizzle (X, X).

public readonly Float2 XX { get; }

Property Value

Float2

XY

Gets the XY swizzle (X, Y).

public readonly Float2 XY { get; }

Property Value

Float2

YX

Gets the YX swizzle (Y, X).

public readonly Float2 YX { get; }

Property Value

Float2

YY

Gets the YY swizzle (Y, Y).

public readonly Float2 YY { get; }

Property Value

Float2

Zero

Gets the zero vector.

public static Float2 Zero { get; }

Property Value

Float2

Methods

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

Operators

operator +(Float2, Float2)

Adds two vectors.

public static Float2 operator +(Float2 left, Float2 right)

Parameters

left Float2
right Float2

Returns

Float2

operator /(Float2, F32)

Divides a vector by a scalar.

public static Float2 operator /(Float2 left, F32 right)

Parameters

left Float2
right F32

Returns

Float2

operator /(Float2, Float2)

Divides two vectors component-wise.

public static Float2 operator /(Float2 left, Float2 right)

Parameters

left Float2
right Float2

Returns

Float2

implicit operator Float2(Point)

Implicitly converts from Point to Float2.

public static implicit operator Float2(Point point)

Parameters

point Point

Returns

Float2

implicit operator Float2(Size)

Implicitly converts from Size to Float2.

public static implicit operator Float2(Size size)

Parameters

size Size

Returns

Float2

implicit operator Float2(Vector)

Implicitly converts from Vector to Float2.

public static implicit operator Float2(Vector vector)

Parameters

vector Vector

Returns

Float2

operator *(F32, Float2)

Multiplies a scalar by a vector.

public static Float2 operator *(F32 left, Float2 right)

Parameters

left F32
right Float2

Returns

Float2

operator *(Float2, F32)

Multiplies a vector by a scalar.

public static Float2 operator *(Float2 left, F32 right)

Parameters

left Float2
right F32

Returns

Float2

operator *(Float2, Float2)

Multiplies two vectors component-wise.

public static Float2 operator *(Float2 left, Float2 right)

Parameters

left Float2
right Float2

Returns

Float2

operator -(Float2, Float2)

Subtracts two vectors.

public static Float2 operator -(Float2 left, Float2 right)

Parameters

left Float2
right Float2

Returns

Float2

operator -(Float2)

Negates a vector.

public static Float2 operator -(Float2 value)

Parameters

value Float2

Returns

Float2