Reset avatar as well as displayPlugin when "driving"

This commit is contained in:
Anthony J. Thibault 2016-05-19 15:00:08 -07:00
parent 8381e74fb3
commit 7f131e2c4f
3 changed files with 6 additions and 3 deletions

View file

@ -234,7 +234,7 @@ QByteArray MyAvatar::toByteArray(bool cullSmallChanges, bool sendAll) {
return AvatarData::toByteArray(cullSmallChanges, sendAll);
}
void MyAvatar::reset(bool andRecenter) {
void MyAvatar::reset(bool andRecenter, bool andReload) {
if (QThread::currentThread() != thread()) {
QMetaObject::invokeMethod(this, "reset", Q_ARG(bool, andRecenter));
@ -244,7 +244,9 @@ void MyAvatar::reset(bool andRecenter) {
// Reset dynamic state.
_wasPushing = _isPushing = _isBraking = false;
_follow.deactivate();
_skeletonModel->reset();
if (andReload) {
_skeletonModel->reset();
}
getHead()->reset();
_targetVelocity = glm::vec3(0.0f);
setThrust(glm::vec3(0.0f));

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);
Q_INVOKABLE void reset(bool andRecenter = false, bool andReload = true);
void update(float deltaTime);
virtual void postUpdate(float deltaTime) override;
void preDisplaySide(RenderArgs* renderArgs);

View file

@ -86,6 +86,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);
}
if (_wantsOverlays) {
qDebug() << "flipping" << !nowDriving;