From bb10d8a7d5d7deaa6295e5f54016415647076384 Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Wed, 7 Oct 2015 20:08:30 -0700 Subject: [PATCH] more work on rationalizing particle properties --- examples/html/entityProperties.html | 29 ++++++++++++------- .../entities/src/ParticleEffectEntityItem.cpp | 2 +- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/examples/html/entityProperties.html b/examples/html/entityProperties.html index ac46272a4d..dcb49477d8 100644 --- a/examples/html/entityProperties.html +++ b/examples/html/entityProperties.html @@ -310,6 +310,7 @@ var elParticleLifeSpan = document.getElementById("property-particle-lifespan"); var elParticleEmitRate = document.getElementById("property-particle-emit-rate"); var elParticleRadius = document.getElementById("property-particle-radius"); + var elParticleTextures = document.getElementById("property-particle-textures"); var elTextSections = document.querySelectorAll(".text-section"); allSections.push(elTextSections); @@ -525,7 +526,7 @@ elModelAnimationHold.checked = properties.animation.hold; elModelAnimationStartAutomatically.checked = properties.animation.startAutomatically; elModelTextures.value = properties.textures; - elModelOriginalTextures.value = properties.originalTextures; + elModelOriginalTextures.value = properties.originalTextures; } else if (properties.type == "Web") { for (var i = 0; i < elWebSections.length; i++) { elWebSections[i].style.display = 'block'; @@ -618,16 +619,16 @@ elParticleLifeSpan.value = properties.lifespan.toFixed(2); elParticleEmitRate.value = properties.emitRate.toFixed(1); elParticleRadius.value = properties.particleRadius.toFixed(3); + elParticleTextures.value = properties.textures; - /* - COPY_ENTITY_PROPERTY_TO_PROPERTIES(shapeType, getShapeType); - COPY_ENTITY_PROPERTY_TO_PROPERTIES(colorSpread, getColorSpread); - COPY_ENTITY_PROPERTY_TO_PROPERTIES(colorStart, getColorStart); - COPY_ENTITY_PROPERTY_TO_PROPERTIES(colorFinish, getColorFinish); - COPY_ENTITY_PROPERTY_TO_PROPERTIES(alphaSpread, getAlphaSpread); - COPY_ENTITY_PROPERTY_TO_PROPERTIES(alphaStart, getAlphaStart); - COPY_ENTITY_PROPERTY_TO_PROPERTIES(alphaFinish, getAlphaFinish); - COPY_ENTITY_PROPERTY_TO_PROPERTIES(textures, getTextures); + // FIXME - these are other particle properties we could support in the editor + // shapeType // ??? + // color colorSpread + // color colorStart + // color colorFinish + // float alphaSpread + // float alphaStart + // float alphaFinish // float emitSpeed // float speedSpread // quat emitOrientation @@ -643,7 +644,6 @@ // float radiusSpread?? // float radiusFinish // float RadiusSpread - */ } else if (properties.type == "PolyVox") { for (var i = 0; i < elPolyVoxSections.length; i++) { @@ -782,6 +782,7 @@ elParticleLifeSpan.addEventListener('change', createEmitNumberPropertyUpdateFunction('lifespan')); elParticleEmitRate.addEventListener('change', createEmitNumberPropertyUpdateFunction('emitRate')); elParticleRadius.addEventListener('change', createEmitNumberPropertyUpdateFunction('particleRadius')); + elParticleTextures.addEventListener('change', createEmitTextPropertyUpdateFunction('textures')); elModelURL.addEventListener('change', createEmitTextPropertyUpdateFunction('modelURL')); elShapeType.addEventListener('change', createEmitTextPropertyUpdateFunction('shapeType')); @@ -1405,6 +1406,12 @@ +
+
Textures
+
+ +
+
diff --git a/libraries/entities/src/ParticleEffectEntityItem.cpp b/libraries/entities/src/ParticleEffectEntityItem.cpp index d04f192f80..f6ed4a06ab 100644 --- a/libraries/entities/src/ParticleEffectEntityItem.cpp +++ b/libraries/entities/src/ParticleEffectEntityItem.cpp @@ -329,7 +329,7 @@ EntityItemProperties ParticleEffectEntityItem::getProperties(EntityPropertyFlags COPY_ENTITY_PROPERTY_TO_PROPERTIES(color, getXColor); COPY_ENTITY_PROPERTY_TO_PROPERTIES(alpha, getAlpha); COPY_ENTITY_PROPERTY_TO_PROPERTIES(glowLevel, getGlowLevel); - COPY_ENTITY_PROPERTY_TO_PROPERTIES(shapeType, getShapeType); + COPY_ENTITY_PROPERTY_TO_PROPERTIES(shapeType, getShapeType); // FIXME - this doesn't appear to get used COPY_ENTITY_PROPERTY_TO_PROPERTIES(maxParticles, getMaxParticles); COPY_ENTITY_PROPERTY_TO_PROPERTIES(lifespan, getLifespan); COPY_ENTITY_PROPERTY_TO_PROPERTIES(isEmitting, getIsEmitting);