载入中...
搜索中...
未找到
GridConfig.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
12#include <string>
13
14namespace eve::grid {
15
19enum class StaggerAxis { X, Y };
21enum class StaggerIndex { Odd, Even };
22
28enum class GridPlane { XY, XZ };
29
35 GridLayout layout = GridLayout::Rectangle;
36 GridPlane plane = GridPlane::XY;
37 float cellW = 32.f;
38 float cellH = 32.f;
39 float cellGapX = 0.f;
40 float cellGapY = 0.f;
41 float originX = 0.f;
42 float originY = 0.f;
43 StaggerAxis staggerAxis = StaggerAxis::Y;
44 StaggerIndex staggerIndex = StaggerIndex::Odd;
45 float hexSideLength = 0.f;
46
48 static const char *layoutName(GridLayout l);
50 static GridLayout layoutFromName(const std::string &name);
52 static const char *planeName(GridPlane p);
54 static GridPlane planeFromName(const std::string &name);
55};
56
58inline float cellPitchX(const GridConfig &cfg) { return cfg.cellW + cfg.cellGapX; }
60inline float cellPitchY(const GridConfig &cfg) { return cfg.cellH + cfg.cellGapY; }
61
62} // namespace eve::grid
glm::vec4 p[6]
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Definition Export.h:106
std::string layout
std::string name
GridPlane
Placement plane for the second grid axis. XY maps the second axis to world Y (2D tilemaps / top-down)...
Definition GridConfig.h:28
StaggerAxis
Axis used for odd/even row or column offset in staggered layouts.
Definition GridConfig.h:19
GridLayout
Cell topology: rectangle, hex, isometric, or staggered variants.
Definition GridConfig.h:17
StaggerIndex
Whether odd or even indices along the stagger axis are offset.
Definition GridConfig.h:21
float cellPitchY(const GridConfig &cfg)
Effective cell pitch on Y including gap.
Definition GridConfig.h:60
float cellPitchX(const GridConfig &cfg)
Effective cell pitch on X including gap.
Definition GridConfig.h:58
Grid shape, cell metrics, origin, and placement plane. Pure data; use GridProjection helpers for worl...
Definition GridConfig.h:34