载入中...
搜索中...
未找到
GridProjection.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
9#include "grid/GridConfig.h"
10
11#include <cstdint>
12#include <functional>
13#include <vector>
14
15namespace eve::grid {
16
21EVENGINE_API_FOUNDATION void cellToWorld(const GridConfig &cfg, int cx, int cy, float &px, float &py);
22
27EVENGINE_API_FOUNDATION float cellToDepthY(const GridConfig &cfg, int cx, int cy);
28
34EVENGINE_API_FOUNDATION void worldToCell(const GridConfig &cfg, float px, float py, int &cx, int &cy, int mapW = 1,
35 int mapH = 1);
36
43EVENGINE_API_FOUNDATION void foreachRotatedFootprint(int w, int h, const std::vector<uint8_t> &mask, int steps,
44 bool hexMode, const std::function<void(int lx, int ly)> &fn);
45
47EVENGINE_API_FOUNDATION void rotatedFootprintSize(int w, int h, const std::vector<uint8_t> &mask, int steps,
48 bool hexMode, int &outW, int &outH);
49
50} // namespace eve::grid
float w
Definition AnimClip.cpp:738
int mask
float cx
Definition CardTypes.cpp:33
float cy
Definition CardTypes.cpp:34
float py
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Definition Export.h:106
Module-neutral grid topology and sizing (no building/map dependency).
int h
std::vector< Colorf > px
int steps
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...
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 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 ...
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.
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.
SettlementPipeline::Stage fn