载入中...
搜索中...
未找到
SceneWind.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4#include "common/Result.h"
6
7#include <glm/vec3.hpp>
8
9namespace eve::graphics::fog {
10
19public:
21 [[nodiscard]] Result<void> setMainWind(const glm::vec3& metersPerSecond);
23 [[nodiscard]] Result<void> setCurlStrength(float metersPerSecond);
25 [[nodiscard]] Result<void> setCurlFrequency(float frequency);
27 [[nodiscard]] Result<void> setCurlTimeScale(float scale);
29 [[nodiscard]] Result<void> setResponseRate(float metersPerSecondPerSecond);
30
31 [[nodiscard]] glm::vec3 mainWind() const noexcept { return currentMain_; }
32 [[nodiscard]] float curlStrength() const noexcept { return currentCurl_; }
33 [[nodiscard]] float curlFrequency() const noexcept { return curlFrequency_; }
34 [[nodiscard]] float curlTimeScale() const noexcept { return curlTimeScale_; }
35
40 [[nodiscard]] Result<void> tick(float dt);
41
46 [[nodiscard]] glm::vec3 sample(const glm::vec3& world, float timeSeconds) const noexcept;
47
48private:
49 glm::vec3 targetMain_{0.f};
50 glm::vec3 currentMain_{0.f};
51 float targetCurl_ = 0.f;
52 float currentCurl_ = 0.f;
53 float curlFrequency_ = 0.15f;
54 float curlTimeScale_ = 1.f;
55 float responseRate_ = 4.f;
56};
57
58} // namespace eve::graphics::fog
#define EVENGINE_API_WORLD
Definition Export.h:109
std::array< float, 3 > scale
World3D * world
Move-only, checked operation results for the common layer.
SimulationTick tick
Move-only operation result carrying either a value or Status.
Definition Result.h:155
World-space wind provider for MAC fog transport.
Definition SceneWind.h:18
float curlTimeScale() const noexcept
Definition SceneWind.h:34
float curlFrequency() const noexcept
Definition SceneWind.h:33
glm::vec3 mainWind() const noexcept
Definition SceneWind.h:31
float curlStrength() const noexcept
Definition SceneWind.h:32