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

Method BlasterTrail

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

Source from the content-addressed store, hash-verified

1311 * ===============
1312 */
1313 static void BlasterTrail(float[] start, float[] end) {
1314 float len;
1315 int j;
1316 cparticle_t p;
1317 int dec;
1318
1319 Math3D.VectorCopy(start, move);
1320 Math3D.VectorSubtract(end, start, vec);
1321 len = Math3D.VectorNormalize(vec);
1322
1323 dec = 5;
1324 Math3D.VectorScale(vec, 5, vec);
1325
1326 // FIXME: this is a really silly way to have a loop
1327 while (len > 0) {
1328 len -= dec;
1329
1330 if (free_particles == null)
1331 return;
1332 p = free_particles;
1333 free_particles = p.next;
1334 p.next = active_particles;
1335 active_particles = p;
1336 Math3D.VectorClear(p.accel);
1337
1338 p.time = ClientGlobals.cl.time;
1339
1340 p.alpha = 1.0f;
1341 p.alphavel = -1.0f / (0.3f + Globals.rnd.nextFloat() * 0.2f);
1342 p.color = 0xe0;
1343 for (j = 0; j < 3; j++) {
1344 p.org[j] = move[j] + Lib.crandom();
1345 p.vel[j] = Lib.crandom() * 5;
1346 p.accel[j] = 0;
1347 }
1348
1349 Math3D.VectorAdd(move, vec, move);
1350 }
1351 }
1352
1353 // stack variable
1354 // move, vec

Callers 1

AddPacketEntitiesMethod · 0.95

Calls 7

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

Tested by

no test coverage detected