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

Method RocketTrail

client/src/main/java/jake2/client/CL_fx.java:1491–1534  ·  view source on GitHub ↗
(float[] start, float[] end, centity_t old)

Source from the content-addressed store, hash-verified

1489 * ===============
1490 */
1491 static void RocketTrail(float[] start, float[] end, centity_t old) {
1492 float len;
1493 int j;
1494 cparticle_t p;
1495 float dec;
1496
1497 // smoke
1498 DiminishingTrail(start, end, old, Defines.EF_ROCKET);
1499
1500 // fire
1501 Math3D.VectorCopy(start, move);
1502 Math3D.VectorSubtract(end, start, vec);
1503 len = Math3D.VectorNormalize(vec);
1504
1505 dec = 1;
1506 Math3D.VectorScale(vec, dec, vec);
1507
1508 while (len > 0) {
1509 len -= dec;
1510
1511 if (free_particles == null)
1512 return;
1513
1514 if ((Lib.rand() & 7) == 0) {
1515 p = free_particles;
1516 free_particles = p.next;
1517 p.next = active_particles;
1518 active_particles = p;
1519
1520 Math3D.VectorClear(p.accel);
1521 p.time = ClientGlobals.cl.time;
1522
1523 p.alpha = 1.0f;
1524 p.alphavel = -1.0f / (1.0f + Globals.rnd.nextFloat() * 0.2f);
1525 p.color = 0xdc + (Lib.rand() & 3);
1526 for (j = 0; j < 3; j++) {
1527 p.org[j] = move[j] + Lib.crandom() * 5;
1528 p.vel[j] = Lib.crandom() * 20;
1529 }
1530 p.accel[2] = -PARTICLE_GRAVITY;
1531 }
1532 Math3D.VectorAdd(move, vec, move);
1533 }
1534 }
1535
1536 // stack variable
1537 // move, vec

Callers 1

AddPacketEntitiesMethod · 0.95

Calls 9

DiminishingTrailMethod · 0.95
VectorCopyMethod · 0.95
VectorSubtractMethod · 0.95
VectorNormalizeMethod · 0.95
VectorScaleMethod · 0.95
randMethod · 0.95
VectorClearMethod · 0.95
crandomMethod · 0.95
VectorAddMethod · 0.95

Tested by

no test coverage detected