]> git.rm.cloudns.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)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 9 Sep 2010 06:55:01 +0000 (06:55 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10450 d7cf8633-e32d-0410-b094-e92efae38249

cl_particles.c

index 85b709eb2cb83adfbd07c7566505416da80dd751..92b0b1c6ef0f2f2073bd3f6c8f81836755cb1cc8 100644 (file)
@@ -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)