final final final coding standards

This commit is contained in:
amantley 2018-06-26 17:43:45 -07:00
parent ea76def2b5
commit 8b13905d6c
4 changed files with 9 additions and 13 deletions

View file

@ -194,7 +194,7 @@ void AvatarManager::updateOtherAvatars(float deltaTime) {
const auto avatar = std::static_pointer_cast<Avatar>(sortData.getAvatar()); const auto avatar = std::static_pointer_cast<Avatar>(sortData.getAvatar());
const auto otherAvatar = std::static_pointer_cast<OtherAvatar>(sortData.getAvatar()); const auto otherAvatar = std::static_pointer_cast<OtherAvatar>(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()) { if (avatar->getSkeletonModel()->isLoaded()) {
//remove the orb if it is there //remove the orb if it is there
otherAvatar->removeOrb(); otherAvatar->removeOrb();
@ -326,7 +326,6 @@ void AvatarManager::simulateAvatarFades(float deltaTime) {
} }
AvatarSharedPointer AvatarManager::newSharedAvatar() { AvatarSharedPointer AvatarManager::newSharedAvatar() {
return AvatarSharedPointer(new OtherAvatar(qApp->thread()), [](OtherAvatar* ptr) { ptr->deleteLater(); }); return AvatarSharedPointer(new OtherAvatar(qApp->thread()), [](OtherAvatar* ptr) { ptr->deleteLater(); });
} }

View file

@ -18,14 +18,13 @@ OtherAvatar::OtherAvatar(QThread* thread) : Avatar(thread) {
connect(_skeletonModel.get(), &Model::rigReady, this, &Avatar::rigReady); connect(_skeletonModel.get(), &Model::rigReady, this, &Avatar::rigReady);
connect(_skeletonModel.get(), &Model::rigReset, this, &Avatar::rigReset); connect(_skeletonModel.get(), &Model::rigReset, this, &Avatar::rigReset);
//add the purple orb // add the purple orb
createOrb(); createOrb();
} }
void OtherAvatar::removeOrb() { void OtherAvatar::removeOrb() {
if (qApp->getOverlays().isAddedOverlay(_otherAvatarOrbMeshPlaceholderID)) { if (qApp->getOverlays().isAddedOverlay(_otherAvatarOrbMeshPlaceholderID)) {
qApp->getOverlays().deleteOverlay(_otherAvatarOrbMeshPlaceholderID); qApp->getOverlays().deleteOverlay(_otherAvatarOrbMeshPlaceholderID);
//qCWarning(avatars_renderer) << "remove the purple orb***************************";
} }
} }
@ -34,7 +33,6 @@ void OtherAvatar::updateOrbPosition() {
} }
void OtherAvatar::createOrb() { void OtherAvatar::createOrb() {
qCDebug(interfaceapp) << "we are in create orb otherAvatar.h";
if (_otherAvatarOrbMeshPlaceholderID == UNKNOWN_OVERLAY_ID || if (_otherAvatarOrbMeshPlaceholderID == UNKNOWN_OVERLAY_ID ||
!qApp->getOverlays().isAddedOverlay(_otherAvatarOrbMeshPlaceholderID)) { !qApp->getOverlays().isAddedOverlay(_otherAvatarOrbMeshPlaceholderID)) {
_otherAvatarOrbMeshPlaceholder = std::make_shared<Sphere3DOverlay>(); _otherAvatarOrbMeshPlaceholder = std::make_shared<Sphere3DOverlay>();
@ -49,7 +47,7 @@ void OtherAvatar::createOrb() {
_otherAvatarOrbMeshPlaceholderID = qApp->getOverlays().addOverlay(_otherAvatarOrbMeshPlaceholder); _otherAvatarOrbMeshPlaceholderID = qApp->getOverlays().addOverlay(_otherAvatarOrbMeshPlaceholder);
// Position focus // Position focus
_otherAvatarOrbMeshPlaceholder->setWorldOrientation(glm::quat(0.0f, 0.0f, 0.0f, 1.0)); _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->setDimensions(glm::vec3(0.5f, 0.5f, 0.5f));
_otherAvatarOrbMeshPlaceholder->setVisible(true); _otherAvatarOrbMeshPlaceholder->setVisible(true);
} }

View file

@ -17,12 +17,14 @@
class OtherAvatar : public Avatar { class OtherAvatar : public Avatar {
public: public:
explicit OtherAvatar(QThread* thread); explicit OtherAvatar(QThread* thread);
virtual void instantiableAvatar() override{}; virtual void instantiableAvatar() override { };
void createOrb() override; void createOrb() override;
void updateOrbPosition(); void updateOrbPosition();
void removeOrb(); void removeOrb();
std::shared_ptr<Sphere3DOverlay> _otherAvatarOrbMeshPlaceholder{ nullptr };
OverlayID _otherAvatarOrbMeshPlaceholderID{ UNKNOWN_OVERLAY_ID }; protected:
std::shared_ptr<Sphere3DOverlay> _otherAvatarOrbMeshPlaceholder { nullptr };
OverlayID _otherAvatarOrbMeshPlaceholderID { UNKNOWN_OVERLAY_ID };
}; };
#endif // hifi_OtherAvatar_h #endif // hifi_OtherAvatar_h

View file

@ -234,7 +234,7 @@ public:
/// Scales a world space position vector relative to the avatar position and scale /// Scales a world space position vector relative to the avatar position and scale
/// \param vector position to be scaled. Will store the result /// \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); void slamPosition(const glm::vec3& position);
virtual void updateAttitude(const glm::quat& orientation) override; virtual void updateAttitude(const glm::quat& orientation) override;
@ -361,9 +361,6 @@ public:
virtual scriptable::ScriptableModelBase getScriptableModel() override; virtual scriptable::ScriptableModelBase getScriptableModel() override;
//void updateOrbPosition();
//std::shared_ptr<Sphere3DOverlay> _purpleOrbMeshPlaceholder{ nullptr };
//OverlayID _purpleOrbMeshPlaceholderID{ UNKNOWN_OVERLAY_ID };
public slots: public slots:
// FIXME - these should be migrated to use Pose data instead // FIXME - these should be migrated to use Pose data instead