use #define for HexTile

This commit is contained in:
Josh Holtrop 2012-09-09 23:56:00 -04:00
parent 19b3a79f33
commit 433d702096
2 changed files with 8 additions and 6 deletions

View File

@ -6,12 +6,12 @@
/* points of a horizontal hexagon 2.0 units high */
static const float hex_points[][2] = {
{1.1547005383792517, 0.0},
{0.577350269189626, 1.0},
{-0.5773502691896256, 1.0},
{-1.1547005383792517, 0.0},
{-0.5773502691896264, -1.0},
{0.577350269189626, -1.0}
{HEX_WIDTH_TO_HEIGHT, 0.0},
{HEX_WIDTH_TO_HEIGHT / 2.0, 1.0},
{-HEX_WIDTH_TO_HEIGHT / 2.0, 1.0},
{-HEX_WIDTH_TO_HEIGHT, 0.0},
{-HEX_WIDTH_TO_HEIGHT / 2.0, -1.0},
{HEX_WIDTH_TO_HEIGHT / 2.0, -1.0}
};
HexTile::HexTile(float x, float y, float size)

View File

@ -2,6 +2,8 @@
#ifndef HEXTILE_H
#define HEXTILE_H
#define HEX_WIDTH_TO_HEIGHT 1.1547005383792517
class HexTile
{
public: