From 8c22db17cccae48fd0b8c17391bf00d01036622a Mon Sep 17 00:00:00 2001 From: David Rowe Date: Fri, 16 Oct 2015 15:43:23 -0700 Subject: [PATCH 1/5] Fix reading of QVector from models files - polyline strokeWidths --- libraries/shared/src/VariantMapToScriptValue.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libraries/shared/src/VariantMapToScriptValue.cpp b/libraries/shared/src/VariantMapToScriptValue.cpp index c0d21e9995..00fc2cd682 100644 --- a/libraries/shared/src/VariantMapToScriptValue.cpp +++ b/libraries/shared/src/VariantMapToScriptValue.cpp @@ -62,12 +62,11 @@ QScriptValue variantMapToScriptValue(QVariantMap& variantMap, QScriptEngine& scr QScriptValue variantListToScriptValue(QVariantList& variantList, QScriptEngine& scriptEngine) { - QScriptValue scriptValue = scriptEngine.newObject(); - scriptValue.setProperty("length", variantList.size()); - int i = 0; - foreach (QVariant v, variantList) { - scriptValue.setProperty(i++, variantToScriptValue(v, scriptEngine)); + QScriptValue scriptValue = scriptEngine.newArray(); + + for (int i = 0; i < variantList.size(); i++) { + scriptValue.setProperty(i, variantToScriptValue(variantList[i], scriptEngine)); } return scriptValue; From aa6aaf912e3d12b0e94dc3c106314361fc2cfe24 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Fri, 16 Oct 2015 16:07:20 -0700 Subject: [PATCH 2/5] add color bars below position inputs --- examples/html/entityProperties.html | 6 +++--- examples/html/style.css | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/examples/html/entityProperties.html b/examples/html/entityProperties.html index 97d8fe4729..9fa596ae09 100644 --- a/examples/html/entityProperties.html +++ b/examples/html/entityProperties.html @@ -1035,9 +1035,9 @@
Position
-
X
-
Y
-
Z
+
X
+
Y
+
Z
diff --git a/examples/html/style.css b/examples/html/style.css index 3614ea821b..98a3e8bd6e 100644 --- a/examples/html/style.css +++ b/examples/html/style.css @@ -75,6 +75,7 @@ body { height: 22.5pt; } + .property-section label { font-weight: bold; } @@ -342,3 +343,23 @@ input#property-name { margin: 5px; border: 1px solid white; } + +.prop-x{ + color:red !important; + background: rgba(255, 0, 0, .9); + height:2px !important; + +} + +.prop-y{ + color:green !important; + background: rgba(0, 255, 0, .9); + height:2px !important; + +} + +.prop-z{ + color:blue !important; + background: rgba(0, 0, 255, .9); + height:2px !important; +} From c6fcaf158b221fd934fdc3861366783aa6114e4f Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Fri, 16 Oct 2015 16:15:20 -0700 Subject: [PATCH 3/5] add color to more props --- examples/html/entityProperties.html | 30 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/examples/html/entityProperties.html b/examples/html/entityProperties.html index 9fa596ae09..cffca523d7 100644 --- a/examples/html/entityProperties.html +++ b/examples/html/entityProperties.html @@ -1048,18 +1048,18 @@
Registration
-
X
-
Y
-
Z
+
X
+
Y
+
Z
Dimensions
-
X
-
Y
-
Z
+
X
+
Y
+
Z
@@ -1123,9 +1123,9 @@
Linear Velocity
-
X
-
Y
-
Z
+
X
+
Y
+
Z
@@ -1164,18 +1164,18 @@
Gravity
-
X
-
Y
-
Z
+
X
+
Y
+
Z
Acceleration
-
X
-
Y
-
Z
+
X
+
Y
+
Z
From 31cc451fd44e38e608b3377842a9d79ae94427e8 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Fri, 16 Oct 2015 16:42:29 -0700 Subject: [PATCH 4/5] css cleanup --- examples/html/style.css | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/examples/html/style.css b/examples/html/style.css index 98a3e8bd6e..5b794cbfec 100644 --- a/examples/html/style.css +++ b/examples/html/style.css @@ -344,18 +344,16 @@ input#property-name { border: 1px solid white; } -.prop-x{ - color:red !important; - background: rgba(255, 0, 0, .9); - height:2px !important; - +.prop-x { + color:red !important; + background: rgba(255, 0, 0, .9); + height:2px !important; } -.prop-y{ +.prop-y { color:green !important; background: rgba(0, 255, 0, .9); height:2px !important; - } .prop-z{ From 1da68e02146056ce922d853db8a68c6ea7a86820 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Fri, 16 Oct 2015 18:10:50 -0700 Subject: [PATCH 5/5] Fix particle bug by having lifetimes increase --- libraries/entities/src/ParticleEffectEntityItem.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libraries/entities/src/ParticleEffectEntityItem.cpp b/libraries/entities/src/ParticleEffectEntityItem.cpp index 29e2aa512d..ddd79375b3 100644 --- a/libraries/entities/src/ParticleEffectEntityItem.cpp +++ b/libraries/entities/src/ParticleEffectEntityItem.cpp @@ -644,14 +644,13 @@ void ParticleEffectEntityItem::stepSimulation(float deltaTime) { // update particles between head and tail for (quint32 i = _particleHeadIndex; i != _particleTailIndex; i = (i + 1) % _maxParticles) { - _particleLifetimes[i] -= deltaTime; + _particleLifetimes[i] += deltaTime; // if particle has died. - if (_particleLifetimes[i] <= 0.0f || _lifespan == 0.0f) { + if (_particleLifetimes[i] >= _lifespan || _lifespan < EPSILON) { // move head forward _particleHeadIndex = (_particleHeadIndex + 1) % _maxParticles; - } - else { + } else { float age = 1.0f - _particleLifetimes[i] / _lifespan; // 0.0 .. 1.0 updateRadius(i, age); updateColor(i, age); @@ -672,7 +671,7 @@ void ParticleEffectEntityItem::stepSimulation(float deltaTime) { // emit a new particle at tail index. quint32 i = _particleTailIndex; - _particleLifetimes[i] = _lifespan; + _particleLifetimes[i] = 0.0f; // Radius if (_radiusSpread == 0.0f) {