mirror of
https://github.com/overte-org/overte.git
synced 2025-04-24 12:13:36 +02:00
fix go to orientation to not put the user sideways
This commit is contained in:
parent
9ff0a36a06
commit
c8d3cd2a1b
1 changed files with 5 additions and 1 deletions
|
@ -1158,6 +1158,8 @@ void MyAvatar::updateLocationInDataServer() {
|
|||
QString positionString(createByteArray(_position));
|
||||
QString orientationString(createByteArray(glm::degrees(safeEulerAngles(getOrientation()))));
|
||||
|
||||
qDebug() << orientationString;
|
||||
|
||||
// construct the json to put the user's location
|
||||
QString locationPutJson = QString() + "{\"address\":{\"position\":\""
|
||||
+ positionString + "\", \"orientation\":\"" + orientationString + "\"}}";
|
||||
|
@ -1188,11 +1190,13 @@ void MyAvatar::goToLocationFromResponse(const QJsonObject& jsonObject) {
|
|||
|
||||
NodeList::getInstance()->getDomainInfo().setHostname(domainHostnameString);
|
||||
|
||||
qDebug() << orientationItems[0] << orientationItems[1] << orientationItems[2];
|
||||
|
||||
// orient the user to face the target
|
||||
glm::quat newOrientation = glm::quat(glm::vec3(orientationItems[0].toFloat(),
|
||||
orientationItems[1].toFloat(),
|
||||
orientationItems[2].toFloat()))
|
||||
* glm::angleAxis(PI, glm::vec3(0.0f, 1.0f, 0.0f));
|
||||
* glm::angleAxis(180.0f, glm::vec3(0.0f, 1.0f, 0.0f));
|
||||
setOrientation(newOrientation);
|
||||
|
||||
// move the user a couple units away
|
||||
|
|
Loading…
Reference in a new issue