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
FastVec2f(Size2i)
public FastVec2f(Size2i size)
Parameters
sizeSize2i
Fields
X
public float X
Field Value
Y
public float Y
Field Value
Zero
public static readonly FastVec2f Zero
Field Value
Properties
A
public float A { get; }
Property Value
B
public float B { get; }
Property Value
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
Methods
Distance(float, float, float, float)
public static float Distance(float x1, float y1, float x2, float y2)
Parameters
Returns
DistanceTo(float, float)
public float DistanceTo(float x, float y)
Parameters
Returns
DistanceTo(FastVec2f)
public float DistanceTo(FastVec2f p)
Parameters
Returns
Dot(FastVec2f, FastVec2f)
public static float Dot(FastVec2f a, FastVec2f b)
Parameters
Returns
Equals(object)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand 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
Length()
public float Length()
Returns
LengthSq()
public float LengthSq()
Returns
Normalize()
public FastVec2f Normalize()
Returns
Rotate(float)
public FastVec2f Rotate(float angleRad)
Parameters
angleRadfloat
Returns
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
Returns
operator +(FastVec2f, FastVec2f)
public static FastVec2f operator +(FastVec2f left, FastVec2f right)
Parameters
Returns
operator +(FastVec2f, Vec2i)
public static FastVec2f operator +(FastVec2f left, Vec2i right)
Parameters
Returns
operator /(FastVec2f, float)
public static FastVec2f operator /(FastVec2f left, float right)
Parameters
Returns
operator ==(FastVec2f, FastVec2f)
public static bool operator ==(FastVec2f left, FastVec2f right)
Parameters
Returns
operator !=(FastVec2f, FastVec2f)
public static bool operator !=(FastVec2f left, FastVec2f right)
Parameters
Returns
operator *(double, FastVec2f)
public static FastVec2f operator *(double left, FastVec2f right)
Parameters
Returns
operator *(float, FastVec2f)
public static FastVec2f operator *(float left, FastVec2f right)
Parameters
Returns
operator *(FastVec2f, double)
public static FastVec2f operator *(FastVec2f left, double right)
Parameters
Returns
operator *(FastVec2f, float)
public static FastVec2f operator *(FastVec2f left, float right)
Parameters
Returns
operator *(FastVec2f, FastVec2f)
public static double operator *(FastVec2f left, FastVec2f right)
Parameters
Returns
operator -(float, FastVec2f)
public static FastVec2f operator -(float left, FastVec2f right)
Parameters
Returns
operator -(FastVec2f, float)
public static FastVec2f operator -(FastVec2f left, float right)
Parameters
Returns
operator -(FastVec2f, FastVec2f)
public static FastVec2f operator -(FastVec2f left, FastVec2f right)