mirror of
https://github.com/overte-org/overte.git
synced 2025-04-16 13:56:24 +02:00
growing plant fixes
This commit is contained in:
parent
724d403fc7
commit
9ff4540697
4 changed files with 62 additions and 79 deletions
|
@ -33,9 +33,7 @@
|
|||
max: 1000
|
||||
};
|
||||
_this.canCreateFlower = true;
|
||||
// _this.SHADER_URL = "atp:/shaders/flower.fs";
|
||||
// EBL REMOVE ME
|
||||
_this.SHADER_URL = Script.resolvePath("flower.fs");
|
||||
_this.SHADER_URL = "atp:/shaders/flower.fs";
|
||||
|
||||
_this.flowerHSLColors = [{
|
||||
hue: 19 / 360,
|
||||
|
|
|
@ -86,12 +86,12 @@
|
|||
var forwardVec = Quat.getFront(rotation);
|
||||
if (forwardVec.y < _this.POUR_ANGLE_THRESHOLD) {
|
||||
// Water is pouring
|
||||
var spoutProps = Entities.getEntityProperties(_this.waterSpout, ["rotation", "position"]);
|
||||
_this.spoutProps= Entities.getEntityProperties(_this.waterSpout, ["rotation", "position"]);
|
||||
_this.castRay();
|
||||
if (!_this.waterPouring) {
|
||||
_this.startPouring();
|
||||
}
|
||||
_this.waterSpoutRotation = spoutProps.rotation;
|
||||
_this.waterSpoutRotation = _this.spoutProps.rotation;
|
||||
var waterEmitOrientation = Quat.multiply(_this.waterSpoutRotation, Quat.fromPitchYawRollDegrees(0, 180, 0));
|
||||
Entities.editEntity(_this.waterEffect, {
|
||||
emitOrientation: waterEmitOrientation
|
||||
|
@ -125,7 +125,7 @@
|
|||
_this.waterPouring = true;
|
||||
if (!_this.waterInjector) {
|
||||
_this.waterInjector = Audio.playSound(_this.waterSound, {
|
||||
position: spoutProps.position,
|
||||
position: _this.spoutProps.position,
|
||||
loop: true
|
||||
});
|
||||
|
||||
|
@ -214,9 +214,7 @@
|
|||
alpha: 1.0,
|
||||
alphaFinish: 1.0,
|
||||
emitterShouldTrail: true,
|
||||
// textures: "atp:/growingPlant/raindrop.png",
|
||||
//EBL REMOVE ME
|
||||
textures: "https://s3-us-west-1.amazonaws.com/hifi-content/eric/images/raindrop.png",
|
||||
textures: "atp:/growingPlant/raindrop.png",
|
||||
userData: JSON.stringify({
|
||||
'hifiHomeKey': {
|
||||
'reset': true
|
||||
|
|
|
@ -11,12 +11,9 @@
|
|||
//
|
||||
|
||||
//
|
||||
// var PLANT_SCRIPT_URL = Script.resolvePath("atp:/growingPlant/growingPlantEntityScript.js");
|
||||
// var WATER_CAN_SCRIPT_URL = Script.resolvePath("atp:/growingPlant/waterCanEntityScript.js");
|
||||
var PLANT_SCRIPT_URL = Script.resolvePath("atp:/growingPlant/growingPlantEntityScript.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) {
|
||||
print("EBL PLANT CONSTRUCTOR!")
|
||||
var orientation;
|
||||
|
@ -27,11 +24,8 @@ Plant = function(spawnPosition, spawnRotation) {
|
|||
}
|
||||
print("EBL ORIENTATION " + JSON.stringify(orientation));
|
||||
var bowlPosition = spawnPosition;
|
||||
// var BOWL_MODEL_URL = "atp:/growingPlant/Flowers-Bowl.fbx";
|
||||
var BOWL_COLLISION_HULL_URL = "atp:/growingPlant/bowl.obj";
|
||||
var BOWL_MODEL_URL = "atp:/growingPlant/Flowers-Bowl.fbx";
|
||||
|
||||
//EBL REMOVE ME
|
||||
var BOWL_MODEL_URL = "http://hifi-content.s3.amazonaws.com/alan/dev/Flowers--Bowl.fbx";
|
||||
var bowlDimensions = {
|
||||
x: 0.518,
|
||||
y: 0.1938,
|
||||
|
@ -41,9 +35,9 @@ Plant = function(spawnPosition, spawnRotation) {
|
|||
type: "Model",
|
||||
modelURL: BOWL_MODEL_URL,
|
||||
dimensions: bowlDimensions,
|
||||
// dynamic: true,
|
||||
shapeType: 'box',
|
||||
// compoundShapeURL: BOWL_COLLISION_HULL_URL,
|
||||
dynamic: true,
|
||||
shapeType: 'compound',
|
||||
compoundShapeURL: BOWL_COLLISION_HULL_URL,
|
||||
name: "home_model_plantNowl",
|
||||
position: bowlPosition,
|
||||
userData: JSON.stringify({
|
||||
|
@ -55,9 +49,7 @@ Plant = function(spawnPosition, spawnRotation) {
|
|||
|
||||
|
||||
|
||||
//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 PLANT_MODEL_URL = "atp:/growingPlant/Flowers-Rock.fbx";
|
||||
var plantDimensions = {
|
||||
x: 0.52,
|
||||
y: 0.2600,
|
||||
|
@ -84,16 +76,14 @@ Plant = function(spawnPosition, spawnRotation) {
|
|||
});
|
||||
|
||||
|
||||
// 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_MODEL_URL = "atp:/growingPlant/waterCan.fbx";
|
||||
var WATER_CAN_COLLIISION_HULL_URL = "atp:/growingPlant/can.obj";
|
||||
var waterCanPosition = Vec3.sum(plantPosition, Vec3.multiply(0.6, Quat.getRight(orientation)));
|
||||
var waterCanRotation = orientation;
|
||||
var waterCan = Entities.addEntity({
|
||||
type: "Model",
|
||||
shapeType: 'box',
|
||||
// compoundShapeURL: WATER_CAN_COLLIISION_HULL_URL,
|
||||
shapeType: 'compound',
|
||||
compoundShapeURL: WATER_CAN_COLLIISION_HULL_URL,
|
||||
name: "home_model_waterCan",
|
||||
modelURL: WATER_CAN_MODEL_URL,
|
||||
script: WATER_CAN_SCRIPT_URL,
|
||||
|
|
|
@ -28,11 +28,10 @@
|
|||
|
||||
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
|
||||
var myPlant;
|
||||
var plantPath = Script.resolvePath("growingPlant/wrapper.js?v1" + Math.random());
|
||||
|
||||
var cuckooClockPath = Script.resolvePath("atp:/cuckooClock/wrapper.js");
|
||||
|
||||
|
@ -113,16 +112,16 @@
|
|||
_this.showTidyingButton();
|
||||
_this.playTidyingSound();
|
||||
|
||||
// _this.findAndDeleteHomeEntities();
|
||||
_this.findAndDeleteHomeEntities();
|
||||
Script.setTimeout(function() {
|
||||
_this.showTidyButton();
|
||||
_this.tidying = false;
|
||||
}, 2500);
|
||||
|
||||
Script.setTimeout(function() {
|
||||
// _this.createKineticEntities();
|
||||
_this.createKineticEntities();
|
||||
_this.createDynamicEntities();
|
||||
// _this.setupDressingRoom();
|
||||
_this.setupDressingRoom();
|
||||
}, 750)
|
||||
|
||||
|
||||
|
@ -142,31 +141,31 @@
|
|||
},
|
||||
|
||||
createDynamicEntities: function() {
|
||||
// var fishTank = new FishTank({
|
||||
// x: 1099.2200,
|
||||
// y: 460.5460,
|
||||
// z: -78.2363
|
||||
// }, {
|
||||
// x: 0,
|
||||
// y: 0,
|
||||
// z: 0
|
||||
// });
|
||||
var fishTank = new FishTank({
|
||||
x: 1099.2200,
|
||||
y: 460.5460,
|
||||
z: -78.2363
|
||||
}, {
|
||||
x: 0,
|
||||
y: 0,
|
||||
z: 0
|
||||
});
|
||||
|
||||
// var tiltMaze = new TiltMaze({
|
||||
// x: 1105.5768,
|
||||
// y: 460.3298,
|
||||
// z: -80.4891
|
||||
// });
|
||||
var tiltMaze = new TiltMaze({
|
||||
x: 1105.5768,
|
||||
y: 460.3298,
|
||||
z: -80.4891
|
||||
});
|
||||
|
||||
// var whiteboard = new Whiteboard({
|
||||
// x: 1104,
|
||||
// y: 460.5,
|
||||
// z: -77
|
||||
// }, {
|
||||
// x: 0,
|
||||
// y: -133,
|
||||
// z: 0
|
||||
// });
|
||||
var whiteboard = new Whiteboard({
|
||||
x: 1104,
|
||||
y: 460.5,
|
||||
z: -77
|
||||
}, {
|
||||
x: 0,
|
||||
y: -133,
|
||||
z: 0
|
||||
});
|
||||
|
||||
myPlant = new Plant({
|
||||
x: 1099.8785,
|
||||
|
@ -178,26 +177,26 @@
|
|||
z: 0
|
||||
});
|
||||
|
||||
// var pingPongGun = new HomePingPongGun({
|
||||
// x: 1101.2123,
|
||||
// y: 460.2328,
|
||||
// z: -65.8513
|
||||
// }, {
|
||||
// x: 97.3683,
|
||||
// y: 179.0293,
|
||||
// z: 89.9698
|
||||
// });
|
||||
// var cuckooClock = new MyCuckooClock({
|
||||
// x: 1105.267,
|
||||
// y: 461.44,
|
||||
// z: -81.9495
|
||||
// }, {
|
||||
// x: 0,
|
||||
// y: -57,
|
||||
// z: 0
|
||||
// });
|
||||
var pingPongGun = new HomePingPongGun({
|
||||
x: 1101.2123,
|
||||
y: 460.2328,
|
||||
z: -65.8513
|
||||
}, {
|
||||
x: 97.3683,
|
||||
y: 179.0293,
|
||||
z: 89.9698
|
||||
});
|
||||
var cuckooClock = new MyCuckooClock({
|
||||
x: 1105.267,
|
||||
y: 461.44,
|
||||
z: -81.9495
|
||||
}, {
|
||||
x: 0,
|
||||
y: -57,
|
||||
z: 0
|
||||
});
|
||||
|
||||
//v2.0
|
||||
// v2.0
|
||||
// var musicBox = new MusicBox();
|
||||
// var doppelganger = new Doppelganger();
|
||||
|
||||
|
@ -460,9 +459,7 @@
|
|||
},
|
||||
|
||||
unload: function() {
|
||||
// this.findAndDeleteHomeEntities();
|
||||
//REMOVE ME
|
||||
myPlant.cleanup();
|
||||
this.findAndDeleteHomeEntities();
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue