From 46c70d948f054a06dd54adcf2317180bf1ee0a80 Mon Sep 17 00:00:00 2001 From: amantley Date: Tue, 26 Jun 2018 15:11:58 -0700 Subject: [PATCH] Moved OtherAvatar class to interface project. This allows AvatarManager to create and delete the orb overlay that is drawn when an avatar is present in a domain but for some reason the geometry is not loaded. OtherAvatar has new members orbMeshPlaceholder and orbMeshPlaceholderID for a spherical orb that is drawn --- interface/src/avatar/AvatarManager.cpp | 38 +----- interface/src/avatar/OtherAvatar.cpp | 58 +++++++++ interface/src/avatar/OtherAvatar.h | 28 +++++ .../src/avatars-renderer/Avatar.cpp | 24 +--- .../src/avatars-renderer/Avatar.h | 118 ++++++++++-------- .../src/avatars-renderer/OtherAvatar.cpp | 41 ------ .../src/avatars-renderer/OtherAvatar.h | 20 --- 7 files changed, 157 insertions(+), 170 deletions(-) create mode 100644 interface/src/avatar/OtherAvatar.cpp create mode 100644 interface/src/avatar/OtherAvatar.h delete mode 100644 libraries/avatars-renderer/src/avatars-renderer/OtherAvatar.cpp delete mode 100644 libraries/avatars-renderer/src/avatars-renderer/OtherAvatar.h diff --git a/interface/src/avatar/AvatarManager.cpp b/interface/src/avatar/AvatarManager.cpp index 8866ae68f9..1304fa84a9 100644 --- a/interface/src/avatar/AvatarManager.cpp +++ b/interface/src/avatar/AvatarManager.cpp @@ -36,13 +36,13 @@ #include #include #include -#include #include #include "Application.h" #include "InterfaceLogging.h" #include "Menu.h" #include "MyAvatar.h" +#include "OtherAvatar.h" #include "SceneScriptingInterface.h" // 50 times per second - target is 45hz, but this helps account for any small deviations @@ -192,13 +192,14 @@ void AvatarManager::updateOtherAvatars(float deltaTime) { while (!sortedAvatars.empty()) { const SortableAvatar& sortData = sortedAvatars.top(); const auto avatar = std::static_pointer_cast(sortData.getAvatar()); + const auto otherAvatar = std::static_pointer_cast(sortData.getAvatar()); //if the geometry is loaded then turn off the orb if (avatar->getSkeletonModel()->isLoaded()) { //remove the orb if it is there - removeOrb(avatar->_purpleOrbMeshPlaceholderID); + otherAvatar->removeOrb(); } else { - avatar->updateOrbPosition(); + otherAvatar->updateOrbPosition(); } bool ignoring = DependencyManager::get()->isPersonalMutingNode(avatar->getID()); @@ -327,30 +328,6 @@ void AvatarManager::simulateAvatarFades(float deltaTime) { AvatarSharedPointer AvatarManager::newSharedAvatar() { auto newOtherAvatar = AvatarSharedPointer(new OtherAvatar(qApp->thread()), [](OtherAvatar* ptr) { ptr->deleteLater(); }); - - //add the purple orb - /* - if (newOtherAvatar->_purpleOrbMeshPlaceholderID == UNKNOWN_OVERLAY_ID || - !qApp->getOverlays().isAddedOverlay(newOtherAvatar->_purpleOrbMeshPlaceholderID)) { - newOtherAvatar->_purpleOrbMeshPlaceholder = std::make_shared(); - newOtherAvatar->_purpleOrbMeshPlaceholder->setAlpha(1.0f); - newOtherAvatar->_purpleOrbMeshPlaceholder->setColor({ 0xFF, 0x00, 0xFF }); - newOtherAvatar->_purpleOrbMeshPlaceholder->setIsSolid(false); - newOtherAvatar->_purpleOrbMeshPlaceholder->setPulseMin(0.5); - newOtherAvatar->_purpleOrbMeshPlaceholder->setPulseMax(1.0); - newOtherAvatar->_purpleOrbMeshPlaceholder->setColorPulse(1.0); - newOtherAvatar->_purpleOrbMeshPlaceholder->setIgnoreRayIntersection(true); - newOtherAvatar->_purpleOrbMeshPlaceholder->setDrawInFront(false); - newOtherAvatar->_purpleOrbMeshPlaceholderID = qApp->getOverlays().addOverlay(newOtherAvatar->_purpleOrbMeshPlaceholder); - // Position focus - newOtherAvatar->_purpleOrbMeshPlaceholder->setWorldOrientation(glm::quat(0.0f, 0.0f, 0.0f, 1.0)); - newOtherAvatar->_purpleOrbMeshPlaceholder->setWorldPosition(glm::vec3(476.0f, 500.0f, 493.0f)); - newOtherAvatar->_purpleOrbMeshPlaceholder->setDimensions(glm::vec3(0.5f, 0.5f, 0.5f)); - newOtherAvatar->_purpleOrbMeshPlaceholder->setVisible(true); - } - */ - - return newOtherAvatar; } @@ -649,11 +626,6 @@ void AvatarManager::setAvatarSortCoefficient(const QString& name, const QScriptV } } -void AvatarManager::removeOrb(OverlayID orbID) { - if (qApp->getOverlays().isAddedOverlay(orbID)) { - qApp->getOverlays().deleteOverlay(orbID); - //qCWarning(avatars_renderer) << "remove the purple orb***************************"; - } -} + diff --git a/interface/src/avatar/OtherAvatar.cpp b/interface/src/avatar/OtherAvatar.cpp new file mode 100644 index 0000000000..e6c3553b1e --- /dev/null +++ b/interface/src/avatar/OtherAvatar.cpp @@ -0,0 +1,58 @@ +// +// Created by Bradley Austin Davis on 2017/04/27 +// Copyright 2013-2017 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +#include "OtherAvatar.h" +#include "../../interface/src/Application.h" + +OtherAvatar::OtherAvatar(QThread* thread) : Avatar(thread) { + // give the pointer to our head to inherited _headData variable from AvatarData + _headData = new Head(this); + _skeletonModel = std::make_shared(this, nullptr); + _skeletonModel->setLoadingPriority(OTHERAVATAR_LOADING_PRIORITY); + connect(_skeletonModel.get(), &Model::setURLFinished, this, &Avatar::setModelURLFinished); + connect(_skeletonModel.get(), &Model::rigReady, this, &Avatar::rigReady); + connect(_skeletonModel.get(), &Model::rigReset, this, &Avatar::rigReset); + + //add the purple orb + createOrb(); + + +} + +void OtherAvatar::removeOrb() { + if (qApp->getOverlays().isAddedOverlay(_otherAvatarOrbMeshPlaceholderID)) { + qApp->getOverlays().deleteOverlay(_otherAvatarOrbMeshPlaceholderID); + //qCWarning(avatars_renderer) << "remove the purple orb***************************"; + } +} + +void OtherAvatar::updateOrbPosition() { + _otherAvatarOrbMeshPlaceholder->setWorldPosition(getHead()->getPosition()); +} + +void OtherAvatar::createOrb() { + qCDebug(interfaceapp) << "we are in create orb otherAvatar.h"; + if (_otherAvatarOrbMeshPlaceholderID == UNKNOWN_OVERLAY_ID || + !qApp->getOverlays().isAddedOverlay(_otherAvatarOrbMeshPlaceholderID)) { + _otherAvatarOrbMeshPlaceholder = std::make_shared(); + _otherAvatarOrbMeshPlaceholder->setAlpha(1.0f); + _otherAvatarOrbMeshPlaceholder->setColor({ 0xFF, 0x00, 0xFF }); + _otherAvatarOrbMeshPlaceholder->setIsSolid(false); + _otherAvatarOrbMeshPlaceholder->setPulseMin(0.5); + _otherAvatarOrbMeshPlaceholder->setPulseMax(1.0); + _otherAvatarOrbMeshPlaceholder->setColorPulse(1.0); + _otherAvatarOrbMeshPlaceholder->setIgnoreRayIntersection(true); + _otherAvatarOrbMeshPlaceholder->setDrawInFront(false); + _otherAvatarOrbMeshPlaceholderID = qApp->getOverlays().addOverlay(_otherAvatarOrbMeshPlaceholder); + // Position focus + _otherAvatarOrbMeshPlaceholder->setWorldOrientation(glm::quat(0.0f, 0.0f, 0.0f, 1.0)); + _otherAvatarOrbMeshPlaceholder->setWorldPosition(glm::vec3(476.0f, 500.0f, 493.0f)); + _otherAvatarOrbMeshPlaceholder->setDimensions(glm::vec3(0.5f, 0.5f, 0.5f)); + _otherAvatarOrbMeshPlaceholder->setVisible(true); + } +} diff --git a/interface/src/avatar/OtherAvatar.h b/interface/src/avatar/OtherAvatar.h new file mode 100644 index 0000000000..707dd1fcc8 --- /dev/null +++ b/interface/src/avatar/OtherAvatar.h @@ -0,0 +1,28 @@ +// +// Created by Bradley Austin Davis on 2017/04/27 +// Copyright 2013-2017 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +#ifndef hifi_OtherAvatar_h +#define hifi_OtherAvatar_h + +#include +#include "ui/overlays/Overlays.h" +#include "ui/overlays/Sphere3DOverlay.h" +#include "InterfaceLogging.h" + +class OtherAvatar : public Avatar { +public: + explicit OtherAvatar(QThread* thread); + virtual void instantiableAvatar() override{}; + void createOrb() override; + void updateOrbPosition(); + void removeOrb(); + std::shared_ptr _otherAvatarOrbMeshPlaceholder{ nullptr }; + OverlayID _otherAvatarOrbMeshPlaceholderID{ UNKNOWN_OVERLAY_ID }; +}; + +#endif // hifi_OtherAvatar_h diff --git a/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp b/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp index 4fc987d6dd..64545f326d 100644 --- a/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp +++ b/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp @@ -1340,25 +1340,7 @@ void Avatar::scaleVectorRelativeToPosition(glm::vec3 &positionToScale) const { void Avatar::setSkeletonModelURL(const QUrl& skeletonModelURL) { if (!isMyAvatar()) { - if (_purpleOrbMeshPlaceholderID == UNKNOWN_OVERLAY_ID || - !qApp->getOverlays().isAddedOverlay(_purpleOrbMeshPlaceholderID)) { - qCWarning(avatars_renderer) << "change model add the purple orb************************"; - _purpleOrbMeshPlaceholder = std::make_shared(); - _purpleOrbMeshPlaceholder->setAlpha(1.0f); - _purpleOrbMeshPlaceholder->setColor({ 0xFF, 0x00, 0xFF }); - _purpleOrbMeshPlaceholder->setIsSolid(false); - _purpleOrbMeshPlaceholder->setPulseMin(0.5); - _purpleOrbMeshPlaceholder->setPulseMax(1.0); - _purpleOrbMeshPlaceholder->setColorPulse(1.0); - _purpleOrbMeshPlaceholder->setIgnoreRayIntersection(true); - _purpleOrbMeshPlaceholder->setDrawInFront(false); - _purpleOrbMeshPlaceholderID = qApp->getOverlays().addOverlay(_purpleOrbMeshPlaceholder); - // Position focus - _purpleOrbMeshPlaceholder->setWorldOrientation(glm::quat(0.0f, 0.0f, 0.0f, 1.0)); - _purpleOrbMeshPlaceholder->setWorldPosition(getHead()->getPosition()); - _purpleOrbMeshPlaceholder->setDimensions(glm::vec3(0.5f, 0.5f, 0.5f)); - _purpleOrbMeshPlaceholder->setVisible(true); - } + createOrb(); } AvatarData::setSkeletonModelURL(skeletonModelURL); if (QThread::currentThread() == thread()) { @@ -1892,9 +1874,7 @@ void Avatar::processMaterials() { } } -void Avatar::updateOrbPosition() { - _purpleOrbMeshPlaceholder->setWorldPosition(getHead()->getPosition()); -} + scriptable::ScriptableModelBase Avatar::getScriptableModel() { if (!_skeletonModel || !_skeletonModel->isLoaded()) { diff --git a/libraries/avatars-renderer/src/avatars-renderer/Avatar.h b/libraries/avatars-renderer/src/avatars-renderer/Avatar.h index e4052865dd..964ce91a30 100644 --- a/libraries/avatars-renderer/src/avatars-renderer/Avatar.h +++ b/libraries/avatars-renderer/src/avatars-renderer/Avatar.h @@ -23,29 +23,34 @@ #include #include - #include "Head.h" #include "SkeletonModel.h" #include "Rig.h" #include "../../interface/src/ui/overlays/Overlays.h" #include "../../interface/src/ui/overlays/Sphere3DOverlay.h" +#include "Logging.h" + #include namespace render { - template <> const ItemKey payloadGetKey(const AvatarSharedPointer& avatar); - template <> const Item::Bound payloadGetBound(const AvatarSharedPointer& avatar); - template <> void payloadRender(const AvatarSharedPointer& avatar, RenderArgs* args); - template <> uint32_t metaFetchMetaSubItems(const AvatarSharedPointer& avatar, ItemIDs& subItems); -} +template <> +const ItemKey payloadGetKey(const AvatarSharedPointer& avatar); +template <> +const Item::Bound payloadGetBound(const AvatarSharedPointer& avatar); +template <> +void payloadRender(const AvatarSharedPointer& avatar, RenderArgs* args); +template <> +uint32_t metaFetchMetaSubItems(const AvatarSharedPointer& avatar, ItemIDs& subItems); +} // namespace render static const float SCALING_RATIO = .05f; extern const float CHAT_MESSAGE_SCALE; extern const float CHAT_MESSAGE_HEIGHT; - -enum ScreenTintLayer { +enum ScreenTintLayer +{ SCREEN_TINT_BEFORE_LANDSCAPE = 0, SCREEN_TINT_BEFORE_AVATARS, SCREEN_TINT_BEFORE_MY_AVATAR, @@ -85,11 +90,9 @@ public: virtual void render(RenderArgs* renderArgs); - void addToScene(AvatarSharedPointer self, const render::ScenePointer& scene, - render::Transaction& transaction); + void addToScene(AvatarSharedPointer self, const render::ScenePointer& scene, render::Transaction& transaction); - void removeFromScene(AvatarSharedPointer self, const render::ScenePointer& scene, - render::Transaction& transaction); + void removeFromScene(AvatarSharedPointer self, const render::ScenePointer& scene, render::Transaction& transaction); void updateRenderItem(render::Transaction& transaction); @@ -112,6 +115,7 @@ public: float getLODDistance() const; virtual bool isMyAvatar() const override { return false; } + virtual void createOrb() { qCDebug(avatars_renderer) << "we are in create orb avatar.h"; } virtual QVector getJointRotations() const override; using AvatarData::getJointRotation; @@ -166,14 +170,18 @@ public: virtual void setAttachmentData(const QVector& attachmentData) override; void updateDisplayNameAlpha(bool showDisplayName); - virtual void setSessionDisplayName(const QString& sessionDisplayName) override { }; // no-op + virtual void setSessionDisplayName(const QString& sessionDisplayName) override{}; // no-op virtual int parseDataFromBuffer(const QByteArray& buffer) override; - static void renderJointConnectingCone( gpu::Batch& batch, glm::vec3 position1, glm::vec3 position2, - float radius1, float radius2, const glm::vec4& color); + static void renderJointConnectingCone(gpu::Batch& batch, + glm::vec3 position1, + glm::vec3 position2, + float radius1, + float radius2, + const glm::vec4& color); - virtual void applyCollision(const glm::vec3& contactPoint, const glm::vec3& penetration) { } + virtual void applyCollision(const glm::vec3& contactPoint, const glm::vec3& penetration) {} /**jsdoc * Set the offset applied to the current avatar. The offset adjusts the position that the avatar is rendered. For example, @@ -238,7 +246,7 @@ public: /// Scales a world space position vector relative to the avatar position and scale /// \param vector position to be scaled. Will store the result - void scaleVectorRelativeToPosition(glm::vec3 &positionToScale) const; + void scaleVectorRelativeToPosition(glm::vec3& positionToScale) const; void slamPosition(const glm::vec3& position); virtual void updateAttitude(const glm::quat& orientation) override; @@ -257,7 +265,6 @@ public: void setPositionViaScript(const glm::vec3& position) override; void setOrientationViaScript(const glm::quat& orientation) override; - /**jsdoc * @function MyAvatar.getParentID * @returns {Uuid} @@ -286,7 +293,6 @@ public: // This calls through to the SpatiallyNestable versions, but is here to expose these to JavaScript. Q_INVOKABLE virtual void setParentJointIndex(quint16 parentJointIndex) override; - /**jsdoc * Returns an array of joints, where each joint is an object containing name, index, and parentIndex fields. * @function MyAvatar.getSkeleton @@ -324,7 +330,8 @@ public: bool hasNewJointData() const { return _hasNewJointData; } float getBoundingRadius() const; - AABox getRenderBounds() const; // THis call is accessible from rendering thread only to report the bounding box of the avatar during the frame. + AABox getRenderBounds() + const; // THis call is accessible from rendering thread only to report the bounding box of the avatar during the frame. void addToScene(AvatarSharedPointer self, const render::ScenePointer& scene); void ensureInScene(AvatarSharedPointer self, const render::ScenePointer& scene); @@ -352,7 +359,6 @@ public: // not all subclasses of AvatarData have access to this data. virtual bool canMeasureEyeHeight() const override { return true; } - virtual float getModelScale() const { return _modelScale; } virtual void setModelScale(float scale) { _modelScale = scale; } virtual glm::vec3 scaleForChildren() const override { return glm::vec3(getModelScale()); } @@ -367,10 +373,10 @@ public: void removeMaterial(graphics::MaterialPointer material, const std::string& parentMaterialName) override; virtual scriptable::ScriptableModelBase getScriptableModel() override; - - void updateOrbPosition(); - std::shared_ptr _purpleOrbMeshPlaceholder{ nullptr }; - OverlayID _purpleOrbMeshPlaceholderID{ UNKNOWN_OVERLAY_ID }; + + //void updateOrbPosition(); + //std::shared_ptr _purpleOrbMeshPlaceholder{ nullptr }; + //OverlayID _purpleOrbMeshPlaceholderID{ UNKNOWN_OVERLAY_ID }; public slots: // FIXME - these should be migrated to use Pose data instead @@ -432,9 +438,13 @@ protected: float getUnscaledEyeHeightFromSkeleton() const; void buildUnscaledEyeHeightCache(); void clearUnscaledEyeHeightCache(); - virtual const QString& getSessionDisplayNameForTransport() const override { return _empty; } // Save a tiny bit of bandwidth. Mixer won't look at what we send. + virtual const QString& getSessionDisplayNameForTransport() const override { + return _empty; + } // Save a tiny bit of bandwidth. Mixer won't look at what we send. QString _empty{}; - virtual void maybeUpdateSessionDisplayNameFromTransport(const QString& sessionDisplayName) override { _sessionDisplayName = sessionDisplayName; } // don't use no-op setter! + virtual void maybeUpdateSessionDisplayNameFromTransport(const QString& sessionDisplayName) override { + _sessionDisplayName = sessionDisplayName; + } // don't use no-op setter! SkeletonModelPointer _skeletonModel; @@ -442,7 +452,7 @@ protected: void withValidJointIndicesCache(std::function const& worker) const; mutable QHash _modelJointIndicesCache; mutable QReadWriteLock _modelJointIndicesCacheLock; - mutable bool _modelJointsCached { false }; + mutable bool _modelJointsCached{ false }; glm::vec3 _skeletonOffset; std::vector> _attachmentModels; @@ -450,7 +460,7 @@ protected: std::vector> _attachmentsToRemove; std::vector> _attachmentsToDelete; - float _bodyYawDelta { 0.0f }; // degrees/sec + float _bodyYawDelta{ 0.0f }; // degrees/sec // These position histories and derivatives are in the world-frame. // The derivatives are the MEASURED results of all external and internal forces @@ -466,8 +476,8 @@ protected: glm::vec3 _angularAcceleration; glm::quat _lastOrientation; - glm::vec3 _worldUpDirection { Vectors::UP }; - bool _moving { false }; ///< set when position is changing + glm::vec3 _worldUpDirection{ Vectors::UP }; + bool _moving{ false }; ///< set when position is changing // protected methods... bool isLookingAtMe(AvatarSharedPointer avatar) const; @@ -493,10 +503,10 @@ protected: render::ItemID _renderItemID{ render::Item::INVALID_ITEM_ID }; - ThreadSafeValueCache _leftPalmPositionCache { glm::vec3() }; - ThreadSafeValueCache _leftPalmRotationCache { glm::quat() }; - ThreadSafeValueCache _rightPalmPositionCache { glm::vec3() }; - ThreadSafeValueCache _rightPalmRotationCache { glm::quat() }; + ThreadSafeValueCache _leftPalmPositionCache{ glm::vec3() }; + ThreadSafeValueCache _leftPalmRotationCache{ glm::quat() }; + ThreadSafeValueCache _rightPalmPositionCache{ glm::vec3() }; + ThreadSafeValueCache _rightPalmRotationCache{ glm::quat() }; // Some rate tracking support RateCounter<> _simulationRate; @@ -507,36 +517,36 @@ protected: protected: class AvatarEntityDataHash { public: - AvatarEntityDataHash(uint32_t h) : hash(h) {}; - uint32_t hash { 0 }; - bool success { false }; + AvatarEntityDataHash(uint32_t h) : hash(h){}; + uint32_t hash{ 0 }; + bool success{ false }; }; using MapOfAvatarEntityDataHashes = QMap; MapOfAvatarEntityDataHashes _avatarEntityDataHashes; - uint64_t _lastRenderUpdateTime { 0 }; - int _leftPointerGeometryID { 0 }; - int _rightPointerGeometryID { 0 }; - int _nameRectGeometryID { 0 }; - bool _initialized { false }; - bool _isLookAtTarget { false }; - bool _isAnimatingScale { false }; - bool _mustFadeIn { false }; - bool _isFading { false }; - bool _reconstructSoftEntitiesJointMap { false }; - float _modelScale { 1.0f }; + uint64_t _lastRenderUpdateTime{ 0 }; + int _leftPointerGeometryID{ 0 }; + int _rightPointerGeometryID{ 0 }; + int _nameRectGeometryID{ 0 }; + bool _initialized{ false }; + bool _isLookAtTarget{ false }; + bool _isAnimatingScale{ false }; + bool _mustFadeIn{ false }; + bool _isFading{ false }; + bool _reconstructSoftEntitiesJointMap{ false }; + float _modelScale{ 1.0f }; static int _jointConesID; int _voiceSphereID; - AvatarPhysicsCallback _physicsCallback { nullptr }; + AvatarPhysicsCallback _physicsCallback{ nullptr }; - float _displayNameTargetAlpha { 1.0f }; - float _displayNameAlpha { 1.0f }; + float _displayNameTargetAlpha{ 1.0f }; + float _displayNameAlpha{ 1.0f }; - ThreadSafeValueCache _unscaledEyeHeightCache { DEFAULT_AVATAR_EYE_HEIGHT }; + ThreadSafeValueCache _unscaledEyeHeightCache{ DEFAULT_AVATAR_EYE_HEIGHT }; std::unordered_map _materials; std::mutex _materialsLock; @@ -552,4 +562,4 @@ protected: static const float ATTACHMENT_LOADING_PRIORITY; }; -#endif // hifi_Avatar_h +#endif // hifi_Avatar_h diff --git a/libraries/avatars-renderer/src/avatars-renderer/OtherAvatar.cpp b/libraries/avatars-renderer/src/avatars-renderer/OtherAvatar.cpp deleted file mode 100644 index a6c69d24f6..0000000000 --- a/libraries/avatars-renderer/src/avatars-renderer/OtherAvatar.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// -// Created by Bradley Austin Davis on 2017/04/27 -// Copyright 2013-2017 High Fidelity, Inc. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -#include "OtherAvatar.h" -#include "../../interface/src/Application.h" - -OtherAvatar::OtherAvatar(QThread* thread) : Avatar(thread) { - // give the pointer to our head to inherited _headData variable from AvatarData - _headData = new Head(this); - _skeletonModel = std::make_shared(this, nullptr); - _skeletonModel->setLoadingPriority(OTHERAVATAR_LOADING_PRIORITY); - connect(_skeletonModel.get(), &Model::setURLFinished, this, &Avatar::setModelURLFinished); - connect(_skeletonModel.get(), &Model::rigReady, this, &Avatar::rigReady); - connect(_skeletonModel.get(), &Model::rigReset, this, &Avatar::rigReset); - - //add the purple orb - - if (_purpleOrbMeshPlaceholderID == UNKNOWN_OVERLAY_ID || !qApp->getOverlays().isAddedOverlay(_purpleOrbMeshPlaceholderID)) { - _purpleOrbMeshPlaceholder = std::make_shared(); - _purpleOrbMeshPlaceholder->setAlpha(1.0f); - _purpleOrbMeshPlaceholder->setColor({ 0xFF, 0x00, 0xFF }); - _purpleOrbMeshPlaceholder->setIsSolid(false); - _purpleOrbMeshPlaceholder->setPulseMin(0.5); - _purpleOrbMeshPlaceholder->setPulseMax(1.0); - _purpleOrbMeshPlaceholder->setColorPulse(1.0); - _purpleOrbMeshPlaceholder->setIgnoreRayIntersection(true); - _purpleOrbMeshPlaceholder->setDrawInFront(false); - _purpleOrbMeshPlaceholderID = qApp->getOverlays().addOverlay(_purpleOrbMeshPlaceholder); - // Position focus - _purpleOrbMeshPlaceholder->setWorldOrientation(glm::quat(0.0f, 0.0f, 0.0f, 1.0)); - _purpleOrbMeshPlaceholder->setWorldPosition(glm::vec3(476.0f, 500.0f, 493.0f)); - _purpleOrbMeshPlaceholder->setDimensions(glm::vec3(0.5f, 0.5f, 0.5f)); - _purpleOrbMeshPlaceholder->setVisible(true); - } - -} diff --git a/libraries/avatars-renderer/src/avatars-renderer/OtherAvatar.h b/libraries/avatars-renderer/src/avatars-renderer/OtherAvatar.h deleted file mode 100644 index df09d7fd99..0000000000 --- a/libraries/avatars-renderer/src/avatars-renderer/OtherAvatar.h +++ /dev/null @@ -1,20 +0,0 @@ -// -// Created by Bradley Austin Davis on 2017/04/27 -// Copyright 2013-2017 High Fidelity, Inc. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -#ifndef hifi_OtherAvatar_h -#define hifi_OtherAvatar_h - -#include "Avatar.h" - -class OtherAvatar : public Avatar { -public: - explicit OtherAvatar(QThread* thread); - virtual void instantiableAvatar() override {}; -}; - -#endif // hifi_OtherAvatar_h