From 03ca41c0c244559f452d2bb7df2303e97b7e7e67 Mon Sep 17 00:00:00 2001 From: ericrius1 Date: Mon, 15 Feb 2016 15:43:44 -0800 Subject: [PATCH] each flower needs to be its own object --- .../homeContent/plant/growingPlantEntityScript.js | 14 +++++++++----- examples/homeContent/plant/growingPlantSpawner.js | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/examples/homeContent/plant/growingPlantEntityScript.js b/examples/homeContent/plant/growingPlantEntityScript.js index e0aa4b6049..a1beb37140 100644 --- a/examples/homeContent/plant/growingPlantEntityScript.js +++ b/examples/homeContent/plant/growingPlantEntityScript.js @@ -32,6 +32,14 @@ // Need to raise up cactus as it stretches so it doesnt burst out the bottom of the plant _this.cactusPosition = Vec3.sum(_this.cactusPosition, {x: 0, y: _this.cactusHeightMovement, z: 0}); Entities.editEntity(_this.cactus, {dimensions: _this.cactusDimensions, position: _this.cactusPosition}); + + _this.flowers.forEach(_this.waterFlower) + }, + + waterFlower: function(flower) { + var props = Entities.getEntityProperties(flower, ["position, dimensions"]); + var newDimensions = Vec3.sum(props.dimensions, {x: 0, y: 0.01, z: 0}); + Entities.editEntity(flower, {dimensions: newDimensions}); }, createFlowers: function() { @@ -88,13 +96,9 @@ modelURL: MODEL_URL, position: _this.cactusPosition, dimensions: _this.cactusDimensions - }); - - - + }); }, - preload: function(entityID) { print("EBL PRELOAD"); this.entityID = entityID; diff --git a/examples/homeContent/plant/growingPlantSpawner.js b/examples/homeContent/plant/growingPlantSpawner.js index 63a2bf465d..65bc91ac0d 100644 --- a/examples/homeContent/plant/growingPlantSpawner.js +++ b/examples/homeContent/plant/growingPlantSpawner.js @@ -14,7 +14,7 @@ var orientation = Camera.getOrientation(); orientation = Quat.safeEulerAngles(orientation); orientation.x = 0; orientation = Quat.fromVec3Degrees(orientation); -var center = Vec3.sum(MyAvatar.position, Vec3.multiply(3, Quat.getFront(orientation))); +var center = Vec3.sum(MyAvatar.position, Vec3.multiply(2, Quat.getFront(orientation))); var pot, hose; initializePlant();