each flower needs to be its own object

This commit is contained in:
ericrius1 2016-02-15 15:43:44 -08:00
parent 969ae2e07b
commit 03ca41c0c2
2 changed files with 10 additions and 6 deletions

View file

@ -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;

View file

@ -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();