载入中...
搜索中...
未找到
eve::grid 命名空间参考

类

struct  GridConfig
 Grid shape, cell metrics, origin, and placement plane. Pure data; use GridProjection helpers for world/cell conversion. 更多...
 

枚举

enum class  GridLayout {
  Rectangle , Hexagon , Isometric , Staggered ,
  IsometricZAsY
}
 Cell topology: rectangle, hex, isometric, or staggered variants. 更多...
 
enum class  StaggerAxis { X , Y }
 Axis used for odd/even row or column offset in staggered layouts. 更多...
 
enum class  StaggerIndex { Odd , Even }
 Whether odd or even indices along the stagger axis are offset. 更多...
 
enum class  GridPlane { XY , XZ }
 Placement plane for the second grid axis. XY maps the second axis to world Y (2D tilemaps / top-down). XZ maps the second axis to world Z with world Y as height (3D ground grids). 更多...
 

函数

float cellPitchX (const GridConfig &cfg)
 Effective cell pitch on X including gap.
 
float cellPitchY (const GridConfig &cfg)
 Effective cell pitch on Y including gap.
 
void cellToWorld (const GridConfig &cfg, int cx, int cy, float &px, float &py)
 Maps a cell to planar coordinates (px, py). On XY plane these are world (x, y); on XZ plane they are world (x, z).
 
float cellToDepthY (const GridConfig &cfg, int cx, int cy)
 2D sort key (cell foot Y), matching map::tileToDepthY semantics. Unused on the XZ plane.
 
void worldToCell (const GridConfig &cfg, float px, float py, int &cx, int &cy, int mapW=1, int mapH=1)
 Maps planar coordinates to the nearest cell. Staggered/hex layouts use a bounded nearest-neighbor search; mapW/mapH bound the search range (Tiled-compatible pick semantics).
 
void foreachRotatedFootprint (int w, int h, const std::vector< uint8_t > &mask, int steps, bool hexMode, const std::function< void(int lx, int ly)> &fn)
 Enumerates local cells of a rotated footprint.
 
void rotatedFootprintSize (int w, int h, const std::vector< uint8_t > &mask, int steps, bool hexMode, int &outW, int &outH)
 Axis-aligned size of a footprint after rotation.
 

枚举类型说明

◆ GridLayout

enum class eve::grid::GridLayout
strong

Cell topology: rectangle, hex, isometric, or staggered variants.

枚举值
Rectangle 
Hexagon 
Isometric 
Staggered 
IsometricZAsY 

在文件 GridConfig.h 第 17 行定义.

◆ GridPlane

enum class eve::grid::GridPlane
strong

Placement plane for the second grid axis. XY maps the second axis to world Y (2D tilemaps / top-down). XZ maps the second axis to world Z with world Y as height (3D ground grids).

枚举值
XY 
XZ 

在文件 GridConfig.h 第 28 行定义.

◆ StaggerAxis

enum class eve::grid::StaggerAxis
strong

Axis used for odd/even row or column offset in staggered layouts.

枚举值
X 
Y 

在文件 GridConfig.h 第 19 行定义.

◆ StaggerIndex

enum class eve::grid::StaggerIndex
strong

Whether odd or even indices along the stagger axis are offset.

枚举值
Odd 
Even 

在文件 GridConfig.h 第 21 行定义.

函数说明

◆ cellPitchX()

float eve::grid::cellPitchX ( const GridConfig &  cfg)
inline

Effective cell pitch on X including gap.

在文件 GridConfig.h 第 58 行定义.

引用了 eve::grid::GridConfig::cellGapX , 以及 eve::grid::GridConfig::cellW.

被这些函数引用 cellToWorld() , 以及 worldToCell().

◆ cellPitchY()

float eve::grid::cellPitchY ( const GridConfig &  cfg)
inline

Effective cell pitch on Y including gap.

在文件 GridConfig.h 第 60 行定义.

引用了 eve::grid::GridConfig::cellGapY , 以及 eve::grid::GridConfig::cellH.

被这些函数引用 cellToWorld() , 以及 worldToCell().

◆ cellToDepthY()

EVENGINE_API_FOUNDATION float eve::grid::cellToDepthY ( const GridConfig &  cfg,
int  cx,
int  cy 
)

2D sort key (cell foot Y), matching map::tileToDepthY semantics. Unused on the XZ plane.

在文件 GridProjection.cpp 第 63 行定义.

引用了 eve::grid::GridConfig::cellH, cellToWorld(), cx, cy, px , 以及 py.

被这些函数引用 eve::map::tileToDepthY().

◆ cellToWorld()

◆ foreachRotatedFootprint()

EVENGINE_API_FOUNDATION void eve::grid::foreachRotatedFootprint ( int  w,
int  h,
const std::vector< uint8_t > &  mask,
int  steps,
bool  hexMode,
const std::function< void(int lx, int ly)> &  fn 
)

Enumerates local cells of a rotated footprint.

参数
maskRow-major w*h occupancy (empty = solid rectangle).
stepsCardinal: 90° steps (0..3); hexMode: 60° steps (0..5). Callback receives normalized local coords (bbox min corner at origin, anchor at origin cell).

在文件 GridProjection.cpp 第 121 行定义.

引用了 c, fn, h, idx, mask, nx, ny, nz, q, s, steps, w, x, y , 以及 z.

被这些函数引用 eve::building::PlacementSystem::foreachFootprintCell() , 以及 rotatedFootprintSize().

◆ rotatedFootprintSize()

EVENGINE_API_FOUNDATION void eve::grid::rotatedFootprintSize ( int  w,
int  h,
const std::vector< uint8_t > &  mask,
int  steps,
bool  hexMode,
int &  outW,
int &  outH 
)

Axis-aligned size of a footprint after rotation.

在文件 GridProjection.cpp 第 187 行定义.

引用了 foreachRotatedFootprint(), h, mask, steps , 以及 w.

被这些函数引用 eve::building::PlacementSystem::effectiveFootprint().

◆ worldToCell()