Queryable spatial input for procedural pipelines. 更多...
#include <SpatialData.h>
Public 类型 | |
| enum class | Kind { Empty , Points , Box , Sphere , Polygon , Spline , Heightfield , TextureMask , MeshSurface , Union , Intersection , Difference } |
| Kind public API. 更多... | |
Public 成员函数 | |
| SpatialData ()=default | |
| Construct empty spatial data. | |
| std::string | getKind () const |
| Stable textual kind used by scripts and diagnostics. | |
| bool | contains (float x, float y, float z) const |
| Whether this domain contains a world-space position. | |
| SpatialBounds | bounds () const |
| Conservative world-space bounds, or invalid bounds for an empty domain. | |
| bool | hasBounds () const |
| float | getMinX () const |
| float | getMinY () const |
| float | getMinZ () const |
| float | getMaxX () const |
| float | getMaxY () const |
| float | getMaxZ () const |
| float | sampleScalar (float x, float y, float z, float outsideValue=0.f) const |
| Sample a continuous scalar at a world position. | |
| PointSet | sample (float spacing, uint32_t seed, float jitter) const |
| Deterministically sample a 3D lattice inside the domain. | |
| PointSet | filter (const PointSet &input, bool invert=false) const |
| Filter attributed points by this domain. | |
| PointSet | project (const PointSet &input) const |
| Project points onto a heightfield surface; other kinds return an unchanged copy. | |
静态 Public 成员函数 | |
| static SpatialData | fromPoints (const PointSet &points) |
| Create spatial data whose domain is the bounds of attributed points. | |
| static SpatialData | box (float minX, float minY, float minZ, float maxX, float maxY, float maxZ) |
| Create an axis-aligned volume; unordered endpoints are normalized. | |
| static SpatialData | sphere (float x, float y, float z, float radius) |
| Create a spherical volume. A non-positive radius produces an empty domain. | |
| static SpatialData | polygon (const PointSet &controlPoints, float minY, float maxY) |
| Create an XZ polygon prism between two world-space heights. | |
| static SpatialData | spline (const PointSet &controlPoints, float radius) |
| Create a polyline domain with a radial influence width. | |
| static SpatialData | heightfield (const Heightmap &heightmap, float originX, float originZ, float cellSize, float heightScale) |
| Create a sampled heightfield surface in world space. | |
| static SpatialData | textureMask (const Heightmap &values, float originX, float originZ, float cellSize, float minValue, float maxValue, float minY, float maxY) |
| Create an extruded spatial mask from scalar texture data. | |
| static SpatialData | meshSurface (const MeshBuild &mesh, float tolerance) |
| Create a queryable triangle surface from CPU mesh data. | |
| static SpatialData | unite (const SpatialData &a, const SpatialData &b) |
| Create the union of two domains. | |
| static SpatialData | intersect (const SpatialData &a, const SpatialData &b) |
| Create the intersection of two domains. | |
| static SpatialData | subtract (const SpatialData &a, const SpatialData &b) |
| Create the part of a outside b. | |
详细描述
Queryable spatial input for procedural pipelines.
SpatialData mirrors the data-oriented role of UE PCG spatial data without coupling the procgen module to scene or rendering types. Values are cheap to copy and composite operations retain immutable copies of their operands.
在文件 SpatialData.h 第 35 行定义.
成员枚举类型说明
◆ Kind
|
strong |
Kind public API.
| 枚举值 | |
|---|---|
| Empty | |
| Points | |
| Box | |
| Sphere | |
| Polygon | |
| Spline | |
| Heightfield | |
| TextureMask | |
| MeshSurface | |
| Union | |
| Intersection | |
| Difference | |
在文件 SpatialData.h 第 38 行定义.
构造及析构函数说明
◆ SpatialData()
|
default |
Construct empty spatial data.
成员函数说明
◆ bounds()
| SpatialBounds eve::procgen::SpatialData::bounds | ( | ) | const |
Conservative world-space bounds, or invalid bounds for an empty domain.
在文件 SpatialData.cpp 第 361 行定义.
被这些函数引用 fromPoints() , 以及 meshSurface().
◆ box()
|
static |
Create an axis-aligned volume; unordered endpoints are normalized.
在文件 SpatialData.cpp 第 152 行定义.
引用了 Box.
◆ contains()
| bool eve::procgen::SpatialData::contains | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) | const |
Whether this domain contains a world-space position.
在文件 SpatialData.cpp 第 314 行定义.
引用了 Box, Difference, dx, dy, dz, Heightfield, Intersection, eve::procgen::SpatialBounds::maxX, eve::procgen::SpatialBounds::maxY, eve::procgen::SpatialBounds::maxZ, MeshSurface, eve::procgen::SpatialBounds::minX, eve::procgen::SpatialBounds::minY, eve::procgen::SpatialBounds::minZ, nx, ny, nz, point, eve::procgen::PointSet::points(), Points, Polygon, size, Sphere, Spline, TextureMask, Union, value, x, y , 以及 z.
被这些函数引用 filter(), sample() , 以及 sampleScalar().
◆ filter()
Filter attributed points by this domain.
在文件 SpatialData.cpp 第 463 行定义.
引用了 contains(), index, input, output, point, eve::procgen::PointSet::points() , 以及 size.
◆ fromPoints()
|
static |
Create spatial data whose domain is the bounds of attributed points.
在文件 SpatialData.cpp 第 132 行定义.
引用了 bounds(), eve::procgen::SpatialBounds::maxX, eve::procgen::SpatialBounds::maxY, eve::procgen::SpatialBounds::maxZ, eve::procgen::SpatialBounds::minX, eve::procgen::SpatialBounds::minY, eve::procgen::SpatialBounds::minZ, point, points, Points , 以及 eve::procgen::SpatialBounds::valid.
被这些函数引用 eve::procgen::Procgen::pointDataHandle(), polygon() , 以及 spline().
◆ getKind()
| std::string eve::procgen::SpatialData::getKind | ( | ) | const |
Stable textual kind used by scripts and diagnostics.
在文件 SpatialData.cpp 第 297 行定义.
引用了 Box, Difference, Heightfield, Intersection, MeshSurface, Points, Polygon, Sphere, Spline, TextureMask , 以及 Union.
◆ getMaxX()
| float eve::procgen::SpatialData::getMaxX | ( | ) | const |
在文件 SpatialData.cpp 第 366 行定义.
引用了 eve::procgen::SpatialBounds::maxX , 以及 eve::procgen::SpatialBounds::valid.
◆ getMaxY()
| float eve::procgen::SpatialData::getMaxY | ( | ) | const |
在文件 SpatialData.cpp 第 367 行定义.
引用了 eve::procgen::SpatialBounds::maxY , 以及 eve::procgen::SpatialBounds::valid.
◆ getMaxZ()
| float eve::procgen::SpatialData::getMaxZ | ( | ) | const |
在文件 SpatialData.cpp 第 368 行定义.
引用了 eve::procgen::SpatialBounds::maxZ , 以及 eve::procgen::SpatialBounds::valid.
◆ getMinX()
| float eve::procgen::SpatialData::getMinX | ( | ) | const |
在文件 SpatialData.cpp 第 363 行定义.
引用了 eve::procgen::SpatialBounds::minX , 以及 eve::procgen::SpatialBounds::valid.
◆ getMinY()
| float eve::procgen::SpatialData::getMinY | ( | ) | const |
在文件 SpatialData.cpp 第 364 行定义.
引用了 eve::procgen::SpatialBounds::minY , 以及 eve::procgen::SpatialBounds::valid.
◆ getMinZ()
| float eve::procgen::SpatialData::getMinZ | ( | ) | const |
在文件 SpatialData.cpp 第 365 行定义.
引用了 eve::procgen::SpatialBounds::minZ , 以及 eve::procgen::SpatialBounds::valid.
◆ hasBounds()
| bool eve::procgen::SpatialData::hasBounds | ( | ) | const |
在文件 SpatialData.cpp 第 362 行定义.
◆ heightfield()
|
static |
Create a sampled heightfield surface in world space.
在文件 SpatialData.cpp 第 200 行定义.
引用了 eve::procgen::Heightmap::getHeight(), eve::procgen::Heightmap::getWidth(), eve::procgen::Heightmap::height(), Heightfield, value, x , 以及 z.
被这些函数引用 eve::procgen::Procgen::heightfieldDataHandle() , 以及 eve::asset_procgen::EvpackTerrainLoader::load().
◆ intersect()
|
static |
◆ meshSurface()
|
static |
Create a queryable triangle surface from CPU mesh data.
在文件 SpatialData.cpp 第 247 行定义.
引用了 bounds(), eve::procgen::SpatialBounds::maxX, eve::procgen::SpatialBounds::maxY, eve::procgen::SpatialBounds::maxZ, mesh, MeshSurface, eve::procgen::SpatialBounds::minX, eve::procgen::SpatialBounds::minY, eve::procgen::SpatialBounds::minZ, size , 以及 eve::procgen::SpatialBounds::valid.
◆ polygon()
|
static |
Create an XZ polygon prism between two world-space heights.
在文件 SpatialData.cpp 第 177 行定义.
引用了 fromPoints(), eve::procgen::PointSet::getCount(), eve::procgen::SpatialBounds::maxY, eve::procgen::SpatialBounds::minY , 以及 Polygon.
◆ project()
Project points onto a heightfield surface; other kinds return an unchanged copy.
在文件 SpatialData.cpp 第 473 行定义.
引用了 Heightfield, index, input, left, length, eve::procgen::SpatialBounds::maxX, eve::procgen::SpatialBounds::maxZ, MeshSurface, eve::procgen::SpatialBounds::minX, eve::procgen::SpatialBounds::minZ, eve::procgen::PointSet::mutablePoint(), nx, ny, nz, output, point, right, size, up, y , 以及 eve::procgen::ProcgenPoint::y.
被这些函数引用 sample().
◆ sample()
| PointSet eve::procgen::SpatialData::sample | ( | float | spacing, |
| uint32_t | seed, | ||
| float | jitter | ||
| ) | const |
Deterministically sample a 3D lattice inside the domain.
- 参数
-
spacing Distance between candidates on all axes. seed Root seed used for stable point seeds and jitter. jitter Fraction of spacing used for position jitter, clamped to [0,1].
- 返回
- Attributed samples inside the domain.
在文件 SpatialData.cpp 第 425 行定义.
引用了 contains(), Heightfield, index, eve::procgen::SpatialBounds::maxX, eve::procgen::SpatialBounds::maxY, eve::procgen::SpatialBounds::maxZ, MeshSurface, eve::procgen::SpatialBounds::minX, eve::procgen::SpatialBounds::minY, eve::procgen::SpatialBounds::minZ, output, project(), seed, spacing, sx, sy, sz, eve::procgen::SpatialBounds::valid, x, y , 以及 z.
被这些函数引用 eve::procgen::BiomeRules::generate().
◆ sampleScalar()
| float eve::procgen::SpatialData::sampleScalar | ( | float | x, |
| float | y, | ||
| float | z, | ||
| float | outsideValue = 0.f |
||
| ) | const |
Sample a continuous scalar at a world position.
Heightfields return surface height (ignoring input Y). Texture masks return the underlying mask value when XZ (and Y for extrusion) are in bounds. Other kinds return 1 when contains is true and outsideValue otherwise.
在文件 SpatialData.cpp 第 370 行定义.
引用了 contains(), Heightfield, eve::procgen::SpatialBounds::maxX, eve::procgen::SpatialBounds::maxY, eve::procgen::SpatialBounds::maxZ, MeshSurface, eve::procgen::SpatialBounds::minY, eve::procgen::SpatialBounds::minZ, nx, ny, nz, TextureMask, x, y , 以及 z.
◆ sphere()
|
static |
◆ spline()
|
static |
Create a polyline domain with a radial influence width.
在文件 SpatialData.cpp 第 186 行定义.
引用了 fromPoints(), eve::procgen::PointSet::getCount(), eve::procgen::SpatialBounds::maxX, eve::procgen::SpatialBounds::maxY, eve::procgen::SpatialBounds::maxZ, eve::procgen::SpatialBounds::minX, eve::procgen::SpatialBounds::minY, eve::procgen::SpatialBounds::minZ, radius , 以及 Spline.
◆ subtract()
|
static |
◆ textureMask()
|
static |
Create an extruded spatial mask from scalar texture data.
在文件 SpatialData.cpp 第 226 行定义.
引用了 TextureMask , 以及 values.
◆ unite()
|
static |
Create the union of two domains.
在文件 SpatialData.cpp 第 270 行定义.
该类的文档由以下文件生成:
- src/modules/procgen/SpatialData.h
- src/modules/procgen/SpatialData.cpp