From a896e9872cb27a4077120e8d3addc5e1f8f5a54d Mon Sep 17 00:00:00 2001 From: samcake Date: Wed, 14 Mar 2018 17:09:23 -0700 Subject: [PATCH 001/115] adressing the avatar vissibility switch --- interface/src/avatar/MyAvatar.cpp | 3 ++- .../avatars-renderer/src/avatars-renderer/Avatar.cpp | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 9620a2dcec..f18b2ed42c 100755 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -1114,7 +1114,8 @@ void MyAvatar::setEnableDebugDrawIKChains(bool isEnabled) { } void MyAvatar::setEnableMeshVisible(bool isEnabled) { - _skeletonModel->setVisibleInScene(isEnabled, qApp->getMain3DScene(), render::ItemKey::TAG_BITS_NONE, true); + // TODO: This should tell the main MetaRenderItem of the Avatar to be hidden to control vsisiblity since the model is culled by the MetaRI. + _skeletonModel->setVisibleInScene(isEnabled, qApp->getMain3DScene(), render::ItemKey::TAG_BITS_0 | render::ItemKey::TAG_BITS_1, true); } void MyAvatar::setEnableInverseKinematics(bool isEnabled) { diff --git a/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp b/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp index 65145d4c88..f90f3660a0 100644 --- a/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp +++ b/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp @@ -52,7 +52,13 @@ const glm::vec3 HAND_TO_PALM_OFFSET(0.0f, 0.12f, 0.08f); namespace render { template <> const ItemKey payloadGetKey(const AvatarSharedPointer& avatar) { - return ItemKey::Builder::opaqueShape().withTypeMeta().withTagBits(ItemKey::TAG_BITS_0 | ItemKey::TAG_BITS_1).withMetaCullGroup(); + ItemKey::Builder keyBuilder = ItemKey::Builder::opaqueShape().withTypeMeta().withTagBits(ItemKey::TAG_BITS_0 | ItemKey::TAG_BITS_1).withMetaCullGroup(); + auto avatarPtr = static_pointer_cast(avatar); + auto model = avatarPtr->getSkeletonModel(); + if (model && !model->isVisible()) { + keyBuilder.withInvisible(); + } + return keyBuilder.build(); } template <> const Item::Bound payloadGetBound(const AvatarSharedPointer& avatar) { return static_pointer_cast(avatar)->getBounds(); From 2fc23d799ad8fbca48e795835546662e90744c26 Mon Sep 17 00:00:00 2001 From: samcake Date: Thu, 15 Mar 2018 18:05:58 -0700 Subject: [PATCH 002/115] adding the correct flag maybe? --- libraries/render-utils/src/CauterizedModel.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/render-utils/src/CauterizedModel.cpp b/libraries/render-utils/src/CauterizedModel.cpp index 1596f7ba83..3c6a0df850 100644 --- a/libraries/render-utils/src/CauterizedModel.cpp +++ b/libraries/render-utils/src/CauterizedModel.cpp @@ -220,6 +220,7 @@ void CauterizedModel::updateRenderItems() { bool isLayeredInFront = self->isLayeredInFront(); bool isLayeredInHUD = self->isLayeredInHUD(); bool enableCauterization = self->getEnableCauterization(); + bool isGroupCulled = self->isGroupCulled(); render::Transaction transaction; for (int i = 0; i < (int)self->_modelMeshRenderItemIDs.size(); i++) { @@ -234,7 +235,7 @@ void CauterizedModel::updateRenderItems() { bool useDualQuaternionSkinning = self->getUseDualQuaternionSkinning(); transaction.updateItem(itemID, [modelTransform, meshState, useDualQuaternionSkinning, cauterizedMeshState, invalidatePayloadShapeKey, - isWireframe, isVisible, isLayeredInFront, isLayeredInHUD, canCastShadow, enableCauterization](CauterizedMeshPartPayload& data) { + isWireframe, isVisible, isLayeredInFront, isLayeredInHUD, canCastShadow, enableCauterization, isGroupCulled](CauterizedMeshPartPayload& data) { if (useDualQuaternionSkinning) { data.updateClusterBuffer(meshState.clusterDualQuaternions, cauterizedMeshState.clusterDualQuaternions); @@ -276,7 +277,7 @@ void CauterizedModel::updateRenderItems() { data.updateTransformForCauterizedMesh(renderTransform); data.setEnableCauterization(enableCauterization); - data.updateKey(isVisible, isLayeredInFront || isLayeredInHUD, canCastShadow, render::ItemKey::TAG_BITS_ALL); + data.updateKey(isVisible, isLayeredInFront || isLayeredInHUD, canCastShadow, render::ItemKey::TAG_BITS_ALL, isGroupCulled); data.setLayer(isLayeredInFront, isLayeredInHUD); data.setShapeKey(invalidatePayloadShapeKey, isWireframe, useDualQuaternionSkinning); }); From 6d251c4cd3e661242962b7a0ea399eba2c1a62ec Mon Sep 17 00:00:00 2001 From: samcake Date: Thu, 3 May 2018 17:46:50 -0700 Subject: [PATCH 003/115] Bringing the work and refinment done in workload branch to master branch --- .../render-utils/src/AmbientOcclusionEffect.h | 2 +- libraries/render-utils/src/LightClusters.h | 2 +- .../render-utils/src/SubsurfaceScattering.h | 2 +- libraries/render/src/render/Item.h | 1 + libraries/task/src/task/Config.h | 35 ++++++++++++--- libraries/task/src/task/Task.h | 45 +++++++++++++++++-- 6 files changed, 74 insertions(+), 13 deletions(-) diff --git a/libraries/render-utils/src/AmbientOcclusionEffect.h b/libraries/render-utils/src/AmbientOcclusionEffect.h index 3643e608ed..b3a93ab1de 100644 --- a/libraries/render-utils/src/AmbientOcclusionEffect.h +++ b/libraries/render-utils/src/AmbientOcclusionEffect.h @@ -181,7 +181,7 @@ class DebugAmbientOcclusionConfig : public render::Job::Config { Q_PROPERTY(bool showCursorPixel MEMBER showCursorPixel NOTIFY dirty) Q_PROPERTY(glm::vec2 debugCursorTexcoord MEMBER debugCursorTexcoord NOTIFY dirty) public: - DebugAmbientOcclusionConfig() : render::Job::Config(true) {} + DebugAmbientOcclusionConfig() : render::Job::Config(false) {} bool showCursorPixel{ false }; glm::vec2 debugCursorTexcoord{ 0.5f, 0.5f }; diff --git a/libraries/render-utils/src/LightClusters.h b/libraries/render-utils/src/LightClusters.h index f495dabebb..fa054c304a 100644 --- a/libraries/render-utils/src/LightClusters.h +++ b/libraries/render-utils/src/LightClusters.h @@ -195,7 +195,7 @@ class DebugLightClustersConfig : public render::Job::Config { Q_PROPERTY(bool doDrawClusterFromDepth MEMBER doDrawClusterFromDepth NOTIFY dirty) Q_PROPERTY(bool doDrawContent MEMBER doDrawContent NOTIFY dirty) public: - DebugLightClustersConfig() : render::Job::Config(true){} + DebugLightClustersConfig() : render::Job::Config(false){} bool doDrawGrid{ false }; diff --git a/libraries/render-utils/src/SubsurfaceScattering.h b/libraries/render-utils/src/SubsurfaceScattering.h index 30021fae40..780ce34d7f 100644 --- a/libraries/render-utils/src/SubsurfaceScattering.h +++ b/libraries/render-utils/src/SubsurfaceScattering.h @@ -149,7 +149,7 @@ class DebugSubsurfaceScatteringConfig : public render::Job::Config { Q_PROPERTY(bool showCursorPixel MEMBER showCursorPixel NOTIFY dirty) Q_PROPERTY(glm::vec2 debugCursorTexcoord MEMBER debugCursorTexcoord NOTIFY dirty) public: - DebugSubsurfaceScatteringConfig() : render::Job::Config(true) {} + DebugSubsurfaceScatteringConfig() : render::Job::Config(false) {} bool showProfile{ false }; bool showLUT{ false }; diff --git a/libraries/render/src/render/Item.h b/libraries/render/src/render/Item.h index e4dcc7ee03..b8a3fbf0f8 100644 --- a/libraries/render/src/render/Item.h +++ b/libraries/render/src/render/Item.h @@ -122,6 +122,7 @@ public: Builder& withDynamic() { _flags.set(DYNAMIC); return (*this); } Builder& withDeformed() { _flags.set(DEFORMED); return (*this); } Builder& withInvisible() { _flags.set(INVISIBLE); return (*this); } + Builder& withVisible() { _flags.reset(INVISIBLE); return (*this); } Builder& withShadowCaster() { _flags.set(SHADOW_CASTER); return (*this); } Builder& withLayered() { _flags.set(LAYERED); return (*this); } Builder& withMetaCullGroup() { _flags.set(META_CULL_GROUP); return (*this); } diff --git a/libraries/task/src/task/Config.h b/libraries/task/src/task/Config.h index 36dfb35f25..4ba1934643 100644 --- a/libraries/task/src/task/Config.h +++ b/libraries/task/src/task/Config.h @@ -12,6 +12,8 @@ #ifndef hifi_task_Config_h #define hifi_task_Config_h +#include + #include #include #include @@ -108,11 +110,19 @@ public: Q_INVOKABLE QString toJSON() { return QJsonDocument(toJsonValue(*this).toObject()).toJson(QJsonDocument::Compact); } Q_INVOKABLE void load(const QVariantMap& map) { qObjectFromJsonValue(QJsonObject::fromVariantMap(map), *this); emit loaded(); } + Q_INVOKABLE QObject* getConfig(const QString& name) { return nullptr; } + // Running Time measurement // The new stats signal is emitted once per run time of a job when stats (cpu runtime) are updated - void setCPURunTime(double mstime) { _msCPURunTime = mstime; emit newStats(); } + void setCPURunTime(const std::chrono::nanoseconds& runtime) { _msCPURunTime = std::chrono::duration(runtime).count(); emit newStats(); } double getCPURunTime() const { return _msCPURunTime; } + // Describe the node graph data connections of the associated Job/Task + Q_INVOKABLE virtual bool isTask() const { return false; } + Q_INVOKABLE virtual QObjectList getSubConfigs() const { return QObjectList(); } + Q_INVOKABLE virtual int getNumSubs() const { return 0; } + Q_INVOKABLE virtual QObject* getSubConfig(int i) const { return nullptr; } + public slots: void load(const QJsonObject& val) { qObjectFromJsonValue(val, *this); emit loaded(); } @@ -122,6 +132,8 @@ signals: void dirtyEnabled(); }; +using QConfigPointer = std::shared_ptr; + class TConfigProxy { public: using Config = JobConfig; @@ -134,11 +146,9 @@ public: using Persistent = PersistentConfig; - TaskConfig() = default ; + TaskConfig() = default; TaskConfig(bool enabled) : JobConfig(enabled) {} - - // Get a sub job config through task.getConfig(path) // where path can be: // - search for the first job named job_name traversing the the sub graph of task and jobs (from this task as root) @@ -170,6 +180,21 @@ public: return root->findChild(tokens.front()); } + Q_INVOKABLE bool isTask() const override { return true; } + Q_INVOKABLE QObjectList getSubConfigs() const override { + auto list = findChildren(QRegExp(".*"), Qt::FindDirectChildrenOnly); + QObjectList returned; + for (int i = 0; i < list.size(); i++) { + returned.push_back(list[i]); + } + return returned; + } + Q_INVOKABLE int getNumSubs() const override { return getSubConfigs().size(); } + Q_INVOKABLE QObject* getSubConfig(int i) const override { + auto subs = getSubConfigs(); + return ((i < 0 || i >= subs.size()) ? nullptr : subs[i]); + } + void connectChildConfig(QConfigPointer childConfig, const std::string& name); void transferChildrenConfigs(QConfigPointer source); @@ -179,8 +204,6 @@ public slots: void refresh(); }; -using QConfigPointer = std::shared_ptr; - } #endif // hifi_task_Config_h diff --git a/libraries/task/src/task/Task.h b/libraries/task/src/task/Task.h index 022dd99200..93dfdd85f4 100644 --- a/libraries/task/src/task/Task.h +++ b/libraries/task/src/task/Task.h @@ -80,10 +80,11 @@ public: virtual const Varying getInput() const { return Varying(); } virtual const Varying getOutput() const { return Varying(); } + virtual Varying& editInput() = 0; virtual QConfigPointer& getConfiguration() { return _config; } virtual void applyConfiguration() = 0; - void setCPURunTime(double mstime) { std::static_pointer_cast(_config)->setCPURunTime(mstime); } + void setCPURunTime(const std::chrono::nanoseconds& runtime) { std::static_pointer_cast(_config)->setCPURunTime(runtime); } QConfigPointer _config; protected: @@ -143,6 +144,10 @@ public: const Varying getInput() const override { return _input; } const Varying getOutput() const override { return _output; } + Varying& editInput() override { return _input; } + + template void feedInput(const I& in) { _concept->editInput().template edit() = in; } + template void feedInput(int index, const S& inS) { (_concept->editInput().template editN(index)).template edit() = inS; } template Model(const std::string& name, const Varying& input, QConfigPointer config, A&&... args) : @@ -201,11 +206,12 @@ public: PerformanceTimer perfTimer(getName().c_str()); // NOTE: rather than use the PROFILE_RANGE macro, we create a Duration manually Duration profileRange(jobContext->profileCategory, ("run::" + getName()).c_str()); - auto start = usecTimestampNow(); + + auto startTime = std::chrono::high_resolution_clock::now(); _concept->run(jobContext); - _concept->setCPURunTime((double)(usecTimestampNow() - start) / 1000.0); + _concept->setCPURunTime((std::chrono::high_resolution_clock::now() - startTime)); } protected: @@ -242,6 +248,8 @@ public: const Varying getInput() const override { return _input; } const Varying getOutput() const override { return _output; } + Varying& editInput() override { return _input; } + typename Jobs::iterator editJob(std::string name) { typename Jobs::iterator jobIt; for (jobIt = _jobs.begin(); jobIt != _jobs.end(); ++jobIt) { @@ -370,8 +378,36 @@ public: protected: }; -} +template +class Engine : public Task { +public: + using Context = JC; + using ContextPointer = std::shared_ptr; + using Config = TaskConfig; + using TaskType = Task; + using ConceptPointer = typename TaskType::ConceptPointer; + + Engine(ConceptPointer concept) : TaskType(concept) {} + ~Engine() = default; + + void reset(const ContextPointer& context) { _context = context; } + + void run() { + if (_context) { + run(_context); + } + } + +protected: + void run(const ContextPointer& jobContext) override { + TaskType::run(_context); + } + + ContextPointer _context; +}; + +} #define Task_DeclareTypeAliases(ContextType) \ using JobConfig = task::JobConfig; \ @@ -379,6 +415,7 @@ protected: template using PersistentConfig = task::PersistentConfig; \ using Job = task::Job; \ using Task = task::Task; \ + using _Engine = task::Engine; \ using Varying = task::Varying; \ template < typename T0, typename T1 > using VaryingSet2 = task::VaryingSet2; \ template < typename T0, typename T1, typename T2 > using VaryingSet3 = task::VaryingSet3; \ From e1d063e90880f1e885b29c2612fabb5172a9de70 Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Fri, 4 May 2018 00:01:48 -0700 Subject: [PATCH 004/115] Adding the scripts for Jet --- scripts/developer/utilities/lib/jet/jet.js | 73 +++++++++++++++++++ .../utilities/lib/jet/qml/TaskList.qml | 48 ++++++++++++ .../developer/utilities/lib/jet/qml/qmldir | 1 + .../render/configSlider/ConfigSlider.qml | 40 ++++++---- .../utilities/render/deferredLighting.qml | 10 +++ 5 files changed, 159 insertions(+), 13 deletions(-) create mode 100644 scripts/developer/utilities/lib/jet/jet.js create mode 100644 scripts/developer/utilities/lib/jet/qml/TaskList.qml create mode 100644 scripts/developer/utilities/lib/jet/qml/qmldir diff --git a/scripts/developer/utilities/lib/jet/jet.js b/scripts/developer/utilities/lib/jet/jet.js new file mode 100644 index 0000000000..39da9b6d90 --- /dev/null +++ b/scripts/developer/utilities/lib/jet/jet.js @@ -0,0 +1,73 @@ +// +// Job Engine & Task... +// jet.js +// +// Created by Sam Gateau, 2018/03/28 +// Copyright 2018 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// +"use strict"; + + // traverse task tree +function task_traverse(root, functor, depth) { + // if (root.isTask()) { + depth++; + for (var i = 0; i Date: Fri, 4 May 2018 17:58:21 -0700 Subject: [PATCH 005/115] Templatizing the timeProfiler for the task --- libraries/render/src/render/Engine.h | 6 +- libraries/task/src/task/Task.cpp | 4 +- libraries/task/src/task/Task.h | 63 ++++++++++--------- .../utilities/render/deferredLighting.qml | 16 ++--- 4 files changed, 46 insertions(+), 43 deletions(-) diff --git a/libraries/render/src/render/Engine.h b/libraries/render/src/render/Engine.h index 0271c71529..f444416a3f 100644 --- a/libraries/render/src/render/Engine.h +++ b/libraries/render/src/render/Engine.h @@ -25,7 +25,7 @@ namespace render { class RenderContext : public task::JobContext { public: - RenderContext() : task::JobContext(trace_render()) {} + RenderContext() : task::JobContext() {} virtual ~RenderContext() {} RenderArgs* args; @@ -33,7 +33,9 @@ namespace render { }; using RenderContextPointer = std::shared_ptr; - Task_DeclareTypeAliases(RenderContext) + Task_DeclareCategoryTimeProfilerClass(RenderTimeProfiler, trace_render); + + Task_DeclareTypeAliases(RenderContext, RenderTimeProfiler) // Versions of the COnfig integrating a gpu & batch timer class GPUJobConfig : public JobConfig { diff --git a/libraries/task/src/task/Task.cpp b/libraries/task/src/task/Task.cpp index 621d77d7bf..9123ef8b04 100644 --- a/libraries/task/src/task/Task.cpp +++ b/libraries/task/src/task/Task.cpp @@ -12,9 +12,7 @@ using namespace task; -JobContext::JobContext(const QLoggingCategory& category) : - profileCategory(category) { - assert(&category); +JobContext::JobContext() { } JobContext::~JobContext() { diff --git a/libraries/task/src/task/Task.h b/libraries/task/src/task/Task.h index 93dfdd85f4..c9a3285443 100644 --- a/libraries/task/src/task/Task.h +++ b/libraries/task/src/task/Task.h @@ -15,20 +15,15 @@ #include "Config.h" #include "Varying.h" -#include "SettingHandle.h" - -#include -#include - namespace task { class JobConcept; -template class JobT; -template class TaskT; +template class JobT; +template class TaskT; class JobNoIO {}; // Task Flow control class is a simple per value object used to communicate flow control commands trhough the graph of tasks. -// From within the Job::Run function, you can access it from the JobCOntext and issue commands which will be picked up by the Task calling for the Job run. +// From within the Job::Run function, you can access it from the JobContext and issue commands which will be picked up by the Task calling for the Job run. // This is first introduced to provide a way to abort all the work from within a task job. see the "abortTask" call class TaskFlow { public: @@ -55,11 +50,10 @@ protected: // The JobContext can be derived to add more global state to it that Jobs can access class JobContext { public: - JobContext(const QLoggingCategory& category); + JobContext(); virtual ~JobContext(); std::shared_ptr jobConfig { nullptr }; - const QLoggingCategory& profileCategory; // Task flow control TaskFlow taskFlow{}; @@ -115,10 +109,11 @@ template void jobRun(T& data, const JC& jo data.run(jobContext, input, output); } -template +template class Job { public: using Context = JC; + using TimeProfiler = TP; using ContextPointer = std::shared_ptr; using Config = JobConfig; using None = JobNoIO; @@ -165,7 +160,7 @@ public: void applyConfiguration() override { - Duration profileRange(trace_render(), ("configure::" + JobConcept::getName()).c_str()); + TimeProfiler probe(("configure::" + JobConcept::getName())); jobConfigure(_data, *std::static_pointer_cast(Concept::_config)); } @@ -203,14 +198,9 @@ public: } virtual void run(const ContextPointer& jobContext) { - PerformanceTimer perfTimer(getName().c_str()); - // NOTE: rather than use the PROFILE_RANGE macro, we create a Duration manually - Duration profileRange(jobContext->profileCategory, ("run::" + getName()).c_str()); - + TimeProfiler probe(getName()); auto startTime = std::chrono::high_resolution_clock::now(); - _concept->run(jobContext); - _concept->setCPURunTime((std::chrono::high_resolution_clock::now() - startTime)); } @@ -226,13 +216,14 @@ protected: // The build method is where child Jobs can be added internally to the task // where the input of the task can be setup to feed the child jobs // and where the output of the task is defined -template -class Task : public Job { +template +class Task : public Job { public: using Context = JC; + using TimeProfiler = TP; using ContextPointer = std::shared_ptr; using Config = TaskConfig; - using JobType = Job; + using JobType = Job; using None = typename JobType::None; using Concept = typename JobType::Concept; using ConceptPointer = typename JobType::ConceptPointer; @@ -303,7 +294,7 @@ public: auto model = std::make_shared(name, input, std::make_shared()); { - Duration profileRange(trace_render(), ("build::" + model->getName()).c_str()); + TimeProfiler probe("build::" + model->getName()); model->_data.build(*(model), model->_input, model->_output, std::forward(args)...); } // Recreate the Config to use the templated type @@ -338,7 +329,7 @@ public: } void applyConfiguration() override { - Duration profileRange(trace_render(), ("configure::" + JobConcept::getName()).c_str()); + TimeProfiler probe("configure::" + JobConcept::getName()); jobConfigure(_data, *std::static_pointer_cast(Concept::_config)); for (auto& job : TaskConcept::_jobs) { job.applyConfiguration(); @@ -379,13 +370,13 @@ public: protected: }; -template -class Engine : public Task { +template +class Engine : public Task { public: using Context = JC; using ContextPointer = std::shared_ptr; using Config = TaskConfig; - using TaskType = Task; + using TaskType = Task; using ConceptPointer = typename TaskType::ConceptPointer; Engine(ConceptPointer concept) : TaskType(concept) {} @@ -409,13 +400,13 @@ protected: } -#define Task_DeclareTypeAliases(ContextType) \ +#define Task_DeclareTypeAliases(ContextType, TimeProfiler) \ using JobConfig = task::JobConfig; \ using TaskConfig = task::TaskConfig; \ template using PersistentConfig = task::PersistentConfig; \ - using Job = task::Job; \ - using Task = task::Task; \ - using _Engine = task::Engine; \ + using Job = task::Job; \ + using Task = task::Task; \ + using _Engine = task::Engine; \ using Varying = task::Varying; \ template < typename T0, typename T1 > using VaryingSet2 = task::VaryingSet2; \ template < typename T0, typename T1, typename T2 > using VaryingSet3 = task::VaryingSet3; \ @@ -426,4 +417,16 @@ protected: template < typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7 > using VaryingSet8 = task::VaryingSet8; \ template < class T, int NUM > using VaryingArray = task::VaryingArray; + + +#include +#include + +#define Task_DeclareCategoryTimeProfilerClass(className, category) \ + class className : public PerformanceTimer { \ + public: \ + className(const std::string& label) : PerformanceTimer(label.c_str()), profileRange(category(), label.c_str()) {} \ + Duration profileRange; \ + }; + #endif // hifi_task_Task_h diff --git a/scripts/developer/utilities/render/deferredLighting.qml b/scripts/developer/utilities/render/deferredLighting.qml index 160ec26be0..dc81df48cb 100644 --- a/scripts/developer/utilities/render/deferredLighting.qml +++ b/scripts/developer/utilities/render/deferredLighting.qml @@ -37,9 +37,9 @@ Rectangle { anchors.left: parent.left anchors.right: parent.right - spacing: 20 + spacing: 5 Column { - spacing: 10 + spacing: 5 // padding: 10 Repeater { model: [ @@ -61,7 +61,7 @@ Rectangle { Column { - spacing: 10 + spacing: 5 Repeater { model: [ "Obscurance:LightingModel:enableObscurance", @@ -81,7 +81,7 @@ Rectangle { } Column { - spacing: 10 + spacing: 5 Repeater { model: [ "Ambient:LightingModel:enableAmbientLight", @@ -105,7 +105,7 @@ Rectangle { Column { anchors.left: parent.left anchors.right: parent.right - spacing: 10 + spacing: 5 Repeater { model: [ "Tone Mapping Exposure:ToneMapping:exposure:5.0:-5.0" ] @@ -211,9 +211,9 @@ Rectangle { Separator {} Row { - spacing: 10 + spacing: 5 Column { - spacing: 10 + spacing: 5 HifiControls.CheckBox { boxSize: 20 @@ -254,7 +254,7 @@ Rectangle { } Column { - spacing: 10 + spacing: 5 HifiControls.CheckBox { boxSize: 20 text: "Metas" From 859b187db6e3badd5477ea7dc409252fe04e2534 Mon Sep 17 00:00:00 2001 From: samcake Date: Tue, 8 May 2018 18:17:52 -0700 Subject: [PATCH 006/115] Separate panel for inspecting the engine --- scripts/developer/utilities/lib/jet/jet.js | 15 +++--- .../utilities/lib/jet/qml/TaskList.qml | 7 +-- .../utilities/render/deferredLighting.qml | 15 +++--- .../utilities/render/engineInspector.js | 13 +++++ .../utilities/render/engineInspector.qml | 30 +++++++++++ scripts/developer/utilities/render/luci.js | 53 +++++++++++++++---- 6 files changed, 100 insertions(+), 33 deletions(-) create mode 100644 scripts/developer/utilities/render/engineInspector.js create mode 100644 scripts/developer/utilities/render/engineInspector.qml diff --git a/scripts/developer/utilities/lib/jet/jet.js b/scripts/developer/utilities/lib/jet/jet.js index 39da9b6d90..c326a3a73e 100644 --- a/scripts/developer/utilities/lib/jet/jet.js +++ b/scripts/developer/utilities/lib/jet/jet.js @@ -46,19 +46,20 @@ function job_propKeys(job) { } // Use this function to create a functor that will print the content of the Job visited calling the specified 'printout' function -function job_print_functor(printout, maxDepth) { +function job_print_functor(printout, showProps, maxDepth) { if (maxDepth === undefined) maxDepth = 100 return function (job, depth, index) { var tab = " " var depthTab = ""; for (var d = 0; d < depth; d++) { depthTab += tab } - printout(depthTab + index + " " + job.objectName + " " + (job.enabled ? "on" : "off")) - var keys = job_propKeys(job); - for (var p=0; p < keys.length;p++) { - var prop = job[keys[p]] - printout(depthTab + tab + tab + typeof prop + " " + keys[p] + " " + prop); + printout(depthTab + index + " " + job.objectName + " " + (job.enabled ? "on " : "off ") + job.cpuRunTime + "ms") + if (showProps) { + var keys = job_propKeys(job); + for (var p=0; p < keys.length;p++) { + var prop = job[keys[p]] + printout(depthTab + tab + tab + typeof prop + " " + keys[p] + " " + prop); + } } - return true // return depth < maxDepth; } diff --git a/scripts/developer/utilities/lib/jet/qml/TaskList.qml b/scripts/developer/utilities/lib/jet/qml/TaskList.qml index fa004627a7..bd4b1e6c79 100644 --- a/scripts/developer/utilities/lib/jet/qml/TaskList.qml +++ b/scripts/developer/utilities/lib/jet/qml/TaskList.qml @@ -32,14 +32,9 @@ Rectangle { Component.onCompleted: { var message = "" - var functor = Jet.job_print_functor(function (line) { message += line + "\n"; }); + var functor = Jet.job_print_functor(function (line) { message += line + "\n"; }, false); Jet.task_traverseTree(rootConfig, functor); textArea.append(message); - } - function fromScript(mope) { - var message ='Received \n'; - message += mope; - textArea.append(message); } function clearWindow() { diff --git a/scripts/developer/utilities/render/deferredLighting.qml b/scripts/developer/utilities/render/deferredLighting.qml index dc81df48cb..d68b19c513 100644 --- a/scripts/developer/utilities/render/deferredLighting.qml +++ b/scripts/developer/utilities/render/deferredLighting.qml @@ -14,7 +14,6 @@ import QtQuick.Layouts 1.3 import "qrc:///qml/styles-uit" import "qrc:///qml/controls-uit" as HifiControls import "configSlider" -import "../lib/jet/qml" as Jet Rectangle { HifiConstants { id: hifi;} @@ -276,14 +275,12 @@ Rectangle { } } Separator {} - - Jet.TaskList { - rootConfig: Render - anchors.left: parent.left - anchors.right: parent.right - - height: 200 + HifiControls.Button { + text: "Engine" + // activeFocusOnPress: false + onClicked: { + sendToScript({method: "openEngineView"}); + } } } - //} } diff --git a/scripts/developer/utilities/render/engineInspector.js b/scripts/developer/utilities/render/engineInspector.js new file mode 100644 index 0000000000..dcf13157b5 --- /dev/null +++ b/scripts/developer/utilities/render/engineInspector.js @@ -0,0 +1,13 @@ + function openEngineTaskView() { + // Set up the qml ui + var qml = Script.resolvePath('engineInspector.qml'); + var window = new OverlayWindow({ + title: 'Render Engine', + source: qml, + width: 300, + height: 400 + }); + window.setPosition(200, 50); + //window.closed.connect(function() { Script.stop(); }); + } + openEngineTaskView(); \ No newline at end of file diff --git a/scripts/developer/utilities/render/engineInspector.qml b/scripts/developer/utilities/render/engineInspector.qml new file mode 100644 index 0000000000..6461e5d834 --- /dev/null +++ b/scripts/developer/utilities/render/engineInspector.qml @@ -0,0 +1,30 @@ +// +// deferredLighting.qml +// +// Created by Sam Gateau on 6/6/2016 +// Copyright 2016 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or https://www.apache.org/licenses/LICENSE-2.0.html +// +import QtQuick 2.7 +import QtQuick.Controls 1.4 +import QtQuick.Layouts 1.3 + +import "qrc:///qml/styles-uit" +import "qrc:///qml/controls-uit" as HifiControls + +import "../lib/jet/qml" as Jet + +Item { + HifiConstants { id: hifi;} + id: render; + anchors.fill: parent + + property var mainViewTask: Render.getConfig("RenderMainView") + + Jet.TaskList { + rootConfig: Render + anchors.fill: render + } +} \ No newline at end of file diff --git a/scripts/developer/utilities/render/luci.js b/scripts/developer/utilities/render/luci.js index 6482c884ff..005d96780a 100644 --- a/scripts/developer/utilities/render/luci.js +++ b/scripts/developer/utilities/render/luci.js @@ -64,9 +64,6 @@ button.editProperties({isActive: onLuciScreen}); wireEventBridge(onLuciScreen); } - - function fromQml(message) { - } button.clicked.connect(onClicked); tablet.screenChanged.connect(onScreenChanged); @@ -82,14 +79,6 @@ Controller.mouseMoveEvent.connect(function (e) { if (moveDebugCursor) setDebugCursor(e.x, e.y); }); - Script.scriptEnding.connect(function () { - if (onLuciScreen) { - tablet.gotoHomeScreen(); - } - button.clicked.disconnect(onClicked); - tablet.screenChanged.disconnect(onScreenChanged); - tablet.removeButton(button); - }); function setDebugCursor(x, y) { nx = (x / Window.innerWidth); @@ -98,4 +87,46 @@ Render.getConfig("RenderMainView").getConfig("Antialiasing").debugCursorTexcoord = { x: nx, y: ny }; } + + function fromQml(message) { + switch (message.method) { + case "openEngineView": + openEngineTaskView(); + break; + } + } + + + var engineInspectorView = null + function openEngineTaskView() { + if (engineInspectorView == null) { + var qml = Script.resolvePath('engineInspector.qml'); + var window = new OverlayWindow({ + title: 'Render Engine', + source: qml, + width: 300, + height: 400 + }); + window.setPosition(200, 50); + engineInspectorView = window + window.closed.connect(function() { engineInspectorView = null; }); + } else { + engineInspectorView.setPosition(200, 50); + } + } + + + + Script.scriptEnding.connect(function () { + if (onLuciScreen) { + tablet.gotoHomeScreen(); + } + button.clicked.disconnect(onClicked); + tablet.screenChanged.disconnect(onScreenChanged); + tablet.removeButton(button); + + if (engineInspectorView !== null) { + engineInspectorView.close() + } + }); }()); \ No newline at end of file From f08f77098dc22b8d3e40f199d63184fbec9e144d Mon Sep 17 00:00:00 2001 From: samcake Date: Wed, 9 May 2018 18:28:47 -0700 Subject: [PATCH 007/115] Adding a true ListView for the engine --- scripts/developer/utilities/lib/jet/jet.js | 9 +++ .../utilities/lib/jet/qml/TaskList.qml | 4 +- .../utilities/lib/jet/qml/TaskListView.qml | 67 +++++++++++++++++++ .../developer/utilities/lib/jet/qml/qmldir | 3 +- .../utilities/render/engineInspector.qml | 4 +- 5 files changed, 83 insertions(+), 4 deletions(-) create mode 100644 scripts/developer/utilities/lib/jet/qml/TaskListView.qml diff --git a/scripts/developer/utilities/lib/jet/jet.js b/scripts/developer/utilities/lib/jet/jet.js index c326a3a73e..5bebb99068 100644 --- a/scripts/developer/utilities/lib/jet/jet.js +++ b/scripts/developer/utilities/lib/jet/jet.js @@ -45,6 +45,15 @@ function job_propKeys(job) { return propKeys; } +// Use this function to create a functor that will fill the specifed array with one entry name per task and job and it s rank +function job_list_functor(jobList, maxDepth) { + if (maxDepth === undefined) maxDepth = 100 + return function (job, depth, index) { + jobList.push(job.objectName); + return depth < maxDepth; + } +} + // Use this function to create a functor that will print the content of the Job visited calling the specified 'printout' function function job_print_functor(printout, showProps, maxDepth) { if (maxDepth === undefined) maxDepth = 100 diff --git a/scripts/developer/utilities/lib/jet/qml/TaskList.qml b/scripts/developer/utilities/lib/jet/qml/TaskList.qml index bd4b1e6c79..b801b9171d 100644 --- a/scripts/developer/utilities/lib/jet/qml/TaskList.qml +++ b/scripts/developer/utilities/lib/jet/qml/TaskList.qml @@ -17,7 +17,9 @@ import "qrc:///qml/controls-uit" as HifiControls import "../jet.js" as Jet -Rectangle { +Rectangle { + HifiConstants { id: hifi;} + color: hifi.colors.baseGray; id: root // width: parent ? parent.width : 200 // height: parent ? parent.height : 400 diff --git a/scripts/developer/utilities/lib/jet/qml/TaskListView.qml b/scripts/developer/utilities/lib/jet/qml/TaskListView.qml new file mode 100644 index 0000000000..f8775d56b9 --- /dev/null +++ b/scripts/developer/utilities/lib/jet/qml/TaskListView.qml @@ -0,0 +1,67 @@ +// +// jet/TaskListView.qml +// +// Created by Sam Gateau, 2018/05/09 +// Copyright 2018 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +import QtQuick 2.7 +import QtQuick.Controls 1.4 as Original +import QtQuick.Controls.Styles 1.4 + +import "qrc:///qml/styles-uit" +import "qrc:///qml/controls-uit" as HifiControls + +import "../jet.js" as Jet + +Rectangle { + HifiConstants { id: hifi;} + color: hifi.colors.baseGray; + id: root + + // width: parent ? parent.width : 200 + // height: parent ? parent.height : 400 + property var rootConfig : Workload + property var myArray : [] + + Component.onCompleted: { + var message = "" + var functor = Jet.job_print_functor(function (line) { message += line + "\n"; }, false); + + functor = Jet.job_list_functor(root.myArray); + + Jet.task_traverseTree(rootConfig, functor); + //print(JSON.stringify(root.myArray)) + // theView.model = root.myArray.length + for (var i = 0; i < root.myArray.length; i++) { + jobsModel.append({"on": true, "name": root.myArray[i]}) + } + // theView.model = root.myArray + } + + function getJobName(i) { + return root.myArray[i]; + } + + ListModel { + id: jobsModel + } + + Component { + id: itemDelegate + //HifiControls.Label { text: "I am item number: " + index } + HifiControls.CheckBox { text: name + index; + checked: true; } + } + + ListView { + id: theView + anchors.fill: parent + model: jobsModel + delegate: itemDelegate + } + +} \ No newline at end of file diff --git a/scripts/developer/utilities/lib/jet/qml/qmldir b/scripts/developer/utilities/lib/jet/qml/qmldir index f926d8cc67..3134545625 100644 --- a/scripts/developer/utilities/lib/jet/qml/qmldir +++ b/scripts/developer/utilities/lib/jet/qml/qmldir @@ -1 +1,2 @@ -TaskList 1.0 TaskList.qml \ No newline at end of file +TaskList 1.0 TaskList.qml +TaskViewList 1.0 TaskViewList.qml \ No newline at end of file diff --git a/scripts/developer/utilities/render/engineInspector.qml b/scripts/developer/utilities/render/engineInspector.qml index 6461e5d834..1b9941e64e 100644 --- a/scripts/developer/utilities/render/engineInspector.qml +++ b/scripts/developer/utilities/render/engineInspector.qml @@ -20,10 +20,10 @@ Item { HifiConstants { id: hifi;} id: render; anchors.fill: parent - + property var mainViewTask: Render.getConfig("RenderMainView") - Jet.TaskList { + Jet.TaskListView { rootConfig: Render anchors.fill: render } From bf85034f3618d267f0187fe82ea05dbc6236a450 Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Thu, 10 May 2018 02:08:19 -0700 Subject: [PATCH 008/115] Tree view comming together for the engine! --- scripts/developer/utilities/lib/jet/jet.js | 6 +- .../utilities/lib/jet/qml/TaskListView.qml | 90 +++++++++++++++---- 2 files changed, 76 insertions(+), 20 deletions(-) diff --git a/scripts/developer/utilities/lib/jet/jet.js b/scripts/developer/utilities/lib/jet/jet.js index 5bebb99068..18027ea4bd 100644 --- a/scripts/developer/utilities/lib/jet/jet.js +++ b/scripts/developer/utilities/lib/jet/jet.js @@ -12,15 +12,15 @@ // traverse task tree function task_traverse(root, functor, depth) { - // if (root.isTask()) { + if (root.isTask()) { depth++; for (var i = 0; i 0 ? "." : "") + node.get(jobTreePath[n]).name + node = node.get(jobTreePath[n]).subNode + } + node.append(newItem) + jobTreePath.push(0); + } else if (jobTreePath.length >= depth) { + var node = jobsRoot; + for (var n = 0; n < (depth - 1); n++) { + newItem.path += (n > 0 ? "." : "") + node.get(jobTreePath[n]).name + node = node.get(jobTreePath[n]).subNode + } + node.append(newItem) + jobTreePath[depth-1] = index; + while (jobTreePath.length > depth) { + jobTreePath.pop(); + } + } + } + return true; + } Jet.task_traverseTree(rootConfig, functor); - //print(JSON.stringify(root.myArray)) - // theView.model = root.myArray.length - for (var i = 0; i < root.myArray.length; i++) { - jobsModel.append({"on": true, "name": root.myArray[i]}) - } - // theView.model = root.myArray - } - - function getJobName(i) { - return root.myArray[i]; } ListModel { @@ -51,17 +77,47 @@ Rectangle { } Component { - id: itemDelegate - //HifiControls.Label { text: "I am item number: " + index } - HifiControls.CheckBox { text: name + index; - checked: true; } + id: objRecursiveDelegate + Column { + id: objRecursiveColumn + clip: true + visible: model.init + + MouseArea { + width: objRow.implicitWidth + height: objRow.implicitHeight + onDoubleClicked: { + for(var i = 1; i < parent.children.length - 1; ++i) { + parent.children[i].visible = !parent.children[i].visible + } + } + Row { + id: objRow + Item { + height: 1 + width: model.level * 15 + } + HifiControls.CheckBox { + property var config: root.rootConfig.getConfig(model.path + "." + model.name); + text: (objRecursiveColumn.children.length > 2 ? + objRecursiveColumn.children[1].visible ? + qsTr("- ") : qsTr("+ ") : qsTr(" ")) + model.name + " ms=" + config.cpuRunTime.toFixed(3) + checked: config.enabled + } + } + } + Repeater { + model: subNode + delegate: objRecursiveDelegate + } + } } ListView { id: theView anchors.fill: parent model: jobsModel - delegate: itemDelegate + delegate: objRecursiveDelegate } } \ No newline at end of file From 02be965271154c9b29dbdb3e60aaffdfe14431bf Mon Sep 17 00:00:00 2001 From: samcake Date: Thu, 10 May 2018 18:10:01 -0700 Subject: [PATCH 009/115] more stuff fixed --- .../src/procedural/ProceduralSkybox.cpp | 7 +++++- libraries/render/src/render/Engine.cpp | 3 +-- libraries/render/src/render/Engine.h | 14 ++++++----- libraries/task/src/task/Task.h | 2 +- .../utilities/lib/jet/qml/TaskListView.qml | 24 +++++++++---------- 5 files changed, 27 insertions(+), 23 deletions(-) diff --git a/libraries/procedural/src/procedural/ProceduralSkybox.cpp b/libraries/procedural/src/procedural/ProceduralSkybox.cpp index 0c6501928b..806302d7ef 100644 --- a/libraries/procedural/src/procedural/ProceduralSkybox.cpp +++ b/libraries/procedural/src/procedural/ProceduralSkybox.cpp @@ -21,6 +21,7 @@ ProceduralSkybox::ProceduralSkybox() : graphics::Skybox() { _procedural._vertexSource = skybox_vert::getSource(); _procedural._opaquefragmentSource = skybox_frag::getSource(); + _procedural._transparentfragmentSource = skybox_frag::getSource(); // Adjust the pipeline state for background using the stencil test _procedural.setDoesFade(false); // Must match PrepareStencil::STENCIL_BACKGROUND @@ -60,9 +61,13 @@ void ProceduralSkybox::render(gpu::Batch& batch, const ViewFrustum& viewFrustum, batch.setModelTransform(Transform()); // only for Mac auto& procedural = skybox._procedural; - procedural.prepare(batch, glm::vec3(0), glm::vec3(1), glm::quat()); + +// procedural.prepare(batch, glm::vec3(0), glm::vec3(1), glm::quat()); + procedural.prepare(batch, glm::vec3(0), glm::vec3(1), glm::quat(), glm::vec4(glm::vec3(1.0f), 0.9)); + auto textureSlot = procedural.getOpaqueShader()->getTextures().findLocation("cubeMap"); auto bufferSlot = procedural.getOpaqueShader()->getUniformBuffers().findLocation("skyboxBuffer"); + skybox.prepare(batch, textureSlot, bufferSlot); batch.draw(gpu::TRIANGLE_STRIP, 4); } diff --git a/libraries/render/src/render/Engine.cpp b/libraries/render/src/render/Engine.cpp index b0842d63cd..de282bed9f 100644 --- a/libraries/render/src/render/Engine.cpp +++ b/libraries/render/src/render/Engine.cpp @@ -36,8 +36,7 @@ public: } }; -Engine::Engine() : Task(EngineTask::JobModel::create("Engine")), - _renderContext(std::make_shared()) +Engine::Engine() : _Engine(EngineTask::JobModel::create("Engine"), std::make_shared()) { } diff --git a/libraries/render/src/render/Engine.h b/libraries/render/src/render/Engine.h index f444416a3f..7a5f7b7ce8 100644 --- a/libraries/render/src/render/Engine.h +++ b/libraries/render/src/render/Engine.h @@ -82,7 +82,9 @@ namespace render { // The render engine holds all render tasks, and is itself a render task. // State flows through tasks to jobs via the render and scene contexts - // the engine should not be known from its jobs. - class Engine : public Task { + class Engine : public _Engine { + + //class Engine : public Task { public: Engine(); @@ -93,19 +95,19 @@ namespace render { void load(); // Register the scene - void registerScene(const ScenePointer& scene) { _renderContext->_scene = scene; } + void registerScene(const ScenePointer& scene) { _context->_scene = scene; } // acces the RenderContext - RenderContextPointer getRenderContext() const { return _renderContext; } + RenderContextPointer getRenderContext() const { return _context; } // Render a frame // Must have a scene registered and a context set - void run() { assert(_renderContext); Task::run(_renderContext); } + // void run() { assert(_renderContext); Task::run(_renderContext); } protected: - RenderContextPointer _renderContext; + // RenderContextPointer _renderContext; - void run(const RenderContextPointer& context) override { assert(_renderContext); Task::run(_renderContext); } + // void run(const RenderContextPointer& context) override { assert(_renderContext); Task::run(_renderContext); } }; using EnginePointer = std::shared_ptr; diff --git a/libraries/task/src/task/Task.h b/libraries/task/src/task/Task.h index c9a3285443..ef1ca60d57 100644 --- a/libraries/task/src/task/Task.h +++ b/libraries/task/src/task/Task.h @@ -379,7 +379,7 @@ public: using TaskType = Task; using ConceptPointer = typename TaskType::ConceptPointer; - Engine(ConceptPointer concept) : TaskType(concept) {} + Engine(const ConceptPointer& concept, const ContextPointer& context) : TaskType(concept), _context(context) {} ~Engine() = default; void reset(const ContextPointer& context) { _context = context; } diff --git a/scripts/developer/utilities/lib/jet/qml/TaskListView.qml b/scripts/developer/utilities/lib/jet/qml/TaskListView.qml index 998abdef0e..eff456d838 100644 --- a/scripts/developer/utilities/lib/jet/qml/TaskListView.qml +++ b/scripts/developer/utilities/lib/jet/qml/TaskListView.qml @@ -20,7 +20,7 @@ import "../jet.js" as Jet Rectangle { HifiConstants { id: hifi;} color: hifi.colors.baseGray; - id: root + id: root; // width: parent ? parent.width : 200 // height: parent ? parent.height : 400 @@ -29,11 +29,7 @@ Rectangle { Component.onCompleted: { var message = "" - // functor = Jet.job_print_functor(function (line) { message += line + "\n"; }, false); - - // functor = Jet.job_list_functor(root.myArray); - - var maxDepth = 4; + var maxDepth = 3; var jobTreePath = [] var jobsRoot; @@ -72,6 +68,7 @@ Rectangle { Jet.task_traverseTree(rootConfig, functor); } + ListModel { id: jobsModel } @@ -101,7 +98,7 @@ Rectangle { property var config: root.rootConfig.getConfig(model.path + "." + model.name); text: (objRecursiveColumn.children.length > 2 ? objRecursiveColumn.children[1].visible ? - qsTr("- ") : qsTr("+ ") : qsTr(" ")) + model.name + " ms=" + config.cpuRunTime.toFixed(3) + qsTr("- ") : qsTr("+ ") : qsTr(" ")) + model.name + " ms=" + config.cpuRunTime.toFixed(2) checked: config.enabled } } @@ -113,11 +110,12 @@ Rectangle { } } - ListView { - id: theView - anchors.fill: parent - model: jobsModel - delegate: objRecursiveDelegate + Original.ScrollView { + anchors.fill: parent + ListView { + id: theView + model: jobsModel + delegate: objRecursiveDelegate + } } - } \ No newline at end of file From 986318ccfdfe367c08756dbde6ad9caff03bdf41 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Mon, 14 May 2018 16:33:28 -0700 Subject: [PATCH 010/115] Adding preliminary scripts to repro getChildren issue. --- scripts/defaultScripts.js | 4 ++- scripts/system/createobject.js | 60 ++++++++++++++++++++++++++++++++++ scripts/system/deleteobject.js | 41 +++++++++++++++++++++++ 3 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 scripts/system/createobject.js create mode 100644 scripts/system/deleteobject.js diff --git a/scripts/defaultScripts.js b/scripts/defaultScripts.js index 71755e3abb..13994a7e3c 100644 --- a/scripts/defaultScripts.js +++ b/scripts/defaultScripts.js @@ -30,7 +30,9 @@ var DEFAULT_SCRIPTS_COMBINED = [ "system/dialTone.js", "system/firstPersonHMD.js", "system/tablet-ui/tabletUI.js", - "system/emote.js" + "system/emote.js", + "system/createobject.js", + "system/deleteobject.js" ]; var DEFAULT_SCRIPTS_SEPARATE = [ "system/controllers/controllerScripts.js" diff --git a/scripts/system/createobject.js b/scripts/system/createobject.js new file mode 100644 index 0000000000..527bf64315 --- /dev/null +++ b/scripts/system/createobject.js @@ -0,0 +1,60 @@ +(function(){ + var button; + var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + + function createEntity(description, position, parent) { + var entity = Entities.addEntity({ + type: "Sphere", + position: position, + dimensions: Vec3.HALF, + dynamic: true, + collisionless: true, + parentID: parent, + lifetime: 300 // Delete after 5 minutes. + }); + print(description + ": " + entity); + return entity; + } + + + function createBabies() { + var position = Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, {x: 0, y: 2, z: -5})); + var root = createEntity("Root", position, Uuid.NULL); + var ctr; + var avatarChildren = []; + // make five children. + for(var ctr = 0; ctr < 5; ctr++) { + avatarChildren.append(CreateEntity("Child" + ctr, Vec3.sum(position, { x: ctr, y: -1, z: ctr }), root)); + }} + + button = tablet.addButton({ + icon: "icons/tablet-icons/clap-i.svg", + text: "Create OBJ", + sortOrder: 1 + }); + + button.clicked.connect(createBabies); + + Script.scriptEnding.connect(function () { + button.clicked.disconnect(createBabies); + if (tablet) { + tablet.removeButton(button); + } + }); + +/* var entityID = Entities.addEntity({*/ + //type: "Box", + //position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0.75, z: -5 })), + //dimensions: { x: 0.5, y: 0.5, z: 0.5 }, + //dynamic: true, + //collisionless: false, + //userData: "{ \"grabbableKey\": { \"grabbable\": true, \"kinematic\": false } }", + //lifetime: 300 // Delete after 5 minutes. + //}); + + /*var actionID = Entities.addAction("slider", entityID, {*/ + //axis: { x: 0, y: 1, z: 0 }, + //linearLow: 0, + //linearHigh: 0.6 + /*});*/ +}()); diff --git a/scripts/system/deleteobject.js b/scripts/system/deleteobject.js new file mode 100644 index 0000000000..2c366b5546 --- /dev/null +++ b/scripts/system/deleteobject.js @@ -0,0 +1,41 @@ +(function(){ + var button; + var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + + function destroyBabies() { + var avatarEntityID = + for(var ctr = 0; ctr < getChildrenIDs(); ctr++) { + avatarChildren.append(CreateEntity("Child" + ctr, Vec3.sum(position, { x: ctr, y: -1, z: ctr }), root)); + }} + + button = tablet.addButton({ + icon: "icons/tablet-icons/clap-i.svg", + text: "Destroy OBJ", + sortOrder: 1 + }); + + button.clicked.connect(createBabies); + + Script.scriptEnding.connect(function () { + button.clicked.disconnect(createBabies); + if (tablet) { + tablet.removeButton(button); + } + }); + +/* var entityID = Entities.addEntity({*/ + //type: "Box", + //position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0.75, z: -5 })), + //dimensions: { x: 0.5, y: 0.5, z: 0.5 }, + //dynamic: true, + //collisionless: false, + //userData: "{ \"grabbableKey\": { \"grabbable\": true, \"kinematic\": false } }", + //lifetime: 300 // Delete after 5 minutes. + //}); + + /*var actionID = Entities.addAction("slider", entityID, {*/ + //axis: { x: 0, y: 1, z: 0 }, + //linearLow: 0, + //linearHigh: 0.6 + /*});*/ +}()); From bd6905b3d2c73d75d281cd0d0a98db7aa8b943a2 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Mon, 14 May 2018 18:25:39 -0700 Subject: [PATCH 011/115] Adding possible solution to issue#1934. --- .../entities/src/EntityScriptingInterface.cpp | 28 +++++-- scripts/defaultScripts.js | 3 +- scripts/system/createobject.js | 77 ++++++++++++++----- scripts/system/deleteobject.js | 15 ++-- 4 files changed, 85 insertions(+), 38 deletions(-) diff --git a/libraries/entities/src/EntityScriptingInterface.cpp b/libraries/entities/src/EntityScriptingInterface.cpp index 7c16214a78..65bacfec5a 100644 --- a/libraries/entities/src/EntityScriptingInterface.cpp +++ b/libraries/entities/src/EntityScriptingInterface.cpp @@ -1660,14 +1660,28 @@ QVector EntityScriptingInterface::getChildrenIDs(const QUuid& parentID) { return result; } - EntityItemPointer entity = _entityTree->findEntityByEntityItemID(parentID); - if (!entity) { - qCDebug(entities) << "EntityScriptingInterface::getChildrenIDs - no entity with ID" << parentID; - return result; - } - + //EntityItemPointer entity = _entityTree->findEntityByEntityItemID(parentID); + //if (!entity) { + // qCDebug(entities) << "EntityScriptingInterface::getChildrenIDs - no entity with ID" << parentID; + // return result; + //} _entityTree->withReadLock([&] { - entity->forEachChild([&](SpatiallyNestablePointer child) { + QSharedPointer parentFinder = DependencyManager::get(); + if (!parentFinder) { + return; + } + bool success; + SpatiallyNestableWeakPointer parentWP = parentFinder->find(parentID, success); + if (!success) { + return; + } + SpatiallyNestablePointer parent = parentWP.lock(); + if (!parent) { + return; + } + //_entityTree->withReadLock([&] { + //entity->forEachChild([&](SpatiallyNestablePointer child) { + parent->forEachChild([&](SpatiallyNestablePointer child) { result.push_back(child->getID()); }); }); diff --git a/scripts/defaultScripts.js b/scripts/defaultScripts.js index 13994a7e3c..12e9a4fd58 100644 --- a/scripts/defaultScripts.js +++ b/scripts/defaultScripts.js @@ -31,8 +31,7 @@ var DEFAULT_SCRIPTS_COMBINED = [ "system/firstPersonHMD.js", "system/tablet-ui/tabletUI.js", "system/emote.js", - "system/createobject.js", - "system/deleteobject.js" + "system/createobject.js" ]; var DEFAULT_SCRIPTS_SEPARATE = [ "system/controllers/controllerScripts.js" diff --git a/scripts/system/createobject.js b/scripts/system/createobject.js index 527bf64315..887313130c 100644 --- a/scripts/system/createobject.js +++ b/scripts/system/createobject.js @@ -3,34 +3,69 @@ var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); function createEntity(description, position, parent) { - var entity = Entities.addEntity({ - type: "Sphere", - position: position, - dimensions: Vec3.HALF, - dynamic: true, - collisionless: true, - parentID: parent, - lifetime: 300 // Delete after 5 minutes. - }); - print(description + ": " + entity); - return entity; + var entity = Entities.addEntity({ + type: "Sphere", + position: position, + dimensions: Vec3.HALF, + dynamic: true, + collisionless: true, + parentID: parent, + lifetime: 300 // Delete after 5 minutes. + }); + //print(description + ": " + entity); + return entity; } - function createBabies() { - var position = Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, {x: 0, y: 2, z: -5})); - var root = createEntity("Root", position, Uuid.NULL); - var ctr; - var avatarChildren = []; - // make five children. - for(var ctr = 0; ctr < 5; ctr++) { - avatarChildren.append(CreateEntity("Child" + ctr, Vec3.sum(position, { x: ctr, y: -1, z: ctr }), root)); - }} + var position = Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, {x: 0, y: 2, z: -5})); + //var root = createEntity("Root", position, Uuid.NULL); + var avatarChildren = []; + var overlayChildren = []; + var entityChildren = []; + var avatar = MyAvatar.sessionUUID; + if (avatar === Uuid.NULL) { + avatar = MyAvatar.SELF_ID; + } + var textToWrite = "Avatar UUID: " + avatar + "\n\n"; + // make five children. + for(var ctr = 0; ctr < 5; ctr++) { + var entity = createEntity("AvatarChild" + ctr, Vec3.sum(position, { x: ctr, y: -1, z: ctr }), avatar); + avatarChildren.push(entity); + textToWrite += "AvatarChild" + ctr + " UUID: " + entity + "\n"; + } + var overlay = Overlays.addOverlay("cube", { + position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0, z: -3 })), + rotation: MyAvatar.orientation, + dimensions: { x: 0.3, y: 0.3, z: 0.3 }, + solid: true + }); + textToWrite += "\nOverlay UUID: " + overlay + "\n\n"; + for(var ctr = 0; ctr < 5; ctr++) { + var entity = createEntity("OverlayChild" + ctr, Vec3.sum(position, { x: ctr, y: -1, z: ctr }), overlay); + overlayChildren.push(entity); + textToWrite += "OverlayChild" + ctr + " UUID: " + entity + "\n"; + } + var rootEntity = Entities.addEntity({ + type: "Sphere", + position: position, + dimensions: Vec3.HALF, + dynamic: true, + collisionless: true, + lifetime: 300 // Delete after 5 minutes. + }); + textToWrite += "\nEntity UUID: " + rootEntity + "\n\n"; + for(var ctr = 0; ctr < 5; ctr++) { + var entity = createEntity("EntityChild" + ctr, Vec3.sum(position, { x: ctr, y: -1, z: ctr }), rootEntity); + entityChildren.push(entity); + textToWrite += "EntityChild" + ctr + " UUID: " + entity + "\n"; + } + console.log(textToWrite); + } button = tablet.addButton({ icon: "icons/tablet-icons/clap-i.svg", text: "Create OBJ", - sortOrder: 1 + sortOrder: 12 }); button.clicked.connect(createBabies); diff --git a/scripts/system/deleteobject.js b/scripts/system/deleteobject.js index 2c366b5546..ff65762497 100644 --- a/scripts/system/deleteobject.js +++ b/scripts/system/deleteobject.js @@ -3,21 +3,20 @@ var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); function destroyBabies() { - var avatarEntityID = - for(var ctr = 0; ctr < getChildrenIDs(); ctr++) { - avatarChildren.append(CreateEntity("Child" + ctr, Vec3.sum(position, { x: ctr, y: -1, z: ctr }), root)); - }} + // TODO: destroy babies + } + button = tablet.addButton({ - icon: "icons/tablet-icons/clap-i.svg", + icon: "icons/tablet-icons/clap-a.svg", text: "Destroy OBJ", - sortOrder: 1 + sortOrder: 13 }); - button.clicked.connect(createBabies); + button.clicked.connect(destroyBabies); Script.scriptEnding.connect(function () { - button.clicked.disconnect(createBabies); + button.clicked.disconnect(destroyBabies); if (tablet) { tablet.removeButton(button); } From f82e597ac7bf45dc654a1f0e3b6d1e5d85b1a7a9 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Tue, 15 May 2018 09:34:07 -0700 Subject: [PATCH 012/115] Updating documentation for getChildrenIDs + fixing issue #1934 --- interface/src/ui/overlays/Overlays.h | 2 +- libraries/entities/src/EntityScriptingInterface.cpp | 8 -------- libraries/entities/src/EntityScriptingInterface.h | 8 ++++---- scripts/defaultScripts.js | 3 +-- 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/interface/src/ui/overlays/Overlays.h b/interface/src/ui/overlays/Overlays.h index cf1151b46a..b2728e68b2 100644 --- a/interface/src/ui/overlays/Overlays.h +++ b/interface/src/ui/overlays/Overlays.h @@ -482,7 +482,7 @@ public slots: /**jsdoc * Check if there is an overlay of a given ID. - * @function Overlays.isAddedOverly + * @function Overlays.isAddedOverlay * @param {Uuid} overlayID - The ID to check. * @returns {boolean} true if an overlay with the given ID exists, false otherwise. */ diff --git a/libraries/entities/src/EntityScriptingInterface.cpp b/libraries/entities/src/EntityScriptingInterface.cpp index 65bacfec5a..2558cb4ed7 100644 --- a/libraries/entities/src/EntityScriptingInterface.cpp +++ b/libraries/entities/src/EntityScriptingInterface.cpp @@ -1659,12 +1659,6 @@ QVector EntityScriptingInterface::getChildrenIDs(const QUuid& parentID) { if (!_entityTree) { return result; } - - //EntityItemPointer entity = _entityTree->findEntityByEntityItemID(parentID); - //if (!entity) { - // qCDebug(entities) << "EntityScriptingInterface::getChildrenIDs - no entity with ID" << parentID; - // return result; - //} _entityTree->withReadLock([&] { QSharedPointer parentFinder = DependencyManager::get(); if (!parentFinder) { @@ -1679,8 +1673,6 @@ QVector EntityScriptingInterface::getChildrenIDs(const QUuid& parentID) { if (!parent) { return; } - //_entityTree->withReadLock([&] { - //entity->forEachChild([&](SpatiallyNestablePointer child) { parent->forEachChild([&](SpatiallyNestablePointer child) { result.push_back(child->getID()); }); diff --git a/libraries/entities/src/EntityScriptingInterface.h b/libraries/entities/src/EntityScriptingInterface.h index 7e47d9e2d4..46a994e183 100644 --- a/libraries/entities/src/EntityScriptingInterface.h +++ b/libraries/entities/src/EntityScriptingInterface.h @@ -1216,12 +1216,12 @@ public slots: /**jsdoc - * Get the IDs of entities, overlays, and avatars that are directly parented to an entity. To get all descendants of an - * entity, recurse on the IDs returned by the function. + * Get the IDs of entities, overlays, and avatars that are directly parented to an entity, overlay, or avatar model. To get all descendants of an + * entity; overlay; or avatar, recurse on the IDs returned by the function. * @function Entities.getChildrenIDs - * @param {Uuid} parentID - The ID of the entity to get the children IDs of. + * @param {Uuid} parentID - The ID of the entity, overlay, or avatar to get the children IDs of. * @returns {Uuid[]} An array of entity, overlay, and avatar IDs that are parented directly to the parentID - * entity. Does not include children's children, etc. The array is empty if no children can be found or + * entity, overlay, or avatar. Does not include children's children, etc. The array is empty if no children can be found or * parentID cannot be found. * @example Report the children of an entity. * function createEntity(description, position, parent) { diff --git a/scripts/defaultScripts.js b/scripts/defaultScripts.js index 12e9a4fd58..71755e3abb 100644 --- a/scripts/defaultScripts.js +++ b/scripts/defaultScripts.js @@ -30,8 +30,7 @@ var DEFAULT_SCRIPTS_COMBINED = [ "system/dialTone.js", "system/firstPersonHMD.js", "system/tablet-ui/tabletUI.js", - "system/emote.js", - "system/createobject.js" + "system/emote.js" ]; var DEFAULT_SCRIPTS_SEPARATE = [ "system/controllers/controllerScripts.js" From 839d4a3bdaa961a0614b80bd67c665f68dc95839 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Tue, 15 May 2018 09:36:32 -0700 Subject: [PATCH 013/115] removing test script --- scripts/system/createobject.js | 95 ---------------------------------- 1 file changed, 95 deletions(-) delete mode 100644 scripts/system/createobject.js diff --git a/scripts/system/createobject.js b/scripts/system/createobject.js deleted file mode 100644 index 887313130c..0000000000 --- a/scripts/system/createobject.js +++ /dev/null @@ -1,95 +0,0 @@ -(function(){ - var button; - var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); - - function createEntity(description, position, parent) { - var entity = Entities.addEntity({ - type: "Sphere", - position: position, - dimensions: Vec3.HALF, - dynamic: true, - collisionless: true, - parentID: parent, - lifetime: 300 // Delete after 5 minutes. - }); - //print(description + ": " + entity); - return entity; - } - - function createBabies() { - var position = Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, {x: 0, y: 2, z: -5})); - //var root = createEntity("Root", position, Uuid.NULL); - var avatarChildren = []; - var overlayChildren = []; - var entityChildren = []; - var avatar = MyAvatar.sessionUUID; - if (avatar === Uuid.NULL) { - avatar = MyAvatar.SELF_ID; - } - var textToWrite = "Avatar UUID: " + avatar + "\n\n"; - // make five children. - for(var ctr = 0; ctr < 5; ctr++) { - var entity = createEntity("AvatarChild" + ctr, Vec3.sum(position, { x: ctr, y: -1, z: ctr }), avatar); - avatarChildren.push(entity); - textToWrite += "AvatarChild" + ctr + " UUID: " + entity + "\n"; - } - var overlay = Overlays.addOverlay("cube", { - position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0, z: -3 })), - rotation: MyAvatar.orientation, - dimensions: { x: 0.3, y: 0.3, z: 0.3 }, - solid: true - }); - textToWrite += "\nOverlay UUID: " + overlay + "\n\n"; - for(var ctr = 0; ctr < 5; ctr++) { - var entity = createEntity("OverlayChild" + ctr, Vec3.sum(position, { x: ctr, y: -1, z: ctr }), overlay); - overlayChildren.push(entity); - textToWrite += "OverlayChild" + ctr + " UUID: " + entity + "\n"; - } - var rootEntity = Entities.addEntity({ - type: "Sphere", - position: position, - dimensions: Vec3.HALF, - dynamic: true, - collisionless: true, - lifetime: 300 // Delete after 5 minutes. - }); - textToWrite += "\nEntity UUID: " + rootEntity + "\n\n"; - for(var ctr = 0; ctr < 5; ctr++) { - var entity = createEntity("EntityChild" + ctr, Vec3.sum(position, { x: ctr, y: -1, z: ctr }), rootEntity); - entityChildren.push(entity); - textToWrite += "EntityChild" + ctr + " UUID: " + entity + "\n"; - } - console.log(textToWrite); - } - - button = tablet.addButton({ - icon: "icons/tablet-icons/clap-i.svg", - text: "Create OBJ", - sortOrder: 12 - }); - - button.clicked.connect(createBabies); - - Script.scriptEnding.connect(function () { - button.clicked.disconnect(createBabies); - if (tablet) { - tablet.removeButton(button); - } - }); - -/* var entityID = Entities.addEntity({*/ - //type: "Box", - //position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0.75, z: -5 })), - //dimensions: { x: 0.5, y: 0.5, z: 0.5 }, - //dynamic: true, - //collisionless: false, - //userData: "{ \"grabbableKey\": { \"grabbable\": true, \"kinematic\": false } }", - //lifetime: 300 // Delete after 5 minutes. - //}); - - /*var actionID = Entities.addAction("slider", entityID, {*/ - //axis: { x: 0, y: 1, z: 0 }, - //linearLow: 0, - //linearHigh: 0.6 - /*});*/ -}()); From 9269bd261965dee53c1f489fcdd0ec1267bd9beb Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Tue, 15 May 2018 09:37:42 -0700 Subject: [PATCH 014/115] removing dummy script --- scripts/system/deleteobject.js | 40 ---------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 scripts/system/deleteobject.js diff --git a/scripts/system/deleteobject.js b/scripts/system/deleteobject.js deleted file mode 100644 index ff65762497..0000000000 --- a/scripts/system/deleteobject.js +++ /dev/null @@ -1,40 +0,0 @@ -(function(){ - var button; - var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); - - function destroyBabies() { - // TODO: destroy babies - } - - - button = tablet.addButton({ - icon: "icons/tablet-icons/clap-a.svg", - text: "Destroy OBJ", - sortOrder: 13 - }); - - button.clicked.connect(destroyBabies); - - Script.scriptEnding.connect(function () { - button.clicked.disconnect(destroyBabies); - if (tablet) { - tablet.removeButton(button); - } - }); - -/* var entityID = Entities.addEntity({*/ - //type: "Box", - //position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0.75, z: -5 })), - //dimensions: { x: 0.5, y: 0.5, z: 0.5 }, - //dynamic: true, - //collisionless: false, - //userData: "{ \"grabbableKey\": { \"grabbable\": true, \"kinematic\": false } }", - //lifetime: 300 // Delete after 5 minutes. - //}); - - /*var actionID = Entities.addAction("slider", entityID, {*/ - //axis: { x: 0, y: 1, z: 0 }, - //linearLow: 0, - //linearHigh: 0.6 - /*});*/ -}()); From 92e9a8e064058644efd50f25bb03692c5c003597 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Tue, 15 May 2018 16:32:01 -0700 Subject: [PATCH 015/115] fixing typo in documentation. --- libraries/entities/src/EntityScriptingInterface.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libraries/entities/src/EntityScriptingInterface.h b/libraries/entities/src/EntityScriptingInterface.h index 46a994e183..eefb254c2a 100644 --- a/libraries/entities/src/EntityScriptingInterface.h +++ b/libraries/entities/src/EntityScriptingInterface.h @@ -1216,8 +1216,7 @@ public slots: /**jsdoc - * Get the IDs of entities, overlays, and avatars that are directly parented to an entity, overlay, or avatar model. To get all descendants of an - * entity; overlay; or avatar, recurse on the IDs returned by the function. + * Get the IDs of entities, overlays, and avatars that are directly parented to an entity, overlay, or avatar model. Recurse on the IDs returned by the function to get all descendants of an entity, overlay, or avatar. * @function Entities.getChildrenIDs * @param {Uuid} parentID - The ID of the entity, overlay, or avatar to get the children IDs of. * @returns {Uuid[]} An array of entity, overlay, and avatar IDs that are parented directly to the parentID From 86a8672c5a7a230ece2a79341299cb2dab186334 Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Thu, 17 May 2018 10:17:22 -0700 Subject: [PATCH 016/115] Initialize Qt/openssl before RSA keygen to prevent collision --- libraries/networking/src/RSAKeypairGenerator.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/networking/src/RSAKeypairGenerator.cpp b/libraries/networking/src/RSAKeypairGenerator.cpp index 8ca8b81ea3..dcd4e7fd3c 100644 --- a/libraries/networking/src/RSAKeypairGenerator.cpp +++ b/libraries/networking/src/RSAKeypairGenerator.cpp @@ -15,6 +15,7 @@ #include #include +#include #include #include "NetworkLogging.h" @@ -25,7 +26,8 @@ RSAKeypairGenerator::RSAKeypairGenerator(QObject* parent) : QObject(parent) { - + // Ensure openssl/Qt config is set up. + QSslConfiguration::defaultConfiguration(); } void RSAKeypairGenerator::generateKeypair() { From fe92cf0c4788bc2942253d9ade93849d344cf7b2 Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Thu, 17 May 2018 13:34:38 -0700 Subject: [PATCH 017/115] Move fix up a level to bit a little more general --- libraries/networking/src/AccountManager.cpp | 3 +++ libraries/networking/src/RSAKeypairGenerator.cpp | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libraries/networking/src/AccountManager.cpp b/libraries/networking/src/AccountManager.cpp index 049129b2ba..1f6932094c 100644 --- a/libraries/networking/src/AccountManager.cpp +++ b/libraries/networking/src/AccountManager.cpp @@ -729,6 +729,9 @@ void AccountManager::generateNewKeypair(bool isUserKeypair, const QUuid& domainI return; } + // Ensure openssl/Qt config is set up. + QSslConfiguration::defaultConfiguration(); + // make sure we don't already have an outbound keypair generation request if (!_isWaitingForKeypairResponse) { _isWaitingForKeypairResponse = true; diff --git a/libraries/networking/src/RSAKeypairGenerator.cpp b/libraries/networking/src/RSAKeypairGenerator.cpp index dcd4e7fd3c..222b04b47c 100644 --- a/libraries/networking/src/RSAKeypairGenerator.cpp +++ b/libraries/networking/src/RSAKeypairGenerator.cpp @@ -15,7 +15,6 @@ #include #include -#include #include #include "NetworkLogging.h" @@ -26,8 +25,7 @@ RSAKeypairGenerator::RSAKeypairGenerator(QObject* parent) : QObject(parent) { - // Ensure openssl/Qt config is set up. - QSslConfiguration::defaultConfiguration(); + } void RSAKeypairGenerator::generateKeypair() { From aa18aaa7b19e2969633de95b5f55a0e7eb2ef2cc Mon Sep 17 00:00:00 2001 From: samcake Date: Thu, 17 May 2018 18:06:46 -0700 Subject: [PATCH 018/115] Maybe --- interface/src/avatar/MyAvatar.cpp | 2 +- interface/src/avatar/MyAvatar.h | 4 ++-- .../src/avatars-renderer/Avatar.cpp | 14 ++++++++++++++ .../avatars-renderer/src/avatars-renderer/Avatar.h | 4 ++++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 193e974484..8817ea3d05 100755 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -1127,8 +1127,8 @@ void MyAvatar::setEnableDebugDrawIKChains(bool isEnabled) { } void MyAvatar::setEnableMeshVisible(bool isEnabled) { - // TODO: This should tell the main MetaRenderItem of the Avatar to be hidden to control vsisiblity since the model is culled by the MetaRI. _skeletonModel->setVisibleInScene(isEnabled, qApp->getMain3DScene(), render::ItemKey::TAG_BITS_0 | render::ItemKey::TAG_BITS_1, true); + Avatar::setEnableMeshVisible(isEnabled); } void MyAvatar::setEnableInverseKinematics(bool isEnabled) { diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index 154e2e4d09..5e78d508fe 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -1159,7 +1159,7 @@ public slots: * @function MyAvatar.getEnableMeshVisible * @returns {boolean} true if your avatar's mesh is visible, otherwise false. */ - bool getEnableMeshVisible() const { return _skeletonModel->isVisible(); } + bool getEnableMeshVisible() const override { return _skeletonModel->isVisible(); } /**jsdoc * Set whether or not your avatar mesh is visible. @@ -1171,7 +1171,7 @@ public slots: * MyAvatar.setEnableMeshVisible(true); * }, 10000); */ - void setEnableMeshVisible(bool isEnabled); + void setEnableMeshVisible(bool isEnabled) override; /**jsdoc * @function MyAvatar.setEnableInverseKinematics diff --git a/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp b/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp index 38828a5163..858318746c 100644 --- a/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp +++ b/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp @@ -765,6 +765,20 @@ void Avatar::render(RenderArgs* renderArgs) { } } + +void Avatar::setEnableMeshVisible(bool isEnabled) { + render::Transaction transaction; + if (render::Item::isValidID(_renderItemID)) { + transaction.updateItem>(_renderItemID, [](render::Payload& p) { + }); + } + qApp->getMain3DScene()->enqueueTransaction(transaction); +} + +bool Avatar::getEnableMeshVisible() const { + return true; +} + void Avatar::fixupModelsInScene(const render::ScenePointer& scene) { bool canTryFade{ false }; diff --git a/libraries/avatars-renderer/src/avatars-renderer/Avatar.h b/libraries/avatars-renderer/src/avatars-renderer/Avatar.h index 01114b5f6d..06bc1b174c 100644 --- a/libraries/avatars-renderer/src/avatars-renderer/Avatar.h +++ b/libraries/avatars-renderer/src/avatars-renderer/Avatar.h @@ -356,6 +356,10 @@ public: virtual void setAvatarEntityDataChanged(bool value) override; + // Show hide the model representation of the avatar + virtual void setEnableMeshVisible(bool isEnabled); + virtual bool getEnableMeshVisible() const; + void addMaterial(graphics::MaterialLayer material, const std::string& parentMaterialName) override; void removeMaterial(graphics::MaterialPointer material, const std::string& parentMaterialName) override; From 545ada0abb608a577362a36d0550bce1260dc83f Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Fri, 18 May 2018 10:28:52 -0700 Subject: [PATCH 019/115] Connect signal to keyGen thread for it to quit when owner destructed --- libraries/networking/src/AccountManager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/networking/src/AccountManager.cpp b/libraries/networking/src/AccountManager.cpp index 1f6932094c..a975a86ada 100644 --- a/libraries/networking/src/AccountManager.cpp +++ b/libraries/networking/src/AccountManager.cpp @@ -761,6 +761,7 @@ void AccountManager::generateNewKeypair(bool isUserKeypair, const QUuid& domainI this, &AccountManager::handleKeypairGenerationError); connect(keypairGenerator, &QObject::destroyed, generateThread, &QThread::quit); + connect(this, &QObject::destroyed, generateThread, &QThread::quit); connect(generateThread, &QThread::finished, generateThread, &QThread::deleteLater); keypairGenerator->moveToThread(generateThread); From 36a08fdd8415a4de327f019e49c1fb108a86b30a Mon Sep 17 00:00:00 2001 From: samcake Date: Fri, 18 May 2018 17:41:28 -0700 Subject: [PATCH 020/115] Friday night end of the day, last compilation.... almost --- interface/src/avatar/MyAvatar.cpp | 5 ++- interface/src/avatar/MyAvatar.h | 2 +- .../src/avatars-renderer/Avatar.cpp | 20 ++++++---- .../src/avatars-renderer/Avatar.h | 3 ++ libraries/render/src/render/CullTask.cpp | 38 +++++++++---------- 5 files changed, 40 insertions(+), 28 deletions(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 8817ea3d05..c698bb3c1b 100755 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -1126,8 +1126,11 @@ void MyAvatar::setEnableDebugDrawIKChains(bool isEnabled) { _enableDebugDrawIKChains = isEnabled; } +bool MyAvatar::getEnableMeshVisible() const { + return Avatar::getEnableMeshVisible(); +} + void MyAvatar::setEnableMeshVisible(bool isEnabled) { - _skeletonModel->setVisibleInScene(isEnabled, qApp->getMain3DScene(), render::ItemKey::TAG_BITS_0 | render::ItemKey::TAG_BITS_1, true); Avatar::setEnableMeshVisible(isEnabled); } diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index 5e78d508fe..4070d3372c 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -1159,7 +1159,7 @@ public slots: * @function MyAvatar.getEnableMeshVisible * @returns {boolean} true if your avatar's mesh is visible, otherwise false. */ - bool getEnableMeshVisible() const override { return _skeletonModel->isVisible(); } + bool getEnableMeshVisible() const override; /**jsdoc * Set whether or not your avatar mesh is visible. diff --git a/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp b/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp index 858318746c..a3b5a731bb 100644 --- a/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp +++ b/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp @@ -55,7 +55,9 @@ namespace render { ItemKey::Builder keyBuilder = ItemKey::Builder::opaqueShape().withTypeMeta().withTagBits(ItemKey::TAG_BITS_0 | ItemKey::TAG_BITS_1).withMetaCullGroup(); auto avatarPtr = static_pointer_cast(avatar); auto model = avatarPtr->getSkeletonModel(); - if (model && !model->isVisible()) { + //if (model && !model->isVisible()) { + + if (!avatarPtr->getEnableMeshVisible() && model) { keyBuilder.withInvisible(); } return keyBuilder.build(); @@ -767,16 +769,14 @@ void Avatar::render(RenderArgs* renderArgs) { void Avatar::setEnableMeshVisible(bool isEnabled) { - render::Transaction transaction; - if (render::Item::isValidID(_renderItemID)) { - transaction.updateItem>(_renderItemID, [](render::Payload& p) { - }); + if (_isMeshEnableVisible != isEnabled) { + _isMeshEnableVisible = isEnabled; + _needMeshVisibleSwitch = true; } - qApp->getMain3DScene()->enqueueTransaction(transaction); } bool Avatar::getEnableMeshVisible() const { - return true; + return _isMeshEnableVisible; } void Avatar::fixupModelsInScene(const render::ScenePointer& scene) { @@ -801,6 +801,12 @@ void Avatar::fixupModelsInScene(const render::ScenePointer& scene) { } } + if (_needMeshVisibleSwitch) { + // _skeletonModel->setVisibleInScene(_isMeshEnableVisible, scene, render::ItemKey::TAG_BITS_0 | render::ItemKey::TAG_BITS_1, true); + updateRenderItem(transaction); + _needMeshVisibleSwitch = false; + } + if (_mustFadeIn && canTryFade) { // Do it now to be sure all the sub items are ready and the fade is sent to them too fade(transaction, render::Transition::USER_ENTER_DOMAIN); diff --git a/libraries/avatars-renderer/src/avatars-renderer/Avatar.h b/libraries/avatars-renderer/src/avatars-renderer/Avatar.h index 06bc1b174c..f7e89653b5 100644 --- a/libraries/avatars-renderer/src/avatars-renderer/Avatar.h +++ b/libraries/avatars-renderer/src/avatars-renderer/Avatar.h @@ -536,6 +536,9 @@ protected: std::mutex _materialsLock; void processMaterials(); + + bool _isMeshEnableVisible{ true }; + bool _needMeshVisibleSwitch{ true }; }; #endif // hifi_Avatar_h diff --git a/libraries/render/src/render/CullTask.cpp b/libraries/render/src/render/CullTask.cpp index b5819f114f..ce6755b893 100644 --- a/libraries/render/src/render/CullTask.cpp +++ b/libraries/render/src/render/CullTask.cpp @@ -368,9 +368,9 @@ void CullShapeBounds::run(const RenderContextPointer& renderContext, const Input RenderArgs* args = renderContext->args; const auto& inShapes = inputs.get0(); - const auto& cullFilter = inputs.get1(); - const auto& boundsFilter = inputs.get2(); - const auto& antiFrustum = inputs.get3(); + const auto& cullFilter = inputs.get1(); + const auto& boundsFilter = inputs.get2(); + const auto& antiFrustum = inputs.get3(); auto& outShapes = outputs.edit0(); auto& outBounds = outputs.edit1(); @@ -380,7 +380,7 @@ void CullShapeBounds::run(const RenderContextPointer& renderContext, const Input if (!cullFilter.selectsNothing() || !boundsFilter.selectsNothing()) { auto& details = args->_details.edit(_detailType); Test test(_cullFunctor, args, details, antiFrustum); - auto scene = args->_scene; + auto scene = args->_scene; for (auto& inItems : inShapes) { auto key = inItems.first; @@ -395,26 +395,26 @@ void CullShapeBounds::run(const RenderContextPointer& renderContext, const Input if (antiFrustum == nullptr) { for (auto& item : inItems.second) { if (test.solidAngleTest(item.bound) && test.frustumTest(item.bound)) { - const auto shapeKey = scene->getItem(item.id).getKey(); - if (cullFilter.test(shapeKey)) { - outItems->second.emplace_back(item); - } - if (boundsFilter.test(shapeKey)) { - outBounds += item.bound; - } + const auto shapeKey = scene->getItem(item.id).getKey(); + if (cullFilter.test(shapeKey)) { + outItems->second.emplace_back(item); + } + if (boundsFilter.test(shapeKey)) { + outBounds += item.bound; + } } } } else { for (auto& item : inItems.second) { if (test.solidAngleTest(item.bound) && test.frustumTest(item.bound) && test.antiFrustumTest(item.bound)) { - const auto shapeKey = scene->getItem(item.id).getKey(); - if (cullFilter.test(shapeKey)) { - outItems->second.emplace_back(item); - } - if (boundsFilter.test(shapeKey)) { - outBounds += item.bound; - } - } + const auto shapeKey = scene->getItem(item.id).getKey(); + if (cullFilter.test(shapeKey)) { + outItems->second.emplace_back(item); + } + if (boundsFilter.test(shapeKey)) { + outBounds += item.bound; + } + } } } details._rendered += (int)outItems->second.size(); From 1130f9998d8e6e8b92d8ec709d3ad2e1ba01c159 Mon Sep 17 00:00:00 2001 From: luiscuenca Date: Sat, 19 May 2018 10:42:55 -0700 Subject: [PATCH 021/115] Minor fix allows import GLTF from Substance Painter --- libraries/fbx/src/GLTFReader.cpp | 2 +- libraries/fbx/src/GLTFReader.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/fbx/src/GLTFReader.cpp b/libraries/fbx/src/GLTFReader.cpp index f322c2319e..1fa4b3873e 100644 --- a/libraries/fbx/src/GLTFReader.cpp +++ b/libraries/fbx/src/GLTFReader.cpp @@ -1174,7 +1174,7 @@ bool GLTFReader::addArrayOfType(const QByteArray& bin, int byteOffset, int byteL break; } case GLTFAccessorComponentType::UNSIGNED_INT: { - readArray(bin, byteOffset, byteLength, outarray, accessorType); + readArray(bin, byteOffset, byteLength, outarray, accessorType); break; } case GLTFAccessorComponentType::UNSIGNED_SHORT: { diff --git a/libraries/fbx/src/GLTFReader.h b/libraries/fbx/src/GLTFReader.h index 3554594768..28c1d8282f 100644 --- a/libraries/fbx/src/GLTFReader.h +++ b/libraries/fbx/src/GLTFReader.h @@ -190,7 +190,7 @@ namespace GLTFBufferViewTarget { struct GLTFBufferView { int buffer; //required int byteLength; //required - int byteOffset; + int byteOffset { 0 }; int target; QMap defined; void dump() { @@ -470,7 +470,7 @@ namespace GLTFAccessorComponentType { } struct GLTFAccessor { int bufferView; - int byteOffset; + int byteOffset { 0 }; int componentType; //required int count; //required int type; //required From 6d4f70427921ef9d94509d3a2d820a464b695067 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Mon, 21 May 2018 09:32:10 +1200 Subject: [PATCH 022/115] Regularize some JSDoc usage --- interface/src/Application.cpp | 2 +- interface/src/FancyCamera.h | 2 +- interface/src/avatar/MyAvatar.h | 2 +- .../src/raypick/PickScriptingInterface.h | 33 ++++++++++--------- .../src/raypick/PointerScriptingInterface.cpp | 6 ++-- .../scripting/WindowScriptingInterface.cpp | 2 +- .../src/scripting/WindowScriptingInterface.h | 2 +- interface/src/ui/overlays/Overlays.h | 2 +- .../src/avatars-renderer/Avatar.h | 2 +- libraries/avatars/src/AvatarData.cpp | 2 +- .../controllers/src/controllers/Actions.cpp | 2 +- .../controllers/src/controllers/InputDevice.h | 2 +- .../src/controllers/StandardController.cpp | 2 +- .../entities/src/AnimationPropertyGroup.cpp | 2 +- .../entities/src/EntityItemProperties.cpp | 2 +- .../src/input-plugins/KeyboardMouseDevice.cpp | 2 +- libraries/networking/src/AddressManager.h | 2 +- libraries/networking/src/DomainHandler.h | 2 +- .../src/AssetScriptingInterface.h | 8 ++--- libraries/script-engine/src/Quat.h | 2 +- .../src/SceneScriptingInterface.h | 6 ++-- libraries/script-engine/src/ScriptUUID.h | 2 +- libraries/shared/src/shared/Camera.h | 13 ++++---- libraries/ui/src/QmlFragmentClass.h | 2 +- .../ui/src/ui/TabletScriptingInterface.h | 2 +- .../oculus/src/OculusControllerManager.cpp | 2 +- plugins/openvr/src/ViveControllerManager.cpp | 2 +- 27 files changed, 56 insertions(+), 54 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 467c8c9a2c..266c085d99 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -715,7 +715,7 @@ private: * NavigationFocusednumbernumberNot used. * * - * @typedef Controller.Hardware-Application + * @typedef {object} Controller.Hardware-Application */ static const QString STATE_IN_HMD = "InHMD"; diff --git a/interface/src/FancyCamera.h b/interface/src/FancyCamera.h index bee21bad22..4ca073fb4f 100644 --- a/interface/src/FancyCamera.h +++ b/interface/src/FancyCamera.h @@ -25,7 +25,7 @@ class FancyCamera : public Camera { // FIXME: JSDoc 3.5.5 doesn't augment @property definitions. The following definition is repeated in Camera.h. /**jsdoc - * @property cameraEntity {Uuid} The ID of the entity that the camera position and orientation follow when the camera is in + * @property {Uuid} cameraEntity The ID of the entity that the camera position and orientation follow when the camera is in * entity mode. */ Q_PROPERTY(QUuid cameraEntity READ getCameraEntity WRITE setCameraEntity) diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index fa6a675d99..fe6ba71c13 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -121,7 +121,7 @@ class MyAvatar : public Avatar { * while flying. * @property {number} hmdRollControlDeadZone=8 - The amount of HMD roll, in degrees, required before your avatar turns if * hmdRollControlEnabled is enabled. - * @property hmdRollControlRate {number} If hmdRollControlEnabled is true, this value determines the maximum turn rate of + * @property {number} hmdRollControlRate If hmdRollControlEnabled is true, this value determines the maximum turn rate of * your avatar when rolling your HMD in degrees per second. * @property {number} userHeight=1.75 - The height of the user in sensor space. * @property {number} userEyeHeight=1.65 - The estimated height of the user's eyes in sensor space. Read-only. diff --git a/interface/src/raypick/PickScriptingInterface.h b/interface/src/raypick/PickScriptingInterface.h index a39aa3a4a1..5ef5d27d74 100644 --- a/interface/src/raypick/PickScriptingInterface.h +++ b/interface/src/raypick/PickScriptingInterface.h @@ -22,21 +22,22 @@ * @hifi-interface * @hifi-client-entity * - * @property PICK_NOTHING {number} A filter flag. Don't intersect with anything. Read-only. - * @property PICK_ENTITIES {number} A filter flag. Include entities when intersecting. Read-only. - * @property PICK_OVERLAYS {number} A filter flag. Include overlays when intersecting. Read-only. - * @property PICK_AVATARS {number} A filter flag. Include avatars when intersecting. Read-only. - * @property PICK_HUD {number} A filter flag. Include the HUD sphere when intersecting in HMD mode. Read-only. - * @property PICK_COARSE {number} A filter flag. Pick against coarse meshes, instead of exact meshes. Read-only. - * @property PICK_INCLUDE_INVISIBLE {number} A filter flag. Include invisible objects when intersecting. Read-only. - * @property PICK_INCLUDE_NONCOLLIDABLE {number} A filter flag. Include non-collidable objects when intersecting. + * @property {number} PICK_NOTHING A filter flag. Don't intersect with anything. Read-only. + * @property {number} PICK_ENTITIES A filter flag. Include entities when intersecting. Read-only. + * @property {number} PICK_OVERLAYS A filter flag. Include overlays when intersecting. Read-only. + * @property {number} PICK_AVATARS A filter flag. Include avatars when intersecting. Read-only. + * @property {number} PICK_HUD A filter flag. Include the HUD sphere when intersecting in HMD mode. Read-only. + * @property {number} PICK_COARSE A filter flag. Pick against coarse meshes, instead of exact meshes. Read-only. + * @property {number} PICK_INCLUDE_INVISIBLE A filter flag. Include invisible objects when intersecting. Read-only. + * @property {number} PICK_INCLUDE_NONCOLLIDABLE A filter flag. Include non-collidable objects when intersecting. * Read-only. - * @property PICK_ALL_INTERSECTIONS {number} Read-only. - * @property INTERSECTED_NONE {number} An intersection type. Intersected nothing with the given filter flags. Read-only. - * @property INTERSECTED_ENTITY {number} An intersection type. Intersected an entity. Read-only. - * @property INTERSECTED_OVERLAY {number} An intersection type. Intersected an overlay. Read-only. - * @property INTERSECTED_AVATAR {number} An intersection type. Intersected an avatar. Read-only. - * @property INTERSECTED_HUD {number} An intersection type. Intersected the HUD sphere. Read-only. + * @property {number} PICK_ALL_INTERSECTIONS Read-only. + * @property {number} INTERSECTED_NONE An intersection type. Intersected nothing with the given filter flags. + * Read-only. + * @property {number} INTERSECTED_ENTITY An intersection type. Intersected an entity. Read-only. + * @property {number} INTERSECTED_OVERLAY An intersection type. Intersected an overlay. Read-only. + * @property {number} INTERSECTED_AVATAR An intersection type. Intersected an avatar. Read-only. + * @property {number} INTERSECTED_HUD An intersection type. Intersected the HUD sphere. Read-only. * @property {number} perFrameTimeBudget - The max number of usec to spend per frame updating Pick results. Read-only. */ @@ -99,7 +100,7 @@ public: /**jsdoc * An intersection result for a Ray Pick. * - * @typedef {Object} RayPickResult + * @typedef {object} RayPickResult * @property {number} type The intersection type. * @property {boolean} intersects If there was a valid intersection (type != INTERSECTED_NONE) * @property {Uuid} objectID The ID of the intersected object. Uuid.NULL for the HUD or invalid intersections. @@ -113,7 +114,7 @@ public: /**jsdoc * An intersection result for a Stylus Pick. * - * @typedef {Object} StylusPickResult + * @typedef {object} StylusPickResult * @property {number} type The intersection type. * @property {boolean} intersects If there was a valid intersection (type != INTERSECTED_NONE) * @property {Uuid} objectID The ID of the intersected object. Uuid.NULL for the HUD or invalid intersections. diff --git a/interface/src/raypick/PointerScriptingInterface.cpp b/interface/src/raypick/PointerScriptingInterface.cpp index b7ac899c8d..4e953a5cb8 100644 --- a/interface/src/raypick/PointerScriptingInterface.cpp +++ b/interface/src/raypick/PointerScriptingInterface.cpp @@ -68,14 +68,14 @@ unsigned int PointerScriptingInterface::createStylus(const QVariant& properties) * A set of properties used to define the visual aspect of a Ray Pointer in the case that the Pointer is not intersecting something. Same as a {@link Pointers.RayPointerRenderState}, * but with an additional distance field. * - * @typedef {Object} Pointers.DefaultRayPointerRenderState + * @typedef {object} Pointers.DefaultRayPointerRenderState * @augments Pointers.RayPointerRenderState * @property {number} distance The distance at which to render the end of this Ray Pointer, if one is defined. */ /**jsdoc * A set of properties used to define the visual aspect of a Ray Pointer in the case that the Pointer is intersecting something. * - * @typedef {Object} Pointers.RayPointerRenderState + * @typedef {object} Pointers.RayPointerRenderState * @property {string} name The name of this render state, used by {@link Pointers.setRenderState} and {@link Pointers.editRenderState} * @property {Overlays.OverlayProperties} [start] All of the properties you would normally pass to {@link Overlays.addOverlay}, plus the type (as a type field). * An overlay to represent the beginning of the Ray Pointer, if desired. @@ -87,7 +87,7 @@ unsigned int PointerScriptingInterface::createStylus(const QVariant& properties) /**jsdoc * A trigger mechanism for Ray Pointers. * - * @typedef {Object} Pointers.Trigger + * @typedef {object} Pointers.Trigger * @property {Controller.Standard|Controller.Actions|function} action This can be a built-in Controller action, like Controller.Standard.LTClick, or a function that evaluates to >= 1.0 when you want to trigger button. * @property {string} button Which button to trigger. "Primary", "Secondary", "Tertiary", and "Focus" are currently supported. Only "Primary" will trigger clicks on web surfaces. If "Focus" is triggered, * it will try to set the entity or overlay focus to the object at which the Pointer is aimed. Buttons besides the first three will still trigger events, but event.button will be "None". diff --git a/interface/src/scripting/WindowScriptingInterface.cpp b/interface/src/scripting/WindowScriptingInterface.cpp index 6f6e83842c..af9b5c8a46 100644 --- a/interface/src/scripting/WindowScriptingInterface.cpp +++ b/interface/src/scripting/WindowScriptingInterface.cpp @@ -522,7 +522,7 @@ int WindowScriptingInterface::openMessageBox(QString title, QString text, int bu * RestoreDefaults 0x8000000 "Restore Defaults" * * - * @typedef Window.MessageBoxButton + * @typedef {number} Window.MessageBoxButton */ int WindowScriptingInterface::createMessageBox(QString title, QString text, int buttons, int defaultButton) { auto messageBox = DependencyManager::get()->createMessageBox(OffscreenUi::ICON_INFORMATION, title, text, diff --git a/interface/src/scripting/WindowScriptingInterface.h b/interface/src/scripting/WindowScriptingInterface.h index 1d06f33ec0..d280d797d6 100644 --- a/interface/src/scripting/WindowScriptingInterface.h +++ b/interface/src/scripting/WindowScriptingInterface.h @@ -470,7 +470,7 @@ public slots: * * * - * @typedef Window.DisplayTexture + * @typedef {string} Window.DisplayTexture */ bool setDisplayTexture(const QString& name); diff --git a/interface/src/ui/overlays/Overlays.h b/interface/src/ui/overlays/Overlays.h index 3ff782da99..d100b228ed 100644 --- a/interface/src/ui/overlays/Overlays.h +++ b/interface/src/ui/overlays/Overlays.h @@ -53,7 +53,7 @@ const OverlayID UNKNOWN_OVERLAY_ID = OverlayID(); * @property {number} distance - The distance from the {@link PickRay} origin to the intersection point. * @property {Vec3} surfaceNormal - The normal of the overlay surface at the intersection point. * @property {Vec3} intersection - The position of the intersection point. - * @property {Object} extraInfo Additional intersection details, if available. + * @property {object} extraInfo Additional intersection details, if available. */ class RayToOverlayIntersectionResult { public: diff --git a/libraries/avatars-renderer/src/avatars-renderer/Avatar.h b/libraries/avatars-renderer/src/avatars-renderer/Avatar.h index 01114b5f6d..0f48e03e55 100644 --- a/libraries/avatars-renderer/src/avatars-renderer/Avatar.h +++ b/libraries/avatars-renderer/src/avatars-renderer/Avatar.h @@ -292,7 +292,7 @@ public: */ /**jsdoc * Information about a single joint in an Avatar's skeleton hierarchy. - * @typedef MyAvatar.SkeletonJoint + * @typedef {object} MyAvatar.SkeletonJoint * @property {string} name - Joint name. * @property {number} index - Joint index. * @property {number} parentIndex - Index of this joint's parent (-1 if no parent). diff --git a/libraries/avatars/src/AvatarData.cpp b/libraries/avatars/src/AvatarData.cpp index 7a28686f8c..48ef1fb881 100644 --- a/libraries/avatars/src/AvatarData.cpp +++ b/libraries/avatars/src/AvatarData.cpp @@ -2363,7 +2363,7 @@ glm::vec3 AvatarData::getAbsoluteJointTranslationInObjectFrame(int index) const } /**jsdoc - * @typedef AttachmentData + * @typedef {object} AttachmentData * @property {string} modelUrl * @property {string} jointName * @property {Vec3} translation diff --git a/libraries/controllers/src/controllers/Actions.cpp b/libraries/controllers/src/controllers/Actions.cpp index 978b0888ba..6923ef4b98 100644 --- a/libraries/controllers/src/controllers/Actions.cpp +++ b/libraries/controllers/src/controllers/Actions.cpp @@ -307,7 +307,7 @@ namespace controller { * action. * * - * @typedef Controller.Actions + * @typedef {object} Controller.Actions */ // Device functions Input::NamedVector ActionsDevice::getAvailableInputs() const { diff --git a/libraries/controllers/src/controllers/InputDevice.h b/libraries/controllers/src/controllers/InputDevice.h index 30a58eb2f0..1e626e6a3c 100644 --- a/libraries/controllers/src/controllers/InputDevice.h +++ b/libraries/controllers/src/controllers/InputDevice.h @@ -79,7 +79,7 @@ enum Hand { * {@link Controller.Hardware-Vive}. * * - * @typedef Controller.Hardware + * @typedef {object} Controller.Hardware * @example List all the currently available Controller.Hardware properties. * function printProperties(string, item) { * print(string); diff --git a/libraries/controllers/src/controllers/StandardController.cpp b/libraries/controllers/src/controllers/StandardController.cpp index 471943400d..e1733d2524 100644 --- a/libraries/controllers/src/controllers/StandardController.cpp +++ b/libraries/controllers/src/controllers/StandardController.cpp @@ -231,7 +231,7 @@ void StandardController::focusOutEvent() { * * * - * @typedef Controller.Standard + * @typedef {object} Controller.Standard */ Input::NamedVector StandardController::getAvailableInputs() const { static Input::NamedVector availableInputs { diff --git a/libraries/entities/src/AnimationPropertyGroup.cpp b/libraries/entities/src/AnimationPropertyGroup.cpp index 43c6b7a6a5..2db85eb7ac 100644 --- a/libraries/entities/src/AnimationPropertyGroup.cpp +++ b/libraries/entities/src/AnimationPropertyGroup.cpp @@ -46,7 +46,7 @@ bool operator!=(const AnimationPropertyGroup& a, const AnimationPropertyGroup& b /**jsdoc * The AnimationProperties are used to configure an animation. - * @typedef Entities.AnimationProperties + * @typedef {object} Entities.AnimationProperties * @property {string} url="" - The URL of the FBX file that has the animation. * @property {number} fps=30 - The speed in frames/s that the animation is played at. * @property {number} firstFrame=0 - The first frame to play in the animation. diff --git a/libraries/entities/src/EntityItemProperties.cpp b/libraries/entities/src/EntityItemProperties.cpp index 4d7c114176..0def76f1bb 100644 --- a/libraries/entities/src/EntityItemProperties.cpp +++ b/libraries/entities/src/EntityItemProperties.cpp @@ -1391,7 +1391,7 @@ QScriptValue EntityItemProperties::copyToScriptValue(QScriptEngine* engine, bool /**jsdoc * The axis-aligned bounding box of an entity. - * @typedef Entities.BoundingBox + * @typedef {object} Entities.BoundingBox * @property {Vec3} brn - The bottom right near (minimum axes values) corner of the AA box. * @property {Vec3} tfl - The top far left (maximum axes values) corner of the AA box. * @property {Vec3} center - The center of the AA box. diff --git a/libraries/input-plugins/src/input-plugins/KeyboardMouseDevice.cpp b/libraries/input-plugins/src/input-plugins/KeyboardMouseDevice.cpp index 8ecf527a14..650c9675a7 100755 --- a/libraries/input-plugins/src/input-plugins/KeyboardMouseDevice.cpp +++ b/libraries/input-plugins/src/input-plugins/KeyboardMouseDevice.cpp @@ -279,7 +279,7 @@ controller::Input KeyboardMouseDevice::InputDevice::makeInput(KeyboardMouseDevic * moved down. The data value is how far the average position of all touch points moved. * * - * @typedef Controller.Hardware-Keyboard + * @typedef {object} Controller.Hardware-Keyboard * @todo Currently, the mouse wheel in an ordinary mouse generates left/right wheel events instead of up/down. */ controller::Input::NamedVector KeyboardMouseDevice::InputDevice::getAvailableInputs() const { diff --git a/libraries/networking/src/AddressManager.h b/libraries/networking/src/AddressManager.h index 7832b26c96..a12a18fa6a 100644 --- a/libraries/networking/src/AddressManager.h +++ b/libraries/networking/src/AddressManager.h @@ -138,7 +138,7 @@ public: * * * - * @typedef location.LookupTrigger + * @typedef {number} location.LookupTrigger */ enum LookupTrigger { UserInput, diff --git a/libraries/networking/src/DomainHandler.h b/libraries/networking/src/DomainHandler.h index 08908dbaf6..4d98391104 100644 --- a/libraries/networking/src/DomainHandler.h +++ b/libraries/networking/src/DomainHandler.h @@ -137,7 +137,7 @@ public: * * * - * @typedef Window.ConnectionRefusedReason + * @typedef {number} Window.ConnectionRefusedReason */ enum class ConnectionRefusedReason : uint8_t { Unknown, diff --git a/libraries/script-engine/src/AssetScriptingInterface.h b/libraries/script-engine/src/AssetScriptingInterface.h index 7f7a3a68b0..72d6901fb5 100644 --- a/libraries/script-engine/src/AssetScriptingInterface.h +++ b/libraries/script-engine/src/AssetScriptingInterface.h @@ -121,7 +121,7 @@ public: /**jsdoc * A set of properties that can be passed to {@link Assets.getAsset}. - * @typedef {Object} Assets.GetOptions + * @typedef {object} Assets.GetOptions * @property {string} [url] an "atp:" style URL, hash, or relative mapped path to fetch * @property {string} [responseType=text] the desired reponse type (text | arraybuffer | json) * @property {boolean} [decompress=false] whether to attempt gunzip decompression on the fetched data @@ -137,7 +137,7 @@ public: /**jsdoc * Result value returned by {@link Assets.getAsset}. - * @typedef {Object} Assets~getAssetResult + * @typedef {object} Assets~getAssetResult * @property {string} [url] the resolved "atp:" style URL for the fetched asset * @property {string} [hash] the resolved hash for the fetched asset * @property {string|ArrayBuffer|Object} [response] response data (possibly converted per .responseType value) @@ -159,7 +159,7 @@ public: /**jsdoc * A set of properties that can be passed to {@link Assets.putAsset}. - * @typedef {Object} Assets.PutOptions + * @typedef {object} Assets.PutOptions * @property {ArrayBuffer|string} [data] byte buffer or string value representing the new asset's content * @property {string} [path=null] ATP path mapping to automatically create (upon successful upload to hash) * @property {boolean} [compress=false] whether to gzip compress data before uploading @@ -174,7 +174,7 @@ public: /**jsdoc * Result value returned by {@link Assets.putAsset}. - * @typedef {Object} Assets~putAssetResult + * @typedef {object} Assets~putAssetResult * @property {string} [url] the resolved "atp:" style URL for the uploaded asset (based on .path if specified, otherwise on the resulting ATP hash) * @property {string} [path] the uploaded asset's resulting ATP path (or undefined if no path mapping was assigned) * @property {string} [hash] the uploaded asset's resulting ATP hash diff --git a/libraries/script-engine/src/Quat.h b/libraries/script-engine/src/Quat.h index 1ccdfdbf31..76b7ac45e3 100644 --- a/libraries/script-engine/src/Quat.h +++ b/libraries/script-engine/src/Quat.h @@ -43,7 +43,7 @@ * @hifi-server-entity * @hifi-assignment-client * - * @property IDENTITY {Quat} { x: 0, y: 0, z: 0, w: 1 } : The identity rotation, i.e., no rotation. + * @property {Quat} IDENTITY - { x: 0, y: 0, z: 0, w: 1 } : The identity rotation, i.e., no rotation. * Read-only. * @example Print the IDENTITY value. * print(JSON.stringify(Quat.IDENTITY)); // { x: 0, y: 0, z: 0, w: 1 } diff --git a/libraries/script-engine/src/SceneScriptingInterface.h b/libraries/script-engine/src/SceneScriptingInterface.h index fdfbc6f6c0..da42cf2df3 100644 --- a/libraries/script-engine/src/SceneScriptingInterface.h +++ b/libraries/script-engine/src/SceneScriptingInterface.h @@ -21,7 +21,7 @@ namespace SceneScripting { /**jsdoc - * @typedef Scene.Stage.Location + * @typedef {object} Scene.Stage.Location * @property {number} longitude * @property {number} latitude * @property {number} altitude @@ -49,7 +49,7 @@ namespace SceneScripting { using LocationPointer = std::unique_ptr; /**jsdoc - * @typedef Scene.Stage.Time + * @typedef {object} Scene.Stage.Time * @property {number} hour * @property {number} day */ @@ -73,7 +73,7 @@ namespace SceneScripting { using TimePointer = std::unique_ptr