mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 16:41:02 +02:00
Merge pull request #13 from ericrius1/homereset
Water effect for water can created on hold and deleted on release now
This commit is contained in:
commit
7934eee368
2 changed files with 18 additions and 15 deletions
|
@ -37,6 +37,14 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
startHold: function() {
|
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();
|
_this.findGrowableEntities();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -50,6 +58,9 @@
|
||||||
|
|
||||||
releaseHold: function() {
|
releaseHold: function() {
|
||||||
_this.stopPouring();
|
_this.stopPouring();
|
||||||
|
Script.setTimeout(function() {
|
||||||
|
Entities.deleteEntity(_this.waterEffect);
|
||||||
|
}, 2000);
|
||||||
},
|
},
|
||||||
|
|
||||||
stopPouring: function() {
|
stopPouring: function() {
|
||||||
|
@ -130,8 +141,6 @@
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
createWaterEffect: function() {
|
createWaterEffect: function() {
|
||||||
var waterEffectPosition = Vec3.sum(_this.waterSpoutPosition, Vec3.multiply(Quat.getFront(_this.waterSpoutRotation), -0.04));
|
var waterEffectPosition = Vec3.sum(_this.waterSpoutPosition, Vec3.multiply(Quat.getFront(_this.waterSpoutRotation), -0.04));
|
||||||
_this.waterEffect = Entities.addEntity({
|
_this.waterEffect = Entities.addEntity({
|
||||||
|
@ -157,6 +166,7 @@
|
||||||
},
|
},
|
||||||
maxParticles: 20000,
|
maxParticles: 20000,
|
||||||
lifespan: 2,
|
lifespan: 2,
|
||||||
|
lifetime: 5000, //Doubtful anyone will hold water can longer than this
|
||||||
emitRate: 2000,
|
emitRate: 2000,
|
||||||
emitSpeed: .3,
|
emitSpeed: .3,
|
||||||
speedSpread: 0.1,
|
speedSpread: 0.1,
|
||||||
|
@ -222,13 +232,7 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (_this.waterSpout) {
|
}, 2000);
|
||||||
_this.waterSpoutPosition = Entities.getEntityProperties(_this.waterSpout, "position").position;
|
|
||||||
_this.waterSpoutRotation = Entities.getEntityProperties(_this.waterSpout, "rotation").rotation;
|
|
||||||
_this.createWaterEffect();
|
|
||||||
}
|
|
||||||
|
|
||||||
}, 3000);
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -12,14 +12,13 @@
|
||||||
var PLANT_SCRIPT_URL = Script.resolvePath("growingPlantEntityScript.js?v1" + Math.random().toFixed(2));
|
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());
|
var WATER_CAN_SCRIPT_URL = Script.resolvePath("waterCanEntityScript.js?v2" + Math.random().toFixed());
|
||||||
Plant = function(spawnPosition, spawnRotation) {
|
Plant = function(spawnPosition, spawnRotation) {
|
||||||
var orientation = Camera.getOrientation();
|
var orientation;
|
||||||
orientation = Quat.safeEulerAngles(orientation);
|
|
||||||
orientation.x = 0;
|
|
||||||
orientation = Quat.fromVec3Degrees(orientation);
|
|
||||||
if (spawnRotation !== undefined) {
|
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 bowlPosition = spawnPosition;
|
||||||
var BOWL_MODEL_URL = "http://hifi-content.s3.amazonaws.com/alan/dev/Flowers--Bowl.fbx";
|
var BOWL_MODEL_URL = "http://hifi-content.s3.amazonaws.com/alan/dev/Flowers--Bowl.fbx";
|
||||||
var bowlDimensions = {
|
var bowlDimensions = {
|
||||||
|
|
Loading…
Reference in a new issue