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

Method ParticleSteamEffect2

client/src/main/java/jake2/client/CL_newfx.java:370–411  ·  view source on GitHub ↗
(cl_sustain_t self)

Source from the content-addressed store, hash-verified

368 // stack variable
369 // r, u, dir
370 static void ParticleSteamEffect2(cl_sustain_t self)
371 // float[] org, float[] dir, int color, int count, int magnitude)
372 {
373 int i, j;
374 cparticle_t p;
375 float d;
376
377 // vectoangles2 (dir, angle_dir);
378 // AngleVectors (angle_dir, f, r, u);
379
380 Math3D.VectorCopy(self.dir, dir);
381 Math3D.MakeNormalVectors(dir, r, u);
382
383 for (i = 0; i < self.count; i++) {
384 if (CL_fx.free_particles == null)
385 return;
386 p = CL_fx.free_particles;
387 CL_fx.free_particles = p.next;
388 p.next = CL_fx.active_particles;
389 CL_fx.active_particles = p;
390
391 p.time = ClientGlobals.cl.time;
392 p.color = self.color + (Lib.rand() & 7);
393
394 for (j = 0; j < 3; j++) {
395 p.org[j] = self.org[j] + self.magnitude * 0.1f * Lib.crandom();
396 // p.vel[j] = dir[j]*magnitude;
397 }
398 Math3D.VectorScale(dir, self.magnitude, p.vel);
399 d = Lib.crandom() * self.magnitude / 3;
400 Math3D.VectorMA(p.vel, d, r, p.vel);
401 d = Lib.crandom() * self.magnitude / 3;
402 Math3D.VectorMA(p.vel, d, u, p.vel);
403
404 p.accel[0] = p.accel[1] = 0;
405 p.accel[2] = -CL_fx.PARTICLE_GRAVITY / 2;
406 p.alpha = 1.0f;
407
408 p.alphavel = -1.0f / (0.5f + Globals.rnd.nextFloat() * 0.3f);
409 }
410 self.nextthink += self.thinkinterval;
411 }
412
413 // stack variable
414 // move, vec, right, up

Callers

nothing calls this directly

Calls 6

VectorCopyMethod · 0.95
MakeNormalVectorsMethod · 0.95
randMethod · 0.95
crandomMethod · 0.95
VectorScaleMethod · 0.95
VectorMAMethod · 0.95

Tested by

no test coverage detected