载入中...
搜索中...
未找到
HexSphereTopology.h
浏览该文件的文档.
80 [[nodiscard]] std::int32_t cellCount() const noexcept { return static_cast<std::int32_t>(directions_.size()); }
84 [[nodiscard]] std::int32_t edgeCount() const noexcept { return static_cast<std::int32_t>(neighbors_.size() / 2u); }
91 [[nodiscard]] bool contains(HexSphereCell cell) const noexcept { return cell >= 0 && cell < cellCount(); }
106 [[nodiscard]] HexSphereCell neighbor(HexSphereCell cell, std::int32_t direction) const noexcept;
119 [[nodiscard]] std::int32_t oppositeDirection(HexSphereCell cell, std::int32_t direction) const noexcept;
Pointy-top hex metrics, directions and vertex helpers.
Move-only, checked operation results for the common layer.
Icosahedral (Goldberg) hex topology for a spherical hex map.
Definition HexSphereTopology.h:54
std::int32_t subdivision() const noexcept
The subdivision level this topology was built at.
Definition HexSphereTopology.h:76
bool contains(HexSphereCell cell) const noexcept
Whether cell is a valid id of this topology.
Definition HexSphereTopology.h:91
std::int32_t cornerCount() const noexcept
Number of distinct corners (20 * f^2), each shared by three cells.
Definition HexSphereTopology.h:86
std::int32_t cellCount() const noexcept
Number of cells (10 * f^2 + 2).
Definition HexSphereTopology.h:80
std::int32_t pentagonCount() const noexcept
Number of pentagonal cells (12 for every non-empty topology).
Definition HexSphereTopology.h:82
std::int32_t frequency() const noexcept
Subdivision frequency f = 2^subdivision.
Definition HexSphereTopology.h:78
bool isPentagon(HexSphereCell cell) const noexcept
Whether cell has five edges instead of six; false when out of range.
Definition HexSphereTopology.h:93
std::int32_t edgeCount() const noexcept
Number of cell-to-cell edges (30 * f^2).
Definition HexSphereTopology.h:84
Definition HexCell.h:9
constexpr std::int32_t kMaxHexSphereSubdivision
Largest supported subdivision level; 10 * 4^7 + 2 = 163842 cells.
Definition HexSphereTopology.h:22
constexpr HexSphereCell kNoHexSphereCell
Returned by a spherical cell query that has no answer.
Definition HexSphereTopology.h:19
std::int32_t HexSphereCell
Dense identifier of one cell of a spherical hex topology.
Definition HexSphereTopology.h:16
Minimal 3-component float vector used by the hex mesh builders.
Definition HexMetrics.h:18