diff --git a/interface/src/avatar/AvatarManager.cpp b/interface/src/avatar/AvatarManager.cpp index d3fa87b163..961e168fa5 100644 --- a/interface/src/avatar/AvatarManager.cpp +++ b/interface/src/avatar/AvatarManager.cpp @@ -273,17 +273,11 @@ void AvatarManager::simulateAvatarFades(float deltaTime) { return; } - //const float SHRINK_RATE = 0.15f; - //const float MIN_FADE_SCALE = MIN_AVATAR_SCALE; - QReadLocker locker(&_hashLock); QVector::iterator avatarItr = _avatarsToFade.begin(); const render::ScenePointer& scene = qApp->getMain3DScene(); while (avatarItr != _avatarsToFade.end()) { auto avatar = std::static_pointer_cast(*avatarItr); - // avatar->setTargetScale(avatar->getUniformScale() * SHRINK_RATE); - // avatar->animateScaleChanges(deltaTime); - // if (avatar->getTargetScale() <= MIN_FADE_SCALE) { avatar->updateFadingStatus(scene); if (!avatar->isFading()) { // fading to zero is such a rare event we push a unique transaction for each diff --git a/libraries/avatars-renderer/src/avatars-renderer/Avatar.h b/libraries/avatars-renderer/src/avatars-renderer/Avatar.h index 10710bd631..d078514e2e 100644 --- a/libraries/avatars-renderer/src/avatars-renderer/Avatar.h +++ b/libraries/avatars-renderer/src/avatars-renderer/Avatar.h @@ -356,8 +356,8 @@ private: bool _initialized { false }; bool _isLookAtTarget { false }; bool _isAnimatingScale { false }; - bool _mustFadeIn{ false }; - bool _isFading{ false }; + bool _mustFadeIn { false }; + bool _isFading { false }; static int _jointConesID; diff --git a/libraries/avatars/src/AvatarHashMap.cpp b/libraries/avatars/src/AvatarHashMap.cpp index 68df528d7c..540fd583c8 100644 --- a/libraries/avatars/src/AvatarHashMap.cpp +++ b/libraries/avatars/src/AvatarHashMap.cpp @@ -173,14 +173,7 @@ void AvatarHashMap::processKillAvatar(QSharedPointer message, S void AvatarHashMap::removeAvatar(const QUuid& sessionUUID, KillAvatarReason removalReason) { QWriteLocker locker(&_hashLock); - AvatarSharedPointer removedAvatar; - - if (removalReason != KillAvatarReason::TheirAvatarEnteredYourBubble && removalReason != KillAvatarReason::YourAvatarEnteredTheirBubble) { - removedAvatar = _avatarHash.take(sessionUUID); - } - else { - removedAvatar = _avatarHash[sessionUUID]; - } + AvatarSharedPointer removedAvatar = _avatarHash.take(sessionUUID); if (removedAvatar) { handleRemovedAvatar(removedAvatar, removalReason); diff --git a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp index dd6b5d20ef..77070a064f 100644 --- a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp @@ -219,7 +219,7 @@ namespace render { template <> uint32_t metaFetchMetaSubItems(const RenderableModelEntityItemMeta::Pointer& payload, ItemIDs& subItems) { auto modelEntity = std::static_pointer_cast(payload->entity); auto model = modelEntity->getModelNotSafe(); - if (modelEntity->hasModel() && model) { + if (model && modelEntity->hasModel()) { auto& metaSubItems = model->fetchRenderItemIDs(); subItems.insert(subItems.end(), metaSubItems.begin(), metaSubItems.end()); return (uint32_t) metaSubItems.size(); diff --git a/libraries/render/src/render/Scene.cpp b/libraries/render/src/render/Scene.cpp index bc412089be..3e266a6fdf 100644 --- a/libraries/render/src/render/Scene.cpp +++ b/libraries/render/src/render/Scene.cpp @@ -273,8 +273,7 @@ void Scene::queryTransitionItems(const Transaction::TransitionQueries& transacti if (!TransitionStage::isIndexInvalid(transitionId)) { auto& transition = transitionStage->getTransition(transitionId); func(itemId, &transition); - } - else { + } else { func(itemId, nullptr); } } @@ -314,8 +313,7 @@ void Scene::setItemTransition(ItemID itemId, Index transitionId) { auto& subItem = _items[subItemId]; subItem.setTransitionId(transitionId); } - } - else { + } else { qWarning() << "Collecting sub items on item without payload"; } } diff --git a/scripts/developer/utilities/render/fade.qml b/scripts/developer/utilities/render/fade.qml index f4e4a167d9..1dffd0fbbb 100644 --- a/scripts/developer/utilities/render/fade.qml +++ b/scripts/developer/utilities/render/fade.qml @@ -14,384 +14,384 @@ import "configSlider" import "../lib/plotperf" Column { - id: root - property var config: Render.getConfig("RenderMainView.Fade"); - property var configEdit: Render.getConfig("RenderMainView.FadeEdit"); - spacing: 8 + id: root + property var config: Render.getConfig("RenderMainView.Fade"); + property var configEdit: Render.getConfig("RenderMainView.FadeEdit"); + spacing: 8 - Row { - spacing: 8 + Row { + spacing: 8 - CheckBox { - text: "Edit Fade" - checked: root.configEdit["editFade"] - onCheckedChanged: { - root.configEdit["editFade"] = checked; - Render.getConfig("RenderMainView.DrawFadedOpaqueBounds").enabled = checked; - } - } - ComboBox { - id: categoryBox - width: 400 - model: ["Elements enter/leave domain", "Bubble isect. - Owner POV", "Bubble isect. - Trespasser POV", "Another user leaves/arrives", "Changing an avatar"] - Timer { - id: postpone - interval: 100; running: false; repeat: false - onTriggered: { paramWidgetLoader.sourceComponent = paramWidgets } - } - onCurrentIndexChanged: { - root.config["editedCategory"] = currentIndex; - // This is a hack to be sure the widgets below properly reflect the change of category: delete the Component - // by setting the loader source to Null and then recreate it 100ms later - paramWidgetLoader.sourceComponent = undefined; - postpone.interval = 100 - postpone.start() - } - } - } - Row { - spacing: 8 + CheckBox { + text: "Edit Fade" + checked: root.configEdit["editFade"] + onCheckedChanged: { + root.configEdit["editFade"] = checked; + Render.getConfig("RenderMainView.DrawFadedOpaqueBounds").enabled = checked; + } + } + ComboBox { + id: categoryBox + width: 400 + model: ["Elements enter/leave domain", "Bubble isect. - Owner POV", "Bubble isect. - Trespasser POV", "Another user leaves/arrives", "Changing an avatar"] + Timer { + id: postpone + interval: 100; running: false; repeat: false + onTriggered: { paramWidgetLoader.sourceComponent = paramWidgets } + } + onCurrentIndexChanged: { + root.config["editedCategory"] = currentIndex; + // This is a hack to be sure the widgets below properly reflect the change of category: delete the Component + // by setting the loader source to Null and then recreate it 100ms later + paramWidgetLoader.sourceComponent = undefined; + postpone.interval = 100 + postpone.start() + } + } + } + Row { + spacing: 8 - CheckBox { - text: "Manual" - checked: root.config["manualFade"] - onCheckedChanged: { - root.config["manualFade"] = checked; - } - } - ConfigSlider { - label: "Threshold" - integral: false - config: root.config - property: "manualThreshold" - max: 1.0 - min: 0.0 - width: 400 - } - } + CheckBox { + text: "Manual" + checked: root.config["manualFade"] + onCheckedChanged: { + root.config["manualFade"] = checked; + } + } + ConfigSlider { + label: "Threshold" + integral: false + config: root.config + property: "manualThreshold" + max: 1.0 + min: 0.0 + width: 400 + } + } - Action { + Action { id: saveAction text: "Save" onTriggered: { - root.config.save() - } + root.config.save() + } } - Action { + Action { id: loadAction text: "Load" onTriggered: { - root.config.load() - // This is a hack to be sure the widgets below properly reflect the change of category: delete the Component - // by setting the loader source to Null and then recreate it 500ms later - paramWidgetLoader.sourceComponent = undefined; - postpone.interval = 500 - postpone.start() - } + root.config.load() + // This is a hack to be sure the widgets below properly reflect the change of category: delete the Component + // by setting the loader source to Null and then recreate it 500ms later + paramWidgetLoader.sourceComponent = undefined; + postpone.interval = 500 + postpone.start() + } } - Component { - id: paramWidgets + Component { + id: paramWidgets - Column { - spacing: 8 + Column { + spacing: 8 - CheckBox { - text: "Invert" - checked: root.config["isInverted"] - onCheckedChanged: { root.config["isInverted"] = checked } - } - Row { - spacing: 8 - - GroupBox { - title: "Base Gradient" - width: 450 - Column { - spacing: 8 + CheckBox { + text: "Invert" + checked: root.config["isInverted"] + onCheckedChanged: { root.config["isInverted"] = checked } + } + Row { + spacing: 8 - ConfigSlider { - label: "Size X" - integral: false - config: root.config - property: "baseSizeX" - max: 1.0 - min: 0.0 - width: 400 - } - ConfigSlider { - label: "Size Y" - integral: false - config: root.config - property: "baseSizeY" - max: 1.0 - min: 0.0 - width: 400 - } - ConfigSlider { - label: "Size Z" - integral: false - config: root.config - property: "baseSizeZ" - max: 1.0 - min: 0.0 - width: 400 - } - ConfigSlider { - label: "Level" - integral: false - config: root.config - property: "baseLevel" - max: 1.0 - min: 0.0 - width: 400 - } - } - } - GroupBox { - title: "Noise Gradient" - width: 450 - Column { - spacing: 8 + GroupBox { + title: "Base Gradient" + width: 450 + Column { + spacing: 8 - ConfigSlider { - label: "Size X" - integral: false - config: root.config - property: "noiseSizeX" - max: 1.0 - min: 0.0 - width: 400 - } - ConfigSlider { - label: "Size Y" - integral: false - config: root.config - property: "noiseSizeY" - max: 1.0 - min: 0.0 - width: 400 - } - ConfigSlider { - label: "Size Z" - integral: false - config: root.config - property: "noiseSizeZ" - max: 1.0 - min: 0.0 - width: 400 - } - ConfigSlider { - label: "Level" - integral: false - config: root.config - property: "noiseLevel" - max: 1.0 - min: 0.0 - width: 400 - } - } - } - } - Row { - spacing: 8 + ConfigSlider { + label: "Size X" + integral: false + config: root.config + property: "baseSizeX" + max: 1.0 + min: 0.0 + width: 400 + } + ConfigSlider { + label: "Size Y" + integral: false + config: root.config + property: "baseSizeY" + max: 1.0 + min: 0.0 + width: 400 + } + ConfigSlider { + label: "Size Z" + integral: false + config: root.config + property: "baseSizeZ" + max: 1.0 + min: 0.0 + width: 400 + } + ConfigSlider { + label: "Level" + integral: false + config: root.config + property: "baseLevel" + max: 1.0 + min: 0.0 + width: 400 + } + } + } + GroupBox { + title: "Noise Gradient" + width: 450 + Column { + spacing: 8 - GroupBox { - title: "Edge" - width: 450 - Column { - spacing: 8 + ConfigSlider { + label: "Size X" + integral: false + config: root.config + property: "noiseSizeX" + max: 1.0 + min: 0.0 + width: 400 + } + ConfigSlider { + label: "Size Y" + integral: false + config: root.config + property: "noiseSizeY" + max: 1.0 + min: 0.0 + width: 400 + } + ConfigSlider { + label: "Size Z" + integral: false + config: root.config + property: "noiseSizeZ" + max: 1.0 + min: 0.0 + width: 400 + } + ConfigSlider { + label: "Level" + integral: false + config: root.config + property: "noiseLevel" + max: 1.0 + min: 0.0 + width: 400 + } + } + } + } + Row { + spacing: 8 - ConfigSlider { - label: "Width" - integral: false - config: root.config - property: "edgeWidth" - max: 1.0 - min: 0.0 - width: 400 - } - GroupBox { - title: "Inner color" - Column { - spacing: 8 - ConfigSlider { - label: "Color R" - integral: false - config: root.config - property: "edgeInnerColorR" - max: 1.0 - min: 0.0 - width: 400 - } - ConfigSlider { - label: "Color G" - integral: false - config: root.config - property: "edgeInnerColorG" - max: 1.0 - min: 0.0 - width: 400 - } - ConfigSlider { - label: "Color B" - integral: false - config: root.config - property: "edgeInnerColorB" - max: 1.0 - min: 0.0 - width: 400 - } - ConfigSlider { - label: "Color intensity" - integral: false - config: root.config - property: "edgeInnerIntensity" - max: 5.0 - min: 0.0 - width: 400 - } - } - } - GroupBox { - title: "Outer color" - Column { - spacing: 8 - ConfigSlider { - label: "Color R" - integral: false - config: root.config - property: "edgeOuterColorR" - max: 1.0 - min: 0.0 - width: 400 - } - ConfigSlider { - label: "Color G" - integral: false - config: root.config - property: "edgeOuterColorG" - max: 1.0 - min: 0.0 - width: 400 - } - ConfigSlider { - label: "Color B" - integral: false - config: root.config - property: "edgeOuterColorB" - max: 1.0 - min: 0.0 - width: 400 - } - ConfigSlider { - label: "Color intensity" - integral: false - config: root.config - property: "edgeOuterIntensity" - max: 5.0 - min: 0.0 - width: 400 - } - } - } - } - } + GroupBox { + title: "Edge" + width: 450 + Column { + spacing: 8 - Column { - GroupBox { - title: "Timing" - width: 450 - Column { - spacing: 8 + ConfigSlider { + label: "Width" + integral: false + config: root.config + property: "edgeWidth" + max: 1.0 + min: 0.0 + width: 400 + } + GroupBox { + title: "Inner color" + Column { + spacing: 8 + ConfigSlider { + label: "Color R" + integral: false + config: root.config + property: "edgeInnerColorR" + max: 1.0 + min: 0.0 + width: 400 + } + ConfigSlider { + label: "Color G" + integral: false + config: root.config + property: "edgeInnerColorG" + max: 1.0 + min: 0.0 + width: 400 + } + ConfigSlider { + label: "Color B" + integral: false + config: root.config + property: "edgeInnerColorB" + max: 1.0 + min: 0.0 + width: 400 + } + ConfigSlider { + label: "Color intensity" + integral: false + config: root.config + property: "edgeInnerIntensity" + max: 5.0 + min: 0.0 + width: 400 + } + } + } + GroupBox { + title: "Outer color" + Column { + spacing: 8 + ConfigSlider { + label: "Color R" + integral: false + config: root.config + property: "edgeOuterColorR" + max: 1.0 + min: 0.0 + width: 400 + } + ConfigSlider { + label: "Color G" + integral: false + config: root.config + property: "edgeOuterColorG" + max: 1.0 + min: 0.0 + width: 400 + } + ConfigSlider { + label: "Color B" + integral: false + config: root.config + property: "edgeOuterColorB" + max: 1.0 + min: 0.0 + width: 400 + } + ConfigSlider { + label: "Color intensity" + integral: false + config: root.config + property: "edgeOuterIntensity" + max: 5.0 + min: 0.0 + width: 400 + } + } + } + } + } - ConfigSlider { - label: "Duration" - integral: false - config: root.config - property: "duration" - max: 10.0 - min: 0.1 - width: 400 - } - ComboBox { - width: 400 - model: ["Linear", "Ease In", "Ease Out", "Ease In / Out"] - currentIndex: root.config["timing"] - onCurrentIndexChanged: { - root.config["timing"] = currentIndex; - } - } - GroupBox { - title: "Noise Animation" - Column { - spacing: 8 - ConfigSlider { - label: "Speed X" - integral: false - config: root.config - property: "noiseSpeedX" - max: 1.0 - min: -1.0 - width: 400 - } - ConfigSlider { - label: "Speed Y" - integral: false - config: root.config - property: "noiseSpeedY" - max: 1.0 - min: -1.0 - width: 400 - } - ConfigSlider { - label: "Speed Z" - integral: false - config: root.config - property: "noiseSpeedZ" - max: 1.0 - min: -1.0 - width: 400 - } - } - } + Column { + GroupBox { + title: "Timing" + width: 450 + Column { + spacing: 8 - PlotPerf { - title: "Threshold" - height: parent.evalEvenHeight() - object: config - valueUnit: "%" - valueScale: 0.01 - valueNumDigits: "1" - plots: [ - { - prop: "threshold", - label: "Threshold", - color: "#FFBB77" - } - ] - } + ConfigSlider { + label: "Duration" + integral: false + config: root.config + property: "duration" + max: 10.0 + min: 0.1 + width: 400 + } + ComboBox { + width: 400 + model: ["Linear", "Ease In", "Ease Out", "Ease In / Out"] + currentIndex: root.config["timing"] + onCurrentIndexChanged: { + root.config["timing"] = currentIndex; + } + } + GroupBox { + title: "Noise Animation" + Column { + spacing: 8 + ConfigSlider { + label: "Speed X" + integral: false + config: root.config + property: "noiseSpeedX" + max: 1.0 + min: -1.0 + width: 400 + } + ConfigSlider { + label: "Speed Y" + integral: false + config: root.config + property: "noiseSpeedY" + max: 1.0 + min: -1.0 + width: 400 + } + ConfigSlider { + label: "Speed Z" + integral: false + config: root.config + property: "noiseSpeedZ" + max: 1.0 + min: -1.0 + width: 400 + } + } + } - } - } + PlotPerf { + title: "Threshold" + height: parent.evalEvenHeight() + object: config + valueUnit: "%" + valueScale: 0.01 + valueNumDigits: "1" + plots: [ + { + prop: "threshold", + label: "Threshold", + color: "#FFBB77" + } + ] + } - Row { - spacing: 8 - Button { - action: saveAction - } - Button { - action: loadAction - } - } + } + } - } - } - } - } + Row { + spacing: 8 + Button { + action: saveAction + } + Button { + action: loadAction + } + } - Loader { - id: paramWidgetLoader - sourceComponent: paramWidgets - } + } + } + } + } + + Loader { + id: paramWidgetLoader + sourceComponent: paramWidgets + } }