mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 18:23:22 +02:00
avoid unthreadsafe use of getJointIndex
This commit is contained in:
parent
4dd0de62fc
commit
c6d0c0909e
1 changed files with 12 additions and 2 deletions
|
@ -929,7 +929,12 @@ glm::quat Avatar::getAbsoluteJointRotationInObjectFrame(int index) const {
|
|||
}
|
||||
case CAMERA_MATRIX_INDEX: {
|
||||
glm::quat rotation;
|
||||
_skeletonModel->getAbsoluteJointRotationInRigFrame(getJointIndex("head"), rotation);
|
||||
if (_skeletonModel) {
|
||||
int headJointIndex = _skeletonModel->getFBXGeometry().headJointIndex;
|
||||
if (headJointIndex >= 0) {
|
||||
_skeletonModel->getAbsoluteJointRotationInRigFrame(headJointIndex, rotation);
|
||||
}
|
||||
}
|
||||
return rotation;
|
||||
}
|
||||
default: {
|
||||
|
@ -960,7 +965,12 @@ glm::vec3 Avatar::getAbsoluteJointTranslationInObjectFrame(int index) const {
|
|||
}
|
||||
case CAMERA_MATRIX_INDEX: {
|
||||
glm::vec3 translation;
|
||||
_skeletonModel->getAbsoluteJointTranslationInRigFrame(getJointIndex("head"), translation);
|
||||
if (_skeletonModel) {
|
||||
int headJointIndex = _skeletonModel->getFBXGeometry().headJointIndex;
|
||||
if (headJointIndex >= 0) {
|
||||
_skeletonModel->getAbsoluteJointTranslationInRigFrame(headJointIndex, translation);
|
||||
}
|
||||
}
|
||||
return translation;
|
||||
}
|
||||
default: {
|
||||
|
|
Loading…
Reference in a new issue