载入中...
搜索中...
未找到

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

Kind public API.

枚举值
Empty 
Points 
Box 
Sphere 
Polygon 
Spline 
Heightfield 
TextureMask 
MeshSurface 
Union 
Intersection 
Difference 

在文件 SpatialData.h 第 38 行定义.

构造及析构函数说明

◆ SpatialData()

eve::procgen::SpatialData::SpatialData ( )
default

Construct empty spatial data.

引用了 eve::procgen::raster_detail::sample().

成员函数说明

◆ bounds()

SpatialBounds eve::procgen::SpatialData::bounds ( ) const

Conservative world-space bounds, or invalid bounds for an empty domain.

在文件 SpatialData.cpp 第 361 行定义.

被这些函数引用 fromPoints() , 以及 meshSurface().

◆ box()

SpatialData eve::procgen::SpatialData::box ( float  minX,
float  minY,
float  minZ,
float  maxX,
float  maxY,
float  maxZ 
)
static

Create an axis-aligned volume; unordered endpoints are normalized.

在文件 SpatialData.cpp 第 152 行定义.

引用了 Box.

被这些函数引用 eve::procgen::Procgen::boxVolumeHandle().

◆ contains()

bool eve::procgen::SpatialData::contains ( float  x,
float  y,
float  z 
) const

◆ filter()

PointSet eve::procgen::SpatialData::filter ( const PointSet &  input,
bool  invert = false 
) const

Filter attributed points by this domain.

在文件 SpatialData.cpp 第 463 行定义.

引用了 contains(), index, input, output, point, eve::procgen::PointSet::points() , 以及 size.

◆ fromPoints()

SpatialData eve::procgen::SpatialData::fromPoints ( const PointSet &  points)
static

◆ 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

◆ getMaxY()

float eve::procgen::SpatialData::getMaxY ( ) const

◆ getMaxZ()

float eve::procgen::SpatialData::getMaxZ ( ) const

◆ getMinX()

float eve::procgen::SpatialData::getMinX ( ) const

◆ getMinY()

float eve::procgen::SpatialData::getMinY ( ) const

◆ getMinZ()

float eve::procgen::SpatialData::getMinZ ( ) const

◆ hasBounds()

bool eve::procgen::SpatialData::hasBounds ( ) const

在文件 SpatialData.cpp 第 362 行定义.

引用了 eve::procgen::SpatialBounds::valid.

◆ heightfield()

SpatialData eve::procgen::SpatialData::heightfield ( const Heightmap &  heightmap,
float  originX,
float  originZ,
float  cellSize,
float  heightScale 
)
static

◆ intersect()

SpatialData eve::procgen::SpatialData::intersect ( const SpatialData &  a,
const SpatialData &  b 
)
static

Create the intersection of two domains.

在文件 SpatialData.cpp 第 279 行定义.

引用了 a, b , 以及 Intersection.

被这些函数引用 eve::procgen::Procgen::intersectSpatialHandle().

◆ meshSurface()

SpatialData eve::procgen::SpatialData::meshSurface ( const MeshBuild &  mesh,
float  tolerance 
)
static

◆ polygon()

SpatialData eve::procgen::SpatialData::polygon ( const PointSet &  controlPoints,
float  minY,
float  maxY 
)
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.

被这些函数引用 eve::procgen::Procgen::polygonVolumeHandle().

◆ project()

PointSet eve::procgen::SpatialData::project ( const PointSet &  input) const

◆ sample()

PointSet eve::procgen::SpatialData::sample ( float  spacing,
uint32_t  seed,
float  jitter 
) const

Deterministically sample a 3D lattice inside the domain.

参数
spacingDistance between candidates on all axes.
seedRoot seed used for stable point seeds and jitter.
jitterFraction 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()

SpatialData eve::procgen::SpatialData::sphere ( float  x,
float  y,
float  z,
float  radius 
)
static

Create a spherical volume. A non-positive radius produces an empty domain.

在文件 SpatialData.cpp 第 165 行定义.

引用了 radius, Sphere, x, y , 以及 z.

被这些函数引用 eve::procgen::Procgen::sphereVolumeHandle().

◆ spline()

SpatialData eve::procgen::SpatialData::spline ( const PointSet &  controlPoints,
float  radius 
)
static

◆ subtract()

SpatialData eve::procgen::SpatialData::subtract ( const SpatialData &  a,
const SpatialData &  b 
)
static

Create the part of a outside b.

在文件 SpatialData.cpp 第 288 行定义.

引用了 a, b , 以及 Difference.

被这些函数引用 eve::procgen::Procgen::differenceSpatialHandle().

◆ textureMask()

SpatialData eve::procgen::SpatialData::textureMask ( const Heightmap &  values,
float  originX,
float  originZ,
float  cellSize,
float  minValue,
float  maxValue,
float  minY,
float  maxY 
)
static

Create an extruded spatial mask from scalar texture data.

在文件 SpatialData.cpp 第 226 行定义.

引用了 TextureMask , 以及 values.

被这些函数引用 eve::procgen::Procgen::textureMaskDataHandle().

◆ unite()

SpatialData eve::procgen::SpatialData::unite ( const SpatialData &  a,
const SpatialData &  b 
)
static

Create the union of two domains.

在文件 SpatialData.cpp 第 270 行定义.

引用了 a, b , 以及 Union.

被这些函数引用 eve::procgen::Procgen::unionSpatialHandle().


该类的文档由以下文件生成: