mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
23 lines
624 B
C++
23 lines
624 B
C++
#include "NamedSkeletons.hpp"
|
|
|
|
#include "animation/rigging.hpp"
|
|
|
|
using namespace rigging;
|
|
|
|
NamedSkeletons::NamedSkeletons() = default;
|
|
|
|
std::shared_ptr<rigging::Skeleton> NamedSkeletons::createSkeleton(
|
|
const std::string& name, std::shared_ptr<const SkeletonConfig> config
|
|
) {
|
|
auto skeleton = std::make_shared<Skeleton>(std::move(config));
|
|
skeletons[name] = skeleton;
|
|
return skeleton;
|
|
}
|
|
|
|
rigging::Skeleton* NamedSkeletons::getSkeleton(const std::string& name) {
|
|
const auto& found = skeletons.find(name);
|
|
if (found == skeletons.end()) {
|
|
return nullptr;
|
|
}
|
|
return found->second.get();
|
|
}
|