mirror of
https://github.com/overte-org/overte.git
synced 2025-04-15 06:28:48 +02:00
Fix mirrored animations
This commit is contained in:
parent
171440f70b
commit
4b4523579a
1 changed files with 7 additions and 7 deletions
|
@ -32,10 +32,10 @@ AnimSkeleton::AnimSkeleton(const std::vector<FBXJoint>& joints) {
|
|||
|
||||
int AnimSkeleton::nameToJointIndex(const QString& jointName) const {
|
||||
auto itr = _jointIndicesByName.find(jointName);
|
||||
if (_jointIndicesByName.end() == itr) {
|
||||
return -1;
|
||||
if (_jointIndicesByName.end() != itr) {
|
||||
return itr.value();
|
||||
}
|
||||
return itr.value();
|
||||
return -1;
|
||||
}
|
||||
|
||||
int AnimSkeleton::getNumJoints() const {
|
||||
|
@ -202,6 +202,10 @@ void AnimSkeleton::buildSkeletonFromJoints(const std::vector<FBXJoint>& joints)
|
|||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < _jointsSize; i++) {
|
||||
_jointIndicesByName[_joints[i].name] = i;
|
||||
}
|
||||
|
||||
// build mirror map.
|
||||
_nonMirroredIndices.clear();
|
||||
_mirrorMap.reserve(_jointsSize);
|
||||
|
@ -225,10 +229,6 @@ void AnimSkeleton::buildSkeletonFromJoints(const std::vector<FBXJoint>& joints)
|
|||
_mirrorMap.push_back(i);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < _jointsSize; i++) {
|
||||
_jointIndicesByName[_joints[i].name] = i;
|
||||
}
|
||||
}
|
||||
|
||||
void AnimSkeleton::dump(bool verbose) const {
|
||||
|
|
Loading…
Reference in a new issue