mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
use Qt::AutoConnection for Avatar::setFoo() methods
This prevents a JS script from blocking when setting C++ values.
This commit is contained in:
parent
9ddd05ca72
commit
e631ab8d38
1 changed files with 2 additions and 2 deletions
|
@ -871,7 +871,7 @@ const float SCRIPT_PRIORITY = DEFAULT_PRIORITY + 1.0f;
|
||||||
void Avatar::setJointModelPositionAndOrientation(int index, glm::vec3 position, const glm::quat& rotation) {
|
void Avatar::setJointModelPositionAndOrientation(int index, glm::vec3 position, const glm::quat& rotation) {
|
||||||
if (QThread::currentThread() != thread()) {
|
if (QThread::currentThread() != thread()) {
|
||||||
QMetaObject::invokeMethod(const_cast<Avatar*>(this), "setJointModelPositionAndOrientation",
|
QMetaObject::invokeMethod(const_cast<Avatar*>(this), "setJointModelPositionAndOrientation",
|
||||||
Qt::BlockingQueuedConnection, Q_ARG(const int, index), Q_ARG(const glm::vec3, position),
|
Qt::AutoConnection, Q_ARG(const int, index), Q_ARG(const glm::vec3, position),
|
||||||
Q_ARG(const glm::quat&, rotation));
|
Q_ARG(const glm::quat&, rotation));
|
||||||
} else {
|
} else {
|
||||||
_skeletonModel.inverseKinematics(index, position, rotation, SCRIPT_PRIORITY);
|
_skeletonModel.inverseKinematics(index, position, rotation, SCRIPT_PRIORITY);
|
||||||
|
@ -881,7 +881,7 @@ void Avatar::setJointModelPositionAndOrientation(int index, glm::vec3 position,
|
||||||
void Avatar::setJointModelPositionAndOrientation(const QString& name, glm::vec3 position, const glm::quat& rotation) {
|
void Avatar::setJointModelPositionAndOrientation(const QString& name, glm::vec3 position, const glm::quat& rotation) {
|
||||||
if (QThread::currentThread() != thread()) {
|
if (QThread::currentThread() != thread()) {
|
||||||
QMetaObject::invokeMethod(const_cast<Avatar*>(this), "setJointModelPositionAndOrientation",
|
QMetaObject::invokeMethod(const_cast<Avatar*>(this), "setJointModelPositionAndOrientation",
|
||||||
Qt::BlockingQueuedConnection, Q_ARG(const QString&, name), Q_ARG(const glm::vec3, position),
|
Qt::AutoConnection, Q_ARG(const QString&, name), Q_ARG(const glm::vec3, position),
|
||||||
Q_ARG(const glm::quat&, rotation));
|
Q_ARG(const glm::quat&, rotation));
|
||||||
} else {
|
} else {
|
||||||
_skeletonModel.inverseKinematics(getJointIndex(name), position, rotation, SCRIPT_PRIORITY);
|
_skeletonModel.inverseKinematics(getJointIndex(name), position, rotation, SCRIPT_PRIORITY);
|
||||||
|
|
Loading…
Reference in a new issue