mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 03:51:50 +00:00
update rigging
This commit is contained in:
parent
d4460928e5
commit
50f9bd508a
6 changed files with 34 additions and 18 deletions
10
src/objects/rigging.cpp
Normal file
10
src/objects/rigging.cpp
Normal file
|
|
@ -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)) {
|
||||
}
|
||||
|
|
@ -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;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue