Struct FastVec3i
- Namespace
- Vintagestory.API.MathTools
- Assembly
- VintagestoryAPI.dll
Represents a vector of 3 ints, similar to a Vec3i or a BlockPos but this is a struct
public struct FastVec3i
- Inherited Members
- Extension Methods
Constructors
FastVec3i(int, int, int)
Create a new vector with given coordinates
public FastVec3i(int x, int y, int z)
Parameters
FastVec3i(int[])
Create a new vector with given coordinates
public FastVec3i(int[] values)
Parameters
values
int[]
FastVec3i(BlockPos)
Create a new vector with given coordinates
public FastVec3i(BlockPos pos)
Parameters
pos
BlockPos
FastVec3i(Vec3i)
public FastVec3i(Vec3i vec3i)
Parameters
vec3i
Vec3i
Fields
X
The X-Component of the vector
public int X
Field Value
Y
The Y-Component of the vector
public int Y
Field Value
Z
The Z-Component of the vector
public int Z
Field Value
Properties
B
Synonum for Z
public int B { get; set; }
Property Value
G
Synonum for Y
public int G { get; set; }
Property Value
this[int]
Returns the n-th coordinate
public int this[int index] { get; set; }
Parameters
index
int
Property Value
R
Synonum for X
public int R { get; set; }
Property Value
Methods
Add(int, int, int)
Adds given x/y/z coordinates to the vector
public FastVec3i Add(int x, int y, int z)
Parameters
Returns
AddCopy(FastVec3i)
Adds both vectors into a new vector. Both source vectors remain unchanged.
public FastVec3i AddCopy(FastVec3i vec)
Parameters
vec
FastVec3i
Returns
Clone()
Creates a copy of the vetor
public FastVec3i Clone()
Returns
CreateFromBytes(BinaryReader)
public static FastVec3i CreateFromBytes(BinaryReader reader)
Parameters
reader
BinaryReader
Returns
Distance(FastVec3i)
Calculates the distance the two endpoints
public float Distance(FastVec3i vec)
Parameters
vec
FastVec3i
Returns
Distance(Vec3d)
Calculates the distance the two endpoints
public float Distance(Vec3d vec)
Parameters
vec
Vec3d
Returns
DistanceSq(double, double, double)
Calculates the square distance the two endpoints
public double DistanceSq(double x, double y, double z)
Parameters
Returns
Equals(BlockPos)
public bool Equals(BlockPos other)
Parameters
other
BlockPos
Returns
Equals(FastVec3i)
public bool Equals(FastVec3i other)
Parameters
other
FastVec3i
Returns
Equals(Vec3i)
public bool Equals(Vec3i other)
Parameters
other
Vec3i
Returns
Length()
Returns the length of this vector
public float Length()
Returns
Mul(int)
Multiplies each coordinate with given multiplier
public FastVec3i Mul(int multiplier)
Parameters
multiplier
int
Returns
Negate()
public void Negate()
Set(int, int, int)
Sets the vector to this coordinates
public FastVec3i Set(int x, int y, int z)
Parameters
Returns
Set(int[])
public FastVec3i Set(int[] vec)
Parameters
vec
int[]
Returns
Set(FastVec3i)
Sets the vector to the coordinates of given vector
public void Set(FastVec3i vec)
Parameters
vec
FastVec3i
Set(Vec3d)
Sets the vector to the coordinates of given vector
public FastVec3i Set(Vec3d vec)
Parameters
vec
Vec3d
Returns
ToString()
Simple string represenation of the x/y/z components
public override string ToString()
Returns
ToVec3d()
Creates a new double precision vector with the same coordinates
public Vec3d ToVec3d()
Returns
Write(BinaryWriter)
public void Write(BinaryWriter writer)
Parameters
writer
BinaryWriter