From b1690b31899b70401d8a64c3fa54c64363d3f898 Mon Sep 17 00:00:00 2001 From: Alexander Ivash Date: Fri, 16 Mar 2018 00:27:36 +0300 Subject: [PATCH 01/29] fix malformed urls on windows (like file:///Users/ai/AppData....) note: the issue happened because drive letter on Windows is treated by QUrl as 'scheme', so replacing it with 'file' results in broken url. --- tools/oven/src/BakerCLI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/oven/src/BakerCLI.cpp b/tools/oven/src/BakerCLI.cpp index f5af5455fb..aac028e8cf 100644 --- a/tools/oven/src/BakerCLI.cpp +++ b/tools/oven/src/BakerCLI.cpp @@ -28,7 +28,7 @@ void BakerCLI::bakeFile(QUrl inputUrl, const QString& outputPath, const QString& // if the URL doesn't have a scheme, assume it is a local file if (inputUrl.scheme() != "http" && inputUrl.scheme() != "https" && inputUrl.scheme() != "ftp") { - inputUrl.setScheme("file"); + inputUrl = QUrl::fromLocalFile(inputUrl.toString()); } qDebug() << "Baking file type: " << type; From 2439c045281b9c9d47c3b002dba8d0d9821d4d8b Mon Sep 17 00:00:00 2001 From: Alexander Ivash Date: Wed, 25 Apr 2018 11:04:31 +0300 Subject: [PATCH 02/29] skip url conversion to 'file:///' for the urls which schema is already 'file' --- tools/oven/src/BakerCLI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/oven/src/BakerCLI.cpp b/tools/oven/src/BakerCLI.cpp index aac028e8cf..a908b69f77 100644 --- a/tools/oven/src/BakerCLI.cpp +++ b/tools/oven/src/BakerCLI.cpp @@ -27,7 +27,7 @@ BakerCLI::BakerCLI(OvenCLIApplication* parent) : QObject(parent) { void BakerCLI::bakeFile(QUrl inputUrl, const QString& outputPath, const QString& type) { // if the URL doesn't have a scheme, assume it is a local file - if (inputUrl.scheme() != "http" && inputUrl.scheme() != "https" && inputUrl.scheme() != "ftp") { + if (inputUrl.scheme() != "http" && inputUrl.scheme() != "https" && inputUrl.scheme() != "ftp" && inputUrl.scheme() != "file") { inputUrl = QUrl::fromLocalFile(inputUrl.toString()); } From ae03dcb57a41684b14417f7373d3b9a4f5a835a9 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Fri, 6 Jul 2018 15:42:21 -0700 Subject: [PATCH 03/29] fix parent grab dropping and cullig flickering --- .../src/RenderableEntityItem.cpp | 18 ++++++++---------- .../src/RenderableEntityItem.h | 2 +- .../src/RenderableParticleEffectEntityItem.cpp | 2 +- .../src/RenderableShapeEntityItem.cpp | 6 ++---- .../src/RenderableTextEntityItem.cpp | 2 +- .../src/RenderableWebEntityItem.cpp | 2 +- .../controllerModules/nearParentGrabEntity.js | 6 +----- .../libraries/controllerDispatcherUtils.js | 4 +++- 8 files changed, 18 insertions(+), 24 deletions(-) diff --git a/libraries/entities-renderer/src/RenderableEntityItem.cpp b/libraries/entities-renderer/src/RenderableEntityItem.cpp index e8f57ea834..78801df715 100644 --- a/libraries/entities-renderer/src/RenderableEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableEntityItem.cpp @@ -363,12 +363,18 @@ bool EntityRenderer::needsRenderUpdateFromEntity(const EntityItemPointer& entity return false; } -void EntityRenderer::updateModelTransform() { +void EntityRenderer::updateModelTransformAndBound() { bool success = false; auto newModelTransform = _entity->getTransformToCenter(success); if (success) { _modelTransform = newModelTransform; } + + success = false; + auto bound = _entity->getAABox(success); + if (success) { + _bound = bound; + } } void EntityRenderer::doRenderUpdateSynchronous(const ScenePointer& scene, Transaction& transaction, const EntityItemPointer& entity) { @@ -380,15 +386,7 @@ void EntityRenderer::doRenderUpdateSynchronous(const ScenePointer& scene, Transa } _prevIsTransparent = transparent; - bool success = false; - auto bound = entity->getAABox(success); - if (success) { - _bound = bound; - } - auto newModelTransform = entity->getTransformToCenter(success); - if (success) { - _modelTransform = newModelTransform; - } + updateModelTransformAndBound(); _moving = entity->isMovingRelativeToParent(); _visible = entity->getVisible(); diff --git a/libraries/entities-renderer/src/RenderableEntityItem.h b/libraries/entities-renderer/src/RenderableEntityItem.h index 40966c4f41..496649eb5f 100644 --- a/libraries/entities-renderer/src/RenderableEntityItem.h +++ b/libraries/entities-renderer/src/RenderableEntityItem.h @@ -97,7 +97,7 @@ protected: virtual void doRender(RenderArgs* args) = 0; bool isFading() const { return _isFading; } - void updateModelTransform(); + void updateModelTransformAndBound(); virtual bool isTransparent() const { return _isFading ? Interpolate::calculateFadeRatio(_fadeStartTime) < 1.0f : false; } inline bool isValidRenderItem() const { return _renderItemID != Item::INVALID_ITEM_ID; } diff --git a/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp b/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp index a6a6dc05f2..309671f49e 100644 --- a/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp @@ -126,7 +126,7 @@ void ParticleEffectEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePoi void* key = (void*)this; AbstractViewStateInterface::instance()->pushPostUpdateLambda(key, [this] () { withWriteLock([&] { - updateModelTransform(); + updateModelTransformAndBound(); _renderTransform = getModelTransform(); }); }); diff --git a/libraries/entities-renderer/src/RenderableShapeEntityItem.cpp b/libraries/entities-renderer/src/RenderableShapeEntityItem.cpp index 2e0656ab81..c50b3bd760 100644 --- a/libraries/entities-renderer/src/RenderableShapeEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableShapeEntityItem.cpp @@ -106,10 +106,8 @@ void ShapeEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& sce _position = entity->getWorldPosition(); _dimensions = entity->getScaledDimensions(); _orientation = entity->getWorldOrientation(); - bool success = false; - auto newModelTransform = entity->getTransformToCenter(success); - _renderTransform = success ? newModelTransform : getModelTransform(); - + updateModelTransformAndBound(); + _renderTransform = getModelTransform(); if (_shape == entity::Sphere) { _renderTransform.postScale(SPHERE_ENTITY_SCALE); } diff --git a/libraries/entities-renderer/src/RenderableTextEntityItem.cpp b/libraries/entities-renderer/src/RenderableTextEntityItem.cpp index ce4b6d9175..08a3b585e4 100644 --- a/libraries/entities-renderer/src/RenderableTextEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableTextEntityItem.cpp @@ -70,7 +70,7 @@ void TextEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& scen AbstractViewStateInterface::instance()->pushPostUpdateLambda(key, [this, entity] () { withWriteLock([&] { _dimensions = entity->getScaledDimensions(); - updateModelTransform(); + updateModelTransformAndBound(); _renderTransform = getModelTransform(); }); }); diff --git a/libraries/entities-renderer/src/RenderableWebEntityItem.cpp b/libraries/entities-renderer/src/RenderableWebEntityItem.cpp index 17d6d58781..793b4aa158 100644 --- a/libraries/entities-renderer/src/RenderableWebEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableWebEntityItem.cpp @@ -206,7 +206,7 @@ void WebEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& scene glm::vec2 windowSize = getWindowSize(entity); _webSurface->resize(QSize(windowSize.x, windowSize.y)); - updateModelTransform(); + updateModelTransformAndBound(); _renderTransform = getModelTransform(); _renderTransform.postScale(entity->getScaledDimensions()); }); diff --git a/scripts/system/controllers/controllerModules/nearParentGrabEntity.js b/scripts/system/controllers/controllerModules/nearParentGrabEntity.js index 00d7ad0491..580132a648 100644 --- a/scripts/system/controllers/controllerModules/nearParentGrabEntity.js +++ b/scripts/system/controllers/controllerModules/nearParentGrabEntity.js @@ -173,11 +173,7 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); this.lastUnequipCheckTime = now; if (props.parentID === MyAvatar.SELF_ID) { var sensorScaleFactor = MyAvatar.sensorToWorldScale; - var handPosition = controllerData.controllerLocations[this.hand].position; - var dist = distanceBetweenPointAndEntityBoundingBox(handPosition, props); - var distance = Vec3.distance(props.position, handPosition); - if ((dist > TEAR_AWAY_DISTANCE) || - (distance > NEAR_GRAB_RADIUS * sensorScaleFactor)) { + if ((props.localPosition > TEAR_AWAY_DISTANCE * sensorScaleFactor)) { this.autoUnequipCounter++; } else { this.autoUnequipCounter = 0; diff --git a/scripts/system/libraries/controllerDispatcherUtils.js b/scripts/system/libraries/controllerDispatcherUtils.js index 5dfb0d5b69..9a886372b8 100644 --- a/scripts/system/libraries/controllerDispatcherUtils.js +++ b/scripts/system/libraries/controllerDispatcherUtils.js @@ -130,7 +130,9 @@ DISPATCHER_PROPERTIES = [ "type", "href", "cloneable", - "cloneDynamic" + "cloneDynamic", + "localPosition", + "localRotation" ]; // priority -- a lower priority means the module will be asked sooner than one with a higher priority in a given update step From 7a7b9730eeef1d1fff51e5a47f51f687d24f8f6c Mon Sep 17 00:00:00 2001 From: David Back Date: Mon, 9 Jul 2018 15:36:22 -0700 Subject: [PATCH 04/29] only clamp handles in hmd outside bounding box --- scripts/system/libraries/entitySelectionTool.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/scripts/system/libraries/entitySelectionTool.js b/scripts/system/libraries/entitySelectionTool.js index 4ff139ee75..c9a15875f1 100644 --- a/scripts/system/libraries/entitySelectionTool.js +++ b/scripts/system/libraries/entitySelectionTool.js @@ -1186,10 +1186,17 @@ SelectionDisplay = (function() { var localRotationZ = Quat.fromPitchYawRollDegrees(rotationDegrees, 0, 0); var rotationZ = Quat.multiply(rotation, localRotationZ); worldRotationZ = rotationZ; + + var selectionBoxGeometry = { + position: position, + rotation: rotation, + dimensions: dimensions + }; + var isCameraInsideBox = isPointInsideBox(Camera.position, selectionBoxGeometry); - // in HMD we clamp the overlays to the bounding box for now so lasers can hit them + // in HMD if outside the bounding box clamp the overlays to the bounding box for now so lasers can hit them var maxHandleDimension = 0; - if (HMD.active) { + if (HMD.active && !isCameraInsideBox) { maxHandleDimension = Math.max(dimensions.x, dimensions.y, dimensions.z); } @@ -1438,12 +1445,6 @@ SelectionDisplay = (function() { var inModeRotate = isActiveTool(handleRotatePitchRing) || isActiveTool(handleRotateYawRing) || isActiveTool(handleRotateRollRing); - var selectionBoxGeometry = { - position: position, - rotation: rotation, - dimensions: dimensions - }; - var isCameraInsideBox = isPointInsideBox(Camera.position, selectionBoxGeometry); selectionBoxGeometry.visible = !inModeRotate && !isCameraInsideBox; Overlays.editOverlay(selectionBox, selectionBoxGeometry); From ced4e1e0e0b10aee5c8c1e37af6507a1e662612b Mon Sep 17 00:00:00 2001 From: luiscuenca Date: Wed, 11 Jul 2018 18:02:19 -0700 Subject: [PATCH 05/29] Fix blue screen after player step returns NaN values --- libraries/physics/src/CharacterController.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libraries/physics/src/CharacterController.cpp b/libraries/physics/src/CharacterController.cpp index aaf2c0a46b..0bbfa41a12 100755 --- a/libraries/physics/src/CharacterController.cpp +++ b/libraries/physics/src/CharacterController.cpp @@ -277,10 +277,14 @@ void CharacterController::playerStep(btCollisionWorld* collisionWorld, btScalar btVector3 shapeLocalOffset = glmToBullet(_shapeLocalOffset); btVector3 swingDisplacement = rotateVector(endRot, -shapeLocalOffset) - rotateVector(startRot, -shapeLocalOffset); - _followLinearDisplacement = linearDisplacement + swingDisplacement + _followLinearDisplacement; - _followAngularDisplacement = angularDisplacement * _followAngularDisplacement; + if (!isNaN(bulletToGLM(endPos)) && !isNaN(bulletToGLM(endRot))) { + _followLinearDisplacement = linearDisplacement + swingDisplacement + _followLinearDisplacement; + _followAngularDisplacement = angularDisplacement * _followAngularDisplacement; - _rigidBody->setWorldTransform(btTransform(endRot, endPos)); + _rigidBody->setWorldTransform(btTransform(endRot, endPos)); + } else { + qCWarning(physics) << "CharacterController::playerStep produced NaN."; + } } _followTime += dt; From 306a77c0399fee4055c6d0722d1e34642d603ee8 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Jul 2018 12:46:18 -0700 Subject: [PATCH 06/29] fix delete event --- scripts/system/edit.js | 8 ++------ scripts/system/libraries/entityList.js | 12 +++++++++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/scripts/system/edit.js b/scripts/system/edit.js index 73088560d9..c40f97a606 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -1573,15 +1573,11 @@ function deleteSelectedEntities() { Entities.deleteEntity(entityID); } } - + if (savedProperties.length > 0) { SelectionManager.clearSelections(); pushCommandForSelections([], savedProperties); - - entityListTool.webView.emitScriptEvent(JSON.stringify({ - type: "deleted", - ids: deletedIDs - })); + entityListTool.deleteEntities(deletedIDs); } } } diff --git a/scripts/system/libraries/entityList.js b/scripts/system/libraries/entityList.js index de8e5d9c06..ae89b63ea6 100644 --- a/scripts/system/libraries/entityList.js +++ b/scripts/system/libraries/entityList.js @@ -93,12 +93,18 @@ EntityListTool = function() { }; that.removeEntities = function (deletedIDs, selectedIDs) { - var data = { + emitJSONScriptEvent({ type: 'removeEntities', deletedIDs: deletedIDs, selectedIDs: selectedIDs - }; - webView.emitScriptEvent(JSON.stringify(data)); + }); + }; + + that.deleteEntities = function (deletedIDs) { + emitJSONScriptEvent({ + type: "deleted", + ids: deletedIDs + }); }; function valueIfDefined(value) { From 1c64ebc3caf1568bd4edd0fa1753926e9a4be2cb Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Thu, 12 Jul 2018 13:57:48 -0700 Subject: [PATCH 07/29] fixing combo boxes --- interface/resources/qml/controls-uit/ComboBox.qml | 1 - interface/resources/qml/hifi/avatarapp/AdjustWearables.qml | 1 - 2 files changed, 2 deletions(-) diff --git a/interface/resources/qml/controls-uit/ComboBox.qml b/interface/resources/qml/controls-uit/ComboBox.qml index 9ec5ed19ba..be8c9f6740 100644 --- a/interface/resources/qml/controls-uit/ComboBox.qml +++ b/interface/resources/qml/controls-uit/ComboBox.qml @@ -46,7 +46,6 @@ FocusScope { hoverEnabled: true visible: true height: hifi.fontSizes.textFieldInput + 13 // Match height of TextField control. - textRole: "text" function previousItem() { root.currentHighLightedIndex = (root.currentHighLightedIndex + comboBox.count - 1) % comboBox.count; } function nextItem() { root.currentHighLightedIndex = (root.currentHighLightedIndex + comboBox.count + 1) % comboBox.count; } diff --git a/interface/resources/qml/hifi/avatarapp/AdjustWearables.qml b/interface/resources/qml/hifi/avatarapp/AdjustWearables.qml index a501185853..10613a9ec1 100644 --- a/interface/resources/qml/hifi/avatarapp/AdjustWearables.qml +++ b/interface/resources/qml/hifi/avatarapp/AdjustWearables.qml @@ -125,7 +125,6 @@ Rectangle { id: wearablesCombobox anchors.left: parent.left anchors.right: parent.right - comboBox.textRole: "text" model: ListModel { function findIndexById(id) { From 1ab6c7a8acac39ff4e8d68934dda523d4ccf3868 Mon Sep 17 00:00:00 2001 From: luiscuenca Date: Thu, 12 Jul 2018 14:00:55 -0700 Subject: [PATCH 08/29] Proper fix --- libraries/physics/src/CharacterController.cpp | 65 +++++++++++++------ 1 file changed, 45 insertions(+), 20 deletions(-) diff --git a/libraries/physics/src/CharacterController.cpp b/libraries/physics/src/CharacterController.cpp index 0bbfa41a12..7f63fd9f5e 100755 --- a/libraries/physics/src/CharacterController.cpp +++ b/libraries/physics/src/CharacterController.cpp @@ -262,29 +262,54 @@ void CharacterController::playerStep(btCollisionWorld* collisionWorld, btScalar btVector3 linearDisplacement = clampLength(vel * dt, MAX_DISPLACEMENT); // clamp displacement to prevent tunneling. btVector3 endPos = startPos + linearDisplacement; + // resolve the simple linearDisplacement + _followLinearDisplacement += linearDisplacement; + + // now for the rotational part... btQuaternion startRot = bodyTransform.getRotation(); btQuaternion desiredRot = _followDesiredBodyTransform.getRotation(); - if (desiredRot.dot(startRot) < 0.0f) { - desiredRot = -desiredRot; - } - btQuaternion deltaRot = desiredRot * startRot.inverse(); - float angularSpeed = deltaRot.getAngle() / _followTimeRemaining; - glm::vec3 rotationAxis = glm::normalize(glm::axis(bulletToGLM(deltaRot))); // deltaRot.getAxis() is inaccurate - btQuaternion angularDisplacement = btQuaternion(glmToBullet(rotationAxis), angularSpeed * dt); - btQuaternion endRot = angularDisplacement * startRot; - - // in order to accumulate displacement of avatar position, we need to take _shapeLocalOffset into account. - btVector3 shapeLocalOffset = glmToBullet(_shapeLocalOffset); - btVector3 swingDisplacement = rotateVector(endRot, -shapeLocalOffset) - rotateVector(startRot, -shapeLocalOffset); - - if (!isNaN(bulletToGLM(endPos)) && !isNaN(bulletToGLM(endRot))) { - _followLinearDisplacement = linearDisplacement + swingDisplacement + _followLinearDisplacement; - _followAngularDisplacement = angularDisplacement * _followAngularDisplacement; - - _rigidBody->setWorldTransform(btTransform(endRot, endPos)); - } else { - qCWarning(physics) << "CharacterController::playerStep produced NaN."; + + // startRot as default rotation + btQuaternion endRot = startRot; + + // the dot product between two quaternions is equal to +/- cos(angle/2) + // where 'angle' is that of the rotation between them + float qDot = desiredRot.dot(startRot); + + // when the abs() value of the dot product is approximately 1.0 + // then the two rotations are effectively adjacent + const float MIN_DOT_PRODUCT_OF_ADJACENT_QUATERNIONS = 0.99999f; // corresponds to approx 0.5 degrees + if (fabsf(qDot) < MIN_DOT_PRODUCT_OF_ADJACENT_QUATERNIONS) { + if (qDot < 0.0f) { + // the quaternions are actually on opposite hyperhemispheres + // so we move one to agree with the other and negate qDot + desiredRot = -desiredRot; + qDot = -qDot; + } + btQuaternion deltaRot = desiredRot * startRot.inverse(); + + // the axis is the imaginary part, but scaled by sin(angle/2) + btVector3 axis(deltaRot.getX(), deltaRot.getY(), deltaRot.getZ()); + axis /= sqrtf(1.0f - qDot*qDot); + + // compute the angle we will resolve for this dt, but don't overshoot + float angle = (2.0f * acosf(qDot)); + if ( dt < _followTimeRemaining) { + angle *= dt / _followTimeRemaining; + } + + // accumulate rotation + deltaRot = btQuaternion(axis, angle); + _followAngularDisplacement = (deltaRot * _followAngularDisplacement).normalize(); + + // in order to accumulate displacement of avatar position, we need to take _shapeLocalOffset into account. + btVector3 shapeLocalOffset = glmToBullet(_shapeLocalOffset); + + endRot = deltaRot * startRot; + btVector3 swingDisplacement = rotateVector(endRot, -shapeLocalOffset) - rotateVector(startRot, -shapeLocalOffset); + _followLinearDisplacement += swingDisplacement; } + _rigidBody->setWorldTransform(btTransform(endRot, endPos)); } _followTime += dt; From 92756d81ad8296b1c6caa3b4bcdaa16080e53877 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Thu, 12 Jul 2018 15:03:01 -0700 Subject: [PATCH 09/29] Implement MS16562: Massive PAL speedup! --- interface/resources/qml/hifi/Pal.qml | 4 +- interface/src/avatar/AvatarManager.cpp | 39 +++++++ interface/src/avatar/AvatarManager.h | 2 + scripts/system/pal.js | 148 ++++++++++++------------- 4 files changed, 112 insertions(+), 81 deletions(-) diff --git a/interface/resources/qml/hifi/Pal.qml b/interface/resources/qml/hifi/Pal.qml index 3059707313..06ad57139d 100644 --- a/interface/resources/qml/hifi/Pal.qml +++ b/interface/resources/qml/hifi/Pal.qml @@ -1108,7 +1108,7 @@ Rectangle { function findNearbySessionIndex(sessionId, optionalData) { // no findIndex in .qml var data = optionalData || nearbyUserModelData, length = data.length; for (var i = 0; i < length; i++) { - if (data[i].sessionId === sessionId) { + if (data[i].sessionId === sessionId.toString()) { return i; } } @@ -1120,7 +1120,7 @@ Rectangle { var data = message.params; var index = -1; iAmAdmin = Users.canKick; - index = findNearbySessionIndex('', data); + index = findNearbySessionIndex(MyAvatar.sessionUUID, data); if (index !== -1) { myData = data[index]; data.splice(index, 1); diff --git a/interface/src/avatar/AvatarManager.cpp b/interface/src/avatar/AvatarManager.cpp index 29ad71ead6..a7ee5f4869 100644 --- a/interface/src/avatar/AvatarManager.cpp +++ b/interface/src/avatar/AvatarManager.cpp @@ -14,6 +14,7 @@ #include #include +#include #include "AvatarLogging.h" @@ -668,3 +669,41 @@ void AvatarManager::setAvatarSortCoefficient(const QString& name, const QScriptV DependencyManager::get()->broadcastToNodes(std::move(packet), NodeSet() << NodeType::AvatarMixer); } } + +QString AvatarManager::getPalData(const QList specificAvatarIdentifiers) { + QJsonArray palData; + + auto avatarMap = getHashCopy(); + AvatarHash::iterator itr = avatarMap.begin(); + while (itr != avatarMap.end()) { + std::shared_ptr avatar = std::static_pointer_cast(*itr); + QString currentSessionUUID = avatar->getSessionUUID().toString(); + if (specificAvatarIdentifiers.isEmpty() || specificAvatarIdentifiers.contains(currentSessionUUID)) { + QJsonObject thisAvatarPalData; + thisAvatarPalData.insert("sessionUUID", currentSessionUUID); + thisAvatarPalData.insert("sessionDisplayName", avatar->getSessionDisplayName()); + thisAvatarPalData.insert("audioLoudness", avatar->getAudioLoudness()); + thisAvatarPalData.insert("isReplicated", avatar->getIsReplicated()); + + glm::vec3 position = avatar->getWorldPosition(); + QJsonObject jsonPosition; + jsonPosition.insert("x", position.x); + jsonPosition.insert("y", position.y); + jsonPosition.insert("z", position.z); + thisAvatarPalData.insert("position", jsonPosition); + + float palOrbOffset = 0.2f; + int headIndex = avatar->getJointIndex("Head"); + if (headIndex > 0) { + glm::vec3 jointTranslation = avatar->getAbsoluteJointTranslationInObjectFrame(headIndex); + palOrbOffset = jointTranslation.y / 2; + } + thisAvatarPalData.insert("palOrbOffset", palOrbOffset); + + palData.append(thisAvatarPalData); + } + ++itr; + } + QJsonDocument doc(palData); + return doc.toJson(QJsonDocument::Compact); +} diff --git a/interface/src/avatar/AvatarManager.h b/interface/src/avatar/AvatarManager.h index ff29c1b381..507767866b 100644 --- a/interface/src/avatar/AvatarManager.h +++ b/interface/src/avatar/AvatarManager.h @@ -157,6 +157,8 @@ public: */ Q_INVOKABLE void setAvatarSortCoefficient(const QString& name, const QScriptValue& value); + Q_INVOKABLE QString getPalData(const QList specificAvatarIdentifiers = QList()); + float getMyAvatarSendRate() const { return _myAvatarSendRate.rate(); } int getIdentityRequestsSent() const { return _identityRequestsSent; } diff --git a/scripts/system/pal.js b/scripts/system/pal.js index e967ee6469..4a0d866d66 100644 --- a/scripts/system/pal.js +++ b/scripts/system/pal.js @@ -19,7 +19,7 @@ var populateNearbyUserList, color, textures, removeOverlays, controllerComputePickRay, onTabletButtonClicked, onTabletScreenChanged, receiveMessage, avatarDisconnected, clearLocalQMLDataAndClosePAL, - createAudioInterval, tablet, CHANNEL, getConnectionData, findableByChanged, + tablet, CHANNEL, getConnectionData, findableByChanged, avatarAdded, avatarRemoved, avatarSessionChanged; // forward references; // hardcoding these as it appears we cannot traverse the originalTextures in overlays??? Maybe I've missed @@ -447,21 +447,24 @@ function populateNearbyUserList(selectData, oldAudioData) { verticalAngleNormal = filter && Quat.getRight(orientation), horizontalAngleNormal = filter && Quat.getUp(orientation); avatarsOfInterest = {}; - avatars.forEach(function (id) { - var avatar = AvatarList.getAvatar(id); - var name = avatar.sessionDisplayName; + + var avatarData = JSON.parse(AvatarList.getPalData()); + + avatarData.forEach(function (currentAvatarData) { + var id = currentAvatarData.sessionUUID; + var name = currentAvatarData.sessionDisplayName; if (!name) { // Either we got a data packet but no identity yet, or something is really messed up. In any case, // we won't be able to do anything with this user, so don't include them. // In normal circumstances, a refresh will bring in the new user, but if we're very heavily loaded, // we could be losing and gaining people randomly. - print('No avatar identity data for', id); + print('No avatar identity data for', currentAvatarData.sessionUUID); return; } - if (id && myPosition && (Vec3.distance(avatar.position, myPosition) > filter.distance)) { + if (id && myPosition && (Vec3.distance(currentAvatarData.position, myPosition) > filter.distance)) { return; } - var normal = id && filter && Vec3.normalize(Vec3.subtract(avatar.position, myPosition)); + var normal = id && filter && Vec3.normalize(Vec3.subtract(currentAvatarData.position, myPosition)); var horizontal = normal && angleBetweenVectorsInPlane(normal, forward, horizontalAngleNormal); var vertical = normal && angleBetweenVectorsInPlane(normal, forward, verticalAngleNormal); if (id && filter && ((Math.abs(horizontal) > horizontalHalfAngle) || (Math.abs(vertical) > verticalHalfAngle))) { @@ -480,11 +483,11 @@ function populateNearbyUserList(selectData, oldAudioData) { personalMute: !!id && Users.getPersonalMuteStatus(id), // expects proper boolean, not null ignore: !!id && Users.getIgnoreStatus(id), // ditto isPresent: true, - isReplicated: avatar.isReplicated + isReplicated: currentAvatarData.isReplicated }; // Everyone needs to see admin status. Username and fingerprint returns default constructor output if the requesting user isn't an admin. Users.requestUsernameFromID(id); - if (id) { + if (id !== MyAvatar.sessionUUID) { addAvatarNode(id); // No overlay for ourselves avatarsOfInterest[id] = true; } else { @@ -515,30 +518,60 @@ function usernameFromIDReply(id, username, machineFingerprint, isAdmin) { updateUser(data); } +function updateAudioLevel(overlay, avatarData) { + // the VU meter should work similarly to the one in AvatarInputs: log scale, exponentially averaged + // But of course it gets the data at a different rate, so we tweak the averaging ratio and frequency + // of updating (the latter for efficiency too). + var audioLevel = 0.0; + var avgAudioLevel = 0.0; + + // we will do exponential moving average by taking some the last loudness and averaging + overlay.accumulatedLevel = AVERAGING_RATIO * (overlay.accumulatedLevel || 0) + (1 - AVERAGING_RATIO) * (avatarData.audioLoudness); + + // add 1 to insure we don't go log() and hit -infinity. Math.log is + // natural log, so to get log base 2, just divide by ln(2). + audioLevel = scaleAudio(Math.log(overlay.accumulatedLevel + 1) / LOG2); + + // decay avgAudioLevel + avgAudioLevel = Math.max((1 - AUDIO_PEAK_DECAY) * (overlay.avgAudioLevel || 0), audioLevel); + + overlay.avgAudioLevel = avgAudioLevel; + overlay.audioLevel = audioLevel; + + // now scale for the gain. Also, asked to boost the low end, so one simple way is + // to take sqrt of the value. Lets try that, see how it feels. + avgAudioLevel = Math.min(1.0, Math.sqrt(avgAudioLevel * (sessionGains[avatarData.sessionUUID] || 0.75))); + + + var param = {}; + var level = [audioLevel, avgAudioLevel]; + var userId = avatarData.sessionUUID || 0; + param[userId] = level; + sendToQml({ method: 'updateAudioLevel', params: param }); +} + var pingPong = true; function updateOverlays() { var eye = Camera.position; - AvatarList.getAvatarIdentifiers().forEach(function (id) { - if (!id || !avatarsOfInterest[id]) { + + var avatarData = JSON.parse(AvatarList.getPalData()); + + avatarData.forEach(function (currentAvatarData) { + if (currentAvatarData.sessionUUID === MyAvatar.sessionUUID || !avatarsOfInterest[currentAvatarData.sessionUUID]) { return; // don't update ourself, or avatars we're not interested in } - var avatar = AvatarList.getAvatar(id); - if (!avatar) { - return; // will be deleted below if there had been an overlay. - } - var overlay = ExtendedOverlay.get(id); + var overlay = ExtendedOverlay.get(currentAvatarData.sessionUUID); if (!overlay) { // For now, we're treating this as a temporary loss, as from the personal space bubble. Add it back. - print('Adding non-PAL avatar node', id); - overlay = addAvatarNode(id); + print('Adding non-PAL avatar node', currentAvatarData.sessionUUID); + overlay = addAvatarNode(currentAvatarData.sessionUUID); } - var target = avatar.position; + + updateAudioLevel(overlay, currentAvatarData); + + var target = currentAvatarData.position; var distance = Vec3.distance(target, eye); - var offset = 0.2; + var offset = currentAvatarData.palOrbOffset; var diff = Vec3.subtract(target, eye); // get diff between target and eye (a vector pointing to the eye from avatar position) - var headIndex = avatar.getJointIndex("Head"); // base offset on 1/2 distance from hips to head if we can - if (headIndex > 0) { - offset = avatar.getAbsoluteJointTranslationInObjectFrame(headIndex).y / 2; - } // move a bit in front, towards the camera target = Vec3.subtract(target, Vec3.multiply(Vec3.normalize(diff), offset)); @@ -548,7 +581,7 @@ function updateOverlays() { overlay.ping = pingPong; overlay.editOverlay({ - color: color(ExtendedOverlay.isSelected(id), overlay.hovering, overlay.audioLevel), + color: color(ExtendedOverlay.isSelected(currentAvatarData.sessionUUID), overlay.hovering, overlay.audioLevel), position: target, dimensions: 0.032 * distance }); @@ -704,6 +737,13 @@ function wireEventBridge(on) { hasEventBridge = false; } } + } + +var UPDATE_INTERVAL_MS = 100; +function createUpdateInterval() { + return Script.setInterval(function () { + updateOverlays(); + }, UPDATE_INTERVAL_MS); } function onTabletScreenChanged(type, url) { @@ -719,10 +759,8 @@ function onTabletScreenChanged(type, url) { ContextOverlay.enabled = false; Users.requestsDomainListData = true; - audioTimer = createAudioInterval(AUDIO_LEVEL_UPDATE_INTERVAL_MS); - tablet.tabletShownChanged.connect(tabletVisibilityChanged); - Script.update.connect(updateOverlays); + updateInterval = createUpdateInterval(); Controller.mousePressEvent.connect(handleMouseEvent); Controller.mouseMoveEvent.connect(handleMouseMoveEvent); Users.usernameFromIDReply.connect(usernameFromIDReply); @@ -778,50 +816,6 @@ function scaleAudio(val) { return audioLevel; } -function getAudioLevel(id) { - // the VU meter should work similarly to the one in AvatarInputs: log scale, exponentially averaged - // But of course it gets the data at a different rate, so we tweak the averaging ratio and frequency - // of updating (the latter for efficiency too). - var avatar = AvatarList.getAvatar(id); - var audioLevel = 0.0; - var avgAudioLevel = 0.0; - var data = id ? ExtendedOverlay.get(id) : myData; - if (data) { - - // we will do exponential moving average by taking some the last loudness and averaging - data.accumulatedLevel = AVERAGING_RATIO * (data.accumulatedLevel || 0) + (1 - AVERAGING_RATIO) * (avatar.audioLoudness); - - // add 1 to insure we don't go log() and hit -infinity. Math.log is - // natural log, so to get log base 2, just divide by ln(2). - audioLevel = scaleAudio(Math.log(data.accumulatedLevel + 1) / LOG2); - - // decay avgAudioLevel - avgAudioLevel = Math.max((1 - AUDIO_PEAK_DECAY) * (data.avgAudioLevel || 0), audioLevel); - - data.avgAudioLevel = avgAudioLevel; - data.audioLevel = audioLevel; - - // now scale for the gain. Also, asked to boost the low end, so one simple way is - // to take sqrt of the value. Lets try that, see how it feels. - avgAudioLevel = Math.min(1.0, Math.sqrt(avgAudioLevel * (sessionGains[id] || 0.75))); - } - return [audioLevel, avgAudioLevel]; -} - -function createAudioInterval(interval) { - // we will update the audioLevels periodically - // TODO: tune for efficiency - expecially with large numbers of avatars - return Script.setInterval(function () { - var param = {}; - AvatarList.getAvatarIdentifiers().forEach(function (id) { - var level = getAudioLevel(id), - userId = id || 0; // qml didn't like an object with null/empty string for a key, so... - param[userId] = level; - }); - sendToQml({method: 'updateAudioLevel', params: param}); - }, interval); -} - function avatarDisconnected(nodeID) { // remove from the pal list sendToQml({method: 'avatarDisconnected', params: [nodeID]}); @@ -874,11 +868,11 @@ startup(); var isWired = false; -var audioTimer; -var AUDIO_LEVEL_UPDATE_INTERVAL_MS = 100; // 10hz for now (change this and change the AVERAGING_RATIO too) function off() { if (isWired) { - Script.update.disconnect(updateOverlays); + if (updateInterval) { + Script.clearInterval(updateInterval); + } Controller.mousePressEvent.disconnect(handleMouseEvent); Controller.mouseMoveEvent.disconnect(handleMouseMoveEvent); tablet.tabletShownChanged.disconnect(tabletVisibilityChanged); @@ -889,10 +883,6 @@ function off() { Users.requestsDomainListData = false; isWired = false; - - if (audioTimer) { - Script.clearInterval(audioTimer); - } } removeOverlays(); From fa518b995aad602c4c483f6470a5880d46b4f151 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Thu, 12 Jul 2018 15:16:54 -0700 Subject: [PATCH 10/29] Fix my audio level --- scripts/system/pal.js | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/scripts/system/pal.js b/scripts/system/pal.js index 4a0d866d66..b811f5e95a 100644 --- a/scripts/system/pal.js +++ b/scripts/system/pal.js @@ -525,27 +525,30 @@ function updateAudioLevel(overlay, avatarData) { var audioLevel = 0.0; var avgAudioLevel = 0.0; - // we will do exponential moving average by taking some the last loudness and averaging - overlay.accumulatedLevel = AVERAGING_RATIO * (overlay.accumulatedLevel || 0) + (1 - AVERAGING_RATIO) * (avatarData.audioLoudness); + if (overlay) { + // we will do exponential moving average by taking some the last loudness and averaging + overlay.accumulatedLevel = AVERAGING_RATIO * (overlay.accumulatedLevel || 0) + (1 - AVERAGING_RATIO) * (avatarData.audioLoudness); - // add 1 to insure we don't go log() and hit -infinity. Math.log is - // natural log, so to get log base 2, just divide by ln(2). - audioLevel = scaleAudio(Math.log(overlay.accumulatedLevel + 1) / LOG2); + // add 1 to insure we don't go log() and hit -infinity. Math.log is + // natural log, so to get log base 2, just divide by ln(2). + audioLevel = scaleAudio(Math.log(overlay.accumulatedLevel + 1) / LOG2); - // decay avgAudioLevel - avgAudioLevel = Math.max((1 - AUDIO_PEAK_DECAY) * (overlay.avgAudioLevel || 0), audioLevel); + // decay avgAudioLevel + avgAudioLevel = Math.max((1 - AUDIO_PEAK_DECAY) * (overlay.avgAudioLevel || 0), audioLevel); - overlay.avgAudioLevel = avgAudioLevel; - overlay.audioLevel = audioLevel; - - // now scale for the gain. Also, asked to boost the low end, so one simple way is - // to take sqrt of the value. Lets try that, see how it feels. - avgAudioLevel = Math.min(1.0, Math.sqrt(avgAudioLevel * (sessionGains[avatarData.sessionUUID] || 0.75))); + overlay.avgAudioLevel = avgAudioLevel; + overlay.audioLevel = audioLevel; + // now scale for the gain. Also, asked to boost the low end, so one simple way is + // to take sqrt of the value. Lets try that, see how it feels. + avgAudioLevel = Math.min(1.0, Math.sqrt(avgAudioLevel * (sessionGains[avatarData.sessionUUID] || 0.75))); + } else { + audioLevel = scaleAudio(Math.log(((1 - AVERAGING_RATIO) * (avatarData.audioLoudness)) + 1) / LOG2); + } var param = {}; var level = [audioLevel, avgAudioLevel]; - var userId = avatarData.sessionUUID || 0; + var userId = avatarData.sessionUUID === MyAvatar.sessionUUID ? 0 : avatarData.sessionUUID; param[userId] = level; sendToQml({ method: 'updateAudioLevel', params: param }); } @@ -557,6 +560,8 @@ function updateOverlays() { var avatarData = JSON.parse(AvatarList.getPalData()); avatarData.forEach(function (currentAvatarData) { + updateAudioLevel(overlay, currentAvatarData); + if (currentAvatarData.sessionUUID === MyAvatar.sessionUUID || !avatarsOfInterest[currentAvatarData.sessionUUID]) { return; // don't update ourself, or avatars we're not interested in } @@ -566,8 +571,6 @@ function updateOverlays() { overlay = addAvatarNode(currentAvatarData.sessionUUID); } - updateAudioLevel(overlay, currentAvatarData); - var target = currentAvatarData.position; var distance = Vec3.distance(target, eye); var offset = currentAvatarData.palOrbOffset; From 45f8ed010cd820819490b698ba991cf6ee9c5709 Mon Sep 17 00:00:00 2001 From: luiscuenca Date: Thu, 12 Jul 2018 16:03:15 -0700 Subject: [PATCH 11/29] formatting --- libraries/physics/src/CharacterController.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libraries/physics/src/CharacterController.cpp b/libraries/physics/src/CharacterController.cpp index 7f63fd9f5e..cee0e6a1fa 100755 --- a/libraries/physics/src/CharacterController.cpp +++ b/libraries/physics/src/CharacterController.cpp @@ -280,7 +280,7 @@ void CharacterController::playerStep(btCollisionWorld* collisionWorld, btScalar // then the two rotations are effectively adjacent const float MIN_DOT_PRODUCT_OF_ADJACENT_QUATERNIONS = 0.99999f; // corresponds to approx 0.5 degrees if (fabsf(qDot) < MIN_DOT_PRODUCT_OF_ADJACENT_QUATERNIONS) { - if (qDot < 0.0f) { + if (qDot < 0.0f) { // the quaternions are actually on opposite hyperhemispheres // so we move one to agree with the other and negate qDot desiredRot = -desiredRot; @@ -290,16 +290,16 @@ void CharacterController::playerStep(btCollisionWorld* collisionWorld, btScalar // the axis is the imaginary part, but scaled by sin(angle/2) btVector3 axis(deltaRot.getX(), deltaRot.getY(), deltaRot.getZ()); - axis /= sqrtf(1.0f - qDot*qDot); + axis /= sqrtf(1.0f - qDot * qDot); // compute the angle we will resolve for this dt, but don't overshoot - float angle = (2.0f * acosf(qDot)); + float angle = 2.0f * acosf(qDot); if ( dt < _followTimeRemaining) { angle *= dt / _followTimeRemaining; } // accumulate rotation - deltaRot = btQuaternion(axis, angle); + deltaRot = btQuaternion(axis, angle); _followAngularDisplacement = (deltaRot * _followAngularDisplacement).normalize(); // in order to accumulate displacement of avatar position, we need to take _shapeLocalOffset into account. @@ -307,7 +307,7 @@ void CharacterController::playerStep(btCollisionWorld* collisionWorld, btScalar endRot = deltaRot * startRot; btVector3 swingDisplacement = rotateVector(endRot, -shapeLocalOffset) - rotateVector(startRot, -shapeLocalOffset); - _followLinearDisplacement += swingDisplacement; + _followLinearDisplacement += swingDisplacement; } _rigidBody->setWorldTransform(btTransform(endRot, endPos)); } From 04f856019d1fb6c96486402ef3d2013d369878ed Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Thu, 12 Jul 2018 16:27:19 -0700 Subject: [PATCH 12/29] Fix MS16701: Uninstall installed app before updating --- .../hifi/commerce/purchases/PurchasedItem.qml | 10 +++++++++- .../qml/hifi/commerce/purchases/Purchases.qml | 18 +++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/interface/resources/qml/hifi/commerce/purchases/PurchasedItem.qml b/interface/resources/qml/hifi/commerce/purchases/PurchasedItem.qml index 0a69b8b3b5..13dc3cb37f 100644 --- a/interface/resources/qml/hifi/commerce/purchases/PurchasedItem.qml +++ b/interface/resources/qml/hifi/commerce/purchases/PurchasedItem.qml @@ -328,7 +328,15 @@ Item { item.buttonColor = "#E2334D"; item.buttonClicked = function() { sendToPurchases({ method: 'flipCard', closeAll: true }); - sendToPurchases({method: 'updateItemClicked', itemId: root.itemId, itemEdition: root.itemEdition, upgradeUrl: root.upgradeUrl}); + sendToPurchases({ + method: 'updateItemClicked', + itemId: root.itemId, + itemEdition: root.itemEdition, + upgradeUrl: root.upgradeUrl, + itemHref: root.itemHref, + itemType: root.itemType, + isInstalled: root.isInstalled + }); } } } diff --git a/interface/resources/qml/hifi/commerce/purchases/Purchases.qml b/interface/resources/qml/hifi/commerce/purchases/Purchases.qml index 16ad01a56d..91993d0fa3 100644 --- a/interface/resources/qml/hifi/commerce/purchases/Purchases.qml +++ b/interface/resources/qml/hifi/commerce/purchases/Purchases.qml @@ -706,7 +706,23 @@ Rectangle { } } } else if (msg.method === "updateItemClicked") { - sendToScript(msg); + if (msg.itemType === "app" && msg.isInstalled) { + lightboxPopup.titleText = "Uninstall App"; + lightboxPopup.bodyText = "The app that you are trying to update is installed.

" + + "If you proceed, the current version of the app will be uninstalled."; + lightboxPopup.button1text = "CANCEL"; + lightboxPopup.button1method = function() { + lightboxPopup.visible = false; + } + lightboxPopup.button2text = "CONFIRM"; + lightboxPopup.button2method = function() { + Commerce.uninstallApp(msg.itemHref); + sendToScript(msg); + }; + lightboxPopup.visible = true; + } else { + sendToScript(msg); + } } else if (msg.method === "giftAsset") { sendAsset.assetName = msg.itemName; sendAsset.assetCertID = msg.certId; From 437f49ac22ad9644e88a81bbd98bd75a6bac728a Mon Sep 17 00:00:00 2001 From: Alexander Ivash Date: Fri, 13 Jul 2018 03:01:02 +0300 Subject: [PATCH 13/29] 16683 Avatar App - Add to Favorites Button Not Working --- scripts/system/avatarapp.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/system/avatarapp.js b/scripts/system/avatarapp.js index de84782471..f692128fa3 100644 --- a/scripts/system/avatarapp.js +++ b/scripts/system/avatarapp.js @@ -159,6 +159,9 @@ function fromQml(message) { // messages are {method, params}, like json-rpc. See for(var bookmarkName in message.data.bookmarks) { var bookmark = message.data.bookmarks[bookmarkName]; + if (!bookmark.avatarEntites) { // ensure avatarEntites always exist + bookmark.avatarEntites = []; + } bookmark.avatarEntites.forEach(function(avatarEntity) { avatarEntity.properties.localRotationAngles = Quat.safeEulerAngles(avatarEntity.properties.localRotation) From e35cb374ae976d47723a82923211bd4443956427 Mon Sep 17 00:00:00 2001 From: Clement Date: Thu, 12 Jul 2018 18:04:10 -0700 Subject: [PATCH 14/29] Re-host dependencies and update URLs to hifi.com --- cmake/externals/GifCreator/CMakeLists.txt | 2 +- cmake/externals/LibOVR/CMakeLists.txt | 4 ++-- cmake/externals/LibOVRPlatform/CMakeLists.txt | 2 +- cmake/externals/boostconfig/CMakeLists.txt | 2 +- cmake/externals/bullet/CMakeLists.txt | 4 ++-- cmake/externals/crashpad/CMakeLists.txt | 4 ++-- cmake/externals/draco/CMakeLists.txt | 2 +- cmake/externals/etc2comp/CMakeLists.txt | 2 +- cmake/externals/gli/CMakeLists.txt | 2 +- cmake/externals/glm/CMakeLists.txt | 2 +- cmake/externals/hifiAudioCodec/CMakeLists.txt | 8 ++++---- cmake/externals/neuron/CMakeLists.txt | 2 +- cmake/externals/nvtt/CMakeLists.txt | 4 ++-- cmake/externals/openvr/CMakeLists.txt | 2 +- cmake/externals/polyvox/CMakeLists.txt | 2 +- cmake/externals/quazip/CMakeLists.txt | 2 +- cmake/externals/sdl2/CMakeLists.txt | 6 +++--- cmake/externals/sixense/CMakeLists.txt | 6 +++--- cmake/externals/steamworks/CMakeLists.txt | 2 +- cmake/externals/tbb/CMakeLists.txt | 6 +++--- cmake/externals/vhacd/CMakeLists.txt | 2 +- cmake/externals/wasapi/CMakeLists.txt | 2 +- cmake/externals/zlib/CMakeLists.txt | 2 +- 23 files changed, 36 insertions(+), 36 deletions(-) diff --git a/cmake/externals/GifCreator/CMakeLists.txt b/cmake/externals/GifCreator/CMakeLists.txt index 127bdf28f5..094f5612a9 100644 --- a/cmake/externals/GifCreator/CMakeLists.txt +++ b/cmake/externals/GifCreator/CMakeLists.txt @@ -3,7 +3,7 @@ set(EXTERNAL_NAME GifCreator) include(ExternalProject) ExternalProject_Add( ${EXTERNAL_NAME} - URL https://hifi-public.s3.amazonaws.com/dependencies/GifCreator.zip + URL https://public.highfidelity.com/dependencies/GifCreator.zip URL_MD5 8ac8ef5196f47c658dce784df5ecdb70 CONFIGURE_COMMAND "" BUILD_COMMAND "" diff --git a/cmake/externals/LibOVR/CMakeLists.txt b/cmake/externals/LibOVR/CMakeLists.txt index ed76f181e7..ae4cf6320e 100644 --- a/cmake/externals/LibOVR/CMakeLists.txt +++ b/cmake/externals/LibOVR/CMakeLists.txt @@ -17,7 +17,7 @@ if (WIN32) ExternalProject_Add( ${EXTERNAL_NAME} - URL http://hifi-public.s3.amazonaws.com/dependencies/ovr_sdk_win_1.26.0_public.zip + URL https://public.highfidelity.com/dependencies/ovr_sdk_win_1.26.0_public.zip URL_MD5 06804ff9727b910dcd04a37c800053b5 CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH= PATCH_COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/LibOVRCMakeLists.txt" /CMakeLists.txt @@ -38,7 +38,7 @@ elseif(APPLE) ExternalProject_Add( ${EXTERNAL_NAME} - URL http://static.oculus.com/sdk-downloads/ovr_sdk_macos_0.5.0.1.tar.gz + URL https://public.highfidelity.com/dependencies/ovr_sdk_macos_0.5.0.1.tar.gz URL_MD5 0a0785a04fb285f64f62267388344ad6 CONFIGURE_COMMAND "" BUILD_COMMAND "" diff --git a/cmake/externals/LibOVRPlatform/CMakeLists.txt b/cmake/externals/LibOVRPlatform/CMakeLists.txt index 3622972a13..895efa9357 100644 --- a/cmake/externals/LibOVRPlatform/CMakeLists.txt +++ b/cmake/externals/LibOVRPlatform/CMakeLists.txt @@ -9,7 +9,7 @@ if (WIN32) ExternalProject_Add( ${EXTERNAL_NAME} - URL http://hifi-public.s3.amazonaws.com/dependencies/OVRPlatformSDK_v1.10.0.zip + URL https://public.highfidelity.com/dependencies/OVRPlatformSDK_v1.10.0.zip URL_MD5 e6c8264af16d904e6506acd5172fa0a9 CONFIGURE_COMMAND "" BUILD_COMMAND "" diff --git a/cmake/externals/boostconfig/CMakeLists.txt b/cmake/externals/boostconfig/CMakeLists.txt index 0adb349589..e33167b0ba 100644 --- a/cmake/externals/boostconfig/CMakeLists.txt +++ b/cmake/externals/boostconfig/CMakeLists.txt @@ -5,7 +5,7 @@ include(ExternalProject) ExternalProject_Add( ${EXTERNAL_NAME} #URL https://github.com/boostorg/config/archive/boost-1.58.0.zip - URL http://hifi-public.s3.amazonaws.com/dependencies/config-boost-1.58.0.zip + URL https://public.highfidelity.com/dependencies/config-boost-1.58.0.zip URL_MD5 42fa673bae2b7645a22736445e80eb8d CONFIGURE_COMMAND "" BUILD_COMMAND "" diff --git a/cmake/externals/bullet/CMakeLists.txt b/cmake/externals/bullet/CMakeLists.txt index 91860a7470..ffa1c67ce3 100644 --- a/cmake/externals/bullet/CMakeLists.txt +++ b/cmake/externals/bullet/CMakeLists.txt @@ -17,7 +17,7 @@ include(ExternalProject) if (WIN32) ExternalProject_Add( ${EXTERNAL_NAME} - URL http://hifi-public.s3.amazonaws.com/dependencies/bullet-2.88.tgz + URL https://public.highfidelity.com/dependencies/bullet-2.88.tgz URL_MD5 0a6876607ebe83e227427215f15946fd CMAKE_ARGS ${PLATFORM_CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX:PATH= -DBUILD_EXTRAS=0 -DINSTALL_LIBS=1 -DBUILD_BULLET3=0 -DBUILD_OPENGL3_DEMOS=0 -DBUILD_BULLET2_DEMOS=0 -DBUILD_UNIT_TESTS=0 -DUSE_GLUT=0 -DUSE_DX11=0 LOG_DOWNLOAD 1 @@ -28,7 +28,7 @@ if (WIN32) else () ExternalProject_Add( ${EXTERNAL_NAME} - URL http://hifi-public.s3.amazonaws.com/dependencies/bullet-2.88.tgz + URL https://public.highfidelity.com/dependencies/bullet-2.88.tgz URL_MD5 0a6876607ebe83e227427215f15946fd CMAKE_ARGS ${PLATFORM_CMAKE_ARGS} -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX:PATH= -DBUILD_EXTRAS=0 -DINSTALL_LIBS=1 -DBUILD_BULLET3=0 -DBUILD_OPENGL3_DEMOS=0 -DBUILD_BULLET2_DEMOS=0 -DBUILD_UNIT_TESTS=0 -DUSE_GLUT=0 LOG_DOWNLOAD 1 diff --git a/cmake/externals/crashpad/CMakeLists.txt b/cmake/externals/crashpad/CMakeLists.txt index 648ec83280..34348b6418 100644 --- a/cmake/externals/crashpad/CMakeLists.txt +++ b/cmake/externals/crashpad/CMakeLists.txt @@ -6,7 +6,7 @@ string(TOUPPER ${EXTERNAL_NAME} EXTERNAL_NAME_UPPER) if (WIN32) ExternalProject_Add( ${EXTERNAL_NAME} - URL http://public.highfidelity.com/dependencies/crashpad_062317.1.zip + URL https://public.highfidelity.com/dependencies/crashpad_062317.1.zip URL_MD5 9c84b77f5f23daf939da1371825ed2b1 CONFIGURE_COMMAND "" BUILD_COMMAND "" @@ -25,7 +25,7 @@ if (WIN32) elseif (APPLE) ExternalProject_Add( ${EXTERNAL_NAME} - URL http://public.highfidelity.com/dependencies/crashpad_mac_070318.zip + URL https://public.highfidelity.com/dependencies/crashpad_mac_070318.zip URL_MD5 ba1501dc163591ac2d1be74946967e2a CONFIGURE_COMMAND "" BUILD_COMMAND "" diff --git a/cmake/externals/draco/CMakeLists.txt b/cmake/externals/draco/CMakeLists.txt index 6a894e76b6..28a2177cbb 100644 --- a/cmake/externals/draco/CMakeLists.txt +++ b/cmake/externals/draco/CMakeLists.txt @@ -11,7 +11,7 @@ endif () include(ExternalProject) ExternalProject_Add( ${EXTERNAL_NAME} - URL http://hifi-public.s3.amazonaws.com/dependencies/draco-1.1.0.zip + URL https://public.highfidelity.com/dependencies/draco-1.1.0.zip URL_MD5 208f8b04c91d5f1c73d731a3ea37c5bb CONFIGURE_COMMAND CMAKE_ARGS ${ANDROID_CMAKE_ARGS} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX:PATH=-$ ${EXTRA_CMAKE_FLAGS} LOG_DOWNLOAD 1 diff --git a/cmake/externals/etc2comp/CMakeLists.txt b/cmake/externals/etc2comp/CMakeLists.txt index b497212625..88ed988873 100644 --- a/cmake/externals/etc2comp/CMakeLists.txt +++ b/cmake/externals/etc2comp/CMakeLists.txt @@ -15,7 +15,7 @@ include(ExternalProject) # that would override CMAKE_CXX_FLAGS ExternalProject_Add( ${EXTERNAL_NAME} - URL https://hifi-public.s3.amazonaws.com/dependencies/etc2comp-patched.zip + URL https://public.highfidelity.com/dependencies/etc2comp-patched.zip URL_MD5 4c96153eb179acbe619e3d99d3330595 CMAKE_ARGS ${ANDROID_CMAKE_ARGS} ${EXTRA_CMAKE_FLAGS} BINARY_DIR ${EXTERNAL_PROJECT_PREFIX}/build diff --git a/cmake/externals/gli/CMakeLists.txt b/cmake/externals/gli/CMakeLists.txt index 2ef4d2b3af..bde31cbede 100644 --- a/cmake/externals/gli/CMakeLists.txt +++ b/cmake/externals/gli/CMakeLists.txt @@ -3,7 +3,7 @@ set(EXTERNAL_NAME gli) include(ExternalProject) ExternalProject_Add( ${EXTERNAL_NAME} - URL https://hifi-public.s3.amazonaws.com/dependencies/gli-0.8.1.0.zip + URL https://public.highfidelity.com/dependencies/gli-0.8.1.0.zip URL_MD5 00c990f59c12bbf367956ef399d6f798 BINARY_DIR ${EXTERNAL_PROJECT_PREFIX}/build CONFIGURE_COMMAND "" diff --git a/cmake/externals/glm/CMakeLists.txt b/cmake/externals/glm/CMakeLists.txt index 0a83004438..a52ddde9f5 100644 --- a/cmake/externals/glm/CMakeLists.txt +++ b/cmake/externals/glm/CMakeLists.txt @@ -3,7 +3,7 @@ set(EXTERNAL_NAME glm) include(ExternalProject) ExternalProject_Add( ${EXTERNAL_NAME} - URL https://hifi-public.s3.amazonaws.com/dependencies/glm-0.9.8.5-patched.zip + URL https://public.highfidelity.com/dependencies/glm-0.9.8.5-patched.zip URL_MD5 7d39ecc1cea275427534c3cfd6dd63f0 BINARY_DIR ${EXTERNAL_PROJECT_PREFIX}/build CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH= ${EXTERNAL_ARGS} diff --git a/cmake/externals/hifiAudioCodec/CMakeLists.txt b/cmake/externals/hifiAudioCodec/CMakeLists.txt index e3ba36a440..8a8e2573d5 100644 --- a/cmake/externals/hifiAudioCodec/CMakeLists.txt +++ b/cmake/externals/hifiAudioCodec/CMakeLists.txt @@ -6,16 +6,16 @@ set(EXTERNAL_NAME hifiAudioCodec) string(TOUPPER ${EXTERNAL_NAME} EXTERNAL_NAME_UPPER) if (WIN32) - set(DOWNLOAD_URL http://s3.amazonaws.com/hifi-public/dependencies/codecSDK-win-2.0.zip) + set(DOWNLOAD_URL https://public.highfidelity.com/dependencies/codecSDK-win-2.0.zip) set(DOWNLOAD_MD5 9199d4dbd6b16bed736b235efe980e67) elseif (APPLE) - set(DOWNLOAD_URL http://s3.amazonaws.com/hifi-public/dependencies/codecSDK-mac-2.0.zip) + set(DOWNLOAD_URL https://public.highfidelity.com/dependencies/codecSDK-mac-2.0.zip) set(DOWNLOAD_MD5 21649881e7d5dc94f922179be96f76ba) elseif (ANDROID) - set(DOWNLOAD_URL http://s3.amazonaws.com/hifi-public/dependencies/codecSDK-android-2.0.zip) + set(DOWNLOAD_URL https://public.highfidelity.com/dependencies/codecSDK-android-2.0.zip) set(DOWNLOAD_MD5 aef2a852600d498d58aa586668191683) elseif (UNIX) - set(DOWNLOAD_URL http://s3.amazonaws.com/hifi-public/dependencies/codecSDK-linux-2.0.zip) + set(DOWNLOAD_URL https://public.highfidelity.com/dependencies/codecSDK-linux-2.0.zip) set(DOWNLOAD_MD5 67fb7755f9bcafb98a9fceea53bc7481) else() return() diff --git a/cmake/externals/neuron/CMakeLists.txt b/cmake/externals/neuron/CMakeLists.txt index 76dda8f8c5..5ac38bc442 100644 --- a/cmake/externals/neuron/CMakeLists.txt +++ b/cmake/externals/neuron/CMakeLists.txt @@ -4,7 +4,7 @@ set(EXTERNAL_NAME neuron) string(TOUPPER ${EXTERNAL_NAME} EXTERNAL_NAME_UPPER) -set(NEURON_URL "https://s3.amazonaws.com/hifi-public/dependencies/neuron_datareader_b.12.2.zip") +set(NEURON_URL "https://public.highfidelity.com/dependencies/neuron_datareader_b.12.2.zip") set(NEURON_URL_MD5 "84273ad2200bf86a9279d1f412a822ca") ExternalProject_Add(${EXTERNAL_NAME} diff --git a/cmake/externals/nvtt/CMakeLists.txt b/cmake/externals/nvtt/CMakeLists.txt index 3076217c33..2db8335cd7 100644 --- a/cmake/externals/nvtt/CMakeLists.txt +++ b/cmake/externals/nvtt/CMakeLists.txt @@ -8,7 +8,7 @@ string(TOUPPER ${EXTERNAL_NAME} EXTERNAL_NAME_UPPER) if (WIN32) ExternalProject_Add( ${EXTERNAL_NAME} - URL http://s3.amazonaws.com/hifi-public/dependencies/nvtt-win-2.1.0.hifi.zip + URL https://public.highfidelity.com/dependencies/nvtt-win-2.1.0.hifi.zip URL_MD5 10da01cf601f88f6dc12a6bc13c89136 CONFIGURE_COMMAND "" BUILD_COMMAND "" @@ -29,7 +29,7 @@ else () ExternalProject_Add( ${EXTERNAL_NAME} - URL http://hifi-public.s3.amazonaws.com/dependencies/nvidia-texture-tools-2.1.0.hifi-83462e4.zip + URL https://public.highfidelity.com/dependencies/nvidia-texture-tools-2.1.0.hifi-83462e4.zip URL_MD5 602776e08515b54bfa1b8dc455003f0f CONFIGURE_COMMAND CMAKE_ARGS ${ANDROID_CMAKE_ARGS} -DNVTT_SHARED=1 -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX:PATH= -DCMAKE_POSITION_INDEPENDENT_CODE=ON LOG_DOWNLOAD 1 diff --git a/cmake/externals/openvr/CMakeLists.txt b/cmake/externals/openvr/CMakeLists.txt index cb4aafcf8b..a04dbcf3e6 100644 --- a/cmake/externals/openvr/CMakeLists.txt +++ b/cmake/externals/openvr/CMakeLists.txt @@ -7,7 +7,7 @@ string(TOUPPER ${EXTERNAL_NAME} EXTERNAL_NAME_UPPER) ExternalProject_Add( ${EXTERNAL_NAME} - URL https://github.com/ValveSoftware/openvr/archive/v1.0.6.zip + URL https://public.highfidelity.com/dependencies/v1.0.6.zip URL_MD5 f6892cd3a3078f505d03b4297f5a1951 CONFIGURE_COMMAND "" BUILD_COMMAND "" diff --git a/cmake/externals/polyvox/CMakeLists.txt b/cmake/externals/polyvox/CMakeLists.txt index c799b45e78..a92c07da86 100644 --- a/cmake/externals/polyvox/CMakeLists.txt +++ b/cmake/externals/polyvox/CMakeLists.txt @@ -3,7 +3,7 @@ set(EXTERNAL_NAME polyvox) include(ExternalProject) ExternalProject_Add( ${EXTERNAL_NAME} - URL http://hifi-public.s3.amazonaws.com/dependencies/polyvox-master-2015-7-15.zip + URL https://public.highfidelity.com/dependencies/polyvox-master-2015-7-15.zip URL_MD5 9ec6323b87e849ae36e562ae1c7494a9 CMAKE_ARGS -DENABLE_EXAMPLES=OFF -DENABLE_BINDINGS=OFF -DCMAKE_INSTALL_PREFIX:PATH= BINARY_DIR ${EXTERNAL_PROJECT_PREFIX}/build diff --git a/cmake/externals/quazip/CMakeLists.txt b/cmake/externals/quazip/CMakeLists.txt index 7bf6f05d9f..6960f7682a 100644 --- a/cmake/externals/quazip/CMakeLists.txt +++ b/cmake/externals/quazip/CMakeLists.txt @@ -13,7 +13,7 @@ endif () ExternalProject_Add( ${EXTERNAL_NAME} - URL https://hifi-public.s3.amazonaws.com/dependencies/quazip-0.7.3.zip + URL https://public.highfidelity.com/dependencies/quazip-0.7.3.zip URL_MD5 ed03754d39b9da1775771819b8001d45 BINARY_DIR ${EXTERNAL_PROJECT_PREFIX}/build CMAKE_ARGS ${QUAZIP_CMAKE_ARGS} diff --git a/cmake/externals/sdl2/CMakeLists.txt b/cmake/externals/sdl2/CMakeLists.txt index cb61516b9a..635a1cb5bb 100644 --- a/cmake/externals/sdl2/CMakeLists.txt +++ b/cmake/externals/sdl2/CMakeLists.txt @@ -7,7 +7,7 @@ string(TOUPPER ${EXTERNAL_NAME} EXTERNAL_NAME_UPPER) if (WIN32) ExternalProject_Add( ${EXTERNAL_NAME} - URL http://hifi-public.s3.amazonaws.com/dependencies/SDL2-devel-2.0.3-VC.zip + URL https://public.highfidelity.com/dependencies/SDL2-devel-2.0.3-VC.zip URL_MD5 30a333bcbe94bc5016e8799c73e86233 CONFIGURE_COMMAND "" BUILD_COMMAND "" @@ -18,7 +18,7 @@ elseif (APPLE) ExternalProject_Add( ${EXTERNAL_NAME} - URL http://hifi-public.s3.amazonaws.com/dependencies/SDL2-2.0.3.zip + URL https://public.highfidelity.com/dependencies/SDL2-2.0.3.zip CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH= -DVIDEO_OPENGL=OFF BINARY_DIR ${EXTERNAL_PROJECT_PREFIX}/build LOG_DOWNLOAD 1 @@ -49,7 +49,7 @@ else () ExternalProject_Add( ${EXTERNAL_NAME} - URL http://www.libsdl.org/release/SDL2-2.0.3.tar.gz + URL https://public.highfidelity.com/dependencies/SDL2-2.0.3.tar.gz URL_MD5 fe6c61d2e9df9ef570e7e80c6e822537 CMAKE_ARGS ${ANDROID_CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX:PATH= LOG_DOWNLOAD 1 diff --git a/cmake/externals/sixense/CMakeLists.txt b/cmake/externals/sixense/CMakeLists.txt index bd0d042c0b..17d2f98e2d 100644 --- a/cmake/externals/sixense/CMakeLists.txt +++ b/cmake/externals/sixense/CMakeLists.txt @@ -4,15 +4,15 @@ set(EXTERNAL_NAME sixense) string(TOUPPER ${EXTERNAL_NAME} EXTERNAL_NAME_UPPER) -#set(SIXENSE_URL "http://hifi-public.s3.amazonaws.com/dependencies/SixenseSDK_062612.zip") +#set(SIXENSE_URL "https://public.highfidelity.com/dependencies/SixenseSDK_062612.zip") #set(SIXENSE_URL_MD5 "10cc8dc470d2ac1244a88cf04bc549cc") #set(SIXENSE_NEW_LAYOUT 0) -set(SIXENSE_URL "http://hifi-public.s3.amazonaws.com/dependencies/SixenseSDK_071615.zip") +set(SIXENSE_URL "https://public.highfidelity.com/dependencies/SixenseSDK_071615.zip") set(SIXENSE_URL_MD5 "752a3901f334124e9cffc2ba4136ef7d") set(SIXENSE_NEW_LAYOUT 1) -#set(SIXENSE_URL "http://hifi-public.s3.amazonaws.com/dependencies/SixenseSDK_102215.zip") +#set(SIXENSE_URL "https://public.highfidelity.com/dependencies/SixenseSDK_102215.zip") #set(SIXENSE_URL_MD5 "93c3a6795cce777a0f472b09532935f1") #set(SIXENSE_NEW_LAYOUT 1) diff --git a/cmake/externals/steamworks/CMakeLists.txt b/cmake/externals/steamworks/CMakeLists.txt index 152e95cdcf..30b3926436 100644 --- a/cmake/externals/steamworks/CMakeLists.txt +++ b/cmake/externals/steamworks/CMakeLists.txt @@ -4,7 +4,7 @@ set(EXTERNAL_NAME steamworks) string(TOUPPER ${EXTERNAL_NAME} EXTERNAL_NAME_UPPER) -set(STEAMWORKS_URL "https://s3.amazonaws.com/hifi-public/dependencies/steamworks_sdk_137.zip") +set(STEAMWORKS_URL "https://public.highfidelity.com/dependencies/steamworks_sdk_137.zip") set(STEAMWORKS_URL_MD5 "95ba9d0e3ddc04f8a8be17d2da806cbb") ExternalProject_Add( diff --git a/cmake/externals/tbb/CMakeLists.txt b/cmake/externals/tbb/CMakeLists.txt index 9664fe7250..436cae79a1 100644 --- a/cmake/externals/tbb/CMakeLists.txt +++ b/cmake/externals/tbb/CMakeLists.txt @@ -3,13 +3,13 @@ set(EXTERNAL_NAME tbb) include(ExternalProject) if (WIN32) - set(DOWNLOAD_URL http://hifi-public.s3.amazonaws.com/dependencies/tbb2017_20170604oss_win_slim.zip) + set(DOWNLOAD_URL https://public.highfidelity.com/dependencies/tbb2017_20170604oss_win_slim.zip) set(DOWNLOAD_MD5 065934458e3db88397f3d10e7eea536c) elseif (APPLE) - set(DOWNLOAD_URL http://s3.amazonaws.com/hifi-public/dependencies/tbb2017_20170604oss_mac_slim.tar.gz) + set(DOWNLOAD_URL https://public.highfidelity.com/dependencies/tbb2017_20170604oss_mac_slim.tar.gz) set(DOWNLOAD_MD5 62bde626b396f8e1a85c6a8ded1d8105) else () - set(DOWNLOAD_URL http://hifi-public.s3.amazonaws.com/dependencies/tbb2017_20170604oss_lin_slim.tar.gz) + set(DOWNLOAD_URL https://public.highfidelity.com/dependencies/tbb2017_20170604oss_lin_slim.tar.gz) set(DOWNLOAD_MD5 2a5c721f40fa3503ffc12c18dd00011c) endif () diff --git a/cmake/externals/vhacd/CMakeLists.txt b/cmake/externals/vhacd/CMakeLists.txt index 11afa255f1..fe19f7ac7a 100644 --- a/cmake/externals/vhacd/CMakeLists.txt +++ b/cmake/externals/vhacd/CMakeLists.txt @@ -7,7 +7,7 @@ endif () include(ExternalProject) ExternalProject_Add( ${EXTERNAL_NAME} - URL http://hifi-public.s3.amazonaws.com/dependencies/v-hacd-master.zip + URL https://public.highfidelity.com/dependencies/v-hacd-master.zip URL_MD5 3bfc94f8dd3dfbfe8f4dc088f4820b3e CMAKE_ARGS ${ANDROID_CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX:PATH= BINARY_DIR ${EXTERNAL_PROJECT_PREFIX}/build diff --git a/cmake/externals/wasapi/CMakeLists.txt b/cmake/externals/wasapi/CMakeLists.txt index 4c0ffaf88f..8b3408e3fa 100644 --- a/cmake/externals/wasapi/CMakeLists.txt +++ b/cmake/externals/wasapi/CMakeLists.txt @@ -6,7 +6,7 @@ if (WIN32) include(ExternalProject) ExternalProject_Add( ${EXTERNAL_NAME} - URL http://hifi-public.s3.amazonaws.com/dependencies/qtaudio_wasapi10.zip + URL https://public.highfidelity.com/dependencies/qtaudio_wasapi10.zip URL_MD5 4f40e49715a420fb67b45b9cee19052c CONFIGURE_COMMAND "" BUILD_COMMAND "" diff --git a/cmake/externals/zlib/CMakeLists.txt b/cmake/externals/zlib/CMakeLists.txt index 3bbda322a1..987ca1fd18 100644 --- a/cmake/externals/zlib/CMakeLists.txt +++ b/cmake/externals/zlib/CMakeLists.txt @@ -5,7 +5,7 @@ include(ExternalProject) ExternalProject_Add( ${EXTERNAL_NAME} - URL http://hifi-public.s3.amazonaws.com/dependencies/zlib128.zip + URL https://public.highfidelity.com/dependencies/zlib128.zip CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH= BINARY_DIR ${EXTERNAL_PROJECT_PREFIX}/build LOG_DOWNLOAD 1 From 284329209bff3d3f209ce0f32cd1629b6c86f8c0 Mon Sep 17 00:00:00 2001 From: Clement Date: Thu, 12 Jul 2018 18:14:06 -0700 Subject: [PATCH 15/29] Added missing MD5 --- cmake/externals/sdl2/CMakeLists.txt | 1 + cmake/externals/zlib/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/cmake/externals/sdl2/CMakeLists.txt b/cmake/externals/sdl2/CMakeLists.txt index 635a1cb5bb..1e8e690743 100644 --- a/cmake/externals/sdl2/CMakeLists.txt +++ b/cmake/externals/sdl2/CMakeLists.txt @@ -19,6 +19,7 @@ elseif (APPLE) ExternalProject_Add( ${EXTERNAL_NAME} URL https://public.highfidelity.com/dependencies/SDL2-2.0.3.zip + URL_MD5 55f1eae5142d20db11c844d8d4d6deed CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH= -DVIDEO_OPENGL=OFF BINARY_DIR ${EXTERNAL_PROJECT_PREFIX}/build LOG_DOWNLOAD 1 diff --git a/cmake/externals/zlib/CMakeLists.txt b/cmake/externals/zlib/CMakeLists.txt index 987ca1fd18..85506ba0e1 100644 --- a/cmake/externals/zlib/CMakeLists.txt +++ b/cmake/externals/zlib/CMakeLists.txt @@ -6,6 +6,7 @@ include(ExternalProject) ExternalProject_Add( ${EXTERNAL_NAME} URL https://public.highfidelity.com/dependencies/zlib128.zip + URL_MD5 126f8676442ffbd97884eb4d6f32afb4 CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH= BINARY_DIR ${EXTERNAL_PROJECT_PREFIX}/build LOG_DOWNLOAD 1 From acae4df3c344f6ede99c13da8012c3b86756da89 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Jul 2018 19:23:06 -0700 Subject: [PATCH 16/29] fix align to selection to grid --- scripts/system/edit.js | 8 +------- scripts/system/libraries/gridTool.js | 13 ++++++++++--- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/scripts/system/edit.js b/scripts/system/edit.js index 73088560d9..092b7334f1 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -1853,13 +1853,7 @@ var keyReleaseEvent = function (event) { } } else if (event.text === 'g') { if (isActive && selectionManager.hasSelection()) { - var newPosition = selectionManager.worldPosition; - newPosition = Vec3.subtract(newPosition, { - x: 0, - y: selectionManager.worldDimensions.y * 0.5, - z: 0 - }); - grid.setPosition(newPosition); + grid.moveToSelection(); } } else if (event.key === KEY_P && event.isControl && !event.isAutoRepeat ) { if (event.isShifted) { diff --git a/scripts/system/libraries/gridTool.js b/scripts/system/libraries/gridTool.js index 690b4eb4b9..1268117d93 100644 --- a/scripts/system/libraries/gridTool.js +++ b/scripts/system/libraries/gridTool.js @@ -154,6 +154,12 @@ Grid = function(opts) { that.emitUpdate(); } }; + + that.moveToSelection = function() { + var newPosition = SelectionManager.worldPosition; + newPosition = Vec3.subtract(newPosition, { x: 0, y: SelectionManager.worldDimensions.y * 0.5, z: 0 }); + that.setPosition(newPosition); + }; that.emitUpdate = function() { if (that.onUpdate) { @@ -263,6 +269,8 @@ GridTool = function(opts) { print("gridTool.js: Error parsing JSON: " + e.name + " data " + data); return; } + + print("DBACKTEST webEventReceived " + data.type); if (data.type == "init") { horizontalGrid.emitUpdate(); @@ -272,6 +280,7 @@ GridTool = function(opts) { listeners[i] && listeners[i](data); } } else if (data.type == "action") { + print("DBACKTEST webEventReceived action " + data.action); var action = data.action; if (action == "moveToAvatar") { var position = MyAvatar.getJointPosition("LeftFoot"); @@ -280,9 +289,7 @@ GridTool = function(opts) { } horizontalGrid.setPosition(position); } else if (action == "moveToSelection") { - var newPosition = selectionManager.worldPosition; - newPosition = Vec3.subtract(newPosition, { x: 0, y: selectionManager.worldDimensions.y * 0.5, z: 0 }); - grid.setPosition(newPosition); + horizontalGrid.moveToSelection(); } } }; From 151f948b267faf867be23cdb723527789ae5c9cd Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Jul 2018 19:26:20 -0700 Subject: [PATCH 17/29] prints --- scripts/system/libraries/gridTool.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/system/libraries/gridTool.js b/scripts/system/libraries/gridTool.js index 1268117d93..669083a545 100644 --- a/scripts/system/libraries/gridTool.js +++ b/scripts/system/libraries/gridTool.js @@ -269,8 +269,6 @@ GridTool = function(opts) { print("gridTool.js: Error parsing JSON: " + e.name + " data " + data); return; } - - print("DBACKTEST webEventReceived " + data.type); if (data.type == "init") { horizontalGrid.emitUpdate(); @@ -280,7 +278,6 @@ GridTool = function(opts) { listeners[i] && listeners[i](data); } } else if (data.type == "action") { - print("DBACKTEST webEventReceived action " + data.action); var action = data.action; if (action == "moveToAvatar") { var position = MyAvatar.getJointPosition("LeftFoot"); From bdd6f3c5c5f86c83798c1a2f4212cbdc690fdfe7 Mon Sep 17 00:00:00 2001 From: Cristian Luis Duarte Date: Fri, 13 Jul 2018 12:39:31 -0300 Subject: [PATCH 18/29] Android - Refresh domains list with swipe --- .../hifiinterface/fragment/HomeFragment.java | 14 +++++++++++++- .../hifiinterface/provider/DomainProvider.java | 2 +- .../provider/UserStoryDomainProvider.java | 5 +++-- .../hifiinterface/view/DomainAdapter.java | 6 +++--- android/app/src/main/res/layout/fragment_home.xml | 13 +++++++++---- 5 files changed, 29 insertions(+), 11 deletions(-) diff --git a/android/app/src/main/java/io/highfidelity/hifiinterface/fragment/HomeFragment.java b/android/app/src/main/java/io/highfidelity/hifiinterface/fragment/HomeFragment.java index b98849d051..9ca6c7c4cc 100644 --- a/android/app/src/main/java/io/highfidelity/hifiinterface/fragment/HomeFragment.java +++ b/android/app/src/main/java/io/highfidelity/hifiinterface/fragment/HomeFragment.java @@ -4,6 +4,7 @@ import android.app.Fragment; import android.content.Context; import android.os.Bundle; import android.os.Handler; +import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.RecyclerView; import android.text.Editable; @@ -32,6 +33,7 @@ public class HomeFragment extends Fragment { private OnHomeInteractionListener mListener; + private SwipeRefreshLayout mSwipeRefreshLayout; public native String nativeGetLastLocation(); @@ -57,6 +59,7 @@ public class HomeFragment extends Fragment { View rootView = inflater.inflate(R.layout.fragment_home, container, false); searchNoResultsView = rootView.findViewById(R.id.searchNoResultsView); + mSwipeRefreshLayout = rootView.findViewById(R.id.swipeRefreshLayout); mDomainsView = rootView.findViewById(R.id.rvDomains); int numberOfColumns = 1; @@ -76,12 +79,14 @@ public class HomeFragment extends Fragment { searchNoResultsView.setText(R.string.search_no_results); searchNoResultsView.setVisibility(View.VISIBLE); mDomainsView.setVisibility(View.GONE); + mSwipeRefreshLayout.setRefreshing(false); } @Override public void onNonEmptyAdapter() { searchNoResultsView.setVisibility(View.GONE); mDomainsView.setVisibility(View.VISIBLE); + mSwipeRefreshLayout.setRefreshing(false); } @Override @@ -104,7 +109,7 @@ public class HomeFragment extends Fragment { @Override public void afterTextChanged(Editable editable) { - mDomainAdapter.loadDomains(editable.toString()); + mDomainAdapter.loadDomains(editable.toString(), false); if (editable.length() > 0) { mSearchIconView.setVisibility(View.GONE); mClearSearch.setVisibility(View.VISIBLE); @@ -130,6 +135,13 @@ public class HomeFragment extends Fragment { mClearSearch.setOnClickListener(view -> onSearchClear(view)); + mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { + @Override + public void onRefresh() { + mDomainAdapter.loadDomains(mSearchView.getText().toString(), true); + } + }); + getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN); return rootView; diff --git a/android/app/src/main/java/io/highfidelity/hifiinterface/provider/DomainProvider.java b/android/app/src/main/java/io/highfidelity/hifiinterface/provider/DomainProvider.java index 7a2101a229..602fadc37e 100644 --- a/android/app/src/main/java/io/highfidelity/hifiinterface/provider/DomainProvider.java +++ b/android/app/src/main/java/io/highfidelity/hifiinterface/provider/DomainProvider.java @@ -10,7 +10,7 @@ import io.highfidelity.hifiinterface.view.DomainAdapter; public interface DomainProvider { - void retrieve(String filterText, DomainCallback domainCallback); + void retrieve(String filterText, DomainCallback domainCallback, boolean forceRefresh); interface DomainCallback { void retrieveOk(List domain); diff --git a/android/app/src/main/java/io/highfidelity/hifiinterface/provider/UserStoryDomainProvider.java b/android/app/src/main/java/io/highfidelity/hifiinterface/provider/UserStoryDomainProvider.java index ca5e0c17bd..e3b631bd69 100644 --- a/android/app/src/main/java/io/highfidelity/hifiinterface/provider/UserStoryDomainProvider.java +++ b/android/app/src/main/java/io/highfidelity/hifiinterface/provider/UserStoryDomainProvider.java @@ -49,8 +49,8 @@ public class UserStoryDomainProvider implements DomainProvider { } @Override - public synchronized void retrieve(String filterText, DomainCallback domainCallback) { - if (!startedToGetFromAPI) { + public synchronized void retrieve(String filterText, DomainCallback domainCallback, boolean forceRefresh) { + if (!startedToGetFromAPI || forceRefresh) { startedToGetFromAPI = true; fillDestinations(filterText, domainCallback); } else { @@ -72,6 +72,7 @@ public class UserStoryDomainProvider implements DomainProvider { allStories.clear(); getUserStoryPage(1, allStories, null, ex -> { + suggestions.clear(); allStories.forEach(userStory -> { if (taggedStoriesIds.contains(userStory.id)) { userStory.tagFound = true; diff --git a/android/app/src/main/java/io/highfidelity/hifiinterface/view/DomainAdapter.java b/android/app/src/main/java/io/highfidelity/hifiinterface/view/DomainAdapter.java index 4f8b33b481..71d634e9ea 100644 --- a/android/app/src/main/java/io/highfidelity/hifiinterface/view/DomainAdapter.java +++ b/android/app/src/main/java/io/highfidelity/hifiinterface/view/DomainAdapter.java @@ -42,14 +42,14 @@ public class DomainAdapter extends RecyclerView.Adapter domain) { @@ -76,7 +76,7 @@ public class DomainAdapter extends RecyclerView.Adapter domain) { diff --git a/android/app/src/main/res/layout/fragment_home.xml b/android/app/src/main/res/layout/fragment_home.xml index cb39b8f69e..0f8f437c04 100644 --- a/android/app/src/main/res/layout/fragment_home.xml +++ b/android/app/src/main/res/layout/fragment_home.xml @@ -63,13 +63,18 @@ android:visibility="gone" /> - - + android:layout_height="0dp"> + + From 5a80eb646ac2d18f6a5edd3867d2f18f0a72c441 Mon Sep 17 00:00:00 2001 From: Clement Date: Fri, 13 Jul 2018 10:36:01 -0700 Subject: [PATCH 19/29] Fix bad URL --- cmake/externals/openvr/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/externals/openvr/CMakeLists.txt b/cmake/externals/openvr/CMakeLists.txt index a04dbcf3e6..05dfe70ed7 100644 --- a/cmake/externals/openvr/CMakeLists.txt +++ b/cmake/externals/openvr/CMakeLists.txt @@ -7,7 +7,7 @@ string(TOUPPER ${EXTERNAL_NAME} EXTERNAL_NAME_UPPER) ExternalProject_Add( ${EXTERNAL_NAME} - URL https://public.highfidelity.com/dependencies/v1.0.6.zip + URL https://public.highfidelity.com/dependencies/openvr-1.0.6.zip URL_MD5 f6892cd3a3078f505d03b4297f5a1951 CONFIGURE_COMMAND "" BUILD_COMMAND "" From f038ba96b5a1a20bc50a06114ecf5b148ae42e01 Mon Sep 17 00:00:00 2001 From: Clement Date: Fri, 13 Jul 2018 10:52:32 -0700 Subject: [PATCH 20/29] Move a couple dependency archives to dependencies --- cmake/externals/glad32es/CMakeLists.txt | 2 +- cmake/externals/glad41/CMakeLists.txt | 2 +- cmake/externals/glad45/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/externals/glad32es/CMakeLists.txt b/cmake/externals/glad32es/CMakeLists.txt index 8ca4d44021..04000b4cfe 100644 --- a/cmake/externals/glad32es/CMakeLists.txt +++ b/cmake/externals/glad32es/CMakeLists.txt @@ -5,7 +5,7 @@ include(SelectLibraryConfigurations) ExternalProject_Add( ${EXTERNAL_NAME} - URL https://hifi-public.s3.amazonaws.com/austin/glad/glad32es.zip + URL https://public.highfidelity.com/dependencies/glad/glad32es.zip URL_MD5 6a641d8c49dee4c895fa59315f5682a6 CONFIGURE_COMMAND CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX:PATH= -DCMAKE_POSITION_INDEPENDENT_CODE=ON LOG_DOWNLOAD 1 diff --git a/cmake/externals/glad41/CMakeLists.txt b/cmake/externals/glad41/CMakeLists.txt index 2371044362..0c99a03025 100644 --- a/cmake/externals/glad41/CMakeLists.txt +++ b/cmake/externals/glad41/CMakeLists.txt @@ -5,7 +5,7 @@ include(SelectLibraryConfigurations) ExternalProject_Add( ${EXTERNAL_NAME} - URL https://hifi-public.s3.amazonaws.com/austin/glad/glad41.zip + URL https://public.highfidelity.com/dependencies/glad/glad41.zip URL_MD5 1324eeec33abe91e67d19ae551ba624d CONFIGURE_COMMAND CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX:PATH= -DCMAKE_POSITION_INDEPENDENT_CODE=ON LOG_DOWNLOAD 1 diff --git a/cmake/externals/glad45/CMakeLists.txt b/cmake/externals/glad45/CMakeLists.txt index 8ad455fa7e..112f6f3592 100644 --- a/cmake/externals/glad45/CMakeLists.txt +++ b/cmake/externals/glad45/CMakeLists.txt @@ -5,7 +5,7 @@ include(SelectLibraryConfigurations) ExternalProject_Add( ${EXTERNAL_NAME} - URL https://hifi-public.s3.amazonaws.com/austin/glad/glad45.zip + URL https://public.highfidelity.com/dependencies/glad/glad45.zip URL_MD5 cfb19b3cb5b2f8f1d1669fb3150e5f05 CONFIGURE_COMMAND CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX:PATH= -DCMAKE_POSITION_INDEPENDENT_CODE=ON LOG_DOWNLOAD 1 From 4daa0c65378c25ff8bb3bfbcd55cb5fdae8e4126 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Fri, 13 Jul 2018 12:47:45 -0700 Subject: [PATCH 21/29] CR feedback --- interface/resources/qml/hifi/Pal.qml | 6 +++--- interface/src/avatar/AvatarManager.cpp | 14 +++++++++++--- interface/src/avatar/AvatarManager.h | 11 ++++++++++- scripts/system/pal.js | 10 +++++----- 4 files changed, 29 insertions(+), 12 deletions(-) diff --git a/interface/resources/qml/hifi/Pal.qml b/interface/resources/qml/hifi/Pal.qml index 06ad57139d..c66ed1fe18 100644 --- a/interface/resources/qml/hifi/Pal.qml +++ b/interface/resources/qml/hifi/Pal.qml @@ -1120,7 +1120,7 @@ Rectangle { var data = message.params; var index = -1; iAmAdmin = Users.canKick; - index = findNearbySessionIndex(MyAvatar.sessionUUID, data); + index = findNearbySessionIndex("", data); if (index !== -1) { myData = data[index]; data.splice(index, 1); @@ -1197,8 +1197,8 @@ Rectangle { for (var userId in message.params) { var audioLevel = message.params[userId][0]; var avgAudioLevel = message.params[userId][1]; - // If the userId is 0, we're updating "myData". - if (userId == 0) { + // If the userId is "", we're updating "myData". + if (userId === "") { myData.audioLevel = audioLevel; myCard.audioLevel = audioLevel; // Defensive programming myData.avgAudioLevel = avgAudioLevel; diff --git a/interface/src/avatar/AvatarManager.cpp b/interface/src/avatar/AvatarManager.cpp index a7ee5f4869..bb9a78d546 100644 --- a/interface/src/avatar/AvatarManager.cpp +++ b/interface/src/avatar/AvatarManager.cpp @@ -670,7 +670,7 @@ void AvatarManager::setAvatarSortCoefficient(const QString& name, const QScriptV } } -QString AvatarManager::getPalData(const QList specificAvatarIdentifiers) { + QVariantMap AvatarManager::getPalData(const QList specificAvatarIdentifiers) { QJsonArray palData; auto avatarMap = getHashCopy(); @@ -680,6 +680,13 @@ QString AvatarManager::getPalData(const QList specificAvatarIdentifiers QString currentSessionUUID = avatar->getSessionUUID().toString(); if (specificAvatarIdentifiers.isEmpty() || specificAvatarIdentifiers.contains(currentSessionUUID)) { QJsonObject thisAvatarPalData; + + auto myAvatar = DependencyManager::get()->getMyAvatar(); + + if (currentSessionUUID == myAvatar->getSessionUUID().toString()) { + currentSessionUUID = ""; + } + thisAvatarPalData.insert("sessionUUID", currentSessionUUID); thisAvatarPalData.insert("sessionDisplayName", avatar->getSessionDisplayName()); thisAvatarPalData.insert("audioLoudness", avatar->getAudioLoudness()); @@ -704,6 +711,7 @@ QString AvatarManager::getPalData(const QList specificAvatarIdentifiers } ++itr; } - QJsonDocument doc(palData); - return doc.toJson(QJsonDocument::Compact); + QJsonObject doc; + doc.insert("data", palData); + return doc.toVariantMap(); } diff --git a/interface/src/avatar/AvatarManager.h b/interface/src/avatar/AvatarManager.h index 507767866b..c6f71b498d 100644 --- a/interface/src/avatar/AvatarManager.h +++ b/interface/src/avatar/AvatarManager.h @@ -157,7 +157,16 @@ public: */ Q_INVOKABLE void setAvatarSortCoefficient(const QString& name, const QScriptValue& value); - Q_INVOKABLE QString getPalData(const QList specificAvatarIdentifiers = QList()); + /**jsdoc + * Used in the PAL for getting PAL-related data about avatars nearby. Using this method is faster + * than iterating over each avatar and obtaining data about them in JavaScript, as that method + * locks and unlocks each avatar's data structure potentially hundreds of times per update tick. + * @function AvatarManager.getPalData + * @param {string list} specificAvatarIdentifiers - A list of specific Avatar Identifiers about which + * you want to get PAL data + * @returns {string} + */ + Q_INVOKABLE QVariantMap getPalData(const QList specificAvatarIdentifiers = QList()); float getMyAvatarSendRate() const { return _myAvatarSendRate.rate(); } int getIdentityRequestsSent() const { return _identityRequestsSent; } diff --git a/scripts/system/pal.js b/scripts/system/pal.js index b811f5e95a..d8dae80b85 100644 --- a/scripts/system/pal.js +++ b/scripts/system/pal.js @@ -448,7 +448,7 @@ function populateNearbyUserList(selectData, oldAudioData) { horizontalAngleNormal = filter && Quat.getUp(orientation); avatarsOfInterest = {}; - var avatarData = JSON.parse(AvatarList.getPalData()); + var avatarData = AvatarList.getPalData().data; avatarData.forEach(function (currentAvatarData) { var id = currentAvatarData.sessionUUID; @@ -487,7 +487,7 @@ function populateNearbyUserList(selectData, oldAudioData) { }; // Everyone needs to see admin status. Username and fingerprint returns default constructor output if the requesting user isn't an admin. Users.requestUsernameFromID(id); - if (id !== MyAvatar.sessionUUID) { + if (id !== "") { addAvatarNode(id); // No overlay for ourselves avatarsOfInterest[id] = true; } else { @@ -548,7 +548,7 @@ function updateAudioLevel(overlay, avatarData) { var param = {}; var level = [audioLevel, avgAudioLevel]; - var userId = avatarData.sessionUUID === MyAvatar.sessionUUID ? 0 : avatarData.sessionUUID; + var userId = avatarData.sessionUUID; param[userId] = level; sendToQml({ method: 'updateAudioLevel', params: param }); } @@ -557,12 +557,12 @@ var pingPong = true; function updateOverlays() { var eye = Camera.position; - var avatarData = JSON.parse(AvatarList.getPalData()); + var avatarData = AvatarList.getPalData().data; avatarData.forEach(function (currentAvatarData) { updateAudioLevel(overlay, currentAvatarData); - if (currentAvatarData.sessionUUID === MyAvatar.sessionUUID || !avatarsOfInterest[currentAvatarData.sessionUUID]) { + if (currentAvatarData.sessionUUID === "" || !avatarsOfInterest[currentAvatarData.sessionUUID]) { return; // don't update ourself, or avatars we're not interested in } var overlay = ExtendedOverlay.get(currentAvatarData.sessionUUID); From c3ffe7eb97f26f2c4073932cd83faa645d0b81dc Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Fri, 13 Jul 2018 13:55:32 -0700 Subject: [PATCH 22/29] Fix bubble shading; fix audio loudness calculation --- scripts/system/pal.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/system/pal.js b/scripts/system/pal.js index d8dae80b85..fcff83a3d3 100644 --- a/scripts/system/pal.js +++ b/scripts/system/pal.js @@ -518,32 +518,32 @@ function usernameFromIDReply(id, username, machineFingerprint, isAdmin) { updateUser(data); } -function updateAudioLevel(overlay, avatarData) { +function updateAudioLevel(avatarData) { // the VU meter should work similarly to the one in AvatarInputs: log scale, exponentially averaged // But of course it gets the data at a different rate, so we tweak the averaging ratio and frequency // of updating (the latter for efficiency too). var audioLevel = 0.0; var avgAudioLevel = 0.0; - if (overlay) { + var data = avatarData.sessionUUID === "" ? myData : ExtendedOverlay.get(avatarData.sessionUUID); + + if (data) { // we will do exponential moving average by taking some the last loudness and averaging - overlay.accumulatedLevel = AVERAGING_RATIO * (overlay.accumulatedLevel || 0) + (1 - AVERAGING_RATIO) * (avatarData.audioLoudness); + data.accumulatedLevel = AVERAGING_RATIO * (data.accumulatedLevel || 0) + (1 - AVERAGING_RATIO) * (avatarData.audioLoudness); // add 1 to insure we don't go log() and hit -infinity. Math.log is // natural log, so to get log base 2, just divide by ln(2). - audioLevel = scaleAudio(Math.log(overlay.accumulatedLevel + 1) / LOG2); + audioLevel = scaleAudio(Math.log(data.accumulatedLevel + 1) / LOG2); // decay avgAudioLevel - avgAudioLevel = Math.max((1 - AUDIO_PEAK_DECAY) * (overlay.avgAudioLevel || 0), audioLevel); + avgAudioLevel = Math.max((1 - AUDIO_PEAK_DECAY) * (data.avgAudioLevel || 0), audioLevel); - overlay.avgAudioLevel = avgAudioLevel; - overlay.audioLevel = audioLevel; + data.avgAudioLevel = avgAudioLevel; + data.audioLevel = audioLevel; // now scale for the gain. Also, asked to boost the low end, so one simple way is // to take sqrt of the value. Lets try that, see how it feels. avgAudioLevel = Math.min(1.0, Math.sqrt(avgAudioLevel * (sessionGains[avatarData.sessionUUID] || 0.75))); - } else { - audioLevel = scaleAudio(Math.log(((1 - AVERAGING_RATIO) * (avatarData.audioLoudness)) + 1) / LOG2); } var param = {}; @@ -560,11 +560,11 @@ function updateOverlays() { var avatarData = AvatarList.getPalData().data; avatarData.forEach(function (currentAvatarData) { - updateAudioLevel(overlay, currentAvatarData); if (currentAvatarData.sessionUUID === "" || !avatarsOfInterest[currentAvatarData.sessionUUID]) { return; // don't update ourself, or avatars we're not interested in } + updateAudioLevel(currentAvatarData); var overlay = ExtendedOverlay.get(currentAvatarData.sessionUUID); if (!overlay) { // For now, we're treating this as a temporary loss, as from the personal space bubble. Add it back. print('Adding non-PAL avatar node', currentAvatarData.sessionUUID); From e4f13c97f79463b57bb97637fadef5f8abc80934 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sat, 14 Jul 2018 14:01:08 +1200 Subject: [PATCH 23/29] Fix JSDoc for MyAvatar.getLeftPalmRotation and getRightPalmRotation --- libraries/avatars-renderer/src/avatars-renderer/Avatar.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/avatars-renderer/src/avatars-renderer/Avatar.h b/libraries/avatars-renderer/src/avatars-renderer/Avatar.h index fe9a347c20..157f7b2ec6 100644 --- a/libraries/avatars-renderer/src/avatars-renderer/Avatar.h +++ b/libraries/avatars-renderer/src/avatars-renderer/Avatar.h @@ -381,7 +381,7 @@ public slots: /**jsdoc * Get the rotation of the left palm in world coordinates. * @function MyAvatar.getLeftPalmRotation - * @returns {Vec3} The rotation of the left palm in world coordinates. + * @returns {Quat} The rotation of the left palm in world coordinates. * @example Report the rotation of your avatar's left palm. * print(JSON.stringify(MyAvatar.getLeftPalmRotation())); */ @@ -398,7 +398,7 @@ public slots: /**jsdoc * Get the rotation of the right palm in world coordinates. * @function MyAvatar.getRightPalmRotation - * @returns {Vec3} The rotation of the right palm in world coordinates. + * @returns {Quat} The rotation of the right palm in world coordinates. * @example Report the rotation of your avatar's right palm. * print(JSON.stringify(MyAvatar.getRightPalmRotation())); */ From d81420542ccca3dbe87a8902c1e749caa6feb973 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Mon, 16 Jul 2018 11:00:27 -0700 Subject: [PATCH 24/29] making PR requests --- .../controllerModules/nearParentGrabEntity.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/system/controllers/controllerModules/nearParentGrabEntity.js b/scripts/system/controllers/controllerModules/nearParentGrabEntity.js index 580132a648..a9f3fbd668 100644 --- a/scripts/system/controllers/controllerModules/nearParentGrabEntity.js +++ b/scripts/system/controllers/controllerModules/nearParentGrabEntity.js @@ -172,8 +172,12 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); if (now - this.lastUnequipCheckTime > MSECS_PER_SEC * TEAR_AWAY_CHECK_TIME) { this.lastUnequipCheckTime = now; if (props.parentID === MyAvatar.SELF_ID) { - var sensorScaleFactor = MyAvatar.sensorToWorldScale; - if ((props.localPosition > TEAR_AWAY_DISTANCE * sensorScaleFactor)) { + var tearAwayDistance = TEAR_AWAY_DISTANCE; + var localX = props.localPosition.x; + var localZ = props.localPosition.z; + var localY = props.localPosition.y; + if ((localX > tearAwayDistance) || (localY > tearAwayDistance) || + (localZ > tearAwayDistance)) { this.autoUnequipCounter++; } else { this.autoUnequipCounter = 0; @@ -237,10 +241,8 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); for (var i = 0; i < nearbyEntityProperties.length; i++) { var props = nearbyEntityProperties[i]; var handPosition = controllerData.controllerLocations[this.hand].position; - var dist = distanceBetweenPointAndEntityBoundingBox(handPosition, props); var distance = Vec3.distance(handPosition, props.position); - if ((dist > TEAR_AWAY_DISTANCE) || - (distance > NEAR_GRAB_RADIUS * sensorScaleFactor)) { + if ((distance > NEAR_GRAB_RADIUS * sensorScaleFactor)) { continue; } if (entityIsGrabbable(props) || entityIsCloneable(props)) { From ac2351e49f9466a7cc2760233ec8db7ce0f95f73 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Mon, 16 Jul 2018 09:33:36 -0700 Subject: [PATCH 25/29] Make JSDoc happy --- interface/src/avatar/AvatarManager.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/interface/src/avatar/AvatarManager.h b/interface/src/avatar/AvatarManager.h index c6f71b498d..53461146e5 100644 --- a/interface/src/avatar/AvatarManager.h +++ b/interface/src/avatar/AvatarManager.h @@ -162,9 +162,9 @@ public: * than iterating over each avatar and obtaining data about them in JavaScript, as that method * locks and unlocks each avatar's data structure potentially hundreds of times per update tick. * @function AvatarManager.getPalData - * @param {string list} specificAvatarIdentifiers - A list of specific Avatar Identifiers about which - * you want to get PAL data - * @returns {string} + * @param {string[]} specificAvatarIdentifiers - A list of specific Avatar Identifiers about + * which you want to get PAL data + * @returns {object} */ Q_INVOKABLE QVariantMap getPalData(const QList specificAvatarIdentifiers = QList()); From abb2c7ef14608ebed80d053c23571a1e27370d3e Mon Sep 17 00:00:00 2001 From: amantley Date: Mon, 16 Jul 2018 11:29:49 -0700 Subject: [PATCH 26/29] Added reset of the _headControllerFacingMovingAverage in MyAvatar.cpp prePhysicsUpdate(). This stops some of the flipping back and forth that has been happening with rotational recenter. --- interface/src/avatar/MyAvatar.cpp | 2 ++ interface/src/avatar/MyAvatar.h | 1 + 2 files changed, 3 insertions(+) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index dbb1d8a56c..d084ca69f9 100755 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -3551,6 +3551,7 @@ void MyAvatar::FollowHelper::prePhysicsUpdate(MyAvatar& myAvatar, const glm::mat qApp->getCamera().getMode() != CAMERA_MODE_MIRROR) { if (!isActive(Rotation) && (shouldActivateRotation(myAvatar, desiredBodyMatrix, currentBodyMatrix) || hasDriveInput)) { activate(Rotation); + myAvatar.setHeadControllerFacingMovingAverage(myAvatar._headControllerFacing); } if (myAvatar.getCenterOfGravityModelEnabled()) { if (!isActive(Horizontal) && (shouldActivateHorizontalCG(myAvatar) || hasDriveInput)) { @@ -3568,6 +3569,7 @@ void MyAvatar::FollowHelper::prePhysicsUpdate(MyAvatar& myAvatar, const glm::mat } else { if (!isActive(Rotation) && getForceActivateRotation()) { activate(Rotation); + myAvatar.setHeadControllerFacingMovingAverage(myAvatar._headControllerFacing); setForceActivateRotation(false); } if (!isActive(Horizontal) && getForceActivateHorizontal()) { diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index e795d9356d..819d5b0066 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -883,6 +883,7 @@ public: virtual void rebuildCollisionShape() override; const glm::vec2& getHeadControllerFacingMovingAverage() const { return _headControllerFacingMovingAverage; } + void setHeadControllerFacingMovingAverage(glm::vec2 currentHeadControllerFacing) { _headControllerFacingMovingAverage = currentHeadControllerFacing; } float getCurrentStandingHeight() const { return _currentStandingHeight; } void setCurrentStandingHeight(float newMode) { _currentStandingHeight = newMode; } const glm::quat getAverageHeadRotation() const { return _averageHeadRotation; } From 0fa2a71d0f48760e203e5ef8fc3412aaba1076a1 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Mon, 16 Jul 2018 11:35:53 -0700 Subject: [PATCH 27/29] actually fix requested changes --- .../controllerModules/nearParentGrabEntity.js | 12 +++++------ .../libraries/controllerDispatcherUtils.js | 20 +++++++++++++++++++ 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/scripts/system/controllers/controllerModules/nearParentGrabEntity.js b/scripts/system/controllers/controllerModules/nearParentGrabEntity.js index a9f3fbd668..75f8d28c85 100644 --- a/scripts/system/controllers/controllerModules/nearParentGrabEntity.js +++ b/scripts/system/controllers/controllerModules/nearParentGrabEntity.js @@ -11,7 +11,8 @@ TRIGGER_OFF_VALUE, makeDispatcherModuleParameters, entityIsGrabbable, makeRunningValues, NEAR_GRAB_RADIUS, findGroupParent, Vec3, cloneEntity, entityIsCloneable, propsAreCloneDynamic, HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION, BUMPER_ON_VALUE, findHandChildEntities, TEAR_AWAY_DISTANCE, MSECS_PER_SEC, TEAR_AWAY_CHECK_TIME, - TEAR_AWAY_COUNT, distanceBetweenPointAndEntityBoundingBox, print, Uuid, highlightTargetEntity, unhighlightTargetEntity + TEAR_AWAY_COUNT, distanceBetweenPointAndEntityBoundingBox, print, Uuid, highlightTargetEntity, unhighlightTargetEntity, + distanceBetweenEntityLocalPositionAndBoundingBox */ Script.include("/~/system/libraries/controllerDispatcherUtils.js"); @@ -172,12 +173,9 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); if (now - this.lastUnequipCheckTime > MSECS_PER_SEC * TEAR_AWAY_CHECK_TIME) { this.lastUnequipCheckTime = now; if (props.parentID === MyAvatar.SELF_ID) { - var tearAwayDistance = TEAR_AWAY_DISTANCE; - var localX = props.localPosition.x; - var localZ = props.localPosition.z; - var localY = props.localPosition.y; - if ((localX > tearAwayDistance) || (localY > tearAwayDistance) || - (localZ > tearAwayDistance)) { + var tearAwayDistance = TEAR_AWAY_DISTANCE * MyAvatar.sensorToWorldScale; + var distance = distanceBetweenEntityLocalPositionAndBoundingBox(props); + if (distance > tearAwayDistance) { this.autoUnequipCounter++; } else { this.autoUnequipCounter = 0; diff --git a/scripts/system/libraries/controllerDispatcherUtils.js b/scripts/system/libraries/controllerDispatcherUtils.js index 9a886372b8..e817bb4ee1 100644 --- a/scripts/system/libraries/controllerDispatcherUtils.js +++ b/scripts/system/libraries/controllerDispatcherUtils.js @@ -59,6 +59,7 @@ highlightTargetEntity:true, clearHighlightedEntities:true, unhighlightTargetEntity:true + distanceBetweenEntityLocalPositionAndBoundingBox: true */ MSECS_PER_SEC = 1000.0; @@ -415,6 +416,25 @@ findHandChildEntities = function(hand) { }); }; +distanceBetweenEntityLocalPositionAndBoundingBox = function(entityProps) { + var localPoint = entityProps.localPosition; + var entityXform = new Xform(entityProps.rotation, entityProps.position); + var minOffset = Vec3.multiplyVbyV(entityProps.registrationPoint, entityProps.dimensions); + var maxOffset = Vec3.multiplyVbyV(Vec3.subtract(ONE_VEC, entityProps.registrationPoint), entityProps.dimensions); + var localMin = Vec3.subtract(entityXform.trans, minOffset); + var localMax = Vec3.sum(entityXform.trans, maxOffset); + + var v = {x: localPoint.x, y: localPoint.y, z: localPoint.z}; + v.x = Math.max(v.x, localMin.x); + v.x = Math.min(v.x, localMax.x); + v.y = Math.max(v.y, localMin.y); + v.y = Math.min(v.y, localMax.y); + v.z = Math.max(v.z, localMin.z); + v.z = Math.min(v.z, localMax.z); + + return Vec3.distance(v, localPoint); +}; + distanceBetweenPointAndEntityBoundingBox = function(point, entityProps) { var entityXform = new Xform(entityProps.rotation, entityProps.position); var localPoint = entityXform.inv().xformPoint(point); From fa2b975e8f262a96b61ac30685c7a9af1e3febf0 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Mon, 16 Jul 2018 11:42:38 -0700 Subject: [PATCH 28/29] undo some wrong changes --- .../controllers/controllerModules/nearParentGrabEntity.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/system/controllers/controllerModules/nearParentGrabEntity.js b/scripts/system/controllers/controllerModules/nearParentGrabEntity.js index 75f8d28c85..59c2520c01 100644 --- a/scripts/system/controllers/controllerModules/nearParentGrabEntity.js +++ b/scripts/system/controllers/controllerModules/nearParentGrabEntity.js @@ -239,8 +239,10 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); for (var i = 0; i < nearbyEntityProperties.length; i++) { var props = nearbyEntityProperties[i]; var handPosition = controllerData.controllerLocations[this.hand].position; + var dist = distanceBetweenPointAndEntityBoundingBox(handPosition, props); var distance = Vec3.distance(handPosition, props.position); - if ((distance > NEAR_GRAB_RADIUS * sensorScaleFactor)) { + if ((dist > TEAR_AWAY_DISTANCE || + distance > NEAR_GRAB_RADIUS * sensorScaleFactor)) { continue; } if (entityIsGrabbable(props) || entityIsCloneable(props)) { From 20a82753436066d767f87e5e01167d2c22459a52 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Mon, 16 Jul 2018 11:43:29 -0700 Subject: [PATCH 29/29] min diff --- .../controllers/controllerModules/nearParentGrabEntity.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/system/controllers/controllerModules/nearParentGrabEntity.js b/scripts/system/controllers/controllerModules/nearParentGrabEntity.js index 59c2520c01..38334f5523 100644 --- a/scripts/system/controllers/controllerModules/nearParentGrabEntity.js +++ b/scripts/system/controllers/controllerModules/nearParentGrabEntity.js @@ -241,8 +241,8 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); var handPosition = controllerData.controllerLocations[this.hand].position; var dist = distanceBetweenPointAndEntityBoundingBox(handPosition, props); var distance = Vec3.distance(handPosition, props.position); - if ((dist > TEAR_AWAY_DISTANCE || - distance > NEAR_GRAB_RADIUS * sensorScaleFactor)) { + if ((dist > TEAR_AWAY_DISTANCE) || + (distance > NEAR_GRAB_RADIUS * sensorScaleFactor)) { continue; } if (entityIsGrabbable(props) || entityIsCloneable(props)) {