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

Method ParticleSmokeEffect

client/src/main/java/jake2/client/CL_newfx.java:719–753  ·  view source on GitHub ↗
(float[] org, float[] dir, int color,
            int count, int magnitude)

Source from the content-addressed store, hash-verified

717 * unaffected by gravity ===============
718 */
719 static void ParticleSmokeEffect(float[] org, float[] dir, int color,
720 int count, int magnitude) {
721 int i, j;
722 cparticle_t p;
723 float d;
724
725 Math3D.MakeNormalVectors(dir, r, u);
726
727 for (i = 0; i < count; i++) {
728 if (CL_fx.free_particles == null)
729 return;
730 p = CL_fx.free_particles;
731 CL_fx.free_particles = p.next;
732 p.next = CL_fx.active_particles;
733 CL_fx.active_particles = p;
734
735 p.time = ClientGlobals.cl.time;
736 p.color = color + (Lib.rand() & 7);
737
738 for (j = 0; j < 3; j++) {
739 p.org[j] = org[j] + magnitude * 0.1f * Lib.crandom();
740 // p.vel[j] = dir[j]*magnitude;
741 }
742 Math3D.VectorScale(dir, magnitude, p.vel);
743 d = Lib.crandom() * magnitude / 3;
744 Math3D.VectorMA(p.vel, d, r, p.vel);
745 d = Lib.crandom() * magnitude / 3;
746 Math3D.VectorMA(p.vel, d, u, p.vel);
747
748 p.accel[0] = p.accel[1] = p.accel[2] = 0;
749 p.alpha = 1.0f;
750
751 p.alphavel = -1.0f / (0.5f + Globals.rnd.nextFloat() * 0.3f);
752 }
753 }
754
755 /*
756 * =============== CL_BlasterParticles2

Callers 1

ParseTEntMethod · 0.95

Calls 5

MakeNormalVectorsMethod · 0.95
randMethod · 0.95
crandomMethod · 0.95
VectorScaleMethod · 0.95
VectorMAMethod · 0.95

Tested by

no test coverage detected