Struct FastVec2i
- Namespace
- Vintagestory.API.MathTools
- Assembly
- VintagestoryAPI.dll
Represents a vector of 2 ints. Go bug Tyron if you need more utility methods in this class.
[ProtoContract]
public struct FastVec2i : IEquatable<FastVec2i>
- Implements
- Inherited Members
- Extension Methods
Constructors
FastVec2i()
public FastVec2i()
FastVec2i(int, int)
public FastVec2i(int x, int y)
Parameters
FastVec2i(Vec3d)
public FastVec2i(Vec3d pos)
Parameters
pos
Vec3d
Fields
val
[ProtoMember(1)]
public ulong val
Field Value
Properties
this[int]
public int this[int index] { get; set; }
Parameters
index
int
Property Value
X
public int X { get; set; }
Property Value
Y
public int Y { get; set; }
Property Value
Zero
public static FastVec2i Zero { get; }
Property Value
Methods
Add(int, int)
public FastVec2i Add(int dx, int dy)
Parameters
Returns
Copy()
public FastVec2i Copy()
Returns
Equals(object)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object obj)
Parameters
obj
objectThe 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.
Equals(FastVec2i)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(FastVec2i other)
Parameters
other
FastVec2iAn object to compare with this object.
Returns
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.
ManhattenDistance(int, int)
public int ManhattenDistance(int x, int y)
Parameters
Returns
ManhattenDistance(Vec2i)
public int ManhattenDistance(Vec2i point)
Parameters
point
Vec2i
Returns
Set(int, int)
public FastVec2i Set(int x, int y)
Parameters
Returns
Set(Vec2i)
public FastVec2i Set(Vec2i vec)
Parameters
vec
Vec2i
Returns
ToChunkIndex()
27 lowest bits for X Coordinate, then 27 bits for Z coordinate
public ulong ToChunkIndex()
Returns
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
Operators
operator +(FastVec2i, int)
public static FastVec2i operator +(FastVec2i left, int right)
Parameters
Returns
operator +(FastVec2i, FastVec2i)
public static FastVec2i operator +(FastVec2i left, FastVec2i right)
Parameters
Returns
operator /(FastVec2i, int)
public static FastVec2i operator /(FastVec2i left, int right)
Parameters
Returns
operator /(FastVec2i, float)
public static FastVec2i operator /(FastVec2i left, float right)
Parameters
Returns
operator ==(FastVec2i, FastVec2i)
public static bool operator ==(FastVec2i left, FastVec2i right)
Parameters
Returns
operator !=(FastVec2i, FastVec2i)
public static bool operator !=(FastVec2i left, FastVec2i right)
Parameters
Returns
operator *(double, FastVec2i)
public static FastVec2i operator *(double left, FastVec2i right)
Parameters
Returns
operator *(int, FastVec2i)
public static FastVec2i operator *(int left, FastVec2i right)
Parameters
Returns
operator *(FastVec2i, double)
public static FastVec2i operator *(FastVec2i left, double right)
Parameters
Returns
operator *(FastVec2i, int)
public static FastVec2i operator *(FastVec2i left, int right)
Parameters
Returns
operator *(FastVec2i, FastVec2i)
public static double operator *(FastVec2i left, FastVec2i right)
Parameters
Returns
operator -(int, FastVec2i)
public static FastVec2i operator -(int left, FastVec2i right)
Parameters
Returns
operator -(FastVec2i, int)
public static FastVec2i operator -(FastVec2i left, int right)
Parameters
Returns
operator -(FastVec2i, FastVec2i)
public static FastVec2i operator -(FastVec2i left, FastVec2i right)