mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 18:13:05 +02:00
relative smoke trail
This commit is contained in:
parent
fdb5d33866
commit
c26ad2b9d0
1 changed files with 41 additions and 29 deletions
|
@ -45,35 +45,35 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
var MODEL_URL = "https://s3-us-west-1.amazonaws.com/hifi-content/eric/models/Rocket-2.fbx";
|
var MODEL_URL = "https://s3-us-west-1.amazonaws.com/hifi-content/eric/models/Rocket-2.fbx";
|
||||||
var missleDimensions = {
|
var missleDimensions = Vec3.multiply({
|
||||||
x: 0.24,
|
x: 0.24,
|
||||||
y: 0.7,
|
y: 0.7,
|
||||||
z: 0.24
|
z: 0.24
|
||||||
};
|
}, randFloat(0.2, 1.5));
|
||||||
var missle = Entities.addEntity({
|
var missleRotation = Quat.fromPitchYawRollDegrees(randInt(-30, 30), 0, randInt(-30, 30));
|
||||||
type: "Model",
|
var missleVelocity = Vec3.multiply(Quat.getUp(missleRotation), randFloat(1, 3));
|
||||||
modelURL: MODEL_URL,
|
var missleAcceleration = Vec3.multiply(Quat.getUp(missleRotation), randFloat(0.7, 3));
|
||||||
position: rocketPosition,
|
var missle = Entities.addEntity({
|
||||||
dimensions: missleDimensions,
|
type: "Model",
|
||||||
damping: 0,
|
modelURL: MODEL_URL,
|
||||||
dynamic: true,
|
position: rocketPosition,
|
||||||
velocity: {
|
rotation: missleRotation,
|
||||||
x: 0.0,
|
dimensions: missleDimensions,
|
||||||
y: randFloat(0.4, 1.0),
|
damping: 0,
|
||||||
z: 0
|
dynamic: true,
|
||||||
},
|
velocity: missleVelocity,
|
||||||
acceleration: {
|
acceleration: missleAcceleration,
|
||||||
x: 0,
|
angularVelocity: {
|
||||||
y: randFloat(1.0, 2.0),
|
x: 0,
|
||||||
z: 0
|
y: randInt(-5, 5),
|
||||||
},
|
z: 0
|
||||||
angularVelocity: {x: 0, y: randInt(0, 10), z: 0},
|
},
|
||||||
angularDamping: 0
|
angularDamping: 0
|
||||||
});
|
});
|
||||||
|
|
||||||
var smokeTrailPosition = Vec3.sum(rocketPosition, {
|
var smokeTrailPosition = Vec3.sum(rocketPosition, {
|
||||||
x: 0,
|
x: 0,
|
||||||
y: -missleDimensions.y/2 + 0.1,
|
y: -missleDimensions.y / 2 + 0.1,
|
||||||
z: 0
|
z: 0
|
||||||
});
|
});
|
||||||
var smokeSettings = {
|
var smokeSettings = {
|
||||||
|
@ -172,9 +172,21 @@
|
||||||
name: "fireworks emitter",
|
name: "fireworks emitter",
|
||||||
position: explodePosition,
|
position: explodePosition,
|
||||||
type: "ParticleEffect",
|
type: "ParticleEffect",
|
||||||
colorStart: hslToRgb({h: Math.random(), s: 0.5, l: 0.7}),
|
colorStart: hslToRgb({
|
||||||
color: hslToRgb({h: Math.random(), s: 0.5, l: 0.5}),
|
h: Math.random(),
|
||||||
colorFinish: hslToRgb({h: Math.random(), s: 0.5, l: 0.7}),
|
s: 0.5,
|
||||||
|
l: 0.7
|
||||||
|
}),
|
||||||
|
color: hslToRgb({
|
||||||
|
h: Math.random(),
|
||||||
|
s: 0.5,
|
||||||
|
l: 0.5
|
||||||
|
}),
|
||||||
|
colorFinish: hslToRgb({
|
||||||
|
h: Math.random(),
|
||||||
|
s: 0.5,
|
||||||
|
l: 0.7
|
||||||
|
}),
|
||||||
maxParticles: 10000,
|
maxParticles: 10000,
|
||||||
lifetime: 20,
|
lifetime: 20,
|
||||||
lifespan: randFloat(1.5, 3),
|
lifespan: randFloat(1.5, 3),
|
||||||
|
|
Loading…
Reference in a new issue