public override bool Equals(object obj) { if (obj == null || GetType() != obj.GetType()) { return(false); } VectorCube other = (VectorCube)obj; return((x == other.x) && (y == other.y) && (z == other.z)); }
public VectorHex(VectorCube vc) { VectorHex vx = vc.ToAxial(); Set(vx.q, vx.r); }
// given vc coordinates, respective coordinates in 2d plane will be calculated for the pointy orientation private Vector2 CubeToCart(VectorCube vc) { return(new Vector2(WIDTH_RATIO * tileSize * (vc.x - vc.y) / 2.0f, HEIGHT_RATIO * tileSize * -vc.z * 3f / 4f)); }
public VectorCube(VectorHex vx) { VectorCube vc = vx.ToCube(); Set(vc.x, vc.y, vc.z); }