From dc7d6d470ddc6ba5866131dc04a32c1cb7de5bee Mon Sep 17 00:00:00 2001 From: howard-stearns Date: Wed, 25 May 2016 12:21:50 -0700 Subject: [PATCH] Don't reset head when we come back. --- interface/src/avatar/MyAvatar.cpp | 6 ++++-- interface/src/avatar/MyAvatar.h | 2 +- interface/src/ui/OverlayConductor.cpp | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 04224d6fa9..358b3d72ba 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -234,7 +234,7 @@ QByteArray MyAvatar::toByteArray(bool cullSmallChanges, bool sendAll) { return AvatarData::toByteArray(cullSmallChanges, sendAll); } -void MyAvatar::reset(bool andRecenter, bool andReload) { +void MyAvatar::reset(bool andRecenter, bool andReload, bool andHead) { if (QThread::currentThread() != thread()) { QMetaObject::invokeMethod(this, "reset", Q_ARG(bool, andRecenter)); @@ -247,7 +247,9 @@ void MyAvatar::reset(bool andRecenter, bool andReload) { if (andReload) { _skeletonModel->reset(); } - getHead()->reset(); + if (andHead) { // which drives camera in desktop + getHead()->reset(); + } setThrust(glm::vec3(0.0f)); if (andRecenter) { diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index 135e9f6417..f709f79542 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -94,7 +94,7 @@ public: AudioListenerMode getAudioListenerModeCamera() const { return FROM_CAMERA; } AudioListenerMode getAudioListenerModeCustom() const { return CUSTOM; } - Q_INVOKABLE void reset(bool andRecenter = false, bool andReload = true); + Q_INVOKABLE void reset(bool andRecenter = false, bool andReload = true, bool andHead = true); void update(float deltaTime); virtual void postUpdate(float deltaTime) override; void preDisplaySide(RenderArgs* renderArgs); diff --git a/interface/src/ui/OverlayConductor.cpp b/interface/src/ui/OverlayConductor.cpp index cb211fd918..83d729779c 100644 --- a/interface/src/ui/OverlayConductor.cpp +++ b/interface/src/ui/OverlayConductor.cpp @@ -93,7 +93,7 @@ void OverlayConductor::updateMode() { _mode = FLAT; // Seems appropriate to let things reset, below, after the following. // All reset of, e.g., room-scale location as though by apostrophe key, without all the other adjustments. qApp->getActiveDisplayPlugin()->resetSensors(); - myAvatar->reset(true, false); + myAvatar->reset(true, false, false); } if (_wantsOverlays) { setEnabled(!nowDriving, false);