-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSupple Component.cpp
More file actions
69 lines (59 loc) · 1.67 KB
/
Supple Component.cpp
File metadata and controls
69 lines (59 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
struct MaterialComponent {
std::string shaderPath;
std::unordered_map<std::string, float> floatParams;
std::unordered_map<std::string, std::string> texturePaths;
};
struct MaterialInstance {
std::shared_ptr<MaterialComponent> base;
uint32_t gpuMaterialID;
};
class AssetManager {
public:
static std::shared_ptr<Mesh> LoadMesh(const std::string& path);
static std::shared_ptr<Texture> LoadTexture(const std::string& path);
static void ClearCache();
private:
static std::unordered_map<std::string, std::shared_ptr<Mesh>> meshPool;
static std::unordered_map<std::string, std::shared_ptr<Texture>> texturePool;
};
enum class InputKey { W, A, S, D, Space, Escape, Ctrl, Shift };
class InputSystem {
public:
static void Poll();
static bool IsKeyPressed(InputKey key);
static bool IsGamepadButtonPressed(int gamepadID, int button);
};
struct AnimationComponent {
std::string skeletonPath;
std::vector<std::string> clipPaths;
int currentClip = 0;
float playbackTime = 0.f;
};
struct Skeleton {
struct Bone {
std::string name;
int parentIndex;
float bindPose[16]; // 4x4 matrix
};
std::vector<Bone> bones;
};
namespace FGS {
struct Node {
std::string event;
std::string action;
std::unordered_map<std::string, std::string> params;
};
class Graph {
public:
void Connect(const std::string& from, const std::string& to);
void Evaluate();
};
}
class LevelEditorUI {
public:
void Render();
};
class MaterialEditorUI {
public:
void Render(const MaterialComponent& mat);
};