Deterministic replacement for the reference project's hash grid. 更多...
#include <HexFeatures.h>
Public 成员函数 | |
| HexHashGrid (std::uint32_t seed=0u) noexcept | |
Creates a hash field for seed. | |
| HexHash | sample (HexVec3 position) const noexcept |
| Samples the five-component hash at a world-space position. | |
静态 Public 属性 | |
| static constexpr float | kScale = 0.25f |
Spacing of the hash cells, matching the reference hashGridScale. | |
| static constexpr std::int32_t | kSize = 256 |
| Size of the reference grid; only used to reproduce its wrap. | |
详细描述
Deterministic replacement for the reference project's hash grid.
The reference samples an array of HexHash cells indexed by worldXZ * hashGridScale, seeded once from Random. This implementation derives the same five values from a pure integer hash of the grid cell and the seed, so a map's decoration layout is reproducible from the map seed alone and no table has to be allocated or kept alive.
- 注解
- Immutable after construction; safe to share between chunk builds.
在文件 HexFeatures.h 第 35 行定义.
构造及析构函数说明
◆ HexHashGrid()
|
inlineexplicitnoexcept |
Creates a hash field for seed.
- 参数
-
seed Deterministic seed; the same seed always yields the same field.
在文件 HexFeatures.h 第 46 行定义.
成员函数说明
◆ sample()
Samples the five-component hash at a world-space position.
在文件 HexFeatures.cpp 第 582 行定义.
引用了 eve::hexmap::HexHash::a, h, hash, position, u, value, x , 以及 z.
类成员变量说明
◆ kScale
|
staticconstexpr |
Spacing of the hash cells, matching the reference hashGridScale.
在文件 HexFeatures.h 第 38 行定义.
◆ kSize
|
staticconstexpr |
Size of the reference grid; only used to reproduce its wrap.
在文件 HexFeatures.h 第 40 行定义.
该类的文档由以下文件生成:
- src/modules/hexmap/HexFeatures.h
- src/modules/hexmap/HexFeatures.cpp