MCPcopy Create free account
hub / github.com/demoth/jake2 / ParticleEffect

Method ParticleEffect

client/src/main/java/jake2/client/CL_fx.java:995–1023  ·  view source on GitHub ↗
(float[] org, float[] dir, int color, int count)

Source from the content-addressed store, hash-verified

993 * Wall impact puffs ===============
994 */
995 static void ParticleEffect(float[] org, float[] dir, int color, int count) {
996 int j;
997 cparticle_t p;
998 float d;
999
1000 for (int i = 0; i < count; i++) {
1001 if (free_particles == null)
1002 return;
1003 p = free_particles;
1004 free_particles = p.next;
1005 p.next = active_particles;
1006 active_particles = p;
1007
1008 p.time = ClientGlobals.cl.time;
1009 p.color = color + (Lib.rand() & 7);
1010
1011 d = Lib.rand() & 31;
1012 for (j = 0; j < 3; j++) {
1013 p.org[j] = org[j] + ((Lib.rand() & 7) - 4) + d * dir[j];
1014 p.vel[j] = Lib.crandom() * 20;
1015 }
1016
1017 p.accel[0] = p.accel[1] = 0;
1018 p.accel[2] = -PARTICLE_GRAVITY;
1019 p.alpha = 1.0f;
1020
1021 p.alphavel = -1.0f / (0.5f + Globals.rnd.nextFloat() * 0.3f);
1022 }
1023 }
1024
1025 /*
1026 * =============== CL_ParticleEffect2 ===============

Callers 2

ParseMuzzleFlash2Method · 0.95
ParseTEntMethod · 0.95

Calls 2

randMethod · 0.95
crandomMethod · 0.95

Tested by

no test coverage detected