From: havoc Date: Thu, 10 Nov 2005 07:03:40 +0000 (+0000) Subject: condensed CL_EntityParticles code X-Git-Tag: xonotic-v0.1.0preview~4481 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=70954bd88b9c95430fde13be885f5a9a2f246c64;p=xonotic%2Fdarkplaces.git condensed CL_EntityParticles code git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5803 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_particles.c b/cl_particles.c index b772d9ff..3780eb7f 100644 --- a/cl_particles.c +++ b/cl_particles.c @@ -505,40 +505,29 @@ CL_EntityParticles */ void CL_EntityParticles (entity_t *ent) { - int i; - float angle; - float sp, sy, cp, cy; - vec3_t forward; - float dist; - float beamlength; + int i; + float pitch, yaw, dist = 64, beamlength = 16, org[3], v[3]; static vec3_t avelocities[NUMVERTEXNORMALS]; if (!cl_particles.integer) return; - dist = 64; - beamlength = 16; +#ifdef WORKINGLQUAKE + VectorCopy(ent->origin, org); +#else + VectorCopy(ent->render.origin, org); +#endif if (!avelocities[0][0]) - for (i=0 ; iorigin[0] + m_bytenormals[i][0]*dist + forward[0]*beamlength, ent->origin[1] + m_bytenormals[i][1]*dist + forward[1]*beamlength, ent->origin[2] + m_bytenormals[i][2]*dist + forward[2]*beamlength, 0, 0, 0, 0); -#else - particle(particletype + pt_entityparticle, particlepalette[0x6f], particlepalette[0x6f], tex_particle, 2, 255, 0, 0, 0, ent->render.origin[0] + m_bytenormals[i][0]*dist + forward[0]*beamlength, ent->render.origin[1] + m_bytenormals[i][1]*dist + forward[1]*beamlength, ent->render.origin[2] + m_bytenormals[i][2]*dist + forward[2]*beamlength, 0, 0, 0, 0); -#endif + yaw = cl.time * avelocities[i][0]; + pitch = cl.time * avelocities[i][1]; + v[0] = org[0] + m_bytenormals[i][0] * dist + (cos(pitch)*cos(yaw)) * beamlength; + v[1] = org[1] + m_bytenormals[i][1] * dist + (cos(pitch)*sin(yaw)) * beamlength; + v[2] = org[2] + m_bytenormals[i][2] * dist + (-sin(pitch)) * beamlength; + particle(particletype + pt_entityparticle, particlepalette[0x6f], particlepalette[0x6f], tex_particle, 2, 255, 0, 0, 0, v[0], v[1], v[2], 0, 0, 0, 0); } }