Bounded, one-way fluid-advected secondary particle pool. @ownership Owns particles and capacity; no fluid/world pointers are retained. @thread Simulation-thread only, including snapshots; no concurrent calls. @reentrancy Invokes no callbacks. Advance borrows its fluid only for that call. 更多...
#include <VolumeFluidDiffuse.h>
Public 成员函数 | |
| VolumeFluidDiffuse ()=default | |
| Creates an empty pool with capacity 2048; use restore to configure a different capacity. | |
| Result< void > | emit (std::span< const VolumeFluidDiffuseParticle > particles) |
| Admits an entire batch or fails without mutation; finite speed must be <=100 m/s. | |
| Result< void > | advance (const VolumeFluid &fluid, float seconds, unsigned minimumNeighbors=4) |
| Advances once using current liquid/gas velocity, after the caller steps the fluid. | |
| VolumeFluidDiffuseSnapshot | snapshot () const |
| Returns an owning snapshot; later mutation cannot change its values. | |
| Result< void > | restore (const VolumeFluidDiffuseSnapshot &snapshot) |
| Validates schema, capacity [1,65536] and all particles before replacing state. | |
| unsigned | particleCount () const |
| Returns live count without copying particle data. | |
| unsigned | availableCapacity () const |
| Returns remaining admission capacity without allocating. | |
| void | copyRenderData (std::vector< glm::vec4 > &positionLife) const |
| Reuses caller storage to copy XY Z position and remaining life for rendering. | |
| void | clear () |
| Removes all particles, preserving configured capacity. | |
详细描述
Bounded, one-way fluid-advected secondary particle pool. @ownership Owns particles and capacity; no fluid/world pointers are retained. @thread Simulation-thread only, including snapshots; no concurrent calls. @reentrancy Invokes no callbacks. Advance borrows its fluid only for that call.
Fixed input/time ordering repeats on one build, with float tolerance across platforms. No RNG or automatic emission is used by this pool.
在文件 VolumeFluidDiffuse.h 第 38 行定义.
构造及析构函数说明
◆ VolumeFluidDiffuse()
|
default |
Creates an empty pool with capacity 2048; use restore to configure a different capacity.
成员函数说明
◆ advance()
| Result< void > eve::fluids::VolumeFluidDiffuse::advance | ( | const VolumeFluid & | fluid, |
| float | seconds, | ||
| unsigned | minimumNeighbors = 4 |
||
| ) |
Advances once using current liquid/gas velocity, after the caller steps the fluid.
- 参数
-
fluid Borrowed field source; it is not advanced or retained. seconds Injected duration in (0,1/30]. minimumNeighbors Remove particles below this count, in [0,1000000].
Lifetime expires before sampling. Surviving particles use explicit Euler advection and sampled velocity. No pressure, collision or rigid feedback is applied. Field-query budget/invalid output failure preserves the whole pool. Survivor and query-position scratch retain their peak capacity, so stable-size frames reuse all three source-sized working arrays.
在文件 VolumeFluidDiffuse.cpp 第 21 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::Result< T >::success() , 以及 valid.
◆ availableCapacity()
| unsigned eve::fluids::VolumeFluidDiffuse::availableCapacity | ( | ) | const |
Returns remaining admission capacity without allocating.
在文件 VolumeFluidDiffuse.cpp 第 69 行定义.
引用了 particleCount().
被这些函数引用 emit().
◆ clear()
| void eve::fluids::VolumeFluidDiffuse::clear | ( | ) |
Removes all particles, preserving configured capacity.
在文件 VolumeFluidDiffuse.cpp 第 75 行定义.
◆ copyRenderData()
| void eve::fluids::VolumeFluidDiffuse::copyRenderData | ( | std::vector< glm::vec4 > & | positionLife | ) | const |
Reuses caller storage to copy XY Z position and remaining life for rendering.
Simulation/render handoff only; returns owning values and retains no caller reference. The caller must synchronize against concurrent mutation.
在文件 VolumeFluidDiffuse.cpp 第 70 行定义.
引用了 position.
被这些函数引用 eve::fluids::FluidSurfaceRenderer::compositeDiffuse().
◆ emit()
| Result< void > eve::fluids::VolumeFluidDiffuse::emit | ( | std::span< const VolumeFluidDiffuseParticle > | particles | ) |
Admits an entire batch or fails without mutation; finite speed must be <=100 m/s.
在文件 VolumeFluidDiffuse.cpp 第 14 行定义.
引用了 availableCapacity(), eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::Result< T >::success() , 以及 valid.
◆ particleCount()
| unsigned eve::fluids::VolumeFluidDiffuse::particleCount | ( | ) | const |
Returns live count without copying particle data.
在文件 VolumeFluidDiffuse.cpp 第 68 行定义.
被这些函数引用 availableCapacity() , 以及 eve::fluids::FluidSurfaceRenderer::compositeDiffuse().
◆ restore()
| Result< void > eve::fluids::VolumeFluidDiffuse::restore | ( | const VolumeFluidDiffuseSnapshot & | snapshot | ) |
Validates schema, capacity [1,65536] and all particles before replacing state.
在文件 VolumeFluidDiffuse.cpp 第 57 行定义.
引用了 eve::fluids::VolumeFluidDiffuseSnapshot::capacity, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, p, eve::fluids::VolumeFluidDiffuseSnapshot::particles, eve::fluids::VolumeFluidDiffuseSnapshot::schema, snapshot(), eve::Result< T >::success(), valid , 以及 eve::fluids::VolumeFluidDiffuseSnapshot::version.
◆ snapshot()
| VolumeFluidDiffuseSnapshot eve::fluids::VolumeFluidDiffuse::snapshot | ( | ) | const |
Returns an owning snapshot; later mutation cannot change its values.
在文件 VolumeFluidDiffuse.cpp 第 54 行定义.
被这些函数引用 restore().
该类的文档由以下文件生成:
- src/modules/fluids/VolumeFluidDiffuse.h
- src/modules/fluids/VolumeFluidDiffuse.cpp