Table of Contents

Struct FastVec2f

Namespace
Vintagestory.API.MathTools
Assembly
VintagestoryAPI.dll
public struct FastVec2f
Inherited Members
Extension Methods

Constructors

FastVec2f()

public FastVec2f()

FastVec2f(float, float)

public FastVec2f(float x, float y)

Parameters

x float
y float

FastVec2f(Size2i)

public FastVec2f(Size2i size)

Parameters

size Size2i

Fields

X

public float X

Field Value

float

Y

public float Y

Field Value

float

Zero

public static readonly FastVec2f Zero

Field Value

FastVec2f

Properties

A

public float A { get; }

Property Value

float

B

public float B { get; }

Property Value

float

Z

Identical to .Y - optionally, you can use .Z instead for code readability if the vector represents X,Z values

public float Z { get; }

Property Value

float

Methods

Distance(float, float, float, float)

public static float Distance(float x1, float y1, float x2, float y2)

Parameters

x1 float
y1 float
x2 float
y2 float

Returns

float

DistanceTo(float, float)

public float DistanceTo(float x, float y)

Parameters

x float
y float

Returns

float

DistanceTo(FastVec2f)

public float DistanceTo(FastVec2f p)

Parameters

p FastVec2f

Returns

float

Dot(FastVec2f, FastVec2f)

public static float Dot(FastVec2f a, FastVec2f b)

Parameters

a FastVec2f
b FastVec2f

Returns

float

Equals(object)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

LeftNormal()

public FastVec2f LeftNormal()

Returns

FastVec2f

Length()

public float Length()

Returns

float

LengthSq()

public float LengthSq()

Returns

float

Normalize()

public FastVec2f Normalize()

Returns

FastVec2f

Rotate(float)

public FastVec2f Rotate(float angleRad)

Parameters

angleRad float

Returns

FastVec2f

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

Operators

operator +(FastVec2f, float)

public static FastVec2f operator +(FastVec2f left, float right)

Parameters

left FastVec2f
right float

Returns

FastVec2f

operator +(FastVec2f, FastVec2f)

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

Parameters

left FastVec2f
right FastVec2f

Returns

FastVec2f

operator +(FastVec2f, Vec2i)

public static FastVec2f operator +(FastVec2f left, Vec2i right)

Parameters

left FastVec2f
right Vec2i

Returns

FastVec2f

operator /(FastVec2f, float)

public static FastVec2f operator /(FastVec2f left, float right)

Parameters

left FastVec2f
right float

Returns

FastVec2f

operator ==(FastVec2f, FastVec2f)

public static bool operator ==(FastVec2f left, FastVec2f right)

Parameters

left FastVec2f
right FastVec2f

Returns

bool

operator !=(FastVec2f, FastVec2f)

public static bool operator !=(FastVec2f left, FastVec2f right)

Parameters

left FastVec2f
right FastVec2f

Returns

bool

operator *(double, FastVec2f)

public static FastVec2f operator *(double left, FastVec2f right)

Parameters

left double
right FastVec2f

Returns

FastVec2f

operator *(float, FastVec2f)

public static FastVec2f operator *(float left, FastVec2f right)

Parameters

left float
right FastVec2f

Returns

FastVec2f

operator *(FastVec2f, double)

public static FastVec2f operator *(FastVec2f left, double right)

Parameters

left FastVec2f
right double

Returns

FastVec2f

operator *(FastVec2f, float)

public static FastVec2f operator *(FastVec2f left, float right)

Parameters

left FastVec2f
right float

Returns

FastVec2f

operator *(FastVec2f, FastVec2f)

public static double operator *(FastVec2f left, FastVec2f right)

Parameters

left FastVec2f
right FastVec2f

Returns

double

operator -(float, FastVec2f)

public static FastVec2f operator -(float left, FastVec2f right)

Parameters

left float
right FastVec2f

Returns

FastVec2f

operator -(FastVec2f, float)

public static FastVec2f operator -(FastVec2f left, float right)

Parameters

left FastVec2f
right float

Returns

FastVec2f

operator -(FastVec2f, FastVec2f)

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

Parameters

left FastVec2f
right FastVec2f

Returns

FastVec2f