Class Vec2f
- Namespace
- Vintagestory.API.MathTools
- Assembly
- VintagestoryAPI.dll
Represents a vector of 2 floats. Go bug Tyron of you need more utility methods in this class.
[JsonObject(MemberSerialization.OptIn)]
[ProtoContract]
public class Vec2f
- Inheritance
-
Vec2f
- Derived
- Inherited Members
- Extension Methods
Constructors
Vec2f()
public Vec2f()
Vec2f(float, float)
public Vec2f(float x, float y)
Parameters
Vec2f(Size2i)
public Vec2f(Size2i size)
Parameters
size
Size2i
Fields
X
The X element of the vector.
[JsonProperty]
[ProtoMember(1)]
public float X
Field Value
Y
The Y element of the vector.
[JsonProperty]
[ProtoMember(2)]
public float Y
Field Value
Zero
public static readonly Vec2f Zero
Field Value
Properties
A
public float A { get; }
Property Value
B
public float B { get; }
Property Value
Methods
Clone()
public Vec2f Clone()
Returns
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
Equals(object)
Determines whether the specified object is equal to the current object.
public override bool Equals(object obj)
Parameters
obj
objectThe object to compare with the current object.
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
Length()
public float Length()
Returns
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
Operators
operator +(Vec2f, float)
public static Vec2f operator +(Vec2f left, float right)
Parameters
Returns
operator +(Vec2f, Vec2f)
public static Vec2f operator +(Vec2f left, Vec2f right)
Parameters
Returns
operator +(Vec2f, Vec2i)
public static Vec2f operator +(Vec2f left, Vec2i right)
Parameters
Returns
operator /(Vec2f, float)
public static Vec2f operator /(Vec2f left, float right)
Parameters
Returns
operator ==(Vec2f, Vec2f)
public static bool operator ==(Vec2f left, Vec2f right)
Parameters
Returns
operator !=(Vec2f, Vec2f)
public static bool operator !=(Vec2f left, Vec2f right)
Parameters
Returns
operator *(double, Vec2f)
public static Vec2f operator *(double left, Vec2f right)
Parameters
Returns
operator *(float, Vec2f)
public static Vec2f operator *(float left, Vec2f right)
Parameters
Returns
operator *(Vec2f, double)
public static Vec2f operator *(Vec2f left, double right)
Parameters
Returns
operator *(Vec2f, float)
public static Vec2f operator *(Vec2f left, float right)
Parameters
Returns
operator *(Vec2f, Vec2f)
public static double operator *(Vec2f left, Vec2f right)
Parameters
Returns
operator -(float, Vec2f)
public static Vec2f operator -(float left, Vec2f right)
Parameters
Returns
operator -(Vec2f, float)
public static Vec2f operator -(Vec2f left, float right)
Parameters
Returns
operator -(Vec2f, Vec2f)
public static Vec2f operator -(Vec2f left, Vec2f right)