载入中...
搜索中...
未找到
VolumeFluidFoam.h
浏览该文件的文档.
1#pragma once
2
3#include <cstdint>
4#include <string>
5#include "common/Export.h"
6#include "common/Result.h"
9
10namespace eve::fluids {
11
14 float rate = 500.f;
15 float randomness = .01f;
16 float vorticityThreshold = 10.f;
17 float densityThreshold = 2000.f;
18 float lifetime = 2.f;
19 unsigned maxPerStep = 256;
20};
23 std::string schema = "eve.volume-fluid-foam";
24 unsigned version = 1;
27 std::string credit = "0";
29 uint32_t randomState = 1;
30};
31
40public:
56 [[nodiscard]] Result<unsigned> advance(const VolumeFluid& source, VolumeFluidDiffuse& pool, float seconds);
67 [[nodiscard]] Result<unsigned> advanceFromActor(const VolumeFluid& source, VolumeFluidDiffuse& pool, float seconds,
68 unsigned actorGroup);
74 [[nodiscard]] Result<unsigned> advanceFromActorInterpolated(const VolumeFluid& source, VolumeFluidDiffuse& pool,
75 float seconds, unsigned actorGroup, float alpha);
77 [[nodiscard]] VolumeFluidFoamSnapshot snapshot() const;
79 [[nodiscard]] Result<void> restore(const VolumeFluidFoamSnapshot& state);
80
81private:
83 double credit_ = 0;
84 uint32_t randomState_ = 1;
85 std::vector<glm::vec3> positionScratch_;
86 std::vector<VolumeFluidFieldSample> sampleScratch_;
87 std::vector<VolumeFluidDiffuseParticle> batchScratch_;
88 [[nodiscard]] Result<unsigned> advanceFiltered(const VolumeFluid& source, VolumeFluidDiffuse& pool, float seconds,
89 bool filterActor, unsigned actorGroup, float alpha);
90};
91} // namespace eve::fluids
#define EVENGINE_API_DOMAINS
Definition Export.h:110
Move-only, checked operation results for the common layer.
const UnitySourceAsset & source
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Bounded, one-way fluid-advected secondary particle pool. @ownership Owns particles and capacity; no f...
Generates secondary particles at high-curl, low-density fluid source positions. @ownership Owns setti...
CPU position-based free-volume fluid with a bounded spatial grid. @ownership Owns all particle state;...
GLSL compute kernels for the GPU surface-flow solver.
Definition FluidTarget.h:12
Foam source thresholds in the native sampled field, plus bounded emission settings.
Owning strict version-1 foam controller state; checkpoint the diffuse pool separately.
uint32_t randomState
Nonzero state of the isolated foam RNG stream; restore to inject a seed.
std::string credit
Decimal double text preserves fractional emission credit in float32 VMs.