载入中...
搜索中...
未找到
GrassWind.cpp
浏览该文件的文档.
13Result<void> applyGrassWind(Shader& shader, const VegetationWindState& state, const VegetationWindProfile& profile,
18 static const std::array<std::string, 5> names = {"windGlobals", "windPhaseDistance", "windFlex", "windFrequency",
24 shader.getUniformIndex(names[i]) != offsets[i] || shader.getUniformFloatCount(names[i]) != sizes[i])
41Result<void> applyTreeWind(Shader& shader, const VegetationWindState& state, const VegetationWindProfile& vegetation,
43 if (!std::isfinite(tree.widthHeight.x) || tree.widthHeight.x <= 0 || !std::isfinite(tree.widthHeight.y) ||
57 shader.getUniformIndex(names[i]) != offsets[i] || shader.getUniformFloatCount(names[i]) != sizes[i])
81 state.addFunc("setDirection", [](VegetationWindState* s, float x, float y, float z) { s->direction = {x, y, z}; });
85 auto audioState = table.addClass("VegetationWindAudioState", ssq::Class::Ctor<VegetationWindAudioState()>());
91 auto profile = table.addClass("VegetationWindProfile", ssq::Class::Ctor<VegetationWindProfile()>());
96 profile.addFunc("setFlex", [](VegetationWindProfile* p, float x, float y, float z) { p->flex = {x, y, z}; });
103 table.addFunc("advanceVegetationWind", [vm = table.getHandle()](VegetationWindState* s, float x, float y, float z,
111 table.addFunc("initializeVegetationWind", [vm = table.getHandle()](VegetationWindState* s, float x, float y,
119 table.addFunc("applyGrassWind", [vm = table.getHandle()](Shader* shader, const VegetationWindState* s,
128 table.addFunc("applyTreeWind", [vm = table.getHandle()](Shader* shader, const VegetationWindState* s,
138 table.addFunc("advanceVegetationWindAudio", [vm = table.getHandle()](VegetationWindAudioState* state,
142 state ? advanceVegetationWindAudio(*state, strength, transitionTime, dt, enabled, clipAvailable)
EVEngine assertion entry point, backed by zeroerr.
#define EV_ASSERT(cond,...)
Assert an internal engine invariant (state that must always hold).
Definition Assert.h:37
The single Squirrel projection for common Result, Status and Value.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
bool hasUniform(const std::string &name) const
Definition Shader.cpp:71
int getUniformIndex(const std::string &name) const
Definition Shader.cpp:73
int getUniformFloatCount(const std::string &name) const
Definition Shader.cpp:79
int sendToVar(const std::string &name, const void *data, size_t size)
Low-level blob write into a declared uniform (size must match declaration).
Definition Shader.cpp:85
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
Result< std::array< float, 14 > > packVegetationWind(const VegetationWindState &state, const VegetationWindProfile &profile, double seconds)
Pack a wind snapshot into the grass shader's final 14 float slots.
Definition VegetationWind.cpp:18
void exposeGrassWindBindings(ssq::Table &table)
Register wind state/profile and checked operations on the VM owner thread, retaining no table referen...
Definition GrassWind.cpp:76
Result< void > applyTreeWind(Shader &shader, const VegetationWindState &state, const VegetationWindProfile &vegetation, const TreeWindProfile &tree, double seconds)
Atomically publish one validated tree wind snapshot to CPU-side shader parameters.
Definition GrassWind.cpp:41
Result< void > initializeVegetationWind(VegetationWindState &state, glm::vec3 forward, float strength)
Apply Pcg WindManager.InstantWindApply semantics without smoothing.
Definition VegetationWind.cpp:32
Result< void > advanceVegetationWindAudio(VegetationWindAudioState &state, float windStrength, float transitionTime, float dt, bool enabled, bool clipAvailable)
Advance Pcg WindManager CheckWindVolume and ProcessWindAudio as a pure state transition.
Definition VegetationWind.cpp:68
Result< void > applyGrassWind(Shader &shader, const VegetationWindState &state, const VegetationWindProfile &profile, double seconds)
Atomically apply a validated wind snapshot to a grass shader's CPU uniform storage.
Definition GrassWind.cpp:13
@ InvalidArgument
ssq::Table projectResult(HSQUIRRELVM vm, Result< void > &&result)
Consume and project a void native Result using the common schema.
Definition SquirrelBinding.cpp:540
@ InvalidArgument
Caller-owned tree prototype wind geometry matching Pcg ResourceProtoTree inputs.
Definition TreeWind.h:12
glm::vec2 widthHeight
Object-space crown width and source prototype height; both must be positive.
Definition TreeWind.h:14
Caller-owned state for Pcg WindManager's looping wind-audio volume controller.
Definition VegetationWind.h:17
float anchorVolume
Definition VegetationWind.h:19
float currentWindSpeed
Definition VegetationWind.h:18
Caller-owned material wind controls; billboard suppresses source branch and leaf motion....
Definition VegetationWind.h:46
float maximumDistance
Definition VegetationWind.h:48
Caller-owned wind globals; no hidden clock, singleton or retained scene link.
Definition VegetationWind.h:7
float updatePhase
WindManager's private update accumulator; InstantWindApply deliberately preserves it.
Definition VegetationWind.h:13