private static bool IsInsideParallelogramXZ(PointyTriPoint point, int width, int height) { return (point.X >= 0 && point.X < width && point.Z >= 0 && point.Z < height); }
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; } } }
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); }
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); }