载入中...
搜索中...
未找到
MeshEffect.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
7
8#include <string>
9
10namespace eve::graphics {
11class Graphics;
12class Shader;
13}
14
15namespace eve::stylize {
16
17struct MeshEffectTargetTag;
19
22
25 float fadeIn = 0.08f;
26 float duration = 0.25f;
27 float fadeOut = 0.12f;
28 bool loop = false;
29};
30
41public:
43 explicit MeshEffectInstance(std::string style);
45 MeshEffectInstance(std::string style, std::map<std::string, float> defaults);
46
49
51 void bindTarget(MeshEffectTargetHandle target);
53 void unbindTarget() noexcept;
55 [[nodiscard]] MeshEffectTargetHandle target() const noexcept { return target_; }
57 [[nodiscard]] bool isBound() const noexcept { return target_.isValid(); }
58
60 void setPlayback(MeshEffectPlayback playback);
62 [[nodiscard]] MeshEffectPlayback playback() const noexcept { return playback_; }
64 void play() noexcept;
66 void stop(float fadeOutSeconds = 0.f);
68 void update(float dtSeconds);
69
71 [[nodiscard]] MeshEffectState state() const noexcept { return state_; }
73 [[nodiscard]] float elapsed() const noexcept { return elapsed_; }
75 [[nodiscard]] float intensity() const noexcept;
77 [[nodiscard]] StyleInstance& style() noexcept { return style_; }
79 [[nodiscard]] const StyleInstance& style() const noexcept { return style_; }
80
82 [[nodiscard]] graphics::Shader* newMeshShader(graphics::Graphics* gfx);
83
84private:
85 void updateTimelineState() noexcept;
86 static void validateDuration(float value, const char* name);
87
88 StyleInstance style_;
90 MeshEffectPlayback playback_;
91 MeshEffectState state_ = MeshEffectState::Stopped;
92 float elapsed_ = 0.f;
93 float stopElapsed_ = 0.f;
94 float stopDuration_ = 0.f;
95 float stopStartIntensity_ = 0.f;
96};
97
98} // namespace eve::stylize
LogicalId target
double value
#define EVENGINE_API_WORLD
Definition Export.h:109
std::string name
float f
Strong generation-qualified handles for non-ECS runtime registries.
Custom GPU program.
Definition Shader.h:39
Runtime state for a shader effect attached to a renderable mesh.
Definition MeshEffect.h:40
const StyleInstance & style() const noexcept
Access the owned immutable style parameter instance.
Definition MeshEffect.h:79
float elapsed() const noexcept
Return elapsed playback time in seconds.
Definition MeshEffect.h:73
MeshEffectInstance & operator=(const MeshEffectInstance &)=delete
MeshEffectPlayback playback() const noexcept
Return a value snapshot of the timing configuration.
Definition MeshEffect.h:62
bool isBound() const noexcept
Return whether a target identity is currently bound.
Definition MeshEffect.h:57
MeshEffectInstance(const MeshEffectInstance &)=delete
Mutable parameter instance of an immutable built-in style definition.
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
MeshEffectState
Playback phase of a mesh-attached visual effect.
Definition MeshEffect.h:21
Deterministic timing configuration for one mesh effect playback.
Definition MeshEffect.h:24