// stack variable // dir public static void Nukeblast(cl_sustain_t self) { int i; cparticle_t p; float ratio; ratio = 1.0f - ((float)self.endtime - (float)Globals.cl.time) / 1000.0f; for (i = 0; i < 700; i++) { if (CL_fx.free_particles == null) { return; } p = CL_fx.free_particles; CL_fx.free_particles = p.next; p.next = CL_fx.active_particles; CL_fx.active_particles = p; Math3D.VectorClear(p.accel); p.time = Globals.cl.time; p.alpha = 1.0f; p.alphavel = CL_fx.INSTANT_PARTICLE; p.color = CL_newfx.nb_colortable[Lib.rand() & 3]; CL_newfx.dir[0] = Lib.crand(); CL_newfx.dir[1] = Lib.crand(); CL_newfx.dir[2] = Lib.crand(); Math3D.VectorNormalize(CL_newfx.dir); Math3D.VectorMA(self.org, 200.0f * ratio, CL_newfx.dir, p.org); // VectorMA(origin, 10*(((rand () & 0x7fff) / ((float)0x7fff))), // dir, p.org); } }
// stack variable // r, u, dir public static void ParticleSteamEffect2(cl_sustain_t self) // float[] org, float[] dir, int color, int count, int magnitude) { int i, j; cparticle_t p; float d; // vectoangles2 (dir, angle_dir); // AngleVectors (angle_dir, f, r, u); Math3D.VectorCopy(self.dir, CL_newfx.dir); Math3D.MakeNormalVectors(CL_newfx.dir, CL_newfx.r, CL_newfx.u); for (i = 0; i < self.count; i++) { if (CL_fx.free_particles == null) { return; } p = CL_fx.free_particles; CL_fx.free_particles = p.next; p.next = CL_fx.active_particles; CL_fx.active_particles = p; p.time = Globals.cl.time; p.color = self.color + (Lib.rand() & 7); for (j = 0; j < 3; j++) { p.org[j] = self.org[j] + self.magnitude * 0.1f * Lib.crand(); } // p.vel[j] = dir[j]*magnitude; Math3D.VectorScale(CL_newfx.dir, self.magnitude, p.vel); d = Lib.crand() * self.magnitude / 3; Math3D.VectorMA(p.vel, d, CL_newfx.r, p.vel); d = Lib.crand() * self.magnitude / 3; Math3D.VectorMA(p.vel, d, CL_newfx.u, p.vel); p.accel[0] = p.accel[1] = 0; p.accel[2] = -CL_fx.PARTICLE_GRAVITY / 2; p.alpha = 1.0f; p.alphavel = -1.0f / (0.5f + (float)Globals.rnd.NextDouble() * 0.3f); } self.nextthink += self.thinkinterval; }