mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:50:00 +02:00
Cleanup handleViewpoint
This commit is contained in:
parent
0ec9d9e277
commit
d47c74408e
1 changed files with 4 additions and 3 deletions
|
@ -501,6 +501,8 @@ bool AddressManager::handleViewpoint(const QString& viewpointString, bool should
|
||||||
|
|
||||||
QRegExp orientationRegex(QUAT_REGEX_STRING);
|
QRegExp orientationRegex(QUAT_REGEX_STRING);
|
||||||
|
|
||||||
|
bool orientationChanged = false;
|
||||||
|
|
||||||
// we may also have an orientation
|
// we may also have an orientation
|
||||||
if (viewpointString[positionRegex.matchedLength() - 1] == QChar('/')
|
if (viewpointString[positionRegex.matchedLength() - 1] == QChar('/')
|
||||||
&& orientationRegex.indexIn(viewpointString, positionRegex.matchedLength() - 1) != -1) {
|
&& orientationRegex.indexIn(viewpointString, positionRegex.matchedLength() - 1) != -1) {
|
||||||
|
@ -512,14 +514,13 @@ bool AddressManager::handleViewpoint(const QString& viewpointString, bool should
|
||||||
|
|
||||||
if (!isNaN(newOrientation.x) && !isNaN(newOrientation.y) && !isNaN(newOrientation.z)
|
if (!isNaN(newOrientation.x) && !isNaN(newOrientation.y) && !isNaN(newOrientation.z)
|
||||||
&& !isNaN(newOrientation.w)) {
|
&& !isNaN(newOrientation.w)) {
|
||||||
emit locationChangeRequired(newPosition, true, newOrientation, shouldFace);
|
orientationChanged = true;
|
||||||
return true;
|
|
||||||
} else {
|
} else {
|
||||||
qCDebug(networking) << "Orientation parsed from lookup string is invalid. Will not use for location change.";
|
qCDebug(networking) << "Orientation parsed from lookup string is invalid. Will not use for location change.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
emit locationChangeRequired(newPosition, false, newOrientation, shouldFace);
|
emit locationChangeRequired(newPosition, orientationChanged, newOrientation, shouldFace);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
qCDebug(networking) << "Could not jump to position from lookup string because it has an invalid value.";
|
qCDebug(networking) << "Could not jump to position from lookup string because it has an invalid value.";
|
||||||
|
|
Loading…
Reference in a new issue