From 81f95c6fc7f97ba4b17c9fc31eea77cb982af653 Mon Sep 17 00:00:00 2001 From: ericrius1 Date: Mon, 1 Feb 2016 12:48:40 -0800 Subject: [PATCH] better starting values for particles --- examples/edit.js | 7 +++++++ examples/particle_explorer/particleExplorerTool.js | 10 ++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/examples/edit.js b/examples/edit.js index 9d5a079831..7d05fb7ec9 100644 --- a/examples/edit.js +++ b/examples/edit.js @@ -645,6 +645,12 @@ var toolBar = (function() { type: "ParticleEffect", isEmitting: true, particleRadius: 0.1, + emitAcceleration: {x: 0, y: -1, z: 0}, + accelerationSpread: {x: 5, y: 0, z: 5}, + emitSpeed: 1, + lifespan: 1, + particleRadius: 0.025, + alphaFinish: 0, emitRate: 100, textures: "https://hifi-public.s3.amazonaws.com/alan/Particles/Particle-Sprite-Smoke-1.png", }); @@ -1893,6 +1899,7 @@ entityListTool.webView.eventBridge.webEventReceived.connect(function(data) { currentProperties: properties }; + particleExplorerTool.setActiveParticleEntity(ids[0]); particleExplorerTool.webView.eventBridge.emitScriptEvent(JSON.stringify(data)); } else { diff --git a/examples/particle_explorer/particleExplorerTool.js b/examples/particle_explorer/particleExplorerTool.js index 83484a04ef..de2937bee7 100644 --- a/examples/particle_explorer/particleExplorerTool.js +++ b/examples/particle_explorer/particleExplorerTool.js @@ -14,12 +14,18 @@ ParticleExplorerTool = function() { webView.setVisible(visible); that.webView = webView; - var webEventReceived = function() { + var webEventReceived = function(data) { + var data = JSON.parse(data); + if (data.messageType === "settings_update") { + Entities.editEntity(that.activeParticleEntity, data.updatedSettings); + } print("EBL WEB EVENT RECIEVED FROM PARTICLE GUI"); } - webView.eventBridge.webEventReceived.connect(webEventReceived); + that.setActiveParticleEntity = function(id) { + that.activeParticleEntity = id; + } that.setVisible = function(newVisible) { visible = newVisible;