Ejemplo n.º 1
0
        public static Vector2 GetCenter(MinMaxVector2 blueprintCorners)
        {
            var size = GetSize(blueprintCorners);

            return(new Vector2(
                       blueprintCorners.minX + size.x / 2f,
                       blueprintCorners.minY + size.y / 2f));
        }
Ejemplo n.º 2
0
        public static MinMaxVector2 GetBlueprintCorners(Vector2[] cornerArray)
        {
            var blueprintCorners = new MinMaxVector2(0f, 0f, 0f, 0f);

            blueprintCorners.Apply(cornerArray);

            return(blueprintCorners);
        }
Ejemplo n.º 3
0
        public static MinMaxVector2 GetBlueprintCorners(BlueprintModel blueprint)
        {
            var blueprintCorners = new MinMaxVector2(0f, 0f, 0f, 0f);
            var corners          = GetCorners(blueprint);

            blueprintCorners.Apply(corners);

            return(blueprintCorners);
        }
Ejemplo n.º 4
0
        public static Vector2 GetSize(Vector2[] cornerArray)
        {
            var blueprintCorners = new MinMaxVector2(0f, 0f, 0f, 0f);

            blueprintCorners.Apply(cornerArray);

            return(new Vector2(
                       blueprintCorners.maxX - blueprintCorners.minX,
                       blueprintCorners.maxY - blueprintCorners.minY));
        }
Ejemplo n.º 5
0
        public static Vector2 GetSize(this BlueprintModel blueprint)
        {
            var blueprintCorners = new MinMaxVector2(0f, 0f, 0f, 0f);
            var corners          = GetCorners(blueprint);

            blueprintCorners.Apply(corners);

            return(new Vector2(
                       blueprintCorners.maxX - blueprintCorners.minX,
                       blueprintCorners.maxY - blueprintCorners.minY));
        }
Ejemplo n.º 6
0
 public static Vector2 GetSize(MinMaxVector2 blueprintCorners)
 {
     return(new Vector2(
                blueprintCorners.maxX - blueprintCorners.minX,
                blueprintCorners.maxY - blueprintCorners.minY));
 }