mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 16:41:02 +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: {
|
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