Table of Contents

Struct Float2

Namespace
TileWorld.Engine.Core.Math
Assembly
TileWorld.Engine.dll

Represents a two-dimensional floating-point vector in backend-neutral engine space.

public readonly record struct Float2 : IEquatable<Float2>
Implements
Inherited Members

Constructors

Float2(float, float)

Represents a two-dimensional floating-point vector in backend-neutral engine space.

public Float2(float X, float Y)

Parameters

X float
Y float

Properties

One

Gets the vector whose components are both one.

public static Float2 One { get; }

Property Value

Float2

X

public float X { get; init; }

Property Value

float

Y

public float Y { get; init; }

Property Value

float

Zero

Gets the zero vector.

public static Float2 Zero { get; }

Property Value

Float2

Methods

ToString()

Returns a culture-invariant string representation of the vector.

public override string ToString()

Returns

string

Operators

operator +(Float2, Float2)

Adds two vectors.

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

Parameters

left Float2
right Float2

Returns

Float2

operator /(Float2, float)

Divides a vector by a scalar.

public static Float2 operator /(Float2 value, float scalar)

Parameters

value Float2
scalar float

Returns

Float2

operator *(Float2, float)

Multiplies a vector by a scalar.

public static Float2 operator *(Float2 value, float scalar)

Parameters

value Float2
scalar float

Returns

Float2

operator -(Float2, Float2)

Subtracts two vectors.

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

Parameters

left Float2
right Float2

Returns

Float2