载入中...
搜索中...
未找到
FogInteractor.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4#include "common/Result.h"
6
7#include <cstddef>
8#include <vector>
9
10#include <glm/vec3.hpp>
11
12namespace eve::graphics::fog {
13
14class MacFluidGrid;
15
25public:
27 [[nodiscard]] Result<void> setProxies(std::vector<FogSolidProxy> proxies);
28
29 [[nodiscard]] std::size_t proxyCount() const noexcept { return proxies_.size(); }
30 [[nodiscard]] const FogSolidProxy& proxyAt(std::size_t index) const;
31
33 [[nodiscard]] bool isSolidWorld(const glm::vec3& world) const noexcept;
34
39 [[nodiscard]] Result<void> applyToGrid(MacFluidGrid& grid, float dt) const;
40
49 [[nodiscard]] glm::vec3 clipAdvection(const glm::vec3& startLocal, const glm::vec3& deltaLocal,
51 const glm::vec3& cellSize) const noexcept;
52
53private:
54 [[nodiscard]] float signedDistance(const FogSolidProxy& proxy, const glm::vec3& world) const noexcept;
55 [[nodiscard]] glm::vec3 closestPoint(const FogSolidProxy& proxy, const glm::vec3& world) const noexcept;
56 [[nodiscard]] glm::vec3 surfaceNormal(const FogSolidProxy& proxy, const glm::vec3& world) const noexcept;
57
58 std::vector<FogSolidProxy> proxies_;
59};
60
61} // namespace eve::graphics::fog
#define EVENGINE_API_WORLD
Definition Export.h:109
World3D * world
Move-only, checked operation results for the common layer.
uint32_t index
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Analytic solid proxies that carve fog and inject wake into the MAC field.
std::size_t proxyCount() const noexcept
MAC (Marker-And-Cell) staggered-grid Eulerian fog fluid.
One analytic solid that carves / wakes the fog domain.
Definition FogTypes.h:142
Axis-aligned world bounds for a fog simulation domain.
Definition FogTypes.h:96
glm::vec4 bounds