From 8b13905d6c158ca743fd86f3c2b30ce9bf5dc9ba Mon Sep 17 00:00:00 2001 From: amantley Date: Tue, 26 Jun 2018 17:43:45 -0700 Subject: [PATCH] final final final coding standards --- interface/src/avatar/AvatarManager.cpp | 3 +-- interface/src/avatar/OtherAvatar.cpp | 6 ++---- interface/src/avatar/OtherAvatar.h | 8 +++++--- libraries/avatars-renderer/src/avatars-renderer/Avatar.h | 5 +---- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/interface/src/avatar/AvatarManager.cpp b/interface/src/avatar/AvatarManager.cpp index d1fcfc7d4b..094a49fd44 100644 --- a/interface/src/avatar/AvatarManager.cpp +++ b/interface/src/avatar/AvatarManager.cpp @@ -194,7 +194,7 @@ void AvatarManager::updateOtherAvatars(float deltaTime) { 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 the geometry is loaded then turn off the orb if (avatar->getSkeletonModel()->isLoaded()) { //remove the orb if it is there otherAvatar->removeOrb(); @@ -326,7 +326,6 @@ void AvatarManager::simulateAvatarFades(float deltaTime) { } AvatarSharedPointer AvatarManager::newSharedAvatar() { - return AvatarSharedPointer(new OtherAvatar(qApp->thread()), [](OtherAvatar* ptr) { ptr->deleteLater(); }); } diff --git a/interface/src/avatar/OtherAvatar.cpp b/interface/src/avatar/OtherAvatar.cpp index 035708b71d..7ef4269b96 100644 --- a/interface/src/avatar/OtherAvatar.cpp +++ b/interface/src/avatar/OtherAvatar.cpp @@ -18,14 +18,13 @@ OtherAvatar::OtherAvatar(QThread* thread) : Avatar(thread) { connect(_skeletonModel.get(), &Model::rigReady, this, &Avatar::rigReady); connect(_skeletonModel.get(), &Model::rigReset, this, &Avatar::rigReset); - //add the purple orb + // add the purple orb createOrb(); } void OtherAvatar::removeOrb() { if (qApp->getOverlays().isAddedOverlay(_otherAvatarOrbMeshPlaceholderID)) { qApp->getOverlays().deleteOverlay(_otherAvatarOrbMeshPlaceholderID); - //qCWarning(avatars_renderer) << "remove the purple orb***************************"; } } @@ -34,7 +33,6 @@ void OtherAvatar::updateOrbPosition() { } 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(); @@ -49,7 +47,7 @@ void OtherAvatar::createOrb() { _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->setWorldPosition(getHead()->getPosition()); _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 index 707dd1fcc8..483f400bed 100644 --- a/interface/src/avatar/OtherAvatar.h +++ b/interface/src/avatar/OtherAvatar.h @@ -17,12 +17,14 @@ class OtherAvatar : public Avatar { public: explicit OtherAvatar(QThread* thread); - virtual void instantiableAvatar() override{}; + virtual void instantiableAvatar() override { }; void createOrb() override; void updateOrbPosition(); void removeOrb(); - std::shared_ptr _otherAvatarOrbMeshPlaceholder{ nullptr }; - OverlayID _otherAvatarOrbMeshPlaceholderID{ UNKNOWN_OVERLAY_ID }; + +protected: + std::shared_ptr _otherAvatarOrbMeshPlaceholder { nullptr }; + OverlayID _otherAvatarOrbMeshPlaceholderID { UNKNOWN_OVERLAY_ID }; }; #endif // hifi_OtherAvatar_h diff --git a/libraries/avatars-renderer/src/avatars-renderer/Avatar.h b/libraries/avatars-renderer/src/avatars-renderer/Avatar.h index abe7e4b620..8a0957075d 100644 --- a/libraries/avatars-renderer/src/avatars-renderer/Avatar.h +++ b/libraries/avatars-renderer/src/avatars-renderer/Avatar.h @@ -234,7 +234,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; @@ -361,9 +361,6 @@ public: virtual scriptable::ScriptableModelBase getScriptableModel() override; - //void updateOrbPosition(); - //std::shared_ptr _purpleOrbMeshPlaceholder{ nullptr }; - //OverlayID _purpleOrbMeshPlaceholderID{ UNKNOWN_OVERLAY_ID }; public slots: // FIXME - these should be migrated to use Pose data instead