Example #1
0
 private static bool IsInsideParallelogramXZ(FlatTriPoint point, int width, int height)
 {
     return
         (point.X >= 0 &&
          point.X < width &&
          point.Z >= 0 &&
          point.Z < height);
 }
Example #2
0
    public void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            Vector2      worldPosition = GridBuilderUtils.ScreenToWorld(root, Input.mousePosition);
            FlatTriPoint triPoint      = map[worldPosition];

            if (grid.Contains(triPoint))
            {
                grid[triPoint].HighlightOn = !grid[triPoint].HighlightOn;
            }
        }
    }
Example #3
0
        private static bool IsInsideDownTriangle(FlatTriPoint point, int side)
        {
            if (point.X >= side)
            {
                return(false);
            }
            if (point.Y >= 0)
            {
                return(false);
            }
            if (point.Z > 0)
            {
                return(false);
            }

            //if ()

            return(true);
        }
Example #4
0
        private static bool IsInsideUpTriangle(FlatTriPoint point, int side)
        {
            int x = 2 * (point.X + point.Y) + point.I;

            return(point.X >= 0 && x < 2 * side - 1 && point.Y >= 0);
        }