mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 04:18:12 +02:00
Merge pull request #15459 from luiscuenca/sentHandsCrashFix
Fix crash sending other avatars hands to flow
This commit is contained in:
commit
164984b15d
1 changed files with 12 additions and 5 deletions
|
@ -5813,12 +5813,19 @@ void MyAvatar::releaseGrab(const QUuid& grabID) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyAvatar::addAvatarHandsToFlow(const std::shared_ptr<Avatar>& otherAvatar) {
|
void MyAvatar::addAvatarHandsToFlow(const std::shared_ptr<Avatar>& otherAvatar) {
|
||||||
|
if (QThread::currentThread() != thread()) {
|
||||||
|
QMetaObject::invokeMethod(this, "addAvatarHandsToFlow",
|
||||||
|
Q_ARG(const std::shared_ptr<Avatar>&, otherAvatar));
|
||||||
|
return;
|
||||||
|
}
|
||||||
auto &flow = _skeletonModel->getRig().getFlow();
|
auto &flow = _skeletonModel->getRig().getFlow();
|
||||||
for (auto &handJointName : HAND_COLLISION_JOINTS) {
|
if (otherAvatar != nullptr && flow.getActive()) {
|
||||||
int jointIndex = otherAvatar->getJointIndex(handJointName);
|
for (auto &handJointName : HAND_COLLISION_JOINTS) {
|
||||||
if (jointIndex != -1) {
|
int jointIndex = otherAvatar->getJointIndex(handJointName);
|
||||||
glm::vec3 position = otherAvatar->getJointPosition(jointIndex);
|
if (jointIndex != -1) {
|
||||||
flow.setOthersCollision(otherAvatar->getID(), jointIndex, position);
|
glm::vec3 position = otherAvatar->getJointPosition(jointIndex);
|
||||||
|
flow.setOthersCollision(otherAvatar->getID(), jointIndex, position);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue