예제 #1
0
 public static EntityChunkPos Clamp(EntityChunkPos value, EntityChunkPos max, EntityChunkPos min)
 {
     return(new EntityChunkPos(
                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(EntityChunkPos pos1, EntityChunkPos pos2)
        {
            float x = pos1.X - pos2.X;
            float y = pos1.Y - pos2.Y;
            float z = pos1.Z - pos2.Z;

            return(Math.Sqrt(x * x + y * y + z * z));
        }
예제 #3
0
 public static EntityChunkPos Add(EntityChunkPos pos, float x, float y, float z)
 {
     return(new EntityChunkPos(pos.X + x, pos.Y + y, pos.Z + z));
 }