Exemple #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)));
 }
Exemple #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));
        }
Exemple #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));
 }
Exemple #4
0
 public static BlockWorldPos North(this BlockWorldPos pos, int offset)
 {
     return(new BlockWorldPos(pos.X, pos.Y, pos.Z - offset));
 }
Exemple #5
0
 public static BlockWorldPos West(this BlockWorldPos pos, int offset)
 {
     return(new BlockWorldPos(pos.X - offset, pos.Y, pos.Z));
 }
Exemple #6
0
 public static BlockWorldPos Up(this BlockWorldPos pos, int offset)
 {
     return(new BlockWorldPos(pos.X, pos.Y + offset, pos.Z));
 }
Exemple #7
0
 public static BlockWorldPos North(this BlockWorldPos pos)
 {
     return(new BlockWorldPos(pos.X, pos.Y, pos.Z - 1));
 }
Exemple #8
0
 public static BlockWorldPos West(this BlockWorldPos pos)
 {
     return(new BlockWorldPos(pos.X - 1, pos.Y, pos.Z));
 }
Exemple #9
0
 public static BlockWorldPos South(this BlockWorldPos pos)
 {
     return(new BlockWorldPos(pos.X, pos.Y, pos.Z + 1));
 }
Exemple #10
0
 public static BlockWorldPos Up(this BlockWorldPos pos)
 {
     return(new BlockWorldPos(pos.X, pos.Y + 1, pos.Z));
 }
Exemple #11
0
 public static BlockWorldPos Down(this BlockWorldPos pos)
 {
     return(new BlockWorldPos(pos.X, pos.Y - 1, pos.Z));
 }