Class HexGrid

Inheritance Relationships

Base Type

  • public Node3D

Derived Types

Class Documentation

class HexGrid : public Node3D

Subclassed by sota::HexagonalHexGrid, sota::Honeycomb, sota::RectHexGrid, sota::RidgeHexGrid

Public Functions

HexGrid() = default
void set_shader(const Ref<Shader> p_shader)
Ref<Shader> get_shader() const
void set_divisions(const int p_divisions)
int get_divisions() const
void set_diameter(const float p_diameter)
float get_diameter() const
void set_frame_state(const bool p_state)
bool get_frame_state() const
void set_frame_offset(const float p_offset)
float get_frame_offset() const
virtual int calculate_id(int row, int col) const = 0
inline virtual void calculate_normals()
Array get_hex_meshes()

Protected Functions

virtual void init()
virtual void init_col_row_layout() = 0
virtual void make_tiles()

Protected Attributes

float _diameter = {1}
int _divisions = {3}
Ref<Shader> _shader
std::vector<std::vector<Vector3i>> _col_row_layout
TilesLayout _tiles_layout
std::map<CubeCoordinates, TileMesh*> _cube_coord_to_tile_mesh
bool _frame_state = {false}
float _frame_offset = {0.0}

Protected Static Functions

static void _bind_methods()