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

Method TeleportParticles

client/src/main/java/jake2/client/CL_fx.java:2009–2044  ·  view source on GitHub ↗
(float[] org)

Source from the content-addressed store, hash-verified

2007 * ===============
2008 */
2009 static void TeleportParticles(float[] org) {
2010 cparticle_t p;
2011 float vel;
2012
2013 for (int i = -16; i <= 16; i += 4)
2014 for (int j = -16; j <= 16; j += 4)
2015 for (int k = -16; k <= 32; k += 4) {
2016 if (free_particles == null)
2017 return;
2018 p = free_particles;
2019 free_particles = p.next;
2020 p.next = active_particles;
2021 active_particles = p;
2022
2023 p.time = ClientGlobals.cl.time;
2024 p.color = 7 + (Lib.rand() & 7);
2025
2026 p.alpha = 1.0f;
2027 p.alphavel = -1.0f / (0.3f + (Lib.rand() & 7) * 0.02f);
2028
2029 p.org[0] = org[0] + i + (Lib.rand() & 3);
2030 p.org[1] = org[1] + j + (Lib.rand() & 3);
2031 p.org[2] = org[2] + k + (Lib.rand() & 3);
2032
2033 dir[0] = j * 8;
2034 dir[1] = i * 8;
2035 dir[2] = k * 8;
2036
2037 Math3D.VectorNormalize(dir);
2038 vel = 50 + (Lib.rand() & 63);
2039 Math3D.VectorScale(dir, vel, p.vel);
2040
2041 p.accel[0] = p.accel[1] = 0;
2042 p.accel[2] = -PARTICLE_GRAVITY;
2043 }
2044 }
2045
2046 // stack variable
2047 private static final float[] org = {0, 0, 0};

Callers 2

EntityEventMethod · 0.95
ParseTEntMethod · 0.95

Calls 3

randMethod · 0.95
VectorNormalizeMethod · 0.95
VectorScaleMethod · 0.95

Tested by

no test coverage detected