public static BlockWorldPos Clamp(BlockWorldPos value, BlockWorldPos max, BlockWorldPos min) { return(new BlockWorldPos( Clamp(value.X, max.X, min.X), Clamp(value.Y, max.Y, min.Y), Clamp(value.Z, max.Z, min.Z))); }
public static double Distance(BlockWorldPos pos1, BlockWorldPos pos2) { int x = pos1.X - pos2.X; int y = pos1.Y - pos2.Y; int z = pos1.Z - pos2.Z; return(Math.Sqrt(x * x + y * y + z * z)); }
public static BlockWorldPos Add(BlockWorldPos pos, int x, int y, int z) { return(new BlockWorldPos(pos.X + x, pos.Y + y, pos.Z + z)); }
public static BlockWorldPos North(this BlockWorldPos pos, int offset) { return(new BlockWorldPos(pos.X, pos.Y, pos.Z - offset)); }
public static BlockWorldPos West(this BlockWorldPos pos, int offset) { return(new BlockWorldPos(pos.X - offset, pos.Y, pos.Z)); }
public static BlockWorldPos Up(this BlockWorldPos pos, int offset) { return(new BlockWorldPos(pos.X, pos.Y + offset, pos.Z)); }
public static BlockWorldPos North(this BlockWorldPos pos) { return(new BlockWorldPos(pos.X, pos.Y, pos.Z - 1)); }
public static BlockWorldPos West(this BlockWorldPos pos) { return(new BlockWorldPos(pos.X - 1, pos.Y, pos.Z)); }
public static BlockWorldPos South(this BlockWorldPos pos) { return(new BlockWorldPos(pos.X, pos.Y, pos.Z + 1)); }
public static BlockWorldPos Up(this BlockWorldPos pos) { return(new BlockWorldPos(pos.X, pos.Y + 1, pos.Z)); }
public static BlockWorldPos Down(this BlockWorldPos pos) { return(new BlockWorldPos(pos.X, pos.Y - 1, pos.Z)); }