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

Method RailTrail

fullgame/src/test/java/jake2/fullgame/TestMap.java:370–445  ·  view source on GitHub ↗
(float[] start, float[] end)

Source from the content-addressed store, hash-verified

368 }
369
370 private void RailTrail(float[] start, float[] end)
371 {
372 float[] move = {0, 0, 0};
373 float[] vec = {0, 0, 0};
374 float len;
375 int j;
376 cparticle_t p;
377 float dec;
378 float[] right = {0, 0, 0};
379 float[] up = {0, 0, 0};
380 int i;
381 float d, c, s;
382 float[] dir = {0, 0, 0};
383
384 Math3D.VectorCopy (start, move);
385 Math3D.VectorSubtract (end, start, vec);
386 len = Math3D.VectorNormalize(vec);
387
388 Math3D.MakeNormalVectors(vec, right, up);
389
390 for (i=0 ; i<len ; i++)
391 {
392
393 p = new cparticle_t();
394 p.time = time();
395 Math3D.VectorClear (p.accel);
396
397 d = i * 0.1f;
398 c = (float)Math.cos(d);
399 s = (float)Math.sin(d);
400
401 Math3D.VectorScale (right, c, dir);
402 Math3D.VectorMA (dir, s, up, dir);
403
404 p.alpha = 1.0f;
405 p.alphavel = -1.0f / (1 + Globals.rnd.nextFloat() * 0.2f);
406 p.color = 0x74 + (Lib.rand() & 7);
407 for (j=0 ; j<3 ; j++)
408 {
409 p.org[j] = move[j] + dir[j]*3;
410 p.vel[j] = dir[j]*6;
411 }
412
413 Math3D.VectorAdd (move, vec, move);
414
415 active_particles.add(p);
416 }
417
418 dec = 0.75f;
419 Math3D.VectorScale (vec, dec, vec);
420 Math3D.VectorCopy (start, move);
421
422 while (len > 0)
423 {
424 len -= dec;
425
426 p = new cparticle_t();
427

Callers 1

testMapMethod · 0.95

Calls 12

VectorCopyMethod · 0.95
VectorSubtractMethod · 0.95
VectorNormalizeMethod · 0.95
MakeNormalVectorsMethod · 0.95
timeMethod · 0.95
VectorClearMethod · 0.95
VectorScaleMethod · 0.95
VectorMAMethod · 0.95
randMethod · 0.95
VectorAddMethod · 0.95
crandomMethod · 0.95
addMethod · 0.45

Tested by

no test coverage detected