载入中...
搜索中...
未找到
GridProjection.cpp
浏览该文件的文档.
Pure cell/world projection helpers for GridConfig.
Definition PlacementWorld.h:23
void worldToCell(const GridConfig &cfg, float px, float py, int &cx, int &cy, int mapW, int mapH)
Maps planar coordinates to the nearest cell. Staggered/hex layouts use a bounded nearest-neighbor sea...
Definition GridProjection.cpp:69
float cellToDepthY(const GridConfig &cfg, int cx, int cy)
2D sort key (cell foot Y), matching map::tileToDepthY semantics. Unused on the XZ plane.
Definition GridProjection.cpp:63
@ Hexagon
@ Isometric
@ Rectangle
@ IsometricZAsY
@ Staggered
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 ...
Definition GridProjection.cpp:30
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.
Definition GridProjection.cpp:187
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
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.
Definition GridProjection.cpp:121
WidgetDesc row(std::vector< WidgetDesc > children, std::string id)
Horizontal elastic layout row.
Definition Widget.cpp:679
Grid shape, cell metrics, origin, and placement plane. Pure data; use GridProjection helpers for worl...
Definition GridConfig.h:34