载入中...
搜索中...
未找到
HexSphereMap.h
浏览该文件的文档.
91 [[nodiscard]] std::int32_t cellCount() const noexcept { return static_cast<std::int32_t>(cells_.size()); }
129 [[nodiscard]] bool contains(HexSphereCell cell) const noexcept { return topology_.contains(cell); }
131 [[nodiscard]] bool isPentagon(HexSphereCell cell) const noexcept { return topology_.isPentagon(cell); }
142 [[nodiscard]] HexSphereCell neighbor(HexSphereCell cell, std::int32_t direction) const noexcept {
146 [[nodiscard]] std::int32_t directionOf(HexSphereCell cell, HexSphereCell other) const noexcept {
150 [[nodiscard]] std::int32_t oppositeDirection(HexSphereCell cell, std::int32_t direction) const noexcept {
163 [[nodiscard]] HexVec3 direction(HexSphereCell cell) const noexcept { return topology_.direction(cell); }
254 void collectBrush(HexSphereCell center, std::int32_t radius, std::vector<HexSphereCell>& out) const;
257 [[nodiscard]] Result<void> editElevation(HexSphereCell center, std::int32_t radius, std::int32_t delta);
259 [[nodiscard]] Result<void> editWaterLevel(HexSphereCell center, std::int32_t radius, std::int32_t delta);
261 [[nodiscard]] Result<void> editTerrainType(HexSphereCell center, std::int32_t radius, std::int32_t terrainType);
263 [[nodiscard]] Result<void> editFeatureLevel(HexSphereCell center, std::int32_t radius, std::int32_t feature,
Packed per-cell state records of the hex map.
Pointy-top hex metrics, directions and vertex helpers.
Deterministic asset-free noise for hex perturbation and generation.
Icosahedral hex topology: twelve pentagons and hexagons on a sphere.
Move-only, checked operation results for the common layer.
Packed boolean cell state (roads, rivers, walls, exploration).
Definition HexCell.h:123
Deterministic four-channel value noise over the XZ plane.
Definition HexNoise.h:23
std::int32_t subdivision() const noexcept
The subdivision level this map was built at.
Definition HexSphereMap.h:87
HexSphereCell neighbor(HexSphereCell cell, std::int32_t direction) const noexcept
Neighbour of cell across edge direction, or kNoHexSphereCell.
Definition HexSphereMap.h:142
const HexNoise & noise() const noexcept
Deterministic noise field shared by this map's mesh builders.
Definition HexSphereMap.h:119
std::int32_t directionOf(HexSphereCell cell, HexSphereCell other) const noexcept
Edge index shared with other, or kNoHexSphereCell when not adjacent.
Definition HexSphereMap.h:146
std::int32_t cornerCountOf(HexSphereCell cell) const noexcept
Number of corners of cell (5 or 6), or 0 when out of range.
Definition HexSphereMap.h:154
const HexSphereTopology & topology() const noexcept
The topology backing this map. @ownership Borrowed; valid until this map is destroyed or reset is cal...
Definition HexSphereMap.h:124
std::int32_t pentagonCount() const noexcept
Number of pentagonal cells (12 for a non-empty map).
Definition HexSphereMap.h:93
std::int32_t oppositeDirection(HexSphereCell cell, std::int32_t direction) const noexcept
Edge index of cell's edge towards its neighbour across direction.
Definition HexSphereMap.h:150
bool isPentagon(HexSphereCell cell) const noexcept
Whether cell has five edges instead of six.
Definition HexSphereMap.h:131
HexVec3 cornerDirection(HexSphereCell cell, std::int32_t corner) const noexcept
Unit direction of corner corner of cell.
Definition HexSphereMap.h:170
std::int32_t frequency() const noexcept
Subdivision frequency f = 2^subdivision.
Definition HexSphereMap.h:89
std::int32_t neighborCount(HexSphereCell cell) const noexcept
Number of edges of cell (5 or 6), or 0 when out of range.
Definition HexSphereMap.h:138
std::uint64_t revision() const noexcept
Monotonic counter bumped by every mutation; used to detect stale meshes.
Definition HexSphereMap.h:117
HexVec3 direction(HexSphereCell cell) const noexcept
Unit direction from the sphere centre to the centre of cell.
Definition HexSphereMap.h:163
bool contains(HexSphereCell cell) const noexcept
Whether cell is a valid id of this map.
Definition HexSphereMap.h:129
Icosahedral (Goldberg) hex topology for a spherical hex map.
Definition HexSphereTopology.h:54
Definition HexCell.h:9
HexEdgeType
Relationship between two neighbouring cells of different elevation.
Definition HexMetrics.h:93
std::int32_t HexSphereCell
Dense identifier of one cell of a spherical hex topology.
Definition HexSphereTopology.h:16
Definition Container.h:602
One cell of the hex map: packed values plus packed flags.
Definition HexCell.h:244
Minimal 3-component float vector used by the hex mesh builders.
Definition HexMetrics.h:18