mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-31 03:45:34 +00:00
Cleaner code part 2
This commit is contained in:
parent
960019cf65
commit
4676ac4ac9
1 changed files with 4 additions and 14 deletions
|
@ -48,33 +48,23 @@ namespace Resource
|
||||||
|
|
||||||
bool RetrieveAnimationsVisitor::belongsToRightUpperExtremity(const std::string& name)
|
bool RetrieveAnimationsVisitor::belongsToRightUpperExtremity(const std::string& name)
|
||||||
{
|
{
|
||||||
const int bodypartCount = 25;
|
static const std::array boneNames = { "bip01_r_clavicle", "right_clavicle",
|
||||||
static const std::array<std::string_view, bodypartCount> boneNames = { "bip01_r_clavicle", "right_clavicle",
|
|
||||||
"bip01_r_upperarm", "right_upper_arm", "bip01_r_forearm", "bip01_r_hand", "right_hand", "right_wrist",
|
"bip01_r_upperarm", "right_upper_arm", "bip01_r_forearm", "bip01_r_hand", "right_hand", "right_wrist",
|
||||||
"bip01_r_thumb1", "bip01_r_thumb2", "bip01_r_thumb3", "weapon_bone", "bip01_r_pinky1", "bip01_r_pinky2",
|
"bip01_r_thumb1", "bip01_r_thumb2", "bip01_r_thumb3", "weapon_bone", "bip01_r_pinky1", "bip01_r_pinky2",
|
||||||
"bip01_r_pinky3", "bip01_r_ring1", "bip01_r_ring2", "bip01_r_ring3", "bip01_r_middle1", "bip01_r_middle2",
|
"bip01_r_pinky3", "bip01_r_ring1", "bip01_r_ring2", "bip01_r_ring3", "bip01_r_middle1", "bip01_r_middle2",
|
||||||
"bip01_r_middle3", "bip01_r_pointer1", "bip01_r_pointer2", "bip01_r_pointer3", "right_forearm" };
|
"bip01_r_middle3", "bip01_r_pointer1", "bip01_r_pointer2", "bip01_r_pointer3", "right_forearm" };
|
||||||
|
|
||||||
for (unsigned short int i = 0; i < bodypartCount; i++)
|
if (std::find(boneNames.begin(), boneNames.end(), name) != boneNames.end()) return true;
|
||||||
{
|
|
||||||
if (name == boneNames[i])
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RetrieveAnimationsVisitor::belongsToTorso(const std::string& name)
|
bool RetrieveAnimationsVisitor::belongsToTorso(const std::string& name)
|
||||||
{
|
{
|
||||||
const int bodypartCount = 8;
|
static const std::array boneNames
|
||||||
static const std::array<std::string_view, bodypartCount> boneNames
|
|
||||||
= { "bip01_spine1", "bip01_spine2", "bip01_neck", "bip01_head", "head", "neck", "chest", "groin" };
|
= { "bip01_spine1", "bip01_spine2", "bip01_neck", "bip01_head", "head", "neck", "chest", "groin" };
|
||||||
|
|
||||||
for (unsigned short int i = 0; i < bodypartCount; i++)
|
if (std::find(boneNames.begin(), boneNames.end(), name) != boneNames.end()) return true;
|
||||||
{
|
|
||||||
if (name == boneNames[i])
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue