From e65d9309b3592e2b97b3861bf1cf6511985b2c73 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Mon, 23 Jan 2017 14:56:10 -0800 Subject: [PATCH] remove cruft: Avatar::setShouldDie() --- interface/src/avatar/Avatar.cpp | 6 +++--- interface/src/avatar/Avatar.h | 2 +- libraries/avatars/src/AvatarData.h | 4 ---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index 260373bf50..c5c5dacfc6 100644 --- a/interface/src/avatar/Avatar.cpp +++ b/interface/src/avatar/Avatar.cpp @@ -303,9 +303,9 @@ void Avatar::updateAvatarEntities() { } } -void Avatar::setShouldDie() { - // This will cause the avatar to be shrunk away and removed (the actual Avatar gets removed), but then it comes back. - _owningAvatarMixer.clear(); +bool Avatar::shouldDie() const { + const qint64 AVATAR_SILENCE_THRESHOLD_USECS = 5 * USECS_PER_SECOND; + return _owningAvatarMixer.isNull() || getUsecsSinceLastUpdate() > AVATAR_SILENCE_THRESHOLD_USECS; } void Avatar::simulate(float deltaTime, bool inView) { diff --git a/interface/src/avatar/Avatar.h b/interface/src/avatar/Avatar.h index 3276eaff47..d6f588c47e 100644 --- a/interface/src/avatar/Avatar.h +++ b/interface/src/avatar/Avatar.h @@ -180,7 +180,7 @@ public: uint64_t getLastRenderUpdateTime() const { return _lastRenderUpdateTime; } void setLastRenderUpdateTime(uint64_t time) { _lastRenderUpdateTime = time; } - Q_INVOKABLE void setShouldDie(); + bool shouldDie() const; public slots: diff --git a/libraries/avatars/src/AvatarData.h b/libraries/avatars/src/AvatarData.h index a3c9e537ca..093530235b 100644 --- a/libraries/avatars/src/AvatarData.h +++ b/libraries/avatars/src/AvatarData.h @@ -81,8 +81,6 @@ const quint32 AVATAR_MOTION_DEFAULTS = const quint32 AVATAR_MOTION_SCRIPTABLE_BITS = AVATAR_MOTION_SCRIPTED_MOTOR_ENABLED; -const qint64 AVATAR_SILENCE_THRESHOLD_USECS = 5 * USECS_PER_SECOND; - // Bitset of state flags - we store the key state, hand state, Faceshift, eye tracking, and existence of // referential data in this bit set. The hand state is an octal, but is split into two sections to maintain // backward compatibility. The bits are ordered as such (0-7 left to right). @@ -371,8 +369,6 @@ public: const glm::vec3& getTargetVelocity() const { return _targetVelocity; } - bool shouldDie() const { return _owningAvatarMixer.isNull() || getUsecsSinceLastUpdate() > AVATAR_SILENCE_THRESHOLD_USECS; } - void clearRecordingBasis(); TransformPointer getRecordingBasis() const; void setRecordingBasis(TransformPointer recordingBasis = TransformPointer());