MAC (Marker-And-Cell) staggered-grid Eulerian fog fluid. 更多...
#include <MacFluidGrid.h>
Public 成员函数 | |
| Result< void > | configure (const FogDensityField &field, float fixedDt=kDefaultFixedDt) |
| Allocate MAC arrays matching a density field lattice. | |
| int | width () const noexcept |
| int | height () const noexcept |
| int | depth () const noexcept |
| const FogWorldBounds & | bounds () const noexcept |
| glm::vec3 | cellSize () const noexcept |
| float | fixedDt () const noexcept |
| float | accumulatedTime () const noexcept |
| std::uint64_t | stepCount () const noexcept |
| Result< void > | pullDensity (const FogDensityField &field) |
| Copy concentration from a density field (same resolution). | |
| Result< void > | pushDensity (FogDensityField &field) const |
| Write concentration back into a density field. | |
| float | densityAt (int x, int y, int z) const noexcept |
| Cell-centered concentration. | |
| void | setDensity (int x, int y, int z, float density) |
| float | uAt (int i, int y, int z) const noexcept |
| Face-centered velocity samples (m/s). | |
| float | vAt (int x, int j, int z) const noexcept |
| float | wAt (int x, int y, int k) const noexcept |
| glm::vec3 | velocityAtCell (int x, int y, int z) const noexcept |
| Interpolated cell-center velocity. | |
| Result< FogCflReport > | step (float dt, SceneWind &wind, FogInteractor *interactor, float simTime) |
| Advance simulation by wall-clock dt using fixed substeps. | |
| FogCflReport | diagnoseCfl () const noexcept |
| Diagnose CFL for the current velocity field and fixed dt. | |
静态 Public 属性 | |
| static constexpr float | kDefaultFixedDt = 1.f / 60.f |
| static constexpr float | kMaxAccumulated = 0.25f |
友元 | |
| class | FogInteractor |
详细描述
MAC (Marker-And-Cell) staggered-grid Eulerian fog fluid.
Velocity lives on face centers; concentration lives at cell centers. Each fixed substep applies forces, wind, velocity advection, pressure projection, and density transport. An accumulator keeps wall-clock progress under low FPS.
在文件 MacFluidGrid.h 第 26 行定义.
成员函数说明
◆ accumulatedTime()
|
inlinenoexcept |
在文件 MacFluidGrid.h 第 40 行定义.
◆ bounds()
|
inlinenoexcept |
在文件 MacFluidGrid.h 第 37 行定义.
◆ cellSize()
|
inlinenoexcept |
在文件 MacFluidGrid.h 第 38 行定义.
◆ configure()
| Result< void > eve::graphics::fog::MacFluidGrid::configure | ( | const FogDensityField & | field, |
| float | fixedDt = kDefaultFixedDt |
||
| ) |
Allocate MAC arrays matching a density field lattice.
在文件 MacFluidGrid.cpp 第 14 行定义.
引用了 cells, eve::Diagnostic::error(), eve::Result< T >::failure(), fixedDt(), eve::InvalidArgument , 以及 eve::Result< T >::success().
◆ densityAt()
|
noexcept |
◆ depth()
|
inlinenoexcept |
在文件 MacFluidGrid.h 第 36 行定义.
◆ diagnoseCfl()
|
noexcept |
Diagnose CFL for the current velocity field and fixed dt.
在文件 MacFluidGrid.cpp 第 126 行定义.
引用了 eve::graphics::fog::FogCflReport::cellSize, eve::graphics::fog::FogCflReport::cfl, eve::graphics::fog::FogCflReport::dt, eve::graphics::fog::FogCflReport::maxSpeed, s , 以及 eve::graphics::fog::FogCflReport::stable.
被这些函数引用 step().
◆ fixedDt()
|
inlinenoexcept |
在文件 MacFluidGrid.h 第 39 行定义.
被这些函数引用 configure().
◆ height()
|
inlinenoexcept |
在文件 MacFluidGrid.h 第 35 行定义.
◆ pullDensity()
| Result< void > eve::graphics::fog::MacFluidGrid::pullDensity | ( | const FogDensityField & | field | ) |
Copy concentration from a density field (same resolution).
在文件 MacFluidGrid.cpp 第 63 行定义.
引用了 eve::Conflict, eve::Diagnostic::error(), eve::Result< T >::failure() , 以及 eve::Result< T >::success().
◆ pushDensity()
| Result< void > eve::graphics::fog::MacFluidGrid::pushDensity | ( | FogDensityField & | field | ) | const |
Write concentration back into a density field.
在文件 MacFluidGrid.cpp 第 74 行定义.
引用了 eve::Conflict, densityAt(), eve::Diagnostic::error(), eve::Result< T >::failure(), eve::Result< T >::success(), x, y , 以及 z.
◆ setDensity()
| void eve::graphics::fog::MacFluidGrid::setDensity | ( | int | x, |
| int | y, | ||
| int | z, | ||
| float | density | ||
| ) |
在文件 MacFluidGrid.cpp 第 94 行定义.
◆ step()
| Result< FogCflReport > eve::graphics::fog::MacFluidGrid::step | ( | float | dt, |
| SceneWind & | wind, | ||
| FogInteractor * | interactor, | ||
| float | simTime | ||
| ) |
Advance simulation by wall-clock dt using fixed substeps.
- 参数
-
wind World wind provider sampled each substep. interactor Optional solid proxies; may be nullptr. simTime Absolute simulation time in seconds.
在文件 MacFluidGrid.cpp 第 372 行定义.
引用了 eve::graphics::fog::FogInteractor::applyToGrid(), diagnoseCfl(), eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::InvalidArgument, kMaxAccumulated, eve::Result< T >::success(), eve::graphics::fog::SceneWind::tick() , 以及 time.
◆ stepCount()
|
inlinenoexcept |
在文件 MacFluidGrid.h 第 41 行定义.
◆ uAt()
|
noexcept |
◆ vAt()
|
noexcept |
在文件 MacFluidGrid.cpp 第 108 行定义.
◆ velocityAtCell()
|
noexcept |
◆ wAt()
|
noexcept |
在文件 MacFluidGrid.cpp 第 114 行定义.
◆ width()
|
inlinenoexcept |
在文件 MacFluidGrid.h 第 34 行定义.
友元及相关函数文档
◆ FogInteractor
|
friend |
在文件 MacFluidGrid.h 第 73 行定义.
类成员变量说明
◆ kDefaultFixedDt
在文件 MacFluidGrid.h 第 28 行定义.
◆ kMaxAccumulated
|
staticconstexpr |
在文件 MacFluidGrid.h 第 29 行定义.
被这些函数引用 step().
该类的文档由以下文件生成:
- src/modules/graphics/fog/MacFluidGrid.h
- src/modules/graphics/fog/MacFluidGrid.cpp