mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 11:45:36 +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);
|
||||
|
||||
bool orientationChanged = false;
|
||||
|
||||
// we may also have an orientation
|
||||
if (viewpointString[positionRegex.matchedLength() - 1] == QChar('/')
|
||||
&& 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)
|
||||
&& !isNaN(newOrientation.w)) {
|
||||
emit locationChangeRequired(newPosition, true, newOrientation, shouldFace);
|
||||
return true;
|
||||
orientationChanged = true;
|
||||
} else {
|
||||
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 {
|
||||
qCDebug(networking) << "Could not jump to position from lookup string because it has an invalid value.";
|
||||
|
|
Loading…
Reference in a new issue