more work on rationalizing particle properties

This commit is contained in:
Brad Hefta-Gaub 2015-10-07 20:08:30 -07:00
parent b479dd0a12
commit bb10d8a7d5
2 changed files with 19 additions and 12 deletions

View file

@ -310,6 +310,7 @@
var elParticleLifeSpan = document.getElementById("property-particle-lifespan"); var elParticleLifeSpan = document.getElementById("property-particle-lifespan");
var elParticleEmitRate = document.getElementById("property-particle-emit-rate"); var elParticleEmitRate = document.getElementById("property-particle-emit-rate");
var elParticleRadius = document.getElementById("property-particle-radius"); var elParticleRadius = document.getElementById("property-particle-radius");
var elParticleTextures = document.getElementById("property-particle-textures");
var elTextSections = document.querySelectorAll(".text-section"); var elTextSections = document.querySelectorAll(".text-section");
allSections.push(elTextSections); allSections.push(elTextSections);
@ -525,7 +526,7 @@
elModelAnimationHold.checked = properties.animation.hold; elModelAnimationHold.checked = properties.animation.hold;
elModelAnimationStartAutomatically.checked = properties.animation.startAutomatically; elModelAnimationStartAutomatically.checked = properties.animation.startAutomatically;
elModelTextures.value = properties.textures; elModelTextures.value = properties.textures;
elModelOriginalTextures.value = properties.originalTextures; elModelOriginalTextures.value = properties.originalTextures;
} else if (properties.type == "Web") { } else if (properties.type == "Web") {
for (var i = 0; i < elWebSections.length; i++) { for (var i = 0; i < elWebSections.length; i++) {
elWebSections[i].style.display = 'block'; elWebSections[i].style.display = 'block';
@ -618,16 +619,16 @@
elParticleLifeSpan.value = properties.lifespan.toFixed(2); elParticleLifeSpan.value = properties.lifespan.toFixed(2);
elParticleEmitRate.value = properties.emitRate.toFixed(1); elParticleEmitRate.value = properties.emitRate.toFixed(1);
elParticleRadius.value = properties.particleRadius.toFixed(3); elParticleRadius.value = properties.particleRadius.toFixed(3);
elParticleTextures.value = properties.textures;
/* // FIXME - these are other particle properties we could support in the editor
COPY_ENTITY_PROPERTY_TO_PROPERTIES(shapeType, getShapeType); // shapeType // ???
COPY_ENTITY_PROPERTY_TO_PROPERTIES(colorSpread, getColorSpread); // color colorSpread
COPY_ENTITY_PROPERTY_TO_PROPERTIES(colorStart, getColorStart); // color colorStart
COPY_ENTITY_PROPERTY_TO_PROPERTIES(colorFinish, getColorFinish); // color colorFinish
COPY_ENTITY_PROPERTY_TO_PROPERTIES(alphaSpread, getAlphaSpread); // float alphaSpread
COPY_ENTITY_PROPERTY_TO_PROPERTIES(alphaStart, getAlphaStart); // float alphaStart
COPY_ENTITY_PROPERTY_TO_PROPERTIES(alphaFinish, getAlphaFinish); // float alphaFinish
COPY_ENTITY_PROPERTY_TO_PROPERTIES(textures, getTextures);
// float emitSpeed // float emitSpeed
// float speedSpread // float speedSpread
// quat emitOrientation // quat emitOrientation
@ -643,7 +644,6 @@
// float radiusSpread?? // float radiusSpread??
// float radiusFinish // float radiusFinish
// float RadiusSpread // float RadiusSpread
*/
} else if (properties.type == "PolyVox") { } else if (properties.type == "PolyVox") {
for (var i = 0; i < elPolyVoxSections.length; i++) { for (var i = 0; i < elPolyVoxSections.length; i++) {
@ -782,6 +782,7 @@
elParticleLifeSpan.addEventListener('change', createEmitNumberPropertyUpdateFunction('lifespan')); elParticleLifeSpan.addEventListener('change', createEmitNumberPropertyUpdateFunction('lifespan'));
elParticleEmitRate.addEventListener('change', createEmitNumberPropertyUpdateFunction('emitRate')); elParticleEmitRate.addEventListener('change', createEmitNumberPropertyUpdateFunction('emitRate'));
elParticleRadius.addEventListener('change', createEmitNumberPropertyUpdateFunction('particleRadius')); elParticleRadius.addEventListener('change', createEmitNumberPropertyUpdateFunction('particleRadius'));
elParticleTextures.addEventListener('change', createEmitTextPropertyUpdateFunction('textures'));
elModelURL.addEventListener('change', createEmitTextPropertyUpdateFunction('modelURL')); elModelURL.addEventListener('change', createEmitTextPropertyUpdateFunction('modelURL'));
elShapeType.addEventListener('change', createEmitTextPropertyUpdateFunction('shapeType')); elShapeType.addEventListener('change', createEmitTextPropertyUpdateFunction('shapeType'));
@ -1405,6 +1406,12 @@
<input class="coord" type='number' id="property-particle-radius" min="0" step="0.005"> <input class="coord" type='number' id="property-particle-radius" min="0" step="0.005">
</div> </div>
</div> </div>
<div class="particle-section property">
<div class="label">Textures</div>
<div class="value">
<textarea id="property-particle-textures" value='asdfasdf'></textarea>
</div>
</div>
<div class="section-header text-section"> <div class="section-header text-section">

View file

@ -329,7 +329,7 @@ EntityItemProperties ParticleEffectEntityItem::getProperties(EntityPropertyFlags
COPY_ENTITY_PROPERTY_TO_PROPERTIES(color, getXColor); COPY_ENTITY_PROPERTY_TO_PROPERTIES(color, getXColor);
COPY_ENTITY_PROPERTY_TO_PROPERTIES(alpha, getAlpha); COPY_ENTITY_PROPERTY_TO_PROPERTIES(alpha, getAlpha);
COPY_ENTITY_PROPERTY_TO_PROPERTIES(glowLevel, getGlowLevel); 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(maxParticles, getMaxParticles);
COPY_ENTITY_PROPERTY_TO_PROPERTIES(lifespan, getLifespan); COPY_ENTITY_PROPERTY_TO_PROPERTIES(lifespan, getLifespan);
COPY_ENTITY_PROPERTY_TO_PROPERTIES(isEmitting, getIsEmitting); COPY_ENTITY_PROPERTY_TO_PROPERTIES(isEmitting, getIsEmitting);