载入中...
搜索中...
未找到
Appearance.h
浏览该文件的文档.
1#pragma once
2
3#include "common/Export.h"
4#include "common/Result.h"
5#include "common/Value.h"
6
7#include <map>
8#include <string>
9#include <vector>
10
11namespace ssq {
12class Table;
13}
14namespace eve::graphics {
15class Mesh;
16}
17
18namespace eve::avatar {
19
28public:
33 [[nodiscard]] Result<void> configure(const Value& definition);
38 [[nodiscard]] Result<void> apply(const Value& patch);
43 [[nodiscard]] Result<void> restore(const Value& snapshot);
45 [[nodiscard]] Result<void> undo();
47 [[nodiscard]] Result<void> redo();
49 bool canUndo() const { return !undo_.empty(); }
51 bool canRedo() const { return !redo_.empty(); }
55 Value snapshot() const;
61 Value evaluate() const;
68 [[nodiscard]] Result<void> applyMorphWeights(graphics::Mesh& mesh, std::string_view prefix) const;
69
70private:
71 struct Parameter {
72 double minimum = 0, maximum = 1, initial = 0;
73 };
74 struct Input {
75 std::string parameter;
76 double start = 0, end = 1;
77 };
78 struct Driver {
79 std::string output;
80 double scale = 1;
81 std::vector<Input> inputs;
82 };
83 struct Item {
84 std::string slot;
85 std::vector<std::string> parts, hides, excludes;
86 };
87 struct State {
88 std::map<std::string, double> parameters;
89 std::map<std::string, std::string> selections;
90 bool operator==(const State&) const = default;
91 };
92 [[nodiscard]] Result<void> validate(const State& candidate) const;
93 [[nodiscard]] Result<void> publish(State candidate);
94 std::string profile_;
95 std::map<std::string, Parameter> parameters_;
96 std::map<std::string, Item> items_;
97 std::vector<Driver> drivers_;
98 State state_;
99 std::vector<State> undo_, redo_;
100};
101
105void exposeAppearance(ssq::Table& table);
106
107} // namespace eve::avatar
Duration start
std::vector< eve::artifact::PartView > parts
std::string output
EnvironmentTest definition
#define EVENGINE_API_DOMAINS
Definition Export.h:110
float maximum[3]
float minimum[3]
int inputs
Definition GridGraph.cpp:23
std::array< float, 3 > scale
Snapshot snapshot
OceanMeshSettings mesh
std::array< uint32_t, 9 > parameters
std::string slot
std::string parameter
Move-only, checked operation results for the common layer.
size_t end
Owning, renderer-independent dynamic values.
Move-only operation result carrying either a value or Status.
Definition Result.h:176
The canonical owning dynamic value used by data-facing protocols.
Definition Value.h:31
Renderer-independent character appearance authoring and runtime state. Owns its validated definition,...
Definition Appearance.h:27
bool canRedo() const
Query whether a redo state exists, without evaluating anything.
Definition Appearance.h:51
bool canUndo() const
Query whether an undo state exists, without evaluating anything.
Definition Appearance.h:49
GPU mesh handle (+ optional CPU morph targets).
Definition Mesh.h:26
void exposeAppearance(ssq::Table &table)
Register VM-owned Appearance objects. Table is borrowed only during registration. @thread VM owner th...
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
Result< int > publish(Heightmap &target, std::vector< float > candidate)
Publish.
void validate(const RuntimeTensor &v)
Validate.
State
Lifecycle state of a generic transaction plan.
enum EVENGINE_API_FOUNDATION Table
OT_TABLE (editable via Runtime table APIs / ReflectedPropertyModel).
Definition Runtime.h:121
EVEngine ECS 集成层:底层实现使用 sunxfancy/ECS.hpp https://github.com/sunxfancy/ECS.hpp
Definition ECS.h:21