载入中...
搜索中...
未找到
eve::procgen::ObjectBuildLayer类 参考

Deterministic TileWorldCreator-style object build layer. 更多...

#include <ObjectBuildLayer.h>

Public 成员函数

Result< void > addAsset (std::string asset, float weight)
 Add a weighted asset candidate. Zero and negative weights are rejected.
 
void clearAssets ()
 
void setSeed (std::uint32_t seed) noexcept
 Set the named deterministic random stream seed.
 
void setLayerOffset (float x, float y, float z) noexcept
 Set fixed layer translation applied after source transforms.
 
Result< void > setLayerScale (float x, float y, float z)
 Set fixed component-wise scale multiplier. Values must be non-zero.
 
Result< void > setPositionRadius (float radius)
 Set circular XZ position jitter radius.
 
Result< void > setRandomTransform (const ObjectTransformRange &range)
 Configure independent random Euler and scale intervals for parent objects.
 
Result< void > setRandomRotation (float minPitch, float maxPitch, float minYaw, float maxYaw, float minRoll, float maxRoll)
 Update only the parent Euler randomization interval.
 
Result< void > setRandomScale (float minX, float maxX, float minY, float maxY, float minZ, float maxZ, bool uniform)
 Update only the parent scale randomization interval.
 
Result< void > setOrientation (float cellSize, float yawOffset, bool invert)
 Enable orientation toward the first matching N/E/S/W then diagonal orientation point.
 
void disableOrientation () noexcept
 
void setPlaceOnTop (bool enabled, bool useLowest, float topOffset) noexcept
 Project output Y to surface_lowest_y or surface_highest_y, plus offset, when present.
 
Result< void > addChildRule (std::string asset, int count, float radius, const ObjectTransformRange &range)
 Add a child-spawn rule with its own deterministic transform stream.
 
Result< void > addChild (std::string asset, int count, float radius, float minScale, float maxScale, float minYaw, float maxYaw)
 Script-friendly child rule using uniform scale and yaw ranges.
 
void clearChildRules ()
 Clears child rules.
 
Result< PointSet > build (const PointSet &source, const PointSet *orientation=nullptr) const
 Build attributed object points from source points.
 
std::string serializeDefinition () const
 Serialize all layer settings using the versioned EVPCG object-layer schema.
 
Result< void > deserializeDefinition (std::string_view definition)
 Atomically replace settings from schema version 1; unknown records are rejected.
 

详细描述

Deterministic TileWorldCreator-style object build layer.

Input and output are owned values. Each source point emits one parent object point; child rules emit additional points carrying asset, object_role and parent_index attributes. The layer never creates scene objects or retains input pointers. @thread Affine; configure and build on the owning thread.

在文件 ObjectBuildLayer.h 第 37 行定义.

成员函数说明

◆ addAsset()

Result< void > eve::procgen::ObjectBuildLayer::addAsset ( std::string  asset,
float  weight 
)

Add a weighted asset candidate. Zero and negative weights are rejected.

在文件 ObjectBuildLayer.cpp 第 107 行定义.

引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::Result< T >::success() , 以及 weight.

被这些函数引用 deserializeDefinition().

◆ addChild()

Result< void > eve::procgen::ObjectBuildLayer::addChild ( std::string  asset,
int  count,
float  radius,
float  minScale,
float  maxScale,
float  minYaw,
float  maxYaw 
)

Script-friendly child rule using uniform scale and yaw ranges.

在文件 ObjectBuildLayer.cpp 第 219 行定义.

引用了 addChildRule(), count, eve::procgen::ObjectTransformRange::minScaleX, radius , 以及 range.

◆ addChildRule()

Result< void > eve::procgen::ObjectBuildLayer::addChildRule ( std::string  asset,
int  count,
float  radius,
const ObjectTransformRange &  range 
)

Add a child-spawn rule with its own deterministic transform stream.

参数
assetAsset identifier written to emitted child points.
countChildren emitted per parent.
radiusCircular XZ scatter radius around the parent.
rangeRandom rotation and scale interval.

在文件 ObjectBuildLayer.cpp 第 201 行定义.

引用了 count, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, radius, range, eve::Result< T >::success() , 以及 valid.

被这些函数引用 addChild() , 以及 deserializeDefinition().

◆ build()

Result< PointSet > eve::procgen::ObjectBuildLayer::build ( const PointSet &  source,
const PointSet *  orientation = nullptr 
) const

Build attributed object points from source points.

参数
sourcePlacement points; their attributes and transforms are preserved for parents.
orientationOptional point layer used to derive cardinal orientation.
返回
Complete result, or a diagnostic without mutating the layer or either input. @cost O(P*A + P*C + P*O) where P is source points, A assets, C emitted children, and O orientation points when orientation is enabled.

在文件 ObjectBuildLayer.cpp 第 236 行定义.

引用了 angle, eve::Asset, eve::procgen::derivePointId(), eve::Diagnostic::error(), eve::Result< T >::failure(), eve::ui::WidgetDesc::id, input, eve::InvalidArgument, eve::procgen::ObjectTransformRange::maxYaw, eve::procgen::ObjectTransformRange::minYaw, output, parent, radius, random, eve::procgen::PointSet::reserve(), source, eve::Result< T >::success() , 以及 eve::Result< T >::value().

◆ clearAssets()

void eve::procgen::ObjectBuildLayer::clearAssets ( )

在文件 ObjectBuildLayer.cpp 第 119 行定义.

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

◆ clearChildRules()

void eve::procgen::ObjectBuildLayer::clearChildRules ( )

Clears child rules.

在文件 ObjectBuildLayer.cpp 第 234 行定义.

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

◆ deserializeDefinition()

Result< void > eve::procgen::ObjectBuildLayer::deserializeDefinition ( std::string_view  definition)

◆ disableOrientation()

void eve::procgen::ObjectBuildLayer::disableOrientation ( )
noexcept

在文件 ObjectBuildLayer.cpp 第 193 行定义.

◆ serializeDefinition()

◆ setLayerOffset()

void eve::procgen::ObjectBuildLayer::setLayerOffset ( float  x,
float  y,
float  z 
)
noexcept

Set fixed layer translation applied after source transforms.

在文件 ObjectBuildLayer.cpp 第 121 行定义.

引用了 x, y , 以及 z.

被这些函数引用 deserializeDefinition().

◆ setLayerScale()

Result< void > eve::procgen::ObjectBuildLayer::setLayerScale ( float  x,
float  y,
float  z 
)

Set fixed component-wise scale multiplier. Values must be non-zero.

在文件 ObjectBuildLayer.cpp 第 127 行定义.

引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::Result< T >::success(), x, y , 以及 z.

被这些函数引用 deserializeDefinition().

◆ setOrientation()

Result< void > eve::procgen::ObjectBuildLayer::setOrientation ( float  cellSize,
float  yawOffset,
bool  invert 
)

Enable orientation toward the first matching N/E/S/W then diagonal orientation point.

在文件 ObjectBuildLayer.cpp 第 179 行定义.

引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument , 以及 eve::Result< T >::success().

被这些函数引用 deserializeDefinition().

◆ setPlaceOnTop()

void eve::procgen::ObjectBuildLayer::setPlaceOnTop ( bool  enabled,
bool  useLowest,
float  topOffset 
)
noexcept

Project output Y to surface_lowest_y or surface_highest_y, plus offset, when present.

在文件 ObjectBuildLayer.cpp 第 195 行定义.

引用了 enabled.

被这些函数引用 deserializeDefinition().

◆ setPositionRadius()

Result< void > eve::procgen::ObjectBuildLayer::setPositionRadius ( float  radius)

Set circular XZ position jitter radius.

在文件 ObjectBuildLayer.cpp 第 138 行定义.

引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, radius , 以及 eve::Result< T >::success().

被这些函数引用 deserializeDefinition().

◆ setRandomRotation()

Result< void > eve::procgen::ObjectBuildLayer::setRandomRotation ( float  minPitch,
float  maxPitch,
float  minYaw,
float  maxYaw,
float  minRoll,
float  maxRoll 
)

Update only the parent Euler randomization interval.

在文件 ObjectBuildLayer.cpp 第 154 行定义.

引用了 eve::procgen::ObjectTransformRange::minPitch , 以及 setRandomTransform().

◆ setRandomScale()

Result< void > eve::procgen::ObjectBuildLayer::setRandomScale ( float  minX,
float  maxX,
float  minY,
float  maxY,
float  minZ,
float  maxZ,
bool  uniform 
)

Update only the parent scale randomization interval.

在文件 ObjectBuildLayer.cpp 第 166 行定义.

引用了 eve::procgen::ObjectTransformRange::minScaleX , 以及 setRandomTransform().

◆ setRandomTransform()

Result< void > eve::procgen::ObjectBuildLayer::setRandomTransform ( const ObjectTransformRange &  range)

Configure independent random Euler and scale intervals for parent objects.

在文件 ObjectBuildLayer.cpp 第 147 行定义.

引用了 range, eve::Result< T >::success() , 以及 valid.

被这些函数引用 deserializeDefinition(), setRandomRotation() , 以及 setRandomScale().

◆ setSeed()

void eve::procgen::ObjectBuildLayer::setSeed ( std::uint32_t  seed)
noexcept

Set the named deterministic random stream seed.

在文件 ObjectBuildLayer.cpp 第 120 行定义.

引用了 seed.

被这些函数引用 deserializeDefinition().


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