]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
remove sparks if slower than sqrt(0.03)
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 9 Sep 2010 06:55:01 +0000 (06:55 +0000)
committerRudolf Polzer <divverent@alientrap.org>
Thu, 9 Sep 2010 06:50:30 +0000 (08:50 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10450 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=a47d6d807b1b080ae1c56e6c17c2fec217cd8e89

cl_particles.c

index 5fdde506136f0160839b54e6ed9f61f572f1de8c..3448959704d239328ea055fb7b7425ac7861fa3a 100644 (file)
@@ -2795,7 +2795,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
@@ -2852,11 +2852,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)