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