(float[] start, float[] end)
| 1541 | * =============== |
| 1542 | */ |
| 1543 | static void RailTrail(float[] start, float[] end) { |
| 1544 | float len; |
| 1545 | int j; |
| 1546 | cparticle_t p; |
| 1547 | float dec; |
| 1548 | float[] right = new float[3]; |
| 1549 | float[] up = new float[3]; |
| 1550 | int i; |
| 1551 | float d, c, s; |
| 1552 | float[] dir = new float[3]; |
| 1553 | byte clr = 0x74; |
| 1554 | |
| 1555 | Math3D.VectorCopy(start, move); |
| 1556 | Math3D.VectorSubtract(end, start, vec); |
| 1557 | len = Math3D.VectorNormalize(vec); |
| 1558 | |
| 1559 | Math3D.MakeNormalVectors(vec, right, up); |
| 1560 | |
| 1561 | for (i = 0; i < len; i++) { |
| 1562 | if (free_particles == null) |
| 1563 | return; |
| 1564 | |
| 1565 | p = free_particles; |
| 1566 | free_particles = p.next; |
| 1567 | p.next = active_particles; |
| 1568 | active_particles = p; |
| 1569 | |
| 1570 | p.time = ClientGlobals.cl.time; |
| 1571 | Math3D.VectorClear(p.accel); |
| 1572 | |
| 1573 | d = i * 0.1f; |
| 1574 | c = (float) Math.cos(d); |
| 1575 | s = (float) Math.sin(d); |
| 1576 | |
| 1577 | Math3D.VectorScale(right, c, dir); |
| 1578 | Math3D.VectorMA(dir, s, up, dir); |
| 1579 | |
| 1580 | p.alpha = 1.0f; |
| 1581 | p.alphavel = -1.0f / (1.0f + Globals.rnd.nextFloat() * 0.2f); |
| 1582 | p.color = clr + (Lib.rand() & 7); |
| 1583 | for (j = 0; j < 3; j++) { |
| 1584 | p.org[j] = move[j] + dir[j] * 3; |
| 1585 | p.vel[j] = dir[j] * 6; |
| 1586 | } |
| 1587 | |
| 1588 | Math3D.VectorAdd(move, vec, move); |
| 1589 | } |
| 1590 | |
| 1591 | dec = 0.75f; |
| 1592 | Math3D.VectorScale(vec, dec, vec); |
| 1593 | Math3D.VectorCopy(start, move); |
| 1594 | |
| 1595 | while (len > 0) { |
| 1596 | len -= dec; |
| 1597 | |
| 1598 | if (free_particles == null) |
| 1599 | return; |
| 1600 | p = free_particles; |
no test coverage detected