remove bone::addBone

This commit is contained in:
MihailRis 2026-01-15 23:17:47 +03:00
parent 6760d16052
commit 587c140a6b
4 changed files with 23 additions and 23 deletions

View file

@ -32,11 +32,6 @@ Bone::Bone(
model({model, nullptr, true}) {
}
Bone& Bone::addBone(Bone&& bone) {
bones.push_back(std::make_unique<Bone>(std::move(bone)));
return *bones[bones.size() - 1];
}
void Bone::setModel(const std::string& name) {
if (model.name == name) {
return;
@ -93,7 +88,7 @@ void Skeleton::deserialize(const dv::value& root) {
static void get_all_nodes(std::vector<Bone*>& nodes, Bone* node) {
nodes[node->getIndex()] = node;
for (auto& subnode : node->getSubnodes()) {
for (auto& subnode : node->getBones()) {
get_all_nodes(nodes, subnode.get());
}
}
@ -116,7 +111,7 @@ size_t SkeletonConfig::update(
}
skeleton.calculated.matrices[index] = matrix * baseMatrix * boneMatrix;
size_t count = 1;
for (auto& subnode : node->getSubnodes()) {
for (auto& subnode : node->getBones()) {
count += update(
index + count,
skeleton,
@ -192,7 +187,7 @@ void SkeletonConfig::render(
}
}
Bone* SkeletonConfig::find(std::string_view str) const {
const Bone* SkeletonConfig::find(std::string_view str) const {
for (size_t i = 0; i < nodes.size(); i++) {
auto* node = nodes[i];
if (node->getName() == str) {