载入中...
搜索中...
未找到
eve::graphics::VegetationField类 参考

Backend-independent, owning vegetation influence field. Single writer; concurrent const evaluation is safe while no replace occurs. No callbacks, external resources, global singleton, ECS mutation or wall clock. Returned samples/atlases are owning projections, never additional mutable authority. 更多...

#include <VegetationField.h>

Public 成员函数

VegetationGlobals globalValues () const
 Return detached global defaults; concurrent reads require no writer. No callbacks.
 
uint64_t revision () const
 Monotonic successful-publication revision for derived render snapshots.
 
Result< std::vector< VegetationElement > > snapshotElements () const
 Return an owning, priority-ordered element snapshot for revision-safe editor previews.
 
Result< void > restore (const Value &document)
 Decode eve.graphics.vegetation-field version 1; rejects unknown fields/versions. Single-writer, no callbacks. Fully validates before publication; failure preserves state.
 
Result< Value > snapshot () const
 Owning versioned snapshot; thread-safe while no mutation occurs. No callbacks.
 
Result< void > replace (const VegetationGlobals &globals, std::span< const VegetationElement > elements)
 Validate and atomically replace the entire field; failure preserves prior state.
 
Result< VegetationSample > sample (glm::vec3 position, std::array< uint8_t, 4 > layers={}) const
 Evaluate four independently selected layers (0..8) at a finite world position.
 
Result< VegetationAtlas > bake (glm::vec3 center, glm::vec3 extent, uint32_t width, uint32_t height, std::array< uint8_t, 4 > layers={}, bool snapToTexel=true) const
 Bake an X/Z slice. Width/height in [1,2048]; positive extent; one layer per channel. Texel snapping uses full width/height = 2*extent. Output center records the snapped origin.
 

详细描述

Backend-independent, owning vegetation influence field. Single writer; concurrent const evaluation is safe while no replace occurs. No callbacks, external resources, global singleton, ECS mutation or wall clock. Returned samples/atlases are owning projections, never additional mutable authority.

在文件 VegetationField.h 第 86 行定义.

成员函数说明

◆ bake()

Result< VegetationAtlas > eve::graphics::VegetationField::bake ( glm::vec3  center,
glm::vec3  extent,
uint32_t  width,
uint32_t  height,
std::array< uint8_t, 4 >  layers = {},
bool  snapToTexel = true 
) const

Bake an X/Z slice. Width/height in [1,2048]; positive extent; one layer per channel. Texel snapping uses full width/height = 2*extent. Output center records the snapped origin.

返回
Owning atlas or InvalidArgument/Failed; no partial output.

在文件 VegetationField.cpp 第 136 行定义.

引用了 eve::graphics::VegetationAtlas::center, center, eve::graphics::VegetationAtlas::channels, dx, dz, eve::graphics::VegetationAtlas::extent, eve::Result< T >::failure(), finite, height, eve::graphics::VegetationAtlas::height, index, p, eve::Result< T >::success(), v, width, eve::graphics::VegetationAtlas::width, x , 以及 y.

◆ globalValues()

VegetationGlobals eve::graphics::VegetationField::globalValues ( ) const
inline

Return detached global defaults; concurrent reads require no writer. No callbacks.

在文件 VegetationField.h 第 89 行定义.

被这些函数引用 eve::graphics_editing::VegetationFieldTarget::create().

◆ replace()

Result< void > eve::graphics::VegetationField::replace ( const VegetationGlobals &  globals,
std::span< const VegetationElement >  elements 
)

Validate and atomically replace the entire field; failure preserves prior state.

参数
globalsFinite channel defaults; season in [0,4].
elementsBorrowed only during call; copied, validated and stably ordered.
返回
InvalidArgument for invalid definitions or Failed for allocation failure.

在文件 VegetationField.cpp 第 63 行定义.

引用了 a, b, eve::graphics::Box, eve::graphics::VegetationGlobals::color, elements, eve::graphics::VegetationGlobals::extras, eve::Result< T >::failure(), finite, m, eve::graphics::Maximum, eve::graphics::VegetationGlobals::motion, eve::graphics::VegetationGlobals::season, eve::Result< T >::success(), unit, value, eve::graphics::Vertex , 以及 eve::graphics::VegetationGlobals::vertex.

被这些函数引用 eve::graphics_editing::VegetationFieldTarget::makeSet(), eve::graphics_editing::VegetationFieldTarget::makeTransform() , 以及 restore().

◆ restore()

Result< void > eve::graphics::VegetationField::restore ( const Value &  document)

Decode eve.graphics.vegetation-field version 1; rejects unknown fields/versions. Single-writer, no callbacks. Fully validates before publication; failure preserves state.

在文件 VegetationFieldCodec.cpp 第 39 行定义.

引用了 at, eve::graphics::VegetationElement::channel, eve::graphics::VegetationGlobals::color, elements, error, eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), fields, g, eve::InvalidArgument, mask, number, pixels, replace(), size, source , 以及 eve::UnknownVersion.

被这些函数引用 eve::graphics::exposeVegetationScriptBindings().

◆ revision()

uint64_t eve::graphics::VegetationField::revision ( ) const
inline

Monotonic successful-publication revision for derived render snapshots.

在文件 VegetationField.h 第 91 行定义.

被这些函数引用 eve::graphics_editing::VegetationFieldTarget::create().

◆ sample()

Result< VegetationSample > eve::graphics::VegetationField::sample ( glm::vec3  position,
std::array< uint8_t, 4 >  layers = {} 
) const

Evaluate four independently selected layers (0..8) at a finite world position.

返回
Owning sample or InvalidArgument. Worker-safe with immutable field.

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

引用了 eve::Result< T >::failure(), finite, position , 以及 eve::Result< T >::success().

被这些函数引用 eve::graphics::exposeVegetationScriptBindings().

◆ snapshot()

◆ snapshotElements()

Result< std::vector< VegetationElement > > eve::graphics::VegetationField::snapshotElements ( ) const

Return an owning, priority-ordered element snapshot for revision-safe editor previews.

返回
Detached elements, or Failed if allocation fails. Worker-safe with immutable field.

在文件 VegetationField.cpp 第 53 行定义.

引用了 eve::Diagnostic::error() , 以及 eve::Failed.

被这些函数引用 eve::graphics_editing::VegetationFieldTarget::create().


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