Caller-owned wave field with finite-depth gravity dispersion and absorbing boundaries. No graphics/physics pointers or internal clock. All mutations are owner-thread only; const reads may run concurrently only while the owner is not mutating. No callbacks. 更多...
#include <OceanWake.h>
类 | |
| struct | Impl |
Public 成员函数 | |
| EVENGINE_API_DOMAINS | ~OceanWake () |
| OceanWake (const OceanWake &)=delete | |
| OceanWake & | operator= (const OceanWake &)=delete |
| EVENGINE_API_DOMAINS Result< void > | inject (std::span< const OceanWakeImpulse > impulses) |
| Inject a bounded batch of localized disturbances atomically into vertical velocity/foam. | |
| EVENGINE_API_DOMAINS Result< std::unique_ptr< OceanWakeStep > > | prepareStep (double dt, double endTime, const OceanSpectrumFrame &water) const |
| Prepare an owning candidate for one fixed step with exact per-mode dispersion omega² = g*k*tanh(k*depth). | |
| EVENGINE_API_DOMAINS Result< void > | commitStep (OceanWakeStep &step) |
| Publish a prepared candidate by constant-time state swap without allocation. | |
| EVENGINE_API_DOMAINS Result< void > | recenter (glm::dvec2 center) |
| Move the window by whole cells, retaining overlapping world-space history. | |
| EVENGINE_API_DOMAINS Result< OceanWakeSample > | sample (glm::dvec2 worldXZ) const |
| Query a world point; returns zero outside the tile, InvalidArgument for nonfinite inputs. | |
| EVENGINE_API_DOMAINS double | time () const |
| Current externally advanced simulation time, initially zero. | |
| EVENGINE_API_DOMAINS OceanWakeSettings | settings () const |
| Owning configuration including current window center. | |
| EVENGINE_API_DOMAINS OceanWakeGridView | gridView () const |
| Borrow raw height/foam for immediate GPU upload; never retain across mutation or destruction. | |
静态 Public 成员函数 | |
| static EVENGINE_API_DOMAINS Result< std::unique_ptr< OceanWake > > | create (const OceanWakeSettings &settings) |
| Construct a checked field via explicit settings; copies settings and retains no input. | |
友元 | |
| class | OceanWakeStep |
详细描述
Caller-owned wave field with finite-depth gravity dispersion and absorbing boundaries. No graphics/physics pointers or internal clock. All mutations are owner-thread only; const reads may run concurrently only while the owner is not mutating. No callbacks.
在文件 OceanWake.h 第 53 行定义.
构造及析构函数说明
◆ ~OceanWake()
|
default |
◆ OceanWake()
成员函数说明
◆ commitStep()
| Result< void > eve::fluids::OceanWake::commitStep | ( | OceanWakeStep & | step | ) |
Publish a prepared candidate by constant-time state swap without allocation.
- 参数
-
step Borrowed only for this call; successful commit consumes its publication right.
- 返回
- Success or Conflict if foreign, already consumed, or invalidated by any owner mutation. Rejection changes neither owner nor candidate. Old arrays remain in the consumed candidate until its destruction. Owner-thread only, no callbacks or retained references.
在文件 OceanWake.cpp 第 87 行定义.
引用了 eve::Conflict, eve::Diagnostic::error(), eve::Result< T >::failure(), step , 以及 eve::Result< T >::success().
◆ create()
|
static |
Construct a checked field via explicit settings; copies settings and retains no input.
在文件 OceanWake.cpp 第 30 行定义.
引用了 finite, impl, s , 以及 eve::fluids::ocean_script::vector().
◆ gridView()
| OceanWakeGridView eve::fluids::OceanWake::gridView | ( | ) | const |
Borrow raw height/foam for immediate GPU upload; never retain across mutation or destruction.
在文件 OceanWake.cpp 第 257 行定义.
◆ inject()
| Result< void > eve::fluids::OceanWake::inject | ( | std::span< const OceanWakeImpulse > | impulses | ) |
Inject a bounded batch of localized disturbances atomically into vertical velocity/foam.
- 参数
-
impulses At most 256 finite sources; inputs borrowed for this call only.
- 返回
- Success or InvalidArgument. Entire batch validates before mutation. @cost O(cells * sources); batch hull contacts once per fixed step.
在文件 OceanWake.cpp 第 46 行定义.
引用了 finite, index, p, point, rate, s, shape, eve::Result< T >::success(), eve::fluids::ocean_script::vector(), x , 以及 z.
◆ operator=()
◆ prepareStep()
| Result< std::unique_ptr< OceanWakeStep > > eve::fluids::OceanWake::prepareStep | ( | double | dt, |
| double | endTime, | ||
| const OceanSpectrumFrame & | water | ||
| ) | const |
Prepare an owning candidate for one fixed step with exact per-mode dispersion omega² = g*k*tanh(k*depth).
- 参数
-
dt Seconds in (0,1/30]; endTime must equal time()+dt within 1e-8 seconds. endTime Injected simulation timestamp, not a wall clock. water Borrowed immutable start-of-step frame, alive for this call only. Foam coverage follows its horizontal particle velocity using midpoint backtracing and bounded bilinear sampling. Open boundaries discard outgoing coverage; this is a dissipative coverage approximation, not conserved fluid mass. No input is retained.
- 返回
- Owning candidate, InvalidArgument, or spectral query diagnostic. Preparation never changes the live owner; discard the candidate to cancel. @cost O(N² log N) plus two surface queries per foam-grid cell; execute once per interaction region per fixed step. Empty foam skips transport queries.
在文件 OceanWake.cpp 第 78 行定义.
引用了 dt, endTime, OceanWakeStep, eve::fluids::ocean_script::vector() , 以及 water.
◆ recenter()
Move the window by whole cells, retaining overlapping world-space history.
- 参数
-
center Requested finite center; quantized to the nearest cell relative to current center.
- 返回
- Success or InvalidArgument; new exposed cells start at rest. @cost O(N²) copy; amortize by moving only when interaction approaches the boundary.
在文件 OceanWake.cpp 第 191 行定义.
引用了 cell, center, finite, ox, s, eve::Result< T >::success(), eve::fluids::ocean_script::vector(), x , 以及 z.
◆ sample()
| Result< OceanWakeSample > eve::fluids::OceanWake::sample | ( | glm::dvec2 | worldXZ | ) | const |
Query a world point; returns zero outside the tile, InvalidArgument for nonfinite inputs.
在文件 OceanWake.cpp 第 217 行定义.
引用了 blend, cell, eve::fluids::ocean_detail::derivatives(), distance, dx, dz, finite, index, out, s, eve::Result< T >::success(), t, uv, eve::fluids::ocean_script::vector(), eve::fluids::ocean_detail::weights(), wx, wz, x , 以及 z.
◆ settings()
| OceanWakeSettings eve::fluids::OceanWake::settings | ( | ) | const |
Owning configuration including current window center.
在文件 OceanWake.cpp 第 256 行定义.
◆ time()
| double eve::fluids::OceanWake::time | ( | ) | const |
Current externally advanced simulation time, initially zero.
在文件 OceanWake.cpp 第 255 行定义.
友元及相关函数文档
◆ OceanWakeStep
|
friend |
在文件 OceanWake.h 第 108 行定义.
被这些函数引用 prepareStep().
该类的文档由以下文件生成:
- src/modules/fluids/OceanWake.h
- src/modules/fluids/OceanWake.cpp