update rigging
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
#include "rigging.hpp"
|
||||
|
||||
using namespace rigging;
|
||||
|
||||
RigNode::RigNode(size_t index, std::string name, std::vector<std::unique_ptr<RigNode>> subnodes)
|
||||
: index(index), name(std::move(name)), subnodes(std::move(subnodes)) {
|
||||
}
|
||||
|
||||
RigConfig::RigConfig(std::unique_ptr<RigNode> root) : root(std::move(root)) {
|
||||
}
|
||||
+18
-2
@@ -5,7 +5,9 @@
|
||||
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <glm/glm.hpp>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace rigging {
|
||||
struct Rig;
|
||||
@@ -15,19 +17,33 @@ namespace rigging {
|
||||
};
|
||||
|
||||
class RigNode {
|
||||
uint index;
|
||||
size_t index;
|
||||
std::string name;
|
||||
std::vector<std::unique_ptr<RigNode>> subnodes;
|
||||
public:
|
||||
RigNode(uint index);
|
||||
RigNode(size_t index, std::string name, std::vector<std::unique_ptr<RigNode>> subnodes);
|
||||
|
||||
size_t getIndex() const {
|
||||
return index;
|
||||
}
|
||||
|
||||
const auto& getSubnodes() const {
|
||||
return subnodes;
|
||||
}
|
||||
};
|
||||
|
||||
class RigConfig {
|
||||
std::unique_ptr<RigNode> root;
|
||||
std::unordered_map<std::string, size_t> indices;
|
||||
std::vector<RigNode*> nodes;
|
||||
public:
|
||||
RigConfig(std::unique_ptr<RigNode> root);
|
||||
};
|
||||
|
||||
struct Rig {
|
||||
RigConfig* config;
|
||||
Pose pose;
|
||||
std::vector<std::string> textures;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user