mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 18:56:55 +02:00
water effect created on hold
This commit is contained in:
parent
7bbb8167d0
commit
22629bf6c4
2 changed files with 14 additions and 17 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);
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -127,13 +127,6 @@ Plant = function(spawnPosition, spawnRotation) {
|
||||||
|
|
||||||
var waterSpoutPosition = Vec3.sum(waterCanPosition, Vec3.multiply(0.2, Quat.getFront(orientation)))
|
var waterSpoutPosition = Vec3.sum(waterCanPosition, Vec3.multiply(0.2, Quat.getFront(orientation)))
|
||||||
var waterSpoutRotation = Quat.multiply(waterCanRotation, Quat.fromPitchYawRollDegrees(10, 0, 0));
|
var waterSpoutRotation = Quat.multiply(waterCanRotation, Quat.fromPitchYawRollDegrees(10, 0, 0));
|
||||||
// var waterSpoutRotation = {
|
|
||||||
// x: waterSpoutRotation.x,
|
|
||||||
// y: waterSpoutRotation.y,
|
|
||||||
// z: waterSpoutRotation.z,
|
|
||||||
// w: waterSpoutRotation.w
|
|
||||||
// };
|
|
||||||
print("EBL SET ROTATION")
|
|
||||||
var waterSpout = Entities.addEntity({
|
var waterSpout = Entities.addEntity({
|
||||||
type: "Box",
|
type: "Box",
|
||||||
name: "hifi-water-spout",
|
name: "hifi-water-spout",
|
||||||
|
@ -150,7 +143,7 @@ Plant = function(spawnPosition, spawnRotation) {
|
||||||
position: waterSpoutPosition,
|
position: waterSpoutPosition,
|
||||||
rotation: waterSpoutRotation,
|
rotation: waterSpoutRotation,
|
||||||
parentID: waterCan,
|
parentID: waterCan,
|
||||||
// visible: false,
|
visible: false,
|
||||||
userData: JSON.stringify({
|
userData: JSON.stringify({
|
||||||
'hifiHomeKey': {
|
'hifiHomeKey': {
|
||||||
'reset': true
|
'reset': true
|
||||||
|
|
Loading…
Reference in a new issue