]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
particles: apply rotation so that in the initial display frame of the particle, the...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 11 May 2010 09:11:48 +0000 (09:11 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 11 May 2010 09:11:48 +0000 (09:11 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10188 d7cf8633-e32d-0410-b094-e92efae38249

cl_particles.c

index c33df7baf8b58af134f3d605ec37307e220184b7..1dc96a8b09912b75c2451afdfd71bf09a91ec8f9 100644 (file)
@@ -653,6 +653,7 @@ particle_t *CL_NewParticle(const vec3_t sortorigin, unsigned short ptypeindex, i
        part->airfriction = pairfriction;
        part->liquidfriction = pliquidfriction;
        part->die = cl.time + lifetime;
+       part->delayedspawn = cl.time;
 //     part->delayedcollisions = 0;
        part->qualityreduction = pqualityreduction;
        part->angle = angle;
@@ -2521,7 +2522,7 @@ void R_DrawParticle_TransparentCallback(const entity_render_t *ent, const rtligh
                case PARTICLE_BILLBOARD:
                        if (p->angle + p->spin)
                        {
-                               spinrad = (p->angle + p->spin * spintime) * (float)(M_PI / 180.0f);
+                               spinrad = (p->angle + p->spin * (spintime - p->delayedspawn)) * (float)(M_PI / 180.0f);
                                spinsin = sin(spinrad) * size;
                                spincos = cos(spinrad) * size;
                                spinm1 = -p->stretch * spincos;
@@ -2558,7 +2559,7 @@ void R_DrawParticle_TransparentCallback(const entity_render_t *ent, const rtligh
                        VectorVectors(p->vel, baseright, baseup);
                        if (p->angle + p->spin)
                        {
-                               spinrad = (p->angle + p->spin * spintime) * (float)(M_PI / 180.0f);
+                               spinrad = (p->angle + p->spin * (spintime - p->delayedspawn)) * (float)(M_PI / 180.0f);
                                spinsin = sin(spinrad) * size;
                                spincos = cos(spinrad) * size;
                                spinm1 = p->stretch * spincos;
@@ -2714,7 +2715,6 @@ void R_DrawParticles (void)
                {
                        if (p->delayedspawn > cl.time)
                                continue;
-                       p->delayedspawn = 0;
 
                        p->size += p->sizeincrease * frametime;
                        p->alpha -= p->alphafade * frametime;
@@ -2853,7 +2853,7 @@ void R_DrawParticles (void)
                                }
                        }
                }
-               else if (p->delayedspawn)
+               else if (p->delayedspawn > cl.time)
                        continue;
                if (!drawparticles)
                        continue;