From: divverent Date: Thu, 9 Sep 2010 06:55:01 +0000 (+0000) Subject: remove sparks if slower than sqrt(0.03) X-Git-Tag: xonotic-v0.1.0preview~230^2~34 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a47d6d807b1b080ae1c56e6c17c2fec217cd8e89;p=xonotic%2Fdarkplaces.git remove sparks if slower than sqrt(0.03) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10450 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_particles.c b/cl_particles.c index 85b709eb..92b0b1c6 100644 --- a/cl_particles.c +++ b/cl_particles.c @@ -2789,7 +2789,7 @@ void R_DrawParticles (void) VectorCopy(p->org, oldorg); VectorMA(p->org, frametime, p->vel, p->org); // if (p->bounce && cl.time >= p->delayedcollisions) - if (p->bounce && cl_particles_collisions.integer) + if (p->bounce && cl_particles_collisions.integer && VectorLength(p->vel)) { trace = CL_TraceLine(oldorg, p->org, MOVE_NOMONSTERS, NULL, SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY | ((p->typeindex == pt_rain || p->typeindex == pt_snow) ? SUPERCONTENTS_LIQUIDSMASK : 0), true, false, &hitent, false); // if the trace started in or hit something of SUPERCONTENTS_NODROP @@ -2846,11 +2846,16 @@ void R_DrawParticles (void) // anything else - bounce off solid dist = DotProduct(p->vel, trace.plane.normal) * -p->bounce; VectorMA(p->vel, dist, trace.plane.normal, p->vel); - if (DotProduct(p->vel, p->vel) < 0.03) - VectorClear(p->vel); } } } + + if (VectorLength2(p->vel) < 0.03) + { + if(p->orientation == PARTICLE_SPARK) // sparks are virtually invisible if very slow, so rather let them go off + goto killparticle; + VectorClear(p->vel); + } } if (p->typeindex != pt_static)