growing plant fixes

This commit is contained in:
ericrius1 2016-03-31 16:45:12 -07:00
parent 724d403fc7
commit 9ff4540697
4 changed files with 62 additions and 79 deletions

View file

@ -33,9 +33,7 @@
max: 1000 max: 1000
}; };
_this.canCreateFlower = true; _this.canCreateFlower = true;
// _this.SHADER_URL = "atp:/shaders/flower.fs"; _this.SHADER_URL = "atp:/shaders/flower.fs";
// EBL REMOVE ME
_this.SHADER_URL = Script.resolvePath("flower.fs");
_this.flowerHSLColors = [{ _this.flowerHSLColors = [{
hue: 19 / 360, hue: 19 / 360,

View file

@ -86,12 +86,12 @@
var forwardVec = Quat.getFront(rotation); var forwardVec = Quat.getFront(rotation);
if (forwardVec.y < _this.POUR_ANGLE_THRESHOLD) { if (forwardVec.y < _this.POUR_ANGLE_THRESHOLD) {
// Water is pouring // Water is pouring
var spoutProps = Entities.getEntityProperties(_this.waterSpout, ["rotation", "position"]); _this.spoutProps= Entities.getEntityProperties(_this.waterSpout, ["rotation", "position"]);
_this.castRay(); _this.castRay();
if (!_this.waterPouring) { if (!_this.waterPouring) {
_this.startPouring(); _this.startPouring();
} }
_this.waterSpoutRotation = spoutProps.rotation; _this.waterSpoutRotation = _this.spoutProps.rotation;
var waterEmitOrientation = Quat.multiply(_this.waterSpoutRotation, Quat.fromPitchYawRollDegrees(0, 180, 0)); var waterEmitOrientation = Quat.multiply(_this.waterSpoutRotation, Quat.fromPitchYawRollDegrees(0, 180, 0));
Entities.editEntity(_this.waterEffect, { Entities.editEntity(_this.waterEffect, {
emitOrientation: waterEmitOrientation emitOrientation: waterEmitOrientation
@ -125,7 +125,7 @@
_this.waterPouring = true; _this.waterPouring = true;
if (!_this.waterInjector) { if (!_this.waterInjector) {
_this.waterInjector = Audio.playSound(_this.waterSound, { _this.waterInjector = Audio.playSound(_this.waterSound, {
position: spoutProps.position, position: _this.spoutProps.position,
loop: true loop: true
}); });
@ -214,9 +214,7 @@
alpha: 1.0, alpha: 1.0,
alphaFinish: 1.0, alphaFinish: 1.0,
emitterShouldTrail: true, emitterShouldTrail: true,
// textures: "atp:/growingPlant/raindrop.png", textures: "atp:/growingPlant/raindrop.png",
//EBL REMOVE ME
textures: "https://s3-us-west-1.amazonaws.com/hifi-content/eric/images/raindrop.png",
userData: JSON.stringify({ userData: JSON.stringify({
'hifiHomeKey': { 'hifiHomeKey': {
'reset': true 'reset': true

View file

@ -11,12 +11,9 @@
// //
// //
// var PLANT_SCRIPT_URL = Script.resolvePath("atp:/growingPlant/growingPlantEntityScript.js"); var PLANT_SCRIPT_URL = Script.resolvePath("atp:/growingPlant/growingPlantEntityScript.js");
// var WATER_CAN_SCRIPT_URL = Script.resolvePath("atp:/growingPlant/waterCanEntityScript.js"); var WATER_CAN_SCRIPT_URL = Script.resolvePath("atp:/growingPlant/waterCanEntityScript.js");
//EBL REMOVE ME
var PLANT_SCRIPT_URL = Script.resolvePath("growingPlantEntityScript.js");
var WATER_CAN_SCRIPT_URL = Script.resolvePath("waterCanEntityScript.js");
Plant = function(spawnPosition, spawnRotation) { Plant = function(spawnPosition, spawnRotation) {
print("EBL PLANT CONSTRUCTOR!") print("EBL PLANT CONSTRUCTOR!")
var orientation; var orientation;
@ -27,11 +24,8 @@ Plant = function(spawnPosition, spawnRotation) {
} }
print("EBL ORIENTATION " + JSON.stringify(orientation)); print("EBL ORIENTATION " + JSON.stringify(orientation));
var bowlPosition = spawnPosition; var bowlPosition = spawnPosition;
// var BOWL_MODEL_URL = "atp:/growingPlant/Flowers-Bowl.fbx"; var BOWL_MODEL_URL = "atp:/growingPlant/Flowers-Bowl.fbx";
var BOWL_COLLISION_HULL_URL = "atp:/growingPlant/bowl.obj";
//EBL REMOVE ME
var BOWL_MODEL_URL = "http://hifi-content.s3.amazonaws.com/alan/dev/Flowers--Bowl.fbx";
var bowlDimensions = { var bowlDimensions = {
x: 0.518, x: 0.518,
y: 0.1938, y: 0.1938,
@ -41,9 +35,9 @@ Plant = function(spawnPosition, spawnRotation) {
type: "Model", type: "Model",
modelURL: BOWL_MODEL_URL, modelURL: BOWL_MODEL_URL,
dimensions: bowlDimensions, dimensions: bowlDimensions,
// dynamic: true, dynamic: true,
shapeType: 'box', shapeType: 'compound',
// compoundShapeURL: BOWL_COLLISION_HULL_URL, compoundShapeURL: BOWL_COLLISION_HULL_URL,
name: "home_model_plantNowl", name: "home_model_plantNowl",
position: bowlPosition, position: bowlPosition,
userData: JSON.stringify({ userData: JSON.stringify({
@ -55,9 +49,7 @@ Plant = function(spawnPosition, spawnRotation) {
//var PLANT_MODEL_URL = "atp:/growingPlant/Flowers-Rock.fbx"; var PLANT_MODEL_URL = "atp:/growingPlant/Flowers-Rock.fbx";
//EBL REMOVE ME
var PLANT_MODEL_URL = "http://hifi-content.s3.amazonaws.com/alan/dev/Flowers--Moss-Rock.fbx";
var plantDimensions = { var plantDimensions = {
x: 0.52, x: 0.52,
y: 0.2600, y: 0.2600,
@ -84,16 +76,14 @@ Plant = function(spawnPosition, spawnRotation) {
}); });
// var WATER_CAN_MODEL_URL = "atp:/growingPlant/waterCan.fbx"; var WATER_CAN_MODEL_URL = "atp:/growingPlant/waterCan.fbx";
// EBL REMOVE ME
var WATER_CAN_MODEL_URL = "https://s3-us-west-1.amazonaws.com/hifi-content/eric/models/waterCan.fbx?v1" + Math.random();
var WATER_CAN_COLLIISION_HULL_URL = "atp:/growingPlant/can.obj"; var WATER_CAN_COLLIISION_HULL_URL = "atp:/growingPlant/can.obj";
var waterCanPosition = Vec3.sum(plantPosition, Vec3.multiply(0.6, Quat.getRight(orientation))); var waterCanPosition = Vec3.sum(plantPosition, Vec3.multiply(0.6, Quat.getRight(orientation)));
var waterCanRotation = orientation; var waterCanRotation = orientation;
var waterCan = Entities.addEntity({ var waterCan = Entities.addEntity({
type: "Model", type: "Model",
shapeType: 'box', shapeType: 'compound',
// compoundShapeURL: WATER_CAN_COLLIISION_HULL_URL, compoundShapeURL: WATER_CAN_COLLIISION_HULL_URL,
name: "home_model_waterCan", name: "home_model_waterCan",
modelURL: WATER_CAN_MODEL_URL, modelURL: WATER_CAN_MODEL_URL,
script: WATER_CAN_SCRIPT_URL, script: WATER_CAN_SCRIPT_URL,

View file

@ -28,11 +28,10 @@
var whiteboardPath = Script.resolvePath("atp:/whiteboard/wrapper.js"); var whiteboardPath = Script.resolvePath("atp:/whiteboard/wrapper.js");
// var plantPath = Script.resolvePath("atp:/growingPlant/wrapper.js"); var plantPath = Script.resolvePath("atp:/growingPlant/wrapper.js");
//EBL REMOVE ME //EBL REMOVE ME
var myPlant; var myPlant;
var plantPath = Script.resolvePath("growingPlant/wrapper.js?v1" + Math.random());
var cuckooClockPath = Script.resolvePath("atp:/cuckooClock/wrapper.js"); var cuckooClockPath = Script.resolvePath("atp:/cuckooClock/wrapper.js");
@ -113,16 +112,16 @@
_this.showTidyingButton(); _this.showTidyingButton();
_this.playTidyingSound(); _this.playTidyingSound();
// _this.findAndDeleteHomeEntities(); _this.findAndDeleteHomeEntities();
Script.setTimeout(function() { Script.setTimeout(function() {
_this.showTidyButton(); _this.showTidyButton();
_this.tidying = false; _this.tidying = false;
}, 2500); }, 2500);
Script.setTimeout(function() { Script.setTimeout(function() {
// _this.createKineticEntities(); _this.createKineticEntities();
_this.createDynamicEntities(); _this.createDynamicEntities();
// _this.setupDressingRoom(); _this.setupDressingRoom();
}, 750) }, 750)
@ -142,31 +141,31 @@
}, },
createDynamicEntities: function() { createDynamicEntities: function() {
// var fishTank = new FishTank({ var fishTank = new FishTank({
// x: 1099.2200, x: 1099.2200,
// y: 460.5460, y: 460.5460,
// z: -78.2363 z: -78.2363
// }, { }, {
// x: 0, x: 0,
// y: 0, y: 0,
// z: 0 z: 0
// }); });
// var tiltMaze = new TiltMaze({ var tiltMaze = new TiltMaze({
// x: 1105.5768, x: 1105.5768,
// y: 460.3298, y: 460.3298,
// z: -80.4891 z: -80.4891
// }); });
// var whiteboard = new Whiteboard({ var whiteboard = new Whiteboard({
// x: 1104, x: 1104,
// y: 460.5, y: 460.5,
// z: -77 z: -77
// }, { }, {
// x: 0, x: 0,
// y: -133, y: -133,
// z: 0 z: 0
// }); });
myPlant = new Plant({ myPlant = new Plant({
x: 1099.8785, x: 1099.8785,
@ -178,26 +177,26 @@
z: 0 z: 0
}); });
// var pingPongGun = new HomePingPongGun({ var pingPongGun = new HomePingPongGun({
// x: 1101.2123, x: 1101.2123,
// y: 460.2328, y: 460.2328,
// z: -65.8513 z: -65.8513
// }, { }, {
// x: 97.3683, x: 97.3683,
// y: 179.0293, y: 179.0293,
// z: 89.9698 z: 89.9698
// }); });
// var cuckooClock = new MyCuckooClock({ var cuckooClock = new MyCuckooClock({
// x: 1105.267, x: 1105.267,
// y: 461.44, y: 461.44,
// z: -81.9495 z: -81.9495
// }, { }, {
// x: 0, x: 0,
// y: -57, y: -57,
// z: 0 z: 0
// }); });
//v2.0 // v2.0
// var musicBox = new MusicBox(); // var musicBox = new MusicBox();
// var doppelganger = new Doppelganger(); // var doppelganger = new Doppelganger();
@ -460,9 +459,7 @@
}, },
unload: function() { unload: function() {
// this.findAndDeleteHomeEntities(); this.findAndDeleteHomeEntities();
//REMOVE ME
myPlant.cleanup();
} }