|
@ -24,52 +24,55 @@ |
|
|
#include <engine/debug/log.hpp>
|
|
|
#include <engine/debug/log.hpp>
|
|
|
#include <engine/geom/primitives/box.hpp>
|
|
|
#include <engine/geom/primitives/box.hpp>
|
|
|
#include <unordered_set>
|
|
|
#include <unordered_set>
|
|
|
|
|
|
#include <optional>
|
|
|
|
|
|
|
|
|
|
|
|
using bone_index_type = skeleton::bone_index_type; |
|
|
|
|
|
|
|
|
namespace { |
|
|
namespace { |
|
|
|
|
|
|
|
|
/// Set of pointers to all possible ant skeleton bones.
|
|
|
/// Set of pointers to all possible ant skeleton bones.
|
|
|
struct ant_bone_set |
|
|
struct ant_bone_set |
|
|
{ |
|
|
{ |
|
|
::bone* mesosoma{nullptr}; |
|
|
|
|
|
::bone* procoxa_l{nullptr}; |
|
|
|
|
|
::bone* profemur_l{nullptr}; |
|
|
|
|
|
::bone* protibia_l{nullptr}; |
|
|
|
|
|
::bone* protarsus_l{nullptr}; |
|
|
|
|
|
::bone* procoxa_r{nullptr}; |
|
|
|
|
|
::bone* profemur_r{nullptr}; |
|
|
|
|
|
::bone* protibia_r{nullptr}; |
|
|
|
|
|
::bone* protarsus_r{nullptr}; |
|
|
|
|
|
::bone* mesocoxa_l{nullptr}; |
|
|
|
|
|
::bone* mesofemur_l{nullptr}; |
|
|
|
|
|
::bone* mesotibia_l{nullptr}; |
|
|
|
|
|
::bone* mesotarsus_l{nullptr}; |
|
|
|
|
|
::bone* mesocoxa_r{nullptr}; |
|
|
|
|
|
::bone* mesofemur_r{nullptr}; |
|
|
|
|
|
::bone* mesotibia_r{nullptr}; |
|
|
|
|
|
::bone* mesotarsus_r{nullptr}; |
|
|
|
|
|
::bone* metacoxa_l{nullptr}; |
|
|
|
|
|
::bone* metafemur_l{nullptr}; |
|
|
|
|
|
::bone* metatibia_l{nullptr}; |
|
|
|
|
|
::bone* metatarsus_l{nullptr}; |
|
|
|
|
|
::bone* metacoxa_r{nullptr}; |
|
|
|
|
|
::bone* metafemur_r{nullptr}; |
|
|
|
|
|
::bone* metatibia_r{nullptr}; |
|
|
|
|
|
::bone* metatarsus_r{nullptr}; |
|
|
|
|
|
::bone* head{nullptr}; |
|
|
|
|
|
::bone* mandible_l{nullptr}; |
|
|
|
|
|
::bone* mandible_r{nullptr}; |
|
|
|
|
|
::bone* antennomere1_l{nullptr}; |
|
|
|
|
|
::bone* antennomere2_l{nullptr}; |
|
|
|
|
|
::bone* antennomere1_r{nullptr}; |
|
|
|
|
|
::bone* antennomere2_r{nullptr}; |
|
|
|
|
|
::bone* petiole{nullptr}; |
|
|
|
|
|
::bone* postpetiole{nullptr}; |
|
|
|
|
|
::bone* gaster{nullptr}; |
|
|
|
|
|
::bone* sting{nullptr}; |
|
|
|
|
|
::bone* forewing_l{nullptr}; |
|
|
|
|
|
::bone* forewing_r{nullptr}; |
|
|
|
|
|
::bone* hindwing_l{nullptr}; |
|
|
|
|
|
::bone* hindwing_r{nullptr}; |
|
|
|
|
|
|
|
|
std::optional<bone_index_type> mesosoma; |
|
|
|
|
|
std::optional<bone_index_type> procoxa_l; |
|
|
|
|
|
std::optional<bone_index_type> profemur_l; |
|
|
|
|
|
std::optional<bone_index_type> protibia_l; |
|
|
|
|
|
std::optional<bone_index_type> protarsus_l; |
|
|
|
|
|
std::optional<bone_index_type> procoxa_r; |
|
|
|
|
|
std::optional<bone_index_type> profemur_r; |
|
|
|
|
|
std::optional<bone_index_type> protibia_r; |
|
|
|
|
|
std::optional<bone_index_type> protarsus_r; |
|
|
|
|
|
std::optional<bone_index_type> mesocoxa_l; |
|
|
|
|
|
std::optional<bone_index_type> mesofemur_l; |
|
|
|
|
|
std::optional<bone_index_type> mesotibia_l; |
|
|
|
|
|
std::optional<bone_index_type> mesotarsus_l; |
|
|
|
|
|
std::optional<bone_index_type> mesocoxa_r; |
|
|
|
|
|
std::optional<bone_index_type> mesofemur_r; |
|
|
|
|
|
std::optional<bone_index_type> mesotibia_r; |
|
|
|
|
|
std::optional<bone_index_type> mesotarsus_r; |
|
|
|
|
|
std::optional<bone_index_type> metacoxa_l; |
|
|
|
|
|
std::optional<bone_index_type> metafemur_l; |
|
|
|
|
|
std::optional<bone_index_type> metatibia_l; |
|
|
|
|
|
std::optional<bone_index_type> metatarsus_l; |
|
|
|
|
|
std::optional<bone_index_type> metacoxa_r; |
|
|
|
|
|
std::optional<bone_index_type> metafemur_r; |
|
|
|
|
|
std::optional<bone_index_type> metatibia_r; |
|
|
|
|
|
std::optional<bone_index_type> metatarsus_r; |
|
|
|
|
|
std::optional<bone_index_type> head; |
|
|
|
|
|
std::optional<bone_index_type> mandible_l; |
|
|
|
|
|
std::optional<bone_index_type> mandible_r; |
|
|
|
|
|
std::optional<bone_index_type> antennomere1_l; |
|
|
|
|
|
std::optional<bone_index_type> antennomere2_l; |
|
|
|
|
|
std::optional<bone_index_type> antennomere1_r; |
|
|
|
|
|
std::optional<bone_index_type> antennomere2_r; |
|
|
|
|
|
std::optional<bone_index_type> petiole; |
|
|
|
|
|
std::optional<bone_index_type> postpetiole; |
|
|
|
|
|
std::optional<bone_index_type> gaster; |
|
|
|
|
|
std::optional<bone_index_type> sting; |
|
|
|
|
|
std::optional<bone_index_type> forewing_l; |
|
|
|
|
|
std::optional<bone_index_type> forewing_r; |
|
|
|
|
|
std::optional<bone_index_type> hindwing_l; |
|
|
|
|
|
std::optional<bone_index_type> hindwing_r; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
@ -91,7 +94,7 @@ void reskin_vertices |
|
|
const gl::vertex_attribute& normal_attribute, |
|
|
const gl::vertex_attribute& normal_attribute, |
|
|
const gl::vertex_attribute& tangent_attribute, |
|
|
const gl::vertex_attribute& tangent_attribute, |
|
|
const gl::vertex_attribute& bone_index_attribute, |
|
|
const gl::vertex_attribute& bone_index_attribute, |
|
|
const std::unordered_map<std::uint16_t, std::tuple<std::uint16_t, const math::transform<float>*>>& reskin_map |
|
|
|
|
|
|
|
|
const std::unordered_map<bone_index_type, std::tuple<bone_index_type, const math::transform<float>*>>& reskin_map |
|
|
) |
|
|
) |
|
|
{ |
|
|
{ |
|
|
std::byte* position_data = vertex_data + position_attribute.offset; |
|
|
std::byte* position_data = vertex_data + position_attribute.offset; |
|
@ -105,7 +108,7 @@ void reskin_vertices |
|
|
std::uint32_t& bone_index = reinterpret_cast<std::uint32_t&>(*(bone_index_data + bone_index_attribute.stride * i)); |
|
|
std::uint32_t& bone_index = reinterpret_cast<std::uint32_t&>(*(bone_index_data + bone_index_attribute.stride * i)); |
|
|
|
|
|
|
|
|
// Ignore vertices with unmapped bone indices
|
|
|
// Ignore vertices with unmapped bone indices
|
|
|
auto entry = reskin_map.find(static_cast<std::uint16_t>(bone_index)); |
|
|
|
|
|
|
|
|
auto entry = reskin_map.find(static_cast<bone_index_type>(bone_index)); |
|
|
if (entry == reskin_map.end()) |
|
|
if (entry == reskin_map.end()) |
|
|
{ |
|
|
{ |
|
|
continue; |
|
|
continue; |
|
@ -239,11 +242,11 @@ void reskin_vertices |
|
|
* * sting |
|
|
* * sting |
|
|
* |
|
|
* |
|
|
*/ |
|
|
*/ |
|
|
[[nodiscard]] std::uint16_t count_ant_skeleton_bones(const ant_phenome& phenome) noexcept |
|
|
|
|
|
|
|
|
[[nodiscard]] std::size_t count_ant_skeleton_bones(const ant_phenome& phenome) noexcept |
|
|
{ |
|
|
{ |
|
|
constexpr std::uint16_t minimum_bone_count = 33; |
|
|
|
|
|
|
|
|
constexpr std::size_t minimum_bone_count = 33; |
|
|
|
|
|
|
|
|
std::uint16_t bone_count = minimum_bone_count; |
|
|
|
|
|
|
|
|
std::size_t bone_count = minimum_bone_count; |
|
|
|
|
|
|
|
|
if (phenome.waist->petiole_present) |
|
|
if (phenome.waist->petiole_present) |
|
|
{ |
|
|
{ |
|
@ -275,189 +278,199 @@ void reskin_vertices |
|
|
void build_ant_skeleton(const ant_phenome& phenome, ::skeleton& skeleton, ant_bone_set& bones) |
|
|
void build_ant_skeleton(const ant_phenome& phenome, ::skeleton& skeleton, ant_bone_set& bones) |
|
|
{ |
|
|
{ |
|
|
// Allocate bones
|
|
|
// Allocate bones
|
|
|
const std::uint16_t bone_count = count_ant_skeleton_bones(phenome); |
|
|
|
|
|
skeleton.bones.resize(bone_count); |
|
|
|
|
|
|
|
|
skeleton.set_bone_count(count_ant_skeleton_bones(phenome)); |
|
|
|
|
|
|
|
|
|
|
|
// Construct ant bone set
|
|
|
|
|
|
bone_index_type bone_index = 0; |
|
|
|
|
|
bones.mesosoma = bone_index; |
|
|
|
|
|
bones.procoxa_l = ++bone_index; |
|
|
|
|
|
bones.profemur_l = ++bone_index; |
|
|
|
|
|
bones.protibia_l = ++bone_index; |
|
|
|
|
|
bones.protarsus_l = ++bone_index; |
|
|
|
|
|
bones.procoxa_r = ++bone_index; |
|
|
|
|
|
bones.profemur_r = ++bone_index; |
|
|
|
|
|
bones.protibia_r = ++bone_index; |
|
|
|
|
|
bones.protarsus_r = ++bone_index; |
|
|
|
|
|
bones.mesocoxa_l = ++bone_index; |
|
|
|
|
|
bones.mesofemur_l = ++bone_index; |
|
|
|
|
|
bones.mesotibia_l = ++bone_index; |
|
|
|
|
|
bones.mesotarsus_l = ++bone_index; |
|
|
|
|
|
bones.mesocoxa_r = ++bone_index; |
|
|
|
|
|
bones.mesofemur_r = ++bone_index; |
|
|
|
|
|
bones.mesotibia_r = ++bone_index; |
|
|
|
|
|
bones.mesotarsus_r = ++bone_index; |
|
|
|
|
|
bones.metacoxa_l = ++bone_index; |
|
|
|
|
|
bones.metafemur_l = ++bone_index; |
|
|
|
|
|
bones.metatibia_l = ++bone_index; |
|
|
|
|
|
bones.metatarsus_l = ++bone_index; |
|
|
|
|
|
bones.metacoxa_r = ++bone_index; |
|
|
|
|
|
bones.metafemur_r = ++bone_index; |
|
|
|
|
|
bones.metatibia_r = ++bone_index; |
|
|
|
|
|
bones.metatarsus_r = ++bone_index; |
|
|
|
|
|
bones.head = ++bone_index; |
|
|
|
|
|
bones.mandible_l = ++bone_index; |
|
|
|
|
|
bones.mandible_r = ++bone_index; |
|
|
|
|
|
bones.antennomere1_l = ++bone_index; |
|
|
|
|
|
bones.antennomere2_l = ++bone_index; |
|
|
|
|
|
bones.antennomere1_r = ++bone_index; |
|
|
|
|
|
bones.antennomere2_r = ++bone_index; |
|
|
|
|
|
|
|
|
// Assign bone indices
|
|
|
|
|
|
for (std::uint16_t i = 0; i < bone_count; ++i) |
|
|
|
|
|
|
|
|
if (phenome.waist->petiole_present) |
|
|
{ |
|
|
{ |
|
|
skeleton.bones[i] = i; |
|
|
|
|
|
|
|
|
bones.petiole = ++bone_index; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Construct ant bone set
|
|
|
|
|
|
::bone* current_bone = skeleton.bones.data(); |
|
|
|
|
|
bones.mesosoma = current_bone; |
|
|
|
|
|
bones.procoxa_l = ++current_bone; |
|
|
|
|
|
bones.profemur_l = ++current_bone; |
|
|
|
|
|
bones.protibia_l = ++current_bone; |
|
|
|
|
|
bones.protarsus_l = ++current_bone; |
|
|
|
|
|
bones.procoxa_r = ++current_bone; |
|
|
|
|
|
bones.profemur_r = ++current_bone; |
|
|
|
|
|
bones.protibia_r = ++current_bone; |
|
|
|
|
|
bones.protarsus_r = ++current_bone; |
|
|
|
|
|
bones.mesocoxa_l = ++current_bone; |
|
|
|
|
|
bones.mesofemur_l = ++current_bone; |
|
|
|
|
|
bones.mesotibia_l = ++current_bone; |
|
|
|
|
|
bones.mesotarsus_l = ++current_bone; |
|
|
|
|
|
bones.mesocoxa_r = ++current_bone; |
|
|
|
|
|
bones.mesofemur_r = ++current_bone; |
|
|
|
|
|
bones.mesotibia_r = ++current_bone; |
|
|
|
|
|
bones.mesotarsus_r = ++current_bone; |
|
|
|
|
|
bones.metacoxa_l = ++current_bone; |
|
|
|
|
|
bones.metafemur_l = ++current_bone; |
|
|
|
|
|
bones.metatibia_l = ++current_bone; |
|
|
|
|
|
bones.metatarsus_l = ++current_bone; |
|
|
|
|
|
bones.metacoxa_r = ++current_bone; |
|
|
|
|
|
bones.metafemur_r = ++current_bone; |
|
|
|
|
|
bones.metatibia_r = ++current_bone; |
|
|
|
|
|
bones.metatarsus_r = ++current_bone; |
|
|
|
|
|
bones.head = ++current_bone; |
|
|
|
|
|
bones.mandible_l = ++current_bone; |
|
|
|
|
|
bones.mandible_r = ++current_bone; |
|
|
|
|
|
bones.antennomere1_l = ++current_bone; |
|
|
|
|
|
bones.antennomere2_l = ++current_bone; |
|
|
|
|
|
bones.antennomere1_r = ++current_bone; |
|
|
|
|
|
bones.antennomere2_r = ++current_bone; |
|
|
|
|
|
bones.petiole = phenome.waist->petiole_present ? ++current_bone : nullptr; |
|
|
|
|
|
bones.postpetiole = phenome.waist->postpetiole_present ? ++current_bone : nullptr; |
|
|
|
|
|
bones.gaster = ++current_bone; |
|
|
|
|
|
bones.sting = phenome.sting->present ? ++current_bone : nullptr; |
|
|
|
|
|
bones.forewing_l = phenome.wings->present ? ++current_bone : nullptr; |
|
|
|
|
|
bones.forewing_r = phenome.wings->present ? ++current_bone : nullptr; |
|
|
|
|
|
bones.hindwing_l = phenome.wings->present ? ++current_bone : nullptr; |
|
|
|
|
|
bones.hindwing_r = phenome.wings->present ? ++current_bone : nullptr; |
|
|
|
|
|
|
|
|
if (phenome.waist->postpetiole_present) |
|
|
|
|
|
{ |
|
|
|
|
|
bones.postpetiole = ++bone_index; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bones.gaster = ++bone_index; |
|
|
|
|
|
|
|
|
|
|
|
if (phenome.sting->present) |
|
|
|
|
|
{ |
|
|
|
|
|
bones.sting = ++bone_index; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (phenome.wings->present) |
|
|
|
|
|
{ |
|
|
|
|
|
bones.forewing_l = ++bone_index; |
|
|
|
|
|
bones.forewing_r = ++bone_index; |
|
|
|
|
|
bones.hindwing_l = ++bone_index; |
|
|
|
|
|
bones.hindwing_r = ++bone_index; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Assign bone parents
|
|
|
// Assign bone parents
|
|
|
reparent_bone(*bones.mesosoma, *bones.mesosoma); |
|
|
|
|
|
reparent_bone(*bones.procoxa_l, *bones.mesosoma); |
|
|
|
|
|
reparent_bone(*bones.profemur_l, *bones.procoxa_l); |
|
|
|
|
|
reparent_bone(*bones.protibia_l, *bones.profemur_l); |
|
|
|
|
|
reparent_bone(*bones.protarsus_l, *bones.protibia_l); |
|
|
|
|
|
reparent_bone(*bones.procoxa_r, *bones.mesosoma); |
|
|
|
|
|
reparent_bone(*bones.profemur_r, *bones.procoxa_r); |
|
|
|
|
|
reparent_bone(*bones.protibia_r, *bones.profemur_r); |
|
|
|
|
|
reparent_bone(*bones.protarsus_r, *bones.protibia_r); |
|
|
|
|
|
reparent_bone(*bones.mesocoxa_l, *bones.mesosoma); |
|
|
|
|
|
reparent_bone(*bones.mesofemur_l, *bones.mesocoxa_l); |
|
|
|
|
|
reparent_bone(*bones.mesotibia_l, *bones.mesofemur_l); |
|
|
|
|
|
reparent_bone(*bones.mesotarsus_l, *bones.mesotibia_l); |
|
|
|
|
|
reparent_bone(*bones.mesocoxa_r, *bones.mesosoma); |
|
|
|
|
|
reparent_bone(*bones.mesofemur_r, *bones.mesocoxa_r); |
|
|
|
|
|
reparent_bone(*bones.mesotibia_r, *bones.mesofemur_r); |
|
|
|
|
|
reparent_bone(*bones.mesotarsus_r, *bones.mesotibia_r); |
|
|
|
|
|
reparent_bone(*bones.metacoxa_l, *bones.mesosoma); |
|
|
|
|
|
reparent_bone(*bones.metafemur_l, *bones.metacoxa_l); |
|
|
|
|
|
reparent_bone(*bones.metatibia_l, *bones.metafemur_l); |
|
|
|
|
|
reparent_bone(*bones.metatarsus_l, *bones.metatibia_l); |
|
|
|
|
|
reparent_bone(*bones.metacoxa_r, *bones.mesosoma); |
|
|
|
|
|
reparent_bone(*bones.metafemur_r, *bones.metacoxa_r); |
|
|
|
|
|
reparent_bone(*bones.metatibia_r, *bones.metafemur_r); |
|
|
|
|
|
reparent_bone(*bones.metatarsus_r, *bones.metatibia_r); |
|
|
|
|
|
reparent_bone(*bones.head, *bones.mesosoma); |
|
|
|
|
|
reparent_bone(*bones.mandible_l, *bones.head); |
|
|
|
|
|
reparent_bone(*bones.mandible_r, *bones.head); |
|
|
|
|
|
reparent_bone(*bones.antennomere1_l, *bones.head); |
|
|
|
|
|
reparent_bone(*bones.antennomere2_l, *bones.antennomere1_l); |
|
|
|
|
|
reparent_bone(*bones.antennomere1_r, *bones.head); |
|
|
|
|
|
reparent_bone(*bones.antennomere2_r, *bones.antennomere1_r); |
|
|
|
|
|
|
|
|
skeleton.set_bone_parent(*bones.mesosoma, *bones.mesosoma); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.procoxa_l, *bones.mesosoma); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.profemur_l, *bones.procoxa_l); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.protibia_l, *bones.profemur_l); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.protarsus_l, *bones.protibia_l); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.procoxa_r, *bones.mesosoma); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.profemur_r, *bones.procoxa_r); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.protibia_r, *bones.profemur_r); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.protarsus_r, *bones.protibia_r); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.mesocoxa_l, *bones.mesosoma); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.mesofemur_l, *bones.mesocoxa_l); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.mesotibia_l, *bones.mesofemur_l); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.mesotarsus_l, *bones.mesotibia_l); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.mesocoxa_r, *bones.mesosoma); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.mesofemur_r, *bones.mesocoxa_r); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.mesotibia_r, *bones.mesofemur_r); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.mesotarsus_r, *bones.mesotibia_r); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.metacoxa_l, *bones.mesosoma); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.metafemur_l, *bones.metacoxa_l); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.metatibia_l, *bones.metafemur_l); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.metatarsus_l, *bones.metatibia_l); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.metacoxa_r, *bones.mesosoma); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.metafemur_r, *bones.metacoxa_r); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.metatibia_r, *bones.metafemur_r); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.metatarsus_r, *bones.metatibia_r); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.head, *bones.mesosoma); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.mandible_l, *bones.head); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.mandible_r, *bones.head); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.antennomere1_l, *bones.head); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.antennomere2_l, *bones.antennomere1_l); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.antennomere1_r, *bones.head); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.antennomere2_r, *bones.antennomere1_r); |
|
|
|
|
|
|
|
|
if (bones.petiole) |
|
|
if (bones.petiole) |
|
|
{ |
|
|
{ |
|
|
reparent_bone(*bones.petiole, *bones.mesosoma); |
|
|
|
|
|
|
|
|
skeleton.set_bone_parent(*bones.petiole, *bones.mesosoma); |
|
|
} |
|
|
} |
|
|
if (bones.postpetiole) |
|
|
if (bones.postpetiole) |
|
|
{ |
|
|
{ |
|
|
if (bones.petiole) |
|
|
if (bones.petiole) |
|
|
{ |
|
|
{ |
|
|
reparent_bone(*bones.postpetiole, *bones.petiole); |
|
|
|
|
|
|
|
|
skeleton.set_bone_parent(*bones.postpetiole, *bones.petiole); |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
reparent_bone(*bones.postpetiole, *bones.mesosoma); |
|
|
|
|
|
|
|
|
skeleton.set_bone_parent(*bones.postpetiole, *bones.mesosoma); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (bones.postpetiole) |
|
|
if (bones.postpetiole) |
|
|
{ |
|
|
{ |
|
|
reparent_bone(*bones.gaster, *bones.postpetiole); |
|
|
|
|
|
|
|
|
skeleton.set_bone_parent(*bones.gaster, *bones.postpetiole); |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
if (bones.petiole) |
|
|
if (bones.petiole) |
|
|
{ |
|
|
{ |
|
|
reparent_bone(*bones.gaster, *bones.petiole); |
|
|
|
|
|
|
|
|
skeleton.set_bone_parent(*bones.gaster, *bones.petiole); |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
reparent_bone(*bones.gaster, *bones.mesosoma); |
|
|
|
|
|
|
|
|
skeleton.set_bone_parent(*bones.gaster, *bones.mesosoma); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (bones.sting) |
|
|
if (bones.sting) |
|
|
{ |
|
|
{ |
|
|
reparent_bone(*bones.sting, *bones.gaster); |
|
|
|
|
|
|
|
|
skeleton.set_bone_parent(*bones.sting, *bones.gaster); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (bones.forewing_l) |
|
|
if (bones.forewing_l) |
|
|
{ |
|
|
{ |
|
|
reparent_bone(*bones.forewing_l, *bones.mesosoma); |
|
|
|
|
|
reparent_bone(*bones.forewing_r, *bones.mesosoma); |
|
|
|
|
|
reparent_bone(*bones.hindwing_l, *bones.mesosoma); |
|
|
|
|
|
reparent_bone(*bones.hindwing_r, *bones.mesosoma); |
|
|
|
|
|
|
|
|
skeleton.set_bone_parent(*bones.forewing_l, *bones.mesosoma); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.forewing_r, *bones.mesosoma); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.hindwing_l, *bones.mesosoma); |
|
|
|
|
|
skeleton.set_bone_parent(*bones.hindwing_r, *bones.mesosoma); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Map bone names to bones
|
|
|
// Map bone names to bones
|
|
|
skeleton.bone_map["mesosoma"] = *bones.mesosoma; |
|
|
|
|
|
skeleton.bone_map["procoxa_l"] = *bones.procoxa_l; |
|
|
|
|
|
skeleton.bone_map["profemur_l"] = *bones.profemur_l; |
|
|
|
|
|
skeleton.bone_map["protibia_l"] = *bones.protibia_l; |
|
|
|
|
|
skeleton.bone_map["protarsus_l"] = *bones.protarsus_l; |
|
|
|
|
|
skeleton.bone_map["procoxa_r"] = *bones.procoxa_r; |
|
|
|
|
|
skeleton.bone_map["profemur_r"] = *bones.profemur_r; |
|
|
|
|
|
skeleton.bone_map["protibia_r"] = *bones.protibia_r; |
|
|
|
|
|
skeleton.bone_map["protarsus_r"] = *bones.protarsus_r; |
|
|
|
|
|
skeleton.bone_map["mesocoxa_l"] = *bones.mesocoxa_l; |
|
|
|
|
|
skeleton.bone_map["mesofemur_l"] = *bones.mesofemur_l; |
|
|
|
|
|
skeleton.bone_map["mesotibia_l"] = *bones.mesotibia_l; |
|
|
|
|
|
skeleton.bone_map["mesotarsus_l"] = *bones.mesotarsus_l; |
|
|
|
|
|
skeleton.bone_map["mesocoxa_r"] = *bones.mesocoxa_r; |
|
|
|
|
|
skeleton.bone_map["mesofemur_r"] = *bones.mesofemur_r; |
|
|
|
|
|
skeleton.bone_map["mesotibia_r"] = *bones.mesotibia_r; |
|
|
|
|
|
skeleton.bone_map["mesotarsus_r"] = *bones.mesotarsus_r; |
|
|
|
|
|
skeleton.bone_map["metacoxa_l"] = *bones.metacoxa_l; |
|
|
|
|
|
skeleton.bone_map["metafemur_l"] = *bones.metafemur_l; |
|
|
|
|
|
skeleton.bone_map["metatibia_l"] = *bones.metatibia_l; |
|
|
|
|
|
skeleton.bone_map["metatarsus_l"] = *bones.metatarsus_l; |
|
|
|
|
|
skeleton.bone_map["metacoxa_r"] = *bones.metacoxa_r; |
|
|
|
|
|
skeleton.bone_map["metafemur_r"] = *bones.metafemur_r; |
|
|
|
|
|
skeleton.bone_map["metatibia_r"] = *bones.metatibia_r; |
|
|
|
|
|
skeleton.bone_map["metatarsus_r"] = *bones.metatarsus_r; |
|
|
|
|
|
skeleton.bone_map["head"] = *bones.head; |
|
|
|
|
|
skeleton.bone_map["mandible_l"] = *bones.mandible_l; |
|
|
|
|
|
skeleton.bone_map["mandible_r"] = *bones.mandible_r; |
|
|
|
|
|
skeleton.bone_map["antennomere1_l"] = *bones.antennomere1_l; |
|
|
|
|
|
skeleton.bone_map["antennomere2_l"] = *bones.antennomere2_l; |
|
|
|
|
|
skeleton.bone_map["antennomere1_r"] = *bones.antennomere1_r; |
|
|
|
|
|
skeleton.bone_map["antennomere2_r"] = *bones.antennomere2_r; |
|
|
|
|
|
|
|
|
skeleton.set_bone_name(*bones.mesosoma, "mesosoma"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.procoxa_l, "procoxa_l"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.profemur_l, "profemur_l"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.protibia_l, "protibia_l"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.protarsus_l, "protarsus_l"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.procoxa_r, "procoxa_r"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.profemur_r, "profemur_r"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.protibia_r, "protibia_r"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.protarsus_r, "protarsus_r"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.mesocoxa_l, "mesocoxa_l"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.mesofemur_l, "mesofemur_l"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.mesotibia_l, "mesotibia_l"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.mesotarsus_l, "mesotarsus_l"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.mesocoxa_r, "mesocoxa_r"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.mesofemur_r, "mesofemur_r"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.mesotibia_r, "mesotibia_r"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.mesotarsus_r, "mesotarsus_r"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.metacoxa_l, "metacoxa_l"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.metafemur_l, "metafemur_l"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.metatibia_l, "metatibia_l"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.metatarsus_l, "metatarsus_l"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.metacoxa_r, "metacoxa_r"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.metafemur_r, "metafemur_r"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.metatibia_r, "metatibia_r"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.metatarsus_r, "metatarsus_r"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.head, "head"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.mandible_l, "mandible_l"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.mandible_r, "mandible_r"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.antennomere1_l, "antennomere1_l"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.antennomere2_l, "antennomere2_l"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.antennomere1_r, "antennomere1_r"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.antennomere2_r, "antennomere2_r"); |
|
|
if (bones.petiole) |
|
|
if (bones.petiole) |
|
|
{ |
|
|
{ |
|
|
skeleton.bone_map["petiole"] = *bones.petiole; |
|
|
|
|
|
|
|
|
skeleton.set_bone_name(*bones.petiole, "petiole"); |
|
|
} |
|
|
} |
|
|
if (bones.postpetiole) |
|
|
if (bones.postpetiole) |
|
|
{ |
|
|
{ |
|
|
skeleton.bone_map["postpetiole"] = *bones.postpetiole; |
|
|
|
|
|
|
|
|
skeleton.set_bone_name(*bones.postpetiole, "postpetiole"); |
|
|
} |
|
|
} |
|
|
skeleton.bone_map["gaster"] = *bones.gaster; |
|
|
|
|
|
|
|
|
skeleton.set_bone_name(*bones.gaster, "gaster"); |
|
|
if (bones.sting) |
|
|
if (bones.sting) |
|
|
{ |
|
|
{ |
|
|
skeleton.bone_map["sting"] = *bones.sting; |
|
|
|
|
|
|
|
|
skeleton.set_bone_name(*bones.sting, "sting"); |
|
|
} |
|
|
} |
|
|
if (bones.forewing_l) |
|
|
if (bones.forewing_l) |
|
|
{ |
|
|
{ |
|
|
skeleton.bone_map["forewing_l"] = *bones.forewing_l; |
|
|
|
|
|
skeleton.bone_map["forewing_r"] = *bones.forewing_r; |
|
|
|
|
|
skeleton.bone_map["hindwing_l"] = *bones.hindwing_l; |
|
|
|
|
|
skeleton.bone_map["hindwing_r"] = *bones.hindwing_r; |
|
|
|
|
|
|
|
|
skeleton.set_bone_name(*bones.forewing_l, "forewing_l"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.forewing_r, "forewing_r"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.hindwing_l, "hindwing_l"); |
|
|
|
|
|
skeleton.set_bone_name(*bones.hindwing_r, "hindwing_r"); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -469,7 +482,7 @@ void build_ant_skeleton(const ant_phenome& phenome, ::skeleton& skeleton, ant_bo |
|
|
* @param[in,out] skeleton Ant skeleton. |
|
|
* @param[in,out] skeleton Ant skeleton. |
|
|
* @param[out] bind_pose_ss Skeleton-space bind pose. |
|
|
* @param[out] bind_pose_ss Skeleton-space bind pose. |
|
|
*/ |
|
|
*/ |
|
|
void build_ant_bind_pose(const ant_phenome& phenome, const ant_bone_set& bones, ::skeleton& skeleton, ::pose& bind_pose_ss) |
|
|
|
|
|
|
|
|
void build_ant_bind_pose(const ant_phenome& phenome, const ant_bone_set& bones, ::skeleton& skeleton) |
|
|
{ |
|
|
{ |
|
|
// Get body part skeletons
|
|
|
// Get body part skeletons
|
|
|
const ::skeleton& mesosoma_skeleton = phenome.mesosoma->model->get_skeleton(); |
|
|
const ::skeleton& mesosoma_skeleton = phenome.mesosoma->model->get_skeleton(); |
|
@ -483,80 +496,78 @@ void build_ant_bind_pose(const ant_phenome& phenome, const ant_bone_set& bones, |
|
|
const ::skeleton* forewings_skeleton = (phenome.wings->present) ? &phenome.wings->forewings_model->get_skeleton() : nullptr; |
|
|
const ::skeleton* forewings_skeleton = (phenome.wings->present) ? &phenome.wings->forewings_model->get_skeleton() : nullptr; |
|
|
const ::skeleton* hindwings_skeleton = (phenome.wings->present) ? &phenome.wings->hindwings_model->get_skeleton() : nullptr; |
|
|
const ::skeleton* hindwings_skeleton = (phenome.wings->present) ? &phenome.wings->hindwings_model->get_skeleton() : nullptr; |
|
|
|
|
|
|
|
|
// Get reference to skeleton bind pose
|
|
|
|
|
|
pose& bind_pose = skeleton.bind_pose; |
|
|
|
|
|
|
|
|
auto get_bone_transform = [](const ::skeleton& skeleton, hash::fnv1a32_t bone_name) |
|
|
|
|
|
{ |
|
|
|
|
|
return skeleton.get_bind_pose().get_relative_transform(*skeleton.get_bone_index(bone_name)); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
// Build skeleton bind pose
|
|
|
// Build skeleton bind pose
|
|
|
bind_pose[*bones.mesosoma] = mesosoma_skeleton.bind_pose.at(mesosoma_skeleton.bone_map.at("mesosoma")); |
|
|
|
|
|
bind_pose[*bones.procoxa_l] = legs_skeleton.bind_pose.at(legs_skeleton.bone_map.at("procoxa_l")); |
|
|
|
|
|
bind_pose[*bones.profemur_l] = legs_skeleton.bind_pose.at(legs_skeleton.bone_map.at("profemur_l")); |
|
|
|
|
|
bind_pose[*bones.protibia_l] = legs_skeleton.bind_pose.at(legs_skeleton.bone_map.at("protibia_l")); |
|
|
|
|
|
bind_pose[*bones.protarsus_l] = legs_skeleton.bind_pose.at(legs_skeleton.bone_map.at("protarsus1_l")); |
|
|
|
|
|
bind_pose[*bones.procoxa_r] = legs_skeleton.bind_pose.at(legs_skeleton.bone_map.at("procoxa_r")); |
|
|
|
|
|
bind_pose[*bones.profemur_r] = legs_skeleton.bind_pose.at(legs_skeleton.bone_map.at("profemur_r")); |
|
|
|
|
|
bind_pose[*bones.protibia_r] = legs_skeleton.bind_pose.at(legs_skeleton.bone_map.at("protibia_r")); |
|
|
|
|
|
bind_pose[*bones.protarsus_r] = legs_skeleton.bind_pose.at(legs_skeleton.bone_map.at("protarsus1_r")); |
|
|
|
|
|
bind_pose[*bones.mesocoxa_l] = legs_skeleton.bind_pose.at(legs_skeleton.bone_map.at("mesocoxa_l")); |
|
|
|
|
|
bind_pose[*bones.mesofemur_l] = legs_skeleton.bind_pose.at(legs_skeleton.bone_map.at("mesofemur_l")); |
|
|
|
|
|
bind_pose[*bones.mesotibia_l] = legs_skeleton.bind_pose.at(legs_skeleton.bone_map.at("mesotibia_l")); |
|
|
|
|
|
bind_pose[*bones.mesotarsus_l] = legs_skeleton.bind_pose.at(legs_skeleton.bone_map.at("mesotarsus1_l")); |
|
|
|
|
|
bind_pose[*bones.mesocoxa_r] = legs_skeleton.bind_pose.at(legs_skeleton.bone_map.at("mesocoxa_r")); |
|
|
|
|
|
bind_pose[*bones.mesofemur_r] = legs_skeleton.bind_pose.at(legs_skeleton.bone_map.at("mesofemur_r")); |
|
|
|
|
|
bind_pose[*bones.mesotibia_r] = legs_skeleton.bind_pose.at(legs_skeleton.bone_map.at("mesotibia_r")); |
|
|
|
|
|
bind_pose[*bones.mesotarsus_r] = legs_skeleton.bind_pose.at(legs_skeleton.bone_map.at("mesotarsus1_r")); |
|
|
|
|
|
bind_pose[*bones.metacoxa_l] = legs_skeleton.bind_pose.at(legs_skeleton.bone_map.at("metacoxa_l")); |
|
|
|
|
|
bind_pose[*bones.metafemur_l] = legs_skeleton.bind_pose.at(legs_skeleton.bone_map.at("metafemur_l")); |
|
|
|
|
|
bind_pose[*bones.metatibia_l] = legs_skeleton.bind_pose.at(legs_skeleton.bone_map.at("metatibia_l")); |
|
|
|
|
|
bind_pose[*bones.metatarsus_l] = legs_skeleton.bind_pose.at(legs_skeleton.bone_map.at("metatarsus1_l")); |
|
|
|
|
|
bind_pose[*bones.metacoxa_r] = legs_skeleton.bind_pose.at(legs_skeleton.bone_map.at("metacoxa_r")); |
|
|
|
|
|
bind_pose[*bones.metafemur_r] = legs_skeleton.bind_pose.at(legs_skeleton.bone_map.at("metafemur_r")); |
|
|
|
|
|
bind_pose[*bones.metatibia_r] = legs_skeleton.bind_pose.at(legs_skeleton.bone_map.at("metatibia_r")); |
|
|
|
|
|
bind_pose[*bones.metatarsus_r] = legs_skeleton.bind_pose.at(legs_skeleton.bone_map.at("metatarsus1_r")); |
|
|
|
|
|
bind_pose[*bones.head] = mesosoma_skeleton.bind_pose.at(mesosoma_skeleton.bone_map.at("head")) * head_skeleton.bind_pose.at(head_skeleton.bone_map.at("head")); |
|
|
|
|
|
bind_pose[*bones.mandible_l] = head_skeleton.bind_pose.at(head_skeleton.bone_map.at("mandible_l")) * mandibles_skeleton.bind_pose.at(mandibles_skeleton.bone_map.at("mandible_l")); |
|
|
|
|
|
bind_pose[*bones.mandible_r] = head_skeleton.bind_pose.at(head_skeleton.bone_map.at("mandible_r")) * mandibles_skeleton.bind_pose.at(mandibles_skeleton.bone_map.at("mandible_r")); |
|
|
|
|
|
bind_pose[*bones.antennomere1_l] = head_skeleton.bind_pose.at(head_skeleton.bone_map.at("antenna_l")) * antennae_skeleton.bind_pose.at(antennae_skeleton.bone_map.at("antennomere1_l")); |
|
|
|
|
|
bind_pose[*bones.antennomere2_l] = antennae_skeleton.bind_pose.at(antennae_skeleton.bone_map.at("antennomere2_l")); |
|
|
|
|
|
bind_pose[*bones.antennomere1_r] = head_skeleton.bind_pose.at(head_skeleton.bone_map.at("antenna_r")) * antennae_skeleton.bind_pose.at(antennae_skeleton.bone_map.at("antennomere1_r")); |
|
|
|
|
|
bind_pose[*bones.antennomere2_r] = antennae_skeleton.bind_pose.at(antennae_skeleton.bone_map.at("antennomere2_r")); |
|
|
|
|
|
|
|
|
skeleton.set_bone_transform(*bones.mesosoma, get_bone_transform(mesosoma_skeleton, "mesosoma")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.procoxa_l, get_bone_transform(legs_skeleton, "procoxa_l")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.profemur_l, get_bone_transform(legs_skeleton, "profemur_l")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.protibia_l, get_bone_transform(legs_skeleton, "protibia_l")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.protarsus_l, get_bone_transform(legs_skeleton, "protarsus1_l")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.procoxa_r, get_bone_transform(legs_skeleton, "procoxa_r")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.profemur_r, get_bone_transform(legs_skeleton, "profemur_r")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.protibia_r, get_bone_transform(legs_skeleton, "protibia_r")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.protarsus_r, get_bone_transform(legs_skeleton, "protarsus1_r")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.mesocoxa_l, get_bone_transform(legs_skeleton, "mesocoxa_l")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.mesofemur_l, get_bone_transform(legs_skeleton, "mesofemur_l")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.mesotibia_l, get_bone_transform(legs_skeleton, "mesotibia_l")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.mesotarsus_l, get_bone_transform(legs_skeleton, "mesotarsus1_l")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.mesocoxa_r, get_bone_transform(legs_skeleton, "mesocoxa_r")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.mesofemur_r, get_bone_transform(legs_skeleton, "mesofemur_r")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.mesotibia_r, get_bone_transform(legs_skeleton, "mesotibia_r")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.mesotarsus_r, get_bone_transform(legs_skeleton, "mesotarsus1_r")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.metacoxa_l, get_bone_transform(legs_skeleton, "metacoxa_l")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.metafemur_l, get_bone_transform(legs_skeleton, "metafemur_l")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.metatibia_l, get_bone_transform(legs_skeleton, "metatibia_l")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.metatarsus_l, get_bone_transform(legs_skeleton, "metatarsus1_l")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.metacoxa_r, get_bone_transform(legs_skeleton, "metacoxa_r")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.metafemur_r, get_bone_transform(legs_skeleton, "metafemur_r")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.metatibia_r, get_bone_transform(legs_skeleton, "metatibia_r")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.metatarsus_r, get_bone_transform(legs_skeleton, "metatarsus1_r")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.head, get_bone_transform(mesosoma_skeleton, "head") * get_bone_transform(head_skeleton, "head")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.mandible_l, get_bone_transform(head_skeleton, "mandible_l") * get_bone_transform(mandibles_skeleton, "mandible_l")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.mandible_r, get_bone_transform(head_skeleton, "mandible_r") * get_bone_transform(mandibles_skeleton, "mandible_r")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.antennomere1_l, get_bone_transform(head_skeleton, "antenna_l") * get_bone_transform(antennae_skeleton, "antennomere1_l")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.antennomere2_l, get_bone_transform(antennae_skeleton, "antennomere2_l")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.antennomere1_r, get_bone_transform(head_skeleton, "antenna_r") * get_bone_transform(antennae_skeleton, "antennomere1_r")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.antennomere2_r, get_bone_transform(antennae_skeleton, "antennomere2_r")); |
|
|
|
|
|
|
|
|
if (bones.petiole) |
|
|
if (bones.petiole) |
|
|
{ |
|
|
{ |
|
|
bind_pose[*bones.petiole] = mesosoma_skeleton.bind_pose.at(mesosoma_skeleton.bone_map.at("petiole")) * waist_skeleton.bind_pose.at(waist_skeleton.bone_map.at("petiole")); |
|
|
|
|
|
|
|
|
skeleton.set_bone_transform(*bones.petiole, get_bone_transform(mesosoma_skeleton, "petiole") * get_bone_transform(waist_skeleton, "petiole")); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (bones.postpetiole) |
|
|
if (bones.postpetiole) |
|
|
{ |
|
|
{ |
|
|
bind_pose[*bones.postpetiole] = waist_skeleton.bind_pose.at(waist_skeleton.bone_map.at("postpetiole")); |
|
|
|
|
|
bind_pose[*bones.gaster] = waist_skeleton.bind_pose.at(waist_skeleton.bone_map.at("postpetiole")) * gaster_skeleton.bind_pose.at(gaster_skeleton.bone_map.at("gaster")); |
|
|
|
|
|
|
|
|
skeleton.set_bone_transform(*bones.postpetiole, get_bone_transform(waist_skeleton, "postpetiole")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.gaster, get_bone_transform(waist_skeleton, "postpetiole") * get_bone_transform(gaster_skeleton, "gaster")); |
|
|
} |
|
|
} |
|
|
else if (bones.petiole) |
|
|
else if (bones.petiole) |
|
|
{ |
|
|
{ |
|
|
bind_pose[*bones.gaster] = waist_skeleton.bind_pose.at(waist_skeleton.bone_map.at("petiole")) * gaster_skeleton.bind_pose.at(gaster_skeleton.bone_map.at("gaster")); |
|
|
|
|
|
|
|
|
skeleton.set_bone_transform(*bones.gaster, get_bone_transform(waist_skeleton, "petiole") * get_bone_transform(gaster_skeleton, "gaster")); |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
bind_pose[*bones.gaster] = mesosoma_skeleton.bind_pose.at(mesosoma_skeleton.bone_map.at("petiole")) * gaster_skeleton.bind_pose.at(gaster_skeleton.bone_map.at("gaster")); |
|
|
|
|
|
|
|
|
skeleton.set_bone_transform(*bones.gaster, get_bone_transform(mesosoma_skeleton, "petiole") * get_bone_transform(gaster_skeleton, "gaster")); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (bones.sting) |
|
|
if (bones.sting) |
|
|
{ |
|
|
{ |
|
|
bind_pose[*bones.sting] = gaster_skeleton.bind_pose.at(gaster_skeleton.bone_map.at("sting")) * sting_skeleton->bind_pose.at(sting_skeleton->bone_map.at("sting")); |
|
|
|
|
|
|
|
|
skeleton.set_bone_transform(*bones.sting, get_bone_transform(gaster_skeleton, "sting") * get_bone_transform(*sting_skeleton, "sting")); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (bones.forewing_l) |
|
|
if (bones.forewing_l) |
|
|
{ |
|
|
{ |
|
|
bind_pose[*bones.forewing_l] = mesosoma_skeleton.bind_pose.at(mesosoma_skeleton.bone_map.at("forewing_l")) * forewings_skeleton->bind_pose.at(forewings_skeleton->bone_map.at("forewing_l")); |
|
|
|
|
|
bind_pose[*bones.forewing_r] = mesosoma_skeleton.bind_pose.at(mesosoma_skeleton.bone_map.at("forewing_r")) * forewings_skeleton->bind_pose.at(forewings_skeleton->bone_map.at("forewing_r")); |
|
|
|
|
|
bind_pose[*bones.hindwing_l] = mesosoma_skeleton.bind_pose.at(mesosoma_skeleton.bone_map.at("hindwing_l")) * hindwings_skeleton->bind_pose.at(hindwings_skeleton->bone_map.at("hindwing_l")); |
|
|
|
|
|
bind_pose[*bones.hindwing_r] = mesosoma_skeleton.bind_pose.at(mesosoma_skeleton.bone_map.at("hindwing_r")) * hindwings_skeleton->bind_pose.at(hindwings_skeleton->bone_map.at("hindwing_r")); |
|
|
|
|
|
|
|
|
skeleton.set_bone_transform(*bones.forewing_l, get_bone_transform(mesosoma_skeleton, "forewing_l") * get_bone_transform(*forewings_skeleton, "forewing_l")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.forewing_r, get_bone_transform(mesosoma_skeleton, "forewing_r") * get_bone_transform(*forewings_skeleton, "forewing_r")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.hindwing_l, get_bone_transform(mesosoma_skeleton, "hindwing_l") * get_bone_transform(*hindwings_skeleton, "hindwing_l")); |
|
|
|
|
|
skeleton.set_bone_transform(*bones.hindwing_r, get_bone_transform(mesosoma_skeleton, "hindwing_r") * get_bone_transform(*hindwings_skeleton, "hindwing_r")); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Calculate the skeleton-space bind pose
|
|
|
|
|
|
::concatenate(bind_pose, bind_pose_ss); |
|
|
|
|
|
|
|
|
|
|
|
// Calculate inverse skeleton-space bind pose
|
|
|
|
|
|
::inverse(bind_pose_ss, skeleton.inverse_bind_pose); |
|
|
|
|
|
|
|
|
skeleton.update_bind_pose(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} // namespace
|
|
|
} // namespace
|
|
@ -772,8 +783,8 @@ std::unique_ptr ant_morphogenesis(const ant_phenome& phenome) |
|
|
build_ant_skeleton(phenome, skeleton, bones); |
|
|
build_ant_skeleton(phenome, skeleton, bones); |
|
|
|
|
|
|
|
|
// Build ant bind pose
|
|
|
// Build ant bind pose
|
|
|
pose bind_pose_ss; |
|
|
|
|
|
build_ant_bind_pose(phenome, bones, skeleton, bind_pose_ss); |
|
|
|
|
|
|
|
|
build_ant_bind_pose(phenome, bones, skeleton); |
|
|
|
|
|
const auto& bind_pose = skeleton.get_bind_pose(); |
|
|
|
|
|
|
|
|
// Get number of vertices for each body part
|
|
|
// Get number of vertices for each body part
|
|
|
const std::uint32_t mesosoma_vertex_count = (mesosoma_model->get_groups()).front().index_count; |
|
|
const std::uint32_t mesosoma_vertex_count = (mesosoma_model->get_groups()).front().index_count; |
|
@ -814,41 +825,46 @@ std::unique_ptr ant_morphogenesis(const ant_phenome& phenome) |
|
|
const ::skeleton* forewings_skeleton = (phenome.wings->present) ? &phenome.wings->forewings_model->get_skeleton() : nullptr; |
|
|
const ::skeleton* forewings_skeleton = (phenome.wings->present) ? &phenome.wings->forewings_model->get_skeleton() : nullptr; |
|
|
const ::skeleton* hindwings_skeleton = (phenome.wings->present) ? &phenome.wings->hindwings_model->get_skeleton() : nullptr; |
|
|
const ::skeleton* hindwings_skeleton = (phenome.wings->present) ? &phenome.wings->hindwings_model->get_skeleton() : nullptr; |
|
|
|
|
|
|
|
|
|
|
|
auto get_bone_transform = [](const ::skeleton& skeleton, hash::fnv1a32_t bone_name) |
|
|
|
|
|
{ |
|
|
|
|
|
return skeleton.get_bind_pose().get_relative_transform(*skeleton.get_bone_index(bone_name)); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
// Calculate transformations from part space to body space
|
|
|
// Calculate transformations from part space to body space
|
|
|
const math::transform<float> legs_to_body = math::transform<float>::identity(); |
|
|
const math::transform<float> legs_to_body = math::transform<float>::identity(); |
|
|
const math::transform<float> head_to_body = bind_pose_ss.at(*bones.mesosoma) * mesosoma_skeleton.bind_pose.at(mesosoma_skeleton.bone_map.at("head")); |
|
|
|
|
|
const math::transform<float> mandible_l_to_body = bind_pose_ss.at(*bones.head) * head_skeleton.bind_pose.at(head_skeleton.bone_map.at("mandible_l")); |
|
|
|
|
|
const math::transform<float> mandible_r_to_body = bind_pose_ss.at(*bones.head) * head_skeleton.bind_pose.at(head_skeleton.bone_map.at("mandible_r")); |
|
|
|
|
|
const math::transform<float> antenna_l_to_body = bind_pose_ss.at(*bones.head) * head_skeleton.bind_pose.at(head_skeleton.bone_map.at("antenna_l")); |
|
|
|
|
|
const math::transform<float> antenna_r_to_body = bind_pose_ss.at(*bones.head) * head_skeleton.bind_pose.at(head_skeleton.bone_map.at("antenna_r")); |
|
|
|
|
|
const math::transform<float> waist_to_body = bind_pose_ss.at(*bones.mesosoma) * mesosoma_skeleton.bind_pose.at(mesosoma_skeleton.bone_map.at("petiole")); |
|
|
|
|
|
|
|
|
const math::transform<float> head_to_body = bind_pose.get_absolute_transform(*bones.mesosoma) * get_bone_transform(mesosoma_skeleton, "head"); |
|
|
|
|
|
const math::transform<float> mandible_l_to_body = bind_pose.get_absolute_transform(*bones.head) * get_bone_transform(head_skeleton, "mandible_l"); |
|
|
|
|
|
const math::transform<float> mandible_r_to_body = bind_pose.get_absolute_transform(*bones.head) * get_bone_transform(head_skeleton, "mandible_r"); |
|
|
|
|
|
const math::transform<float> antenna_l_to_body = bind_pose.get_absolute_transform(*bones.head) * get_bone_transform(head_skeleton, "antenna_l"); |
|
|
|
|
|
const math::transform<float> antenna_r_to_body = bind_pose.get_absolute_transform(*bones.head) * get_bone_transform(head_skeleton, "antenna_r"); |
|
|
|
|
|
const math::transform<float> waist_to_body = bind_pose.get_absolute_transform(*bones.mesosoma) * get_bone_transform(mesosoma_skeleton, "petiole"); |
|
|
|
|
|
|
|
|
math::transform<float> gaster_to_body; |
|
|
math::transform<float> gaster_to_body; |
|
|
if (phenome.waist->postpetiole_present) |
|
|
if (phenome.waist->postpetiole_present) |
|
|
{ |
|
|
{ |
|
|
gaster_to_body = bind_pose_ss.at(*bones.postpetiole) * waist_skeleton.bind_pose.at(waist_skeleton.bone_map.at("gaster")); |
|
|
|
|
|
|
|
|
gaster_to_body = bind_pose.get_absolute_transform(*bones.postpetiole) * get_bone_transform(waist_skeleton, "gaster"); |
|
|
} |
|
|
} |
|
|
else if (phenome.waist->petiole_present) |
|
|
else if (phenome.waist->petiole_present) |
|
|
{ |
|
|
{ |
|
|
gaster_to_body = bind_pose_ss.at(*bones.petiole) * waist_skeleton.bind_pose.at(waist_skeleton.bone_map.at("gaster")); |
|
|
|
|
|
|
|
|
gaster_to_body = bind_pose.get_absolute_transform(*bones.petiole) * get_bone_transform(waist_skeleton, "gaster"); |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
gaster_to_body = bind_pose_ss.at(*bones.mesosoma) * waist_skeleton.bind_pose.at(waist_skeleton.bone_map.at("gaster")); |
|
|
|
|
|
|
|
|
gaster_to_body = bind_pose.get_absolute_transform(*bones.mesosoma) * get_bone_transform(waist_skeleton, "gaster"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
math::transform<float> sting_to_body; |
|
|
math::transform<float> sting_to_body; |
|
|
if (phenome.sting->present) |
|
|
if (phenome.sting->present) |
|
|
{ |
|
|
{ |
|
|
sting_to_body = gaster_to_body * gaster_skeleton.bind_pose.at(gaster_skeleton.bone_map.at("sting")); |
|
|
|
|
|
|
|
|
sting_to_body = gaster_to_body * get_bone_transform(gaster_skeleton, "sting"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
math::transform<float> eye_l_to_body; |
|
|
math::transform<float> eye_l_to_body; |
|
|
math::transform<float> eye_r_to_body; |
|
|
math::transform<float> eye_r_to_body; |
|
|
if (phenome.eyes->present) |
|
|
if (phenome.eyes->present) |
|
|
{ |
|
|
{ |
|
|
eye_l_to_body = bind_pose_ss.at(*bones.head) * head_skeleton.bind_pose.at(head_skeleton.bone_map.at("eye_l")); |
|
|
|
|
|
eye_r_to_body = bind_pose_ss.at(*bones.head) * head_skeleton.bind_pose.at(head_skeleton.bone_map.at("eye_r")); |
|
|
|
|
|
|
|
|
eye_l_to_body = bind_pose.get_absolute_transform(*bones.head) * get_bone_transform(head_skeleton, "eye_l"); |
|
|
|
|
|
eye_r_to_body = bind_pose.get_absolute_transform(*bones.head) * get_bone_transform(head_skeleton, "eye_r"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
math::transform<float> ocellus_l_to_body; |
|
|
math::transform<float> ocellus_l_to_body; |
|
@ -856,12 +872,12 @@ std::unique_ptr ant_morphogenesis(const ant_phenome& phenome) |
|
|
math::transform<float> ocellus_m_to_body; |
|
|
math::transform<float> ocellus_m_to_body; |
|
|
if (phenome.ocelli->lateral_ocelli_present) |
|
|
if (phenome.ocelli->lateral_ocelli_present) |
|
|
{ |
|
|
{ |
|
|
ocellus_l_to_body = bind_pose_ss.at(*bones.head) * head_skeleton.bind_pose.at(head_skeleton.bone_map.at("ocellus_l")); |
|
|
|
|
|
ocellus_r_to_body = bind_pose_ss.at(*bones.head) * head_skeleton.bind_pose.at(head_skeleton.bone_map.at("ocellus_r")); |
|
|
|
|
|
|
|
|
ocellus_l_to_body = bind_pose.get_absolute_transform(*bones.head) * get_bone_transform(head_skeleton, "ocellus_l"); |
|
|
|
|
|
ocellus_r_to_body = bind_pose.get_absolute_transform(*bones.head) * get_bone_transform(head_skeleton, "ocellus_r"); |
|
|
} |
|
|
} |
|
|
if (phenome.ocelli->median_ocellus_present) |
|
|
if (phenome.ocelli->median_ocellus_present) |
|
|
{ |
|
|
{ |
|
|
ocellus_m_to_body = bind_pose_ss.at(*bones.head) * head_skeleton.bind_pose.at(head_skeleton.bone_map.at("ocellus_m")); |
|
|
|
|
|
|
|
|
ocellus_m_to_body = bind_pose.get_absolute_transform(*bones.head) * get_bone_transform(head_skeleton, "ocellus_m"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
math::transform<float> forewing_l_to_body; |
|
|
math::transform<float> forewing_l_to_body; |
|
@ -870,85 +886,85 @@ std::unique_ptr ant_morphogenesis(const ant_phenome& phenome) |
|
|
math::transform<float> hindwing_r_to_body; |
|
|
math::transform<float> hindwing_r_to_body; |
|
|
if (phenome.wings->present) |
|
|
if (phenome.wings->present) |
|
|
{ |
|
|
{ |
|
|
forewing_l_to_body = bind_pose_ss.at(*bones.mesosoma) * mesosoma_skeleton.bind_pose.at(mesosoma_skeleton.bone_map.at("forewing_l")); |
|
|
|
|
|
forewing_r_to_body = bind_pose_ss.at(*bones.mesosoma) * mesosoma_skeleton.bind_pose.at(mesosoma_skeleton.bone_map.at("forewing_r")); |
|
|
|
|
|
hindwing_l_to_body = bind_pose_ss.at(*bones.mesosoma) * mesosoma_skeleton.bind_pose.at(mesosoma_skeleton.bone_map.at("hindwing_l")); |
|
|
|
|
|
hindwing_r_to_body = bind_pose_ss.at(*bones.mesosoma) * mesosoma_skeleton.bind_pose.at(mesosoma_skeleton.bone_map.at("hindwing_r")); |
|
|
|
|
|
|
|
|
forewing_l_to_body = bind_pose.get_absolute_transform(*bones.mesosoma) * get_bone_transform(mesosoma_skeleton, "forewing_l"); |
|
|
|
|
|
forewing_r_to_body = bind_pose.get_absolute_transform(*bones.mesosoma) * get_bone_transform(mesosoma_skeleton, "forewing_r"); |
|
|
|
|
|
hindwing_l_to_body = bind_pose.get_absolute_transform(*bones.mesosoma) * get_bone_transform(mesosoma_skeleton, "hindwing_l"); |
|
|
|
|
|
hindwing_r_to_body = bind_pose.get_absolute_transform(*bones.mesosoma) * get_bone_transform(mesosoma_skeleton, "hindwing_r"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Build legs vertex reskin map
|
|
|
// Build legs vertex reskin map
|
|
|
const std::unordered_map<std::uint16_t, std::tuple<std::uint16_t, const math::transform<float>*>> legs_reskin_map |
|
|
|
|
|
{ |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("procoxa_l")), {bone_index(*bones.procoxa_l), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("profemur_l")), {bone_index(*bones.profemur_l), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("protibia_l")), {bone_index(*bones.protibia_l), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("protarsus1_l")), {bone_index(*bones.protarsus_l), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("protarsus2_l")), {bone_index(*bones.protarsus_l), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("protarsus3_l")), {bone_index(*bones.protarsus_l), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("protarsus4_l")), {bone_index(*bones.protarsus_l), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("protarsus5_l")), {bone_index(*bones.protarsus_l), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("procoxa_r")), {bone_index(*bones.procoxa_r), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("profemur_r")), {bone_index(*bones.profemur_r), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("protibia_r")), {bone_index(*bones.protibia_r), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("protarsus1_r")), {bone_index(*bones.protarsus_r), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("protarsus2_r")), {bone_index(*bones.protarsus_r), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("protarsus3_r")), {bone_index(*bones.protarsus_r), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("protarsus4_r")), {bone_index(*bones.protarsus_r), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("protarsus5_r")), {bone_index(*bones.protarsus_r), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("mesocoxa_l")), {bone_index(*bones.mesocoxa_l), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("mesofemur_l")), {bone_index(*bones.mesofemur_l), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("mesotibia_l")), {bone_index(*bones.mesotibia_l), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("mesotarsus1_l")), {bone_index(*bones.mesotarsus_l), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("mesotarsus2_l")), {bone_index(*bones.mesotarsus_l), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("mesotarsus3_l")), {bone_index(*bones.mesotarsus_l), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("mesotarsus4_l")), {bone_index(*bones.mesotarsus_l), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("mesotarsus5_l")), {bone_index(*bones.mesotarsus_l), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("mesocoxa_r")), {bone_index(*bones.mesocoxa_r), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("mesofemur_r")), {bone_index(*bones.mesofemur_r), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("mesotibia_r")), {bone_index(*bones.mesotibia_r), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("mesotarsus1_r")), {bone_index(*bones.mesotarsus_r), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("mesotarsus2_r")), {bone_index(*bones.mesotarsus_r), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("mesotarsus3_r")), {bone_index(*bones.mesotarsus_r), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("mesotarsus4_r")), {bone_index(*bones.mesotarsus_r), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("mesotarsus5_r")), {bone_index(*bones.mesotarsus_r), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("metacoxa_l")), {bone_index(*bones.metacoxa_l), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("metafemur_l")), {bone_index(*bones.metafemur_l), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("metatibia_l")), {bone_index(*bones.metatibia_l), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("metatarsus1_l")), {bone_index(*bones.metatarsus_l), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("metatarsus2_l")), {bone_index(*bones.metatarsus_l), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("metatarsus3_l")), {bone_index(*bones.metatarsus_l), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("metatarsus4_l")), {bone_index(*bones.metatarsus_l), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("metatarsus5_l")), {bone_index(*bones.metatarsus_l), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("metacoxa_r")), {bone_index(*bones.metacoxa_r), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("metafemur_r")), {bone_index(*bones.metafemur_r), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("metatibia_r")), {bone_index(*bones.metatibia_r), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("metatarsus1_r")), {bone_index(*bones.metatarsus_r), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("metatarsus2_r")), {bone_index(*bones.metatarsus_r), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("metatarsus3_r")), {bone_index(*bones.metatarsus_r), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("metatarsus4_r")), {bone_index(*bones.metatarsus_r), &legs_to_body}}, |
|
|
|
|
|
{bone_index(legs_skeleton.bone_map.at("metatarsus5_r")), {bone_index(*bones.metatarsus_r), &legs_to_body}} |
|
|
|
|
|
|
|
|
const std::unordered_map<bone_index_type, std::tuple<bone_index_type, const math::transform<float>*>> legs_reskin_map |
|
|
|
|
|
{ |
|
|
|
|
|
{*legs_skeleton.get_bone_index("procoxa_l"), {*bones.procoxa_l, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("profemur_l"), {*bones.profemur_l, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("protibia_l"), {*bones.protibia_l, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("protarsus1_l"), {*bones.protarsus_l, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("protarsus2_l"), {*bones.protarsus_l, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("protarsus3_l"), {*bones.protarsus_l, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("protarsus4_l"), {*bones.protarsus_l, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("protarsus5_l"), {*bones.protarsus_l, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("procoxa_r"), {*bones.procoxa_r, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("profemur_r"), {*bones.profemur_r, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("protibia_r"), {*bones.protibia_r, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("protarsus1_r"), {*bones.protarsus_r, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("protarsus2_r"), {*bones.protarsus_r, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("protarsus3_r"), {*bones.protarsus_r, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("protarsus4_r"), {*bones.protarsus_r, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("protarsus5_r"), {*bones.protarsus_r, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("mesocoxa_l"), {*bones.mesocoxa_l, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("mesofemur_l"), {*bones.mesofemur_l, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("mesotibia_l"), {*bones.mesotibia_l, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("mesotarsus1_l"), {*bones.mesotarsus_l, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("mesotarsus2_l"), {*bones.mesotarsus_l, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("mesotarsus3_l"), {*bones.mesotarsus_l, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("mesotarsus4_l"), {*bones.mesotarsus_l, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("mesotarsus5_l"), {*bones.mesotarsus_l, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("mesocoxa_r"), {*bones.mesocoxa_r, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("mesofemur_r"), {*bones.mesofemur_r, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("mesotibia_r"), {*bones.mesotibia_r, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("mesotarsus1_r"), {*bones.mesotarsus_r, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("mesotarsus2_r"), {*bones.mesotarsus_r, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("mesotarsus3_r"), {*bones.mesotarsus_r, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("mesotarsus4_r"), {*bones.mesotarsus_r, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("mesotarsus5_r"), {*bones.mesotarsus_r, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("metacoxa_l"), {*bones.metacoxa_l, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("metafemur_l"), {*bones.metafemur_l, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("metatibia_l"), {*bones.metatibia_l, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("metatarsus1_l"), {*bones.metatarsus_l, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("metatarsus2_l"), {*bones.metatarsus_l, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("metatarsus3_l"), {*bones.metatarsus_l, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("metatarsus4_l"), {*bones.metatarsus_l, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("metatarsus5_l"), {*bones.metatarsus_l, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("metacoxa_r"), {*bones.metacoxa_r, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("metafemur_r"), {*bones.metafemur_r, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("metatibia_r"), {*bones.metatibia_r, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("metatarsus1_r"), {*bones.metatarsus_r, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("metatarsus2_r"), {*bones.metatarsus_r, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("metatarsus3_r"), {*bones.metatarsus_r, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("metatarsus4_r"), {*bones.metatarsus_r, &legs_to_body}}, |
|
|
|
|
|
{*legs_skeleton.get_bone_index("metatarsus5_r"), {*bones.metatarsus_r, &legs_to_body}} |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
// Build head vertex reskin map
|
|
|
// Build head vertex reskin map
|
|
|
const std::unordered_map<std::uint16_t, std::tuple<std::uint16_t, const math::transform<float>*>> head_reskin_map |
|
|
|
|
|
|
|
|
const std::unordered_map<bone_index_type, std::tuple<bone_index_type, const math::transform<float>*>> head_reskin_map |
|
|
{ |
|
|
{ |
|
|
{bone_index(head_skeleton.bone_map.at("head")), {bone_index(*bones.head), &head_to_body}} |
|
|
|
|
|
|
|
|
{*head_skeleton.get_bone_index("head"), {*bones.head, &head_to_body}} |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
// Build mandibles vertex reskin map
|
|
|
// Build mandibles vertex reskin map
|
|
|
const std::unordered_map<std::uint16_t, std::tuple<std::uint16_t, const math::transform<float>*>> mandibles_reskin_map |
|
|
|
|
|
|
|
|
const std::unordered_map<bone_index_type, std::tuple<bone_index_type, const math::transform<float>*>> mandibles_reskin_map |
|
|
{ |
|
|
{ |
|
|
{bone_index(mandibles_skeleton.bone_map.at("mandible_l")), {bone_index(*bones.mandible_l), &mandible_l_to_body}}, |
|
|
|
|
|
{bone_index(mandibles_skeleton.bone_map.at("mandible_r")), {bone_index(*bones.mandible_r), &mandible_r_to_body}} |
|
|
|
|
|
|
|
|
{*mandibles_skeleton.get_bone_index("mandible_l"), {*bones.mandible_l, &mandible_l_to_body}}, |
|
|
|
|
|
{*mandibles_skeleton.get_bone_index("mandible_r"), {*bones.mandible_r, &mandible_r_to_body}} |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
// Build antennae vertex reskin map
|
|
|
// Build antennae vertex reskin map
|
|
|
std::unordered_map<std::uint16_t, std::tuple<std::uint16_t, const math::transform<float>*>> antennae_reskin_map |
|
|
|
|
|
|
|
|
std::unordered_map<bone_index_type, std::tuple<bone_index_type, const math::transform<float>*>> antennae_reskin_map |
|
|
{ |
|
|
{ |
|
|
{bone_index(antennae_skeleton.bone_map.at("antennomere1_l")), {bone_index(*bones.antennomere1_l), &antenna_l_to_body}}, |
|
|
|
|
|
{bone_index(antennae_skeleton.bone_map.at("antennomere2_l")), {bone_index(*bones.antennomere2_l), &antenna_l_to_body}}, |
|
|
|
|
|
{bone_index(antennae_skeleton.bone_map.at("antennomere1_r")), {bone_index(*bones.antennomere1_r), &antenna_r_to_body}}, |
|
|
|
|
|
{bone_index(antennae_skeleton.bone_map.at("antennomere2_r")), {bone_index(*bones.antennomere2_r), &antenna_r_to_body}} |
|
|
|
|
|
|
|
|
{*antennae_skeleton.get_bone_index("antennomere1_l"), {*bones.antennomere1_l, &antenna_l_to_body}}, |
|
|
|
|
|
{*antennae_skeleton.get_bone_index("antennomere2_l"), {*bones.antennomere2_l, &antenna_l_to_body}}, |
|
|
|
|
|
{*antennae_skeleton.get_bone_index("antennomere1_r"), {*bones.antennomere1_r, &antenna_r_to_body}}, |
|
|
|
|
|
{*antennae_skeleton.get_bone_index("antennomere2_r"), {*bones.antennomere2_r, &antenna_r_to_body}} |
|
|
}; |
|
|
}; |
|
|
for (std::uint8_t i = 3; i <= phenome.antennae->total_antennomere_count; ++i) |
|
|
for (std::uint8_t i = 3; i <= phenome.antennae->total_antennomere_count; ++i) |
|
|
{ |
|
|
{ |
|
@ -958,66 +974,66 @@ std::unique_ptr ant_morphogenesis(const ant_phenome& phenome) |
|
|
const hash::fnv1a32_t antennomere_l_key = hash::fnv1a32<char>(antennomere_l_name); |
|
|
const hash::fnv1a32_t antennomere_l_key = hash::fnv1a32<char>(antennomere_l_name); |
|
|
const hash::fnv1a32_t antennomere_r_key = hash::fnv1a32<char>(antennomere_r_name); |
|
|
const hash::fnv1a32_t antennomere_r_key = hash::fnv1a32<char>(antennomere_r_name); |
|
|
|
|
|
|
|
|
antennae_reskin_map.emplace(bone_index(antennae_skeleton.bone_map.at(antennomere_l_key)), std::tuple(bone_index(*bones.antennomere2_l), &antenna_l_to_body)); |
|
|
|
|
|
antennae_reskin_map.emplace(bone_index(antennae_skeleton.bone_map.at(antennomere_r_key)), std::tuple(bone_index(*bones.antennomere2_r), &antenna_r_to_body)); |
|
|
|
|
|
|
|
|
antennae_reskin_map.emplace(*antennae_skeleton.get_bone_index(antennomere_l_key), std::tuple(*bones.antennomere2_l, &antenna_l_to_body)); |
|
|
|
|
|
antennae_reskin_map.emplace(*antennae_skeleton.get_bone_index(antennomere_r_key), std::tuple(*bones.antennomere2_r, &antenna_r_to_body)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Build waist vertex reskin map
|
|
|
// Build waist vertex reskin map
|
|
|
std::unordered_map<std::uint16_t, std::tuple<std::uint16_t, const math::transform<float>*>> waist_reskin_map; |
|
|
|
|
|
|
|
|
std::unordered_map<bone_index_type, std::tuple<bone_index_type, const math::transform<float>*>> waist_reskin_map; |
|
|
if (phenome.waist->petiole_present) |
|
|
if (phenome.waist->petiole_present) |
|
|
{ |
|
|
{ |
|
|
waist_reskin_map.emplace(bone_index(waist_skeleton.bone_map.at("petiole")), std::tuple(bone_index(*bones.petiole), &waist_to_body)); |
|
|
|
|
|
|
|
|
waist_reskin_map.emplace(*waist_skeleton.get_bone_index("petiole"), std::tuple(*bones.petiole, &waist_to_body)); |
|
|
} |
|
|
} |
|
|
if (phenome.waist->postpetiole_present) |
|
|
if (phenome.waist->postpetiole_present) |
|
|
{ |
|
|
{ |
|
|
waist_reskin_map.emplace(bone_index(waist_skeleton.bone_map.at("postpetiole")), std::tuple(bone_index(*bones.postpetiole), &waist_to_body)); |
|
|
|
|
|
|
|
|
waist_reskin_map.emplace(*waist_skeleton.get_bone_index("postpetiole"), std::tuple(*bones.postpetiole, &waist_to_body)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Build gaster vertex reskin map
|
|
|
// Build gaster vertex reskin map
|
|
|
const std::unordered_map<std::uint16_t, std::tuple<std::uint16_t, const math::transform<float>*>> gaster_reskin_map |
|
|
|
|
|
|
|
|
const std::unordered_map<bone_index_type, std::tuple<bone_index_type, const math::transform<float>*>> gaster_reskin_map |
|
|
{ |
|
|
{ |
|
|
{bone_index(gaster_skeleton.bone_map.at("gaster")), {bone_index(*bones.gaster), &gaster_to_body}} |
|
|
|
|
|
|
|
|
{*gaster_skeleton.get_bone_index("gaster"), {*bones.gaster, &gaster_to_body}} |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
// Build sting vertex reskin map
|
|
|
// Build sting vertex reskin map
|
|
|
std::unordered_map<std::uint16_t, std::tuple<std::uint16_t, const math::transform<float>*>> sting_reskin_map; |
|
|
|
|
|
|
|
|
std::unordered_map<bone_index_type, std::tuple<bone_index_type, const math::transform<float>*>> sting_reskin_map; |
|
|
if (phenome.sting->present) |
|
|
if (phenome.sting->present) |
|
|
{ |
|
|
{ |
|
|
sting_reskin_map.emplace(bone_index(sting_skeleton->bone_map.at("sting")), std::tuple(bone_index(*bones.sting), &sting_to_body)); |
|
|
|
|
|
|
|
|
sting_reskin_map.emplace(*sting_skeleton->get_bone_index("sting"), std::tuple(*bones.sting, &sting_to_body)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Build eyes vertex reskin map
|
|
|
// Build eyes vertex reskin map
|
|
|
std::unordered_map<std::uint16_t, std::tuple<std::uint16_t, const math::transform<float>*>> eyes_reskin_map; |
|
|
|
|
|
|
|
|
std::unordered_map<bone_index_type, std::tuple<bone_index_type, const math::transform<float>*>> eyes_reskin_map; |
|
|
if (phenome.eyes->present) |
|
|
if (phenome.eyes->present) |
|
|
{ |
|
|
{ |
|
|
eyes_reskin_map.emplace(bone_index(eyes_skeleton->bone_map.at("eye_l")), std::tuple(bone_index(*bones.head), &eye_l_to_body)); |
|
|
|
|
|
eyes_reskin_map.emplace(bone_index(eyes_skeleton->bone_map.at("eye_r")), std::tuple(bone_index(*bones.head), &eye_r_to_body)); |
|
|
|
|
|
|
|
|
eyes_reskin_map.emplace(*eyes_skeleton->get_bone_index("eye_l"), std::tuple(*bones.head, &eye_l_to_body)); |
|
|
|
|
|
eyes_reskin_map.emplace(*eyes_skeleton->get_bone_index("eye_r"), std::tuple(*bones.head, &eye_r_to_body)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Build lateral ocelli vertex reskin map
|
|
|
// Build lateral ocelli vertex reskin map
|
|
|
std::unordered_map<std::uint16_t, std::tuple<std::uint16_t, const math::transform<float>*>> lateral_ocelli_reskin_map; |
|
|
|
|
|
|
|
|
std::unordered_map<bone_index_type, std::tuple<bone_index_type, const math::transform<float>*>> lateral_ocelli_reskin_map; |
|
|
if (phenome.ocelli->lateral_ocelli_present) |
|
|
if (phenome.ocelli->lateral_ocelli_present) |
|
|
{ |
|
|
{ |
|
|
lateral_ocelli_reskin_map.emplace(bone_index(lateral_ocelli_skeleton->bone_map.at("ocellus_l")), std::tuple(bone_index(*bones.head), &ocellus_l_to_body)); |
|
|
|
|
|
lateral_ocelli_reskin_map.emplace(bone_index(lateral_ocelli_skeleton->bone_map.at("ocellus_r")), std::tuple(bone_index(*bones.head), &ocellus_r_to_body)); |
|
|
|
|
|
|
|
|
lateral_ocelli_reskin_map.emplace(*lateral_ocelli_skeleton->get_bone_index("ocellus_l"), std::tuple(*bones.head, &ocellus_l_to_body)); |
|
|
|
|
|
lateral_ocelli_reskin_map.emplace(*lateral_ocelli_skeleton->get_bone_index("ocellus_r"), std::tuple(*bones.head, &ocellus_r_to_body)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Build median ocellus vertex reskin map
|
|
|
// Build median ocellus vertex reskin map
|
|
|
std::unordered_map<std::uint16_t, std::tuple<std::uint16_t, const math::transform<float>*>> median_ocellus_reskin_map; |
|
|
|
|
|
|
|
|
std::unordered_map<bone_index_type, std::tuple<bone_index_type, const math::transform<float>*>> median_ocellus_reskin_map; |
|
|
if (phenome.ocelli->median_ocellus_present) |
|
|
if (phenome.ocelli->median_ocellus_present) |
|
|
{ |
|
|
{ |
|
|
median_ocellus_reskin_map.emplace(bone_index(median_ocellus_skeleton->bone_map.at("ocellus_m")), std::tuple(bone_index(*bones.head), &ocellus_m_to_body)); |
|
|
|
|
|
|
|
|
median_ocellus_reskin_map.emplace(*median_ocellus_skeleton->get_bone_index("ocellus_m"), std::tuple(*bones.head, &ocellus_m_to_body)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Build wings vertex reskin maps
|
|
|
// Build wings vertex reskin maps
|
|
|
std::unordered_map<std::uint16_t, std::tuple<std::uint16_t, const math::transform<float>*>> forewings_reskin_map; |
|
|
|
|
|
std::unordered_map<std::uint16_t, std::tuple<std::uint16_t, const math::transform<float>*>> hindwings_reskin_map; |
|
|
|
|
|
|
|
|
std::unordered_map<bone_index_type, std::tuple<bone_index_type, const math::transform<float>*>> forewings_reskin_map; |
|
|
|
|
|
std::unordered_map<bone_index_type, std::tuple<bone_index_type, const math::transform<float>*>> hindwings_reskin_map; |
|
|
if (phenome.wings->present) |
|
|
if (phenome.wings->present) |
|
|
{ |
|
|
{ |
|
|
forewings_reskin_map.emplace(bone_index(forewings_skeleton->bone_map.at("forewing_l")), std::tuple(bone_index(*bones.forewing_l), &forewing_l_to_body)); |
|
|
|
|
|
forewings_reskin_map.emplace(bone_index(forewings_skeleton->bone_map.at("forewing_r")), std::tuple(bone_index(*bones.forewing_r), &forewing_r_to_body)); |
|
|
|
|
|
hindwings_reskin_map.emplace(bone_index(hindwings_skeleton->bone_map.at("hindwing_l")), std::tuple(bone_index(*bones.hindwing_l), &hindwing_l_to_body)); |
|
|
|
|
|
hindwings_reskin_map.emplace(bone_index(hindwings_skeleton->bone_map.at("hindwing_r")), std::tuple(bone_index(*bones.hindwing_r), &hindwing_r_to_body)); |
|
|
|
|
|
|
|
|
forewings_reskin_map.emplace(*forewings_skeleton->get_bone_index("forewing_l"), std::tuple(*bones.forewing_l, &forewing_l_to_body)); |
|
|
|
|
|
forewings_reskin_map.emplace(*forewings_skeleton->get_bone_index("forewing_r"), std::tuple(*bones.forewing_r, &forewing_r_to_body)); |
|
|
|
|
|
hindwings_reskin_map.emplace(*hindwings_skeleton->get_bone_index("hindwing_l"), std::tuple(*bones.hindwing_l, &hindwing_l_to_body)); |
|
|
|
|
|
hindwings_reskin_map.emplace(*hindwings_skeleton->get_bone_index("hindwing_r"), std::tuple(*bones.hindwing_r, &hindwing_r_to_body)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Reskin legs vertices
|
|
|
// Reskin legs vertices
|
|
|