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

Method animateParticles

fullgame/src/test/java/jake2/fullgame/TestMap.java:319–368  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

317
318 private LinkedList active_particles = new LinkedList();
319 private void animateParticles()
320 {
321 cparticle_t p;
322 float alpha;
323 float time, time2;
324 float[] org = {0, 0, 0};
325 int color;
326
327 time = 0.0f;
328
329 for (Iterator it = active_particles.iterator(); it.hasNext();)
330 {
331 p = (cparticle_t) it.next();
332
333 // PMM - added INSTANT_PARTICLE handling for heat beam
334 if (p.alphavel != INSTANT_PARTICLE)
335 {
336 time = (time() - p.time) * 0.001f;
337 alpha = p.alpha + time*p.alphavel;
338 if (alpha <= 0)
339 { // faded out
340 it.remove();
341 continue;
342 }
343 }
344 else
345 {
346 alpha = p.alpha;
347 }
348
349 if (alpha > 1.0)
350 alpha = 1;
351 color = (int)p.color;
352
353 time2 = time*time;
354
355 org[0] = p.org[0] + p.vel[0]*time + p.accel[0]*time2;
356 org[1] = p.org[1] + p.vel[1]*time + p.accel[1]*time2;
357 org[2] = p.org[2] + p.vel[2]*time + p.accel[2]*time2;
358
359 AddParticle(org, color, alpha);
360
361 // PMM
362 if (p.alphavel == INSTANT_PARTICLE)
363 {
364 p.alphavel = 0.0f;
365 p.alpha = 0.0f;
366 }
367 }
368 }
369
370 private void RailTrail(float[] start, float[] end)
371 {

Callers 1

testMapMethod · 0.95

Calls 5

timeMethod · 0.95
AddParticleMethod · 0.95
hasNextMethod · 0.80
nextMethod · 0.80
removeMethod · 0.80

Tested by

no test coverage detected