Don't reset head when we come back.

This commit is contained in:
howard-stearns 2016-05-25 12:21:50 -07:00
parent 2accccef9e
commit dc7d6d470d
3 changed files with 6 additions and 4 deletions

View file

@ -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) {

View file

@ -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);

View file

@ -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);