mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
update RigConfig
This commit is contained in:
parent
1b41a75cf4
commit
beac332c96
15 changed files with 230 additions and 62 deletions
|
|
@ -9,6 +9,12 @@
|
|||
#include <glm/glm.hpp>
|
||||
#include <unordered_map>
|
||||
|
||||
class Assets;
|
||||
|
||||
namespace model {
|
||||
struct Model;
|
||||
}
|
||||
|
||||
namespace rigging {
|
||||
struct Rig;
|
||||
|
||||
|
|
@ -19,9 +25,21 @@ namespace rigging {
|
|||
class RigNode {
|
||||
size_t index;
|
||||
std::string name;
|
||||
std::string modelName;
|
||||
std::vector<std::unique_ptr<RigNode>> subnodes;
|
||||
model::Model* model = nullptr;
|
||||
public:
|
||||
RigNode(size_t index, std::string name, std::vector<std::unique_ptr<RigNode>> subnodes);
|
||||
RigNode(
|
||||
size_t index,
|
||||
std::string name,
|
||||
std::string model,
|
||||
std::vector<std::unique_ptr<RigNode>> subnodes);
|
||||
|
||||
void setModel(const Assets* assets, const std::string& name);
|
||||
|
||||
const std::string& getModelName() const {
|
||||
return modelName;
|
||||
}
|
||||
|
||||
size_t getIndex() const {
|
||||
return index;
|
||||
|
|
@ -36,13 +54,28 @@ namespace rigging {
|
|||
std::unique_ptr<RigNode> root;
|
||||
std::unordered_map<std::string, size_t> indices;
|
||||
std::vector<RigNode*> nodes;
|
||||
|
||||
size_t update(
|
||||
size_t index,
|
||||
Rig& rig,
|
||||
RigNode* node,
|
||||
glm::mat4 matrix);
|
||||
public:
|
||||
RigConfig(std::unique_ptr<RigNode> root);
|
||||
|
||||
void update(Rig& rig, glm::mat4 matrix);
|
||||
void setup(const Assets* assets, RigNode* node=nullptr);
|
||||
|
||||
static std::unique_ptr<RigConfig> parse(
|
||||
std::string_view src,
|
||||
std::string_view file
|
||||
);
|
||||
};
|
||||
|
||||
struct Rig {
|
||||
RigConfig* config;
|
||||
Pose pose;
|
||||
Pose calculated;
|
||||
std::vector<std::string> textures;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue