diff --git a/assignment-client/src/audio/AudioMixer.cpp b/assignment-client/src/audio/AudioMixer.cpp index 4d0e1bf19c..4173cacfc7 100644 --- a/assignment-client/src/audio/AudioMixer.cpp +++ b/assignment-client/src/audio/AudioMixer.cpp @@ -61,7 +61,7 @@ const float LOUDNESS_TO_DISTANCE_RATIO = 0.00001f; const float DEFAULT_ATTENUATION_PER_DOUBLING_IN_DISTANCE = 0.18; -const float DEFAULT_NOISE_MUTING_THRESHOLD = 0.001f; +const float DEFAULT_NOISE_MUTING_THRESHOLD = 0.003f; const QString AUDIO_MIXER_LOGGING_TARGET_NAME = "audio-mixer"; const QString AUDIO_ENV_GROUP_KEY = "audio_env"; const QString AUDIO_BUFFER_GROUP_KEY = "audio_buffer"; diff --git a/domain-server/resources/describe-settings.json b/domain-server/resources/describe-settings.json index a49e1072eb..ba4cfe8dfd 100644 --- a/domain-server/resources/describe-settings.json +++ b/domain-server/resources/describe-settings.json @@ -93,8 +93,8 @@ "name": "noise_muting_threshold", "label": "Noise Muting Threshold", "help": "Loudness value for noise background between 0 and 1.0 (0: mute everyone, 1.0: never mute)", - "placeholder": "0.001", - "default": "0.001", + "placeholder": "0.003", + "default": "0.003", "advanced": false }, { diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index b1c969b66f..bb19ce3ca5 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -837,14 +837,12 @@ void Application::controlledBroadcastToNodes(const QByteArray& packet, const Nod } bool Application::event(QEvent* event) { - // handle custom URL if (event->type() == QEvent::FileOpen) { QFileOpenEvent* fileEvent = static_cast(event); - - if (!fileEvent->url().isEmpty()) { - AddressManager::getInstance().handleLookupString(fileEvent->url().toLocalFile()); + if (fileEvent->url().isValid()) { + openUrl(fileEvent->url()); } return false; diff --git a/interface/src/renderer/GeometryCache.cpp b/interface/src/renderer/GeometryCache.cpp index 1742afba05..9052ec910f 100644 --- a/interface/src/renderer/GeometryCache.cpp +++ b/interface/src/renderer/GeometryCache.cpp @@ -547,7 +547,8 @@ NetworkGeometry::NetworkGeometry(const QUrl& url, const QSharedPointer& owner) { } void NetworkGeometry::setTextureWithNameToURL(const QString& name, const QUrl& url) { - for (int i = 0; i < _meshes.size(); i++) { - NetworkMesh& mesh = _meshes[i]; - for (int j = 0; j < mesh.parts.size(); j++) { - NetworkMeshPart& part = mesh.parts[j]; - - QSharedPointer matchingTexture = QSharedPointer(); - if (part.diffuseTextureName == name) { - part.diffuseTexture = + if (_meshes.size() > 0) { + for (int i = 0; i < _meshes.size(); i++) { + NetworkMesh& mesh = _meshes[i]; + for (int j = 0; j < mesh.parts.size(); j++) { + NetworkMeshPart& part = mesh.parts[j]; + + QSharedPointer matchingTexture = QSharedPointer(); + if (part.diffuseTextureName == name) { + part.diffuseTexture = Application::getInstance()->getTextureCache()->getTexture(url, DEFAULT_TEXTURE, _geometry.meshes[i].isEye, QByteArray()); - part.diffuseTexture->setLoadPriorities(_loadPriorities); - } else if (part.normalTextureName == name) { - part.normalTexture = Application::getInstance()->getTextureCache()->getTexture(url, DEFAULT_TEXTURE, - false, QByteArray()); - part.normalTexture->setLoadPriorities(_loadPriorities); - } else if (part.specularTextureName == name) { - part.specularTexture = Application::getInstance()->getTextureCache()->getTexture(url, DEFAULT_TEXTURE, - false, QByteArray()); - part.specularTexture->setLoadPriorities(_loadPriorities); + part.diffuseTexture->setLoadPriorities(_loadPriorities); + } else if (part.normalTextureName == name) { + part.normalTexture = Application::getInstance()->getTextureCache()->getTexture(url, DEFAULT_TEXTURE, + false, QByteArray()); + part.normalTexture->setLoadPriorities(_loadPriorities); + } else if (part.specularTextureName == name) { + part.specularTexture = Application::getInstance()->getTextureCache()->getTexture(url, DEFAULT_TEXTURE, + false, QByteArray()); + part.specularTexture->setLoadPriorities(_loadPriorities); + } } } + } else { + qDebug() << "Adding a name url pair to pending" << name << url; + // we don't have meshes downloaded yet, so hold this texture as pending + _pendingTextureChanges.insert(name, url); } } @@ -760,6 +769,15 @@ QStringList NetworkGeometry::getTextureNames() const { return result; } +void NetworkGeometry::replaceTexturesWithPendingChanges() { + QHash::Iterator it = _pendingTextureChanges.begin(); + + while (it != _pendingTextureChanges.end()) { + setTextureWithNameToURL(it.key(), it.value()); + it = _pendingTextureChanges.erase(it); + } +} + /// Reads geometry in a worker thread. class GeometryReader : public QRunnable { public: @@ -807,6 +825,7 @@ void NetworkGeometry::init() { _geometry = FBXGeometry(); _meshes.clear(); _lods.clear(); + _pendingTextureChanges.clear(); _request.setUrl(_url); Resource::init(); } diff --git a/interface/src/renderer/GeometryCache.h b/interface/src/renderer/GeometryCache.h index 28f1341b5f..e58177533c 100644 --- a/interface/src/renderer/GeometryCache.h +++ b/interface/src/renderer/GeometryCache.h @@ -113,7 +113,7 @@ public: void setTextureWithNameToURL(const QString& name, const QUrl& url); QStringList getTextureNames() const; - + protected: virtual void init(); @@ -122,6 +122,8 @@ protected: Q_INVOKABLE void setGeometry(const FBXGeometry& geometry); +private slots: + void replaceTexturesWithPendingChanges(); private: friend class GeometryCache; @@ -139,6 +141,8 @@ private: QWeakPointer _lodParent; QHash, QVector > _jointMappings; + + QHash _pendingTextureChanges; }; /// The state associated with a single mesh part. diff --git a/interface/src/scripting/JoystickScriptingInterface.cpp b/interface/src/scripting/JoystickScriptingInterface.cpp index 68affeda5b..40109703d6 100644 --- a/interface/src/scripting/JoystickScriptingInterface.cpp +++ b/interface/src/scripting/JoystickScriptingInterface.cpp @@ -52,9 +52,12 @@ JoystickScriptingInterface::JoystickScriptingInterface() : for (int i = 0; i < joystickCount; i++) { SDL_GameController* controller = SDL_GameControllerOpen(i); - SDL_JoystickID id = getInstanceId(controller); - Joystick* joystick = new Joystick(id, SDL_GameControllerName(controller), controller); - _openJoysticks[id] = joystick; + + if (controller) { + SDL_JoystickID id = getInstanceId(controller); + Joystick* joystick = new Joystick(id, SDL_GameControllerName(controller), controller); + _openJoysticks[id] = joystick; + } } _isInitialized = true; diff --git a/libraries/entities/src/EntityItem.h b/libraries/entities/src/EntityItem.h index ae44e3931b..adf72198be 100644 --- a/libraries/entities/src/EntityItem.h +++ b/libraries/entities/src/EntityItem.h @@ -145,14 +145,14 @@ public: float getLargestDimension() const { return glm::length(_dimensions); } /// get the largest possible dimension /// set dimensions in domain scale units (0.0 - 1.0) this will also reset radius appropriately - void setDimensions(const glm::vec3& value) { _dimensions = value; ; recalculateCollisionShape(); } + void setDimensions(const glm::vec3& value) { _dimensions = value; recalculateCollisionShape(); } /// set dimensions in meter units (0.0 - TREE_SCALE) this will also reset radius appropriately void setDimensionsInMeters(const glm::vec3& value) { setDimensions(value / (float) TREE_SCALE); } static const glm::quat DEFAULT_ROTATION; const glm::quat& getRotation() const { return _rotation; } - void setRotation(const glm::quat& rotation) { _rotation = rotation; ; recalculateCollisionShape(); } + void setRotation(const glm::quat& rotation) { _rotation = rotation; recalculateCollisionShape(); } static const float DEFAULT_GLOW_LEVEL; float getGlowLevel() const { return _glowLevel; } @@ -169,7 +169,7 @@ public: static const glm::vec3 DEFAULT_VELOCITY; static const glm::vec3 NO_VELOCITY; static const float EPSILON_VELOCITY_LENGTH; - const glm::vec3 getVelocity() const { return _velocity; } /// velocity in domain scale units (0.0-1.0) per second + const glm::vec3& getVelocity() const { return _velocity; } /// velocity in domain scale units (0.0-1.0) per second glm::vec3 getVelocityInMeters() const { return _velocity * (float) TREE_SCALE; } /// get velocity in meters void setVelocity(const glm::vec3& value) { _velocity = value; } /// velocity in domain scale units (0.0-1.0) per second void setVelocityInMeters(const glm::vec3& value) { _velocity = value / (float) TREE_SCALE; } /// velocity in meters