mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 01:00:44 +02:00
need multiple explosions at once
This commit is contained in:
parent
0499334938
commit
0a6a35ddd8
2 changed files with 12 additions and 34 deletions
|
@ -199,7 +199,7 @@ pointInExtents = function(point, minPoint, maxPoint) {
|
||||||
* @param Number l The lightness
|
* @param Number l The lightness
|
||||||
* @return Array The RGB representation
|
* @return Array The RGB representation
|
||||||
*/
|
*/
|
||||||
hslToRgb = function(hsl, hueOffset) {
|
hslToRgb = function(hsl) {
|
||||||
var r, g, b;
|
var r, g, b;
|
||||||
if (hsl.s == 0) {
|
if (hsl.s == 0) {
|
||||||
r = g = b = hsl.l; // achromatic
|
r = g = b = hsl.l; // achromatic
|
||||||
|
|
|
@ -21,12 +21,12 @@
|
||||||
min: 2000,
|
min: 2000,
|
||||||
max: 3000
|
max: 3000
|
||||||
};
|
};
|
||||||
|
_this.explodeTime = 500;
|
||||||
};
|
};
|
||||||
|
|
||||||
Fireworks.prototype = {
|
Fireworks.prototype = {
|
||||||
|
|
||||||
startNearTrigger: function() {
|
startNearTrigger: function() {
|
||||||
print("EBL NEAR TRIGGER")
|
|
||||||
_this.shootFirework();
|
_this.shootFirework();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -170,25 +170,18 @@
|
||||||
name: "fireworks emitter",
|
name: "fireworks emitter",
|
||||||
position: explodePosition,
|
position: explodePosition,
|
||||||
type: "ParticleEffect",
|
type: "ParticleEffect",
|
||||||
color: {
|
colorStart: hslToRgb({h: Math.random(), s: 0.5, l: 0.7}),
|
||||||
red: 205,
|
color: hslToRgb({h: Math.random(), s: 0.5, l: 0.5}),
|
||||||
green: 84,
|
colorFinish: hslToRgb({h: Math.random(), s: 0.5, l: 0.7}),
|
||||||
blue: 84
|
maxParticles: 10000,
|
||||||
},
|
|
||||||
maxParticles: 1000,
|
|
||||||
lifetime: 20,
|
lifetime: 20,
|
||||||
lifespan: 4,
|
lifespan: randFloat(1.5, 3),
|
||||||
emitRate: 1000,
|
emitRate: randInt(500, 3000),
|
||||||
emitSpeed: 1.5,
|
emitSpeed: randFloat(0.5, 2),
|
||||||
speedSpread: 1.0,
|
speedSpread: 1.0,
|
||||||
emitOrientation: {
|
emitOrientation: Quat.fromPitchYawRollDegrees(randInt(0, 360), randInt(0, 360), randInt(0, 360)),
|
||||||
x: -0.2,
|
|
||||||
y: 0,
|
|
||||||
z: 0,
|
|
||||||
w: 0.7
|
|
||||||
},
|
|
||||||
polarStart: 1,
|
polarStart: 1,
|
||||||
polarFinish: 1.2,
|
polarFinish: randFloat(1.2, 3),
|
||||||
azimuthStart: -Math.PI,
|
azimuthStart: -Math.PI,
|
||||||
azimuthFinish: Math.PI,
|
azimuthFinish: Math.PI,
|
||||||
emitAcceleration: {
|
emitAcceleration: {
|
||||||
|
@ -205,21 +198,6 @@
|
||||||
radiusSpread: 0,
|
radiusSpread: 0,
|
||||||
radiusStart: 0.06,
|
radiusStart: 0.06,
|
||||||
radiusFinish: 0.05,
|
radiusFinish: 0.05,
|
||||||
colorSpread: {
|
|
||||||
red: 0,
|
|
||||||
green: 0,
|
|
||||||
blue: 0
|
|
||||||
},
|
|
||||||
colorStart: {
|
|
||||||
red: 255,
|
|
||||||
green: 255,
|
|
||||||
blue: 255
|
|
||||||
},
|
|
||||||
colorFinish: {
|
|
||||||
red: 255,
|
|
||||||
green: 255,
|
|
||||||
blue: 255
|
|
||||||
},
|
|
||||||
alpha: 1,
|
alpha: 1,
|
||||||
alphaSpread: 0,
|
alphaSpread: 0,
|
||||||
alphaStart: 0,
|
alphaStart: 0,
|
||||||
|
@ -233,7 +211,7 @@
|
||||||
Entities.editEntity(_this.firework, {
|
Entities.editEntity(_this.firework, {
|
||||||
isEmitting: false
|
isEmitting: false
|
||||||
});
|
});
|
||||||
}, 1000)
|
}, _this.explodeTime);
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue