Owning gas presentation cache, independent of the source solver. @ownership Owns frames and depth scratch; borrows arguments synchronously only. @thread Single caller, no callbacks or concurrent mutation. 更多...
#include <CollapseDust.h>
Public 成员函数 | |
| CollapseDust () | |
| Construct an empty owning cache; no worker starts until requested. | |
| ~CollapseDust () | |
| Join and check an unpublished CPU job before releasing owned data. | |
| CollapseDust (const CollapseDust &)=delete | |
| CollapseDust & | operator= (const CollapseDust &)=delete |
| CollapseDust (CollapseDust &&)=delete | |
| CollapseDust & | operator= (CollapseDust &&)=delete |
| Result< void > | capture (const fluids::VolumeFluid &source, float seconds) |
| Capture gas particles, fading their final two seconds. @cost Linear in live particles, offline only. | |
| Result< void > | present (fluids::VolumeFluid &target, float seconds) const |
| Restore nearest preceding frame into a dedicated presentation solver. @cost Linear in particles, at the baked display rate; no solver step. | |
| Result< void > | save (std::string_view path) const |
| Save a new asset through the shared atomic, non-replacing baked-asset publisher. @cost Linear in all samples, once after bake. | |
| Result< void > | load (std::string_view path) |
| Validate and load an owning clip; failure preserves this clip. @cost Linear in file size, once at startup. | |
| int | frameCount () const |
| Recorded frame count. | |
| Result< void > | prepareDepth (int width, int height) |
| Allocate bounded CPU scene-depth scratch before rendering. @cost Linear in output pixels, once per resolution. | |
| Result< void > | injectFog (graphics::AtmosphereVolume &grid, const glm::mat4 &inverseViewProjection, float seconds, float density, float radius) const |
| Inject saved gas into the existing local-volume fog grid, without stepping a solver. | |
| Result< void > | updateDepthTexture (graphics::Graphics &graphics, graphics::Texture &texture, const CollapseAnimation &clip, float seconds, graphics::Camera3D &camera) |
| Upload exact animated-fragment depth for the existing fog compositor. @cost Linear in triangles and covered pixels; prepareDepth first, reuse while time/camera unchanged. | |
| Result< void > | prepareFog (const CollapseAnimation &clip, int depthWidth, int depthHeight, int gridWidth, int gridHeight, int gridDepth) |
| Prepare independent clip ownership and bounded worker dimensions. @cost Copies all rigid samples once; call outside playback. | |
| Result< DustFogRequest > | requestFog (float seconds, const DustFogView &view, float density, float radius) |
| Submit at most one CPU-only worker; busy requests do not queue more work. @cost Copies one gas frame and starts bounded background reconstruction; no GPU calls or waits. | |
| Result< std::optional< DustFogFrame > > | takeFogFrame () |
| Nonblocking collection; an empty optional means the sole worker is still running. | |
| Result< DustFogDisplay > | updateFog (graphics::Volumetric &fog, graphics::Graphics &graphics, float seconds, graphics::Camera3D &camera, float density, float radius) |
| Poll/upload completed pixels and request the latest time without blocking rendering. @cost Bounded texture uploads only on completed work; CPU reconstruction is on the owned worker. | |
详细描述
Owning gas presentation cache, independent of the source solver. @ownership Owns frames and depth scratch; borrows arguments synchronously only. @thread Single caller, no callbacks or concurrent mutation.
EVEDUST1 version 1, little endian float32; unknown versions/fields and trailing bytes rejected. Load validates into a candidate before replacing this clip. Playback restores a dedicated render-only fluid, never a gameplay solver. Fixed-step fluid bake is repeatable on the same build; saved playback has no simulation or RNG. Particle births/deaths use recorded frame boundaries.
在文件 CollapseDust.h 第 47 行定义.
构造及析构函数说明
◆ CollapseDust() [1/3]
|
default |
Construct an empty owning cache; no worker starts until requested.
◆ ~CollapseDust()
| eve::physics::CollapseDust::~CollapseDust | ( | ) |
Join and check an unpublished CPU job before releasing owned data.
在文件 CollapseDust.cpp 第 55 行定义.
◆ CollapseDust() [2/3]
|
delete |
◆ CollapseDust() [3/3]
|
delete |
成员函数说明
◆ capture()
| Result< void > eve::physics::CollapseDust::capture | ( | const fluids::VolumeFluid & | source, |
| float | seconds | ||
| ) |
Capture gas particles, fading their final two seconds. @cost Linear in live particles, offline only.
- 返回
- Checked status; failure leaves frames unchanged.
在文件 CollapseDust.cpp 第 64 行定义.
引用了 f, frame, eve::fluids::Gas, eve::physics::collapse_detail::MaxSamples, p, source, eve::Result< T >::success() , 以及 valid.
◆ frameCount()
|
inline |
Recorded frame count.
在文件 CollapseDust.h 第 80 行定义.
◆ injectFog()
| Result< void > eve::physics::CollapseDust::injectFog | ( | graphics::AtmosphereVolume & | grid, |
| const glm::mat4 & | inverseViewProjection, | ||
| float | seconds, | ||
| float | density, | ||
| float | radius | ||
| ) | const |
Inject saved gas into the existing local-volume fog grid, without stepping a solver.
- 参数
-
inverseViewProjection Borrowed inverse camera matrix matching the grid. seconds Recorded playback time; finite, clamped to clip endpoints. density Nonnegative extinction multiplier, at most 10. radius Local fog support radius in metres, in [0.1,5]. @cost Bounded projected particle footprints, once per displayed gas frame; grid must be prepared by caller.
- 返回
- Checked dimensions/parameters status. No references survive this call.
在文件 CollapseDust.cpp 第 284 行定义.
引用了 a, b, c, cell, density, extinction, f, fraction, eve::graphics::FogVolume::getAlbedo(), h, index, nx, ny, offset, p, r, radius, eve::graphics::FogVolume::sampleExtinction(), eve::graphics::FogVolume::setAlbedo(), eve::graphics::FogVolume::setEdgeFalloff(), eve::graphics::FogVolume::setExtinction(), eve::graphics::FogVolume::setNoise(), eve::graphics::FogVolume::setPosition(), eve::graphics::FogVolume::setShape(), eve::graphics::FogVolume::setSize(), eve::Result< T >::success(), t, w, x, y , 以及 z.
被这些函数引用 requestFog().
◆ load()
| Result< void > eve::physics::CollapseDust::load | ( | std::string_view | path | ) |
Validate and load an owning clip; failure preserves this clip. @cost Linear in file size, once at startup.
- 返回
- Checked IO/schema status. EVEDUST1 v2 verifies a noncryptographic checksum over header and samples before decoding. Legacy v1 remains readable without an integrity guarantee; saving migrates it to v2. Unknown versions, extra fields and oversized files are rejected transactionally.
在文件 CollapseDust.cpp 第 122 行定义.
引用了 bytes, eve::physics::CollapseAnimation::contentKey(), count, error, eve::Diagnostic::error(), f, eve::Failed, eve::Result< T >::failure(), file, eve::HashMismatch, eve::physics::collapse_detail::MaxSamples, n, eve::NotFound, p, path, payload, size, status, eve::Result< T >::success(), v, valid , 以及 version.
◆ operator=() [1/2]
|
delete |
◆ operator=() [2/2]
|
delete |
◆ prepareDepth()
| Result< void > eve::physics::CollapseDust::prepareDepth | ( | int | width, |
| int | height | ||
| ) |
Allocate bounded CPU scene-depth scratch before rendering. @cost Linear in output pixels, once per resolution.
- 返回
- Checked dimensions status.
在文件 CollapseDust.cpp 第 190 行定义.
引用了 height, eve::Result< T >::success() , 以及 width.
被这些函数引用 prepareFog() , 以及 requestFog().
◆ prepareFog()
| Result< void > eve::physics::CollapseDust::prepareFog | ( | const CollapseAnimation & | clip, |
| int | depthWidth, | ||
| int | depthHeight, | ||
| int | gridWidth, | ||
| int | gridHeight, | ||
| int | gridDepth | ||
| ) |
Prepare independent clip ownership and bounded worker dimensions. @cost Copies all rigid samples once; call outside playback.
- 返回
- Checked preparation status. @ownership Owns a clip copy; source may be destroyed. An outstanding job must be collected first.
在文件 CollapseDust.cpp 第 381 行定义.
引用了 clip, prepareDepth() , 以及 eve::Result< T >::success().
◆ present()
| Result< void > eve::physics::CollapseDust::present | ( | fluids::VolumeFluid & | target, |
| float | seconds | ||
| ) | const |
Restore nearest preceding frame into a dedicated presentation solver. @cost Linear in particles, at the baked display rate; no solver step.
- 返回
- Transactional restore status.
在文件 CollapseDust.cpp 第 86 行定义.
引用了 f, eve::fluids::Gas, p, eve::fluids::VolumeFluidParticle::position, s, state, t , 以及 target.
◆ requestFog()
| Result< DustFogRequest > eve::physics::CollapseDust::requestFog | ( | float | seconds, |
| const DustFogView & | view, | ||
| float | density, | ||
| float | radius | ||
| ) |
Submit at most one CPU-only worker; busy requests do not queue more work. @cost Copies one gas frame and starts bounded background reconstruction; no GPU calls or waits.
- 返回
- Started, Busy or Unchanged; checked invalid input never submits work. @thread Main caller only; worker captures owning values and invokes no callbacks.
在文件 CollapseDust.cpp 第 397 行定义.
引用了 at, eve::physics::Busy, c, clip, cols, d, density, depth, f, eve::Result< T >::failure(), frame, from, injectFog(), output, prepareDepth(), r, radius, rows, eve::physics::Started, status, eve::Result< T >::success(), sx, sy, t, eve::physics::Unchanged, value, view, eve::physics::DustFogFrame::view, weights, x, y , 以及 z.
被这些函数引用 updateFog().
◆ save()
| Result< void > eve::physics::CollapseDust::save | ( | std::string_view | path | ) | const |
Save a new asset through the shared atomic, non-replacing baked-asset publisher. @cost Linear in all samples, once after bake.
- 返回
- Checked IO status. Linux uses file and directory durability barriers. Other platforms currently guarantee atomic visibility. Barrier failures carry publication and durability details; a published target is never rolled back. @thread Concurrent saves are supported while no caller mutates this clip. No callbacks.
在文件 CollapseDust.cpp 第 103 行定义.
引用了 bytes, eve::physics::CollapseAnimation::contentKey(), f, out, p, path, eve::physics::publishBakedAsset() , 以及 v.
◆ takeFogFrame()
| Result< std::optional< DustFogFrame > > eve::physics::CollapseDust::takeFogFrame | ( | ) |
Nonblocking collection; an empty optional means the sole worker is still running.
- 返回
- Owning pixels, pending, or checked worker failure; no partial GPU publication.
在文件 CollapseDust.cpp 第 513 行定义.
被这些函数引用 updateFog().
◆ updateDepthTexture()
| Result< void > eve::physics::CollapseDust::updateDepthTexture | ( | graphics::Graphics & | graphics, |
| graphics::Texture & | texture, | ||
| const CollapseAnimation & | clip, | ||
| float | seconds, | ||
| graphics::Camera3D & | camera | ||
| ) |
Upload exact animated-fragment depth for the existing fog compositor. @cost Linear in triangles and covered pixels; prepareDepth first, reuse while time/camera unchanged.
- 返回
- Checked raster/upload status. Graphics owns the caller-supplied texture; borrowed only here.
在文件 CollapseDust.cpp 第 265 行定义.
引用了 camera, clip, graphics, eve::Result< T >::success(), texture , 以及 value.
◆ updateFog()
| Result< DustFogDisplay > eve::physics::CollapseDust::updateFog | ( | graphics::Volumetric & | fog, |
| graphics::Graphics & | graphics, | ||
| float | seconds, | ||
| graphics::Camera3D & | camera, | ||
| float | density, | ||
| float | radius | ||
| ) |
Poll/upload completed pixels and request the latest time without blocking rendering. @cost Bounded texture uploads only on completed work; CPU reconstruction is on the owned worker.
- 返回
- Ready only when uploaded fog matches this camera. Borrowed GPU arguments are never retained. @lifetime Destruction joins the one owned CPU job, which retains no engine/service pointers.
在文件 CollapseDust.cpp 第 528 行定义.
引用了 c, camera, density, eve::Result< T >::failure(), frame, eve::graphics::Volumetric::getFroxelAtlas(), eve::graphics::Volumetric::getInvViewProj(), graphics, eve::physics::Pending, radius, eve::physics::Ready, request, requestFog(), status, eve::Result< T >::success(), takeFogFrame() , 以及 view.
该类的文档由以下文件生成:
- src/modules/physics/destruction/fx/CollapseDust.h
- src/modules/physics/destruction/fx/CollapseDust.cpp