/// <summary> /// Returns the center pixel of a hexagon /// </summary> public Vector2 HexToPixel() { HexagonAxial axial = ToAxial(); Vector2 pixel = axial.HexToPixel(); return(pixel); }
public HexagonAxial ToAxial() { float q = X; float r = Z; var axial = new HexagonAxial(q, r); return(axial); }
/// <summary> /// /// </summary> public bool IncludesPixel(Vector2 pixel) { //float q = pixel.X * Constants.TWO_THIRDS / Constants.HALF_HEX_WIDTH; //double r = (-pixel.X / 3.0f + Constants.HALF * pixel.Y) / Constants.HALF_HEX_HEIGHT; //var axial = new HexagonAxial(q, (float)r); HexagonAxial axial = pixel.PixelToHex(); axial = axial.Round(); return(axial.Q == Q && axial.R == R); }