content/hifi-public/eric/scripts/particleTest.js
Dale Glass 0d14e5a379 Initial data.
Needs a lot of cleanup. Data has been de-duplicated, and where identical copies existed, one of them
has been replaced with a symlink.

Some files have been excluded, such as binaries, installers and debug dumps. Some of that may still
be present.
2022-02-13 18:59:11 +01:00

43 lines
No EOL
1.4 KiB
JavaScript

var center = Vec3.sum(MyAvatar.position, Vec3.multiply(3, Quat.getFront(Camera.getOrientation())));
var particleParams = {
type: "ParticleEffect",
position: center,
particleRadius: .01,
radiusSpread: 0.0,
emitRate: 1000,
emitSpeed: .1,
emitAcceleration: {
x: 0,
y: 0,
z: 0
},
speedSpread: 0.0,
polarFinish: Math.PI,
textures: "https://hifi-public.s3.amazonaws.com/alan/Particles/Particle-Sprite-Smoke-1.png",
color: {
red: 255,
green: 0,
blue: 255
},
lifespan: 5.0,
isEmitting: true,
lifetime: 3600, // 1 hour; just in case,
// additiveBlending: false
};
var explosion1 = Entities.addEntity(particleParams);
particleParams.position.x += .2;
particleParams.color.red = 0;
var explosion2 = Entities.addEntity(particleParams);
particleParams.position.x += .2;
particleParams.color.green = 200;
var explosion3 = Entities.addEntity(particleParams);
function cleanup() {
Entities.deleteEntity(explosion1)
Entities.deleteEntity(explosion2)
Entities.deleteEntity(explosion3)
}
Script.scriptEnding.connect(cleanup);