diff --git a/unpublishedScripts/DomainContent/Home/growingPlant/waterCanEntityScript.js b/unpublishedScripts/DomainContent/Home/growingPlant/waterCanEntityScript.js index 44904a0173..21497c2706 100644 --- a/unpublishedScripts/DomainContent/Home/growingPlant/waterCanEntityScript.js +++ b/unpublishedScripts/DomainContent/Home/growingPlant/waterCanEntityScript.js @@ -37,6 +37,14 @@ }, startHold: function() { + if (_this.waterSpout) { + _this.waterSpoutPosition = Entities.getEntityProperties(_this.waterSpout, "position").position; + _this.waterSpoutRotation = Entities.getEntityProperties(_this.waterSpout, "rotation").rotation; + _this.createWaterEffect(); + } else { + print("EBL NO WATER SPOUT FOUND RETURNING"); + return; + } _this.findGrowableEntities(); }, @@ -50,6 +58,9 @@ releaseHold: function() { _this.stopPouring(); + Script.setTimeout(function() { + Entities.deleteEntity(_this.waterEffect); + }, 2000); }, stopPouring: function() { @@ -130,8 +141,6 @@ }, - - createWaterEffect: function() { var waterEffectPosition = Vec3.sum(_this.waterSpoutPosition, Vec3.multiply(Quat.getFront(_this.waterSpoutRotation), -0.04)); _this.waterEffect = Entities.addEntity({ @@ -157,6 +166,7 @@ }, maxParticles: 20000, lifespan: 2, + lifetime: 5000, //Doubtful anyone will hold water can longer than this emitRate: 2000, emitSpeed: .3, speedSpread: 0.1, @@ -222,13 +232,7 @@ } }); - if (_this.waterSpout) { - _this.waterSpoutPosition = Entities.getEntityProperties(_this.waterSpout, "position").position; - _this.waterSpoutRotation = Entities.getEntityProperties(_this.waterSpout, "rotation").rotation; - _this.createWaterEffect(); - } - - }, 3000); + }, 2000); }, diff --git a/unpublishedScripts/DomainContent/Home/growingPlant/wrapper.js b/unpublishedScripts/DomainContent/Home/growingPlant/wrapper.js index 38f26c9edc..f1679d8b8d 100644 --- a/unpublishedScripts/DomainContent/Home/growingPlant/wrapper.js +++ b/unpublishedScripts/DomainContent/Home/growingPlant/wrapper.js @@ -12,14 +12,13 @@ var PLANT_SCRIPT_URL = Script.resolvePath("growingPlantEntityScript.js?v1" + Math.random().toFixed(2)); var WATER_CAN_SCRIPT_URL = Script.resolvePath("waterCanEntityScript.js?v2" + Math.random().toFixed()); Plant = function(spawnPosition, spawnRotation) { - var orientation = Camera.getOrientation(); - orientation = Quat.safeEulerAngles(orientation); - orientation.x = 0; - orientation = Quat.fromVec3Degrees(orientation); + var orientation; if (spawnRotation !== undefined) { - orientation = spawnRotation; + orientation = Quat.fromPitchYawRollDegrees(spawnRotation.x, spawnRotation.y, spawnRotation.z); + } else { + orientation = Camera.getOrientation(); } - + print("EBL ORIENTATION " + JSON.stringify(orientation)); var bowlPosition = spawnPosition; var BOWL_MODEL_URL = "http://hifi-content.s3.amazonaws.com/alan/dev/Flowers--Bowl.fbx"; var bowlDimensions = {