载入中...
搜索中...
未找到
CloudShadow.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
6
7namespace eve::procgen {
8
24public:
26 struct Params {
27 CloudField field; // the cloud field being shadowed
28 float sunDirX = 0.f; // normalized, toward the light (up)
29 float sunDirY = 1.f;
30 float sunDirZ = 0.f;
31 float cloudAltitude = 60.f; // cloud plane height above ground
32 float strength = 0.8f; // 0..1 shadow darkness
33 };
34
35 CloudShadow() = default;
36 explicit CloudShadow(const Params &params) { setParams(params); }
37
38 const Params &params() const { return params_; }
39 void setParams(const Params &params);
40
41 void setSunDirection(float x, float y, float z);
42 void setCloudAltitude(float altitude);
43 void setStrength(float strength);
44
46 float coverageAt(float x, float z, float time) const;
47
49 float shadowFactorAt(float x, float z, float time) const;
50
52 void cloudOffset(float &ox, float &oz) const;
53
55 void sampleCoverage(float *out, int width, int height, float time, float x0, float z0,
56 float extent) const;
57
59 void sampleFactor(float *out, int width, int height, float time, float x0, float z0,
60 float extent) const;
61
62private:
63 Params params_;
64};
65
66} // namespace eve::procgen
float y
Definition AnimClip.cpp:738
float x
Definition AnimClip.cpp:738
float z
Definition AnimClip.cpp:738
#define EVENGINE_API_DOMAINS
Definition Export.h:110
std::uint32_t height
std::uint32_t width
double ox
Deterministic, seamlessly-tiling, time-animated procedural cloud field.
Definition CloudField.h:19
Cloud shadows cast onto the ground plane.
Definition CloudShadow.h:23
const Params & params() const
Definition CloudShadow.h:38
CloudShadow(const Params &params)
Definition CloudShadow.h:36
Owning, typed generation parameters.
Definition Params.h:27
std::vector< ParamSpec > params