mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 04:14:38 +02:00
Merge pull request #9431 from sethalves/tablet-ui
avoid unthreadsafe use of getJointIndex
This commit is contained in:
commit
aeb02001ed
1 changed files with 12 additions and 2 deletions
|
@ -929,7 +929,12 @@ glm::quat Avatar::getAbsoluteJointRotationInObjectFrame(int index) const {
|
||||||
}
|
}
|
||||||
case CAMERA_MATRIX_INDEX: {
|
case CAMERA_MATRIX_INDEX: {
|
||||||
glm::quat rotation;
|
glm::quat rotation;
|
||||||
_skeletonModel->getAbsoluteJointRotationInRigFrame(getJointIndex("head"), rotation);
|
if (_skeletonModel) {
|
||||||
|
int headJointIndex = _skeletonModel->getFBXGeometry().headJointIndex;
|
||||||
|
if (headJointIndex >= 0) {
|
||||||
|
_skeletonModel->getAbsoluteJointRotationInRigFrame(headJointIndex, rotation);
|
||||||
|
}
|
||||||
|
}
|
||||||
return rotation;
|
return rotation;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
|
@ -960,7 +965,12 @@ glm::vec3 Avatar::getAbsoluteJointTranslationInObjectFrame(int index) const {
|
||||||
}
|
}
|
||||||
case CAMERA_MATRIX_INDEX: {
|
case CAMERA_MATRIX_INDEX: {
|
||||||
glm::vec3 translation;
|
glm::vec3 translation;
|
||||||
_skeletonModel->getAbsoluteJointTranslationInRigFrame(getJointIndex("head"), translation);
|
if (_skeletonModel) {
|
||||||
|
int headJointIndex = _skeletonModel->getFBXGeometry().headJointIndex;
|
||||||
|
if (headJointIndex >= 0) {
|
||||||
|
_skeletonModel->getAbsoluteJointTranslationInRigFrame(headJointIndex, translation);
|
||||||
|
}
|
||||||
|
}
|
||||||
return translation;
|
return translation;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
|
|
Loading…
Reference in a new issue