Owning regular scalar volume; x is contiguous, followed by y and z. 更多...
#include <ScalarField3D.h>
Public 成员函数 | |
| Result< void > | resize (int nx, int ny, int nz, float value) |
| Atomically allocate a finite volume with axis sizes in [2,256]. @cost Linear in sample count; reuse a field for multiple edits before replacing a generation stage. | |
| Result< void > | assign (int nx, int ny, int nz, std::span< const float > samples) |
| Atomically copy finite samples of a correctly sized volume. @cost Linear in sample count, amortized across subsequent field reads and edits. | |
| Result< float > | sample (int x, int y, int z) const |
| Return one sample or an out-of-bounds diagnostic. | |
| Result< void > | setSample (int x, int y, int z, float value) |
| Replace one finite sample; invalid input leaves the volume unchanged. | |
| Result< void > | carveEllipsoid (float x, float y, float z, float rx, float ry, float rz) |
| Carve an ellipsoid from rock in normalized [-1,1] coordinates; bounded positive radii required. @cost Linear in volume samples; compose multiple shapes before extracting a mesh. | |
| Result< MeshBuild > | extractMesh (float isolevel) const |
| Extract an independent isosurface in [-0.5,0.5]; empty output returns a diagnostic. @cost Linear in volume cells plus emitted triangles; reuse the result until the field changes. | |
| int | width () const noexcept |
| Number of samples along X. | |
| int | height () const noexcept |
| Number of samples along Y. | |
| int | depth () const noexcept |
| Number of samples along Z. | |
| std::span< const float > | samples () const noexcept |
| Borrow samples until this field is mutated, moved or destroyed; never retain across tasks. | |
详细描述
Owning regular scalar volume; x is contiguous, followed by y and z.
- 备注
- Samples use the caller's coordinate system. Cave volumes span [-1,1] on each axis; nonnegative density is rock. Copies are independent. No ECS, VM or graphics resources are retained. @thread One owner thread for mutation; independent copies may be processed on other threads.
在文件 ScalarField3D.h 第 18 行定义.
成员函数说明
◆ assign()
| Result< void > eve::procgen::ScalarField3D::assign | ( | int | nx, |
| int | ny, | ||
| int | nz, | ||
| std::span< const float > | samples | ||
| ) |
Atomically copy finite samples of a correctly sized volume. @cost Linear in sample count, amortized across subsequent field reads and edits.
在文件 ScalarField3D.cpp 第 26 行定义.
◆ carveEllipsoid()
| Result< void > eve::procgen::ScalarField3D::carveEllipsoid | ( | float | x, |
| float | y, | ||
| float | z, | ||
| float | rx, | ||
| float | ry, | ||
| float | rz | ||
| ) |
Carve an ellipsoid from rock in normalized [-1,1] coordinates; bounded positive radii required. @cost Linear in volume samples; compose multiple shapes before extracting a mesh.
在文件 ScalarFieldGeometry.cpp 第 9 行定义.
引用了 cx, cy, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, px, py, pz, sample(), scale, eve::Result< T >::success(), x, y , 以及 z.
◆ depth()
|
inlinenoexcept |
Number of samples along Z.
在文件 ScalarField3D.h 第 45 行定义.
◆ extractMesh()
Extract an independent isosurface in [-0.5,0.5]; empty output returns a diagnostic. @cost Linear in volume cells plus emitted triangles; reuse the result until the field changes.
在文件 ScalarFieldGeometry.cpp 第 30 行定义.
引用了 error, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::procgen::marchingCubes(), mesh , 以及 eve::Result< T >::success().
◆ height()
|
inlinenoexcept |
Number of samples along Y.
在文件 ScalarField3D.h 第 43 行定义.
◆ resize()
| Result< void > eve::procgen::ScalarField3D::resize | ( | int | nx, |
| int | ny, | ||
| int | nz, | ||
| float | value | ||
| ) |
Atomically allocate a finite volume with axis sizes in [2,256]. @cost Linear in sample count; reuse a field for multiple edits before replacing a generation stage.
在文件 ScalarField3D.cpp 第 16 行定义.
引用了 eve::Result< T >::success(), value, x, y , 以及 z.
◆ sample()
| Result< float > eve::procgen::ScalarField3D::sample | ( | int | x, |
| int | y, | ||
| int | z | ||
| ) | const |
Return one sample or an out-of-bounds diagnostic.
在文件 ScalarField3D.cpp 第 42 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::Result< T >::success(), x, y , 以及 z.
被这些函数引用 carveEllipsoid() , 以及 eve::procgen::exposeGenerationStages().
◆ samples()
|
inlinenoexcept |
Borrow samples until this field is mutated, moved or destroyed; never retain across tasks.
在文件 ScalarField3D.h 第 47 行定义.
◆ setSample()
| Result< void > eve::procgen::ScalarField3D::setSample | ( | int | x, |
| int | y, | ||
| int | z, | ||
| float | value | ||
| ) |
Replace one finite sample; invalid input leaves the volume unchanged.
在文件 ScalarField3D.cpp 第 49 行定义.
引用了 eve::Result< T >::success(), value, x, y , 以及 z.
◆ width()
|
inlinenoexcept |
Number of samples along X.
在文件 ScalarField3D.h 第 41 行定义.
该类的文档由以下文件生成:
- src/modules/procgen/ScalarField3D.h
- src/modules/procgen/ScalarField3D.cpp
- src/modules/procgen/ScalarFieldGeometry.cpp