mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
remove bone::addBone
This commit is contained in:
parent
6760d16052
commit
587c140a6b
4 changed files with 23 additions and 23 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue