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

                if (grid.Contains(triPoint))
                {
                    grid[triPoint].HighlightOn = !grid[triPoint].HighlightOn;
                }
            }
        }
Ejemplo n.º 3
0
        private static bool IsInsideLeftTriangle(PointyTriPoint point, int side)
        {
            if (point.Y >= side)
            {
                return(false);
            }
            if (point.X >= 0)
            {
                return(false);
            }
            if (point.Z > 0)
            {
                return(false);
            }

            //if ()

            return(true);
        }
Ejemplo n.º 4
0
        private static bool IsInsideRightTriangle(PointyTriPoint point, int side)
        {
            int y = 2 * (point.X + point.Y) + point.I;

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