Пример #1
0
 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)));
 }
Пример #2
0
        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));
        }
Пример #3
0
 public static BlockWorldPos Add(BlockWorldPos pos, int x, int y, int z)
 {
     return(new BlockWorldPos(pos.X + x, pos.Y + y, pos.Z + z));
 }
Пример #4
0
 public static BlockWorldPos North(this BlockWorldPos pos, int offset)
 {
     return(new BlockWorldPos(pos.X, pos.Y, pos.Z - offset));
 }
Пример #5
0
 public static BlockWorldPos West(this BlockWorldPos pos, int offset)
 {
     return(new BlockWorldPos(pos.X - offset, pos.Y, pos.Z));
 }
Пример #6
0
 public static BlockWorldPos Up(this BlockWorldPos pos, int offset)
 {
     return(new BlockWorldPos(pos.X, pos.Y + offset, pos.Z));
 }
Пример #7
0
 public static BlockWorldPos North(this BlockWorldPos pos)
 {
     return(new BlockWorldPos(pos.X, pos.Y, pos.Z - 1));
 }
Пример #8
0
 public static BlockWorldPos West(this BlockWorldPos pos)
 {
     return(new BlockWorldPos(pos.X - 1, pos.Y, pos.Z));
 }
Пример #9
0
 public static BlockWorldPos South(this BlockWorldPos pos)
 {
     return(new BlockWorldPos(pos.X, pos.Y, pos.Z + 1));
 }
Пример #10
0
 public static BlockWorldPos Up(this BlockWorldPos pos)
 {
     return(new BlockWorldPos(pos.X, pos.Y + 1, pos.Z));
 }
Пример #11
0
 public static BlockWorldPos Down(this BlockWorldPos pos)
 {
     return(new BlockWorldPos(pos.X, pos.Y - 1, pos.Z));
 }