From 81bd85742f5db6e4727148267cb174c00edd44df Mon Sep 17 00:00:00 2001 From: TimeServ Date: Tue, 18 Apr 2006 23:11:44 +0000 Subject: [PATCH] particle field spawnparam2 changes starting degree for spiral trail git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2225 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/r_part.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/engine/client/r_part.c b/engine/client/r_part.c index 487ca5105..8d7b0e228 100644 --- a/engine/client/r_part.c +++ b/engine/client/r_part.c @@ -2744,6 +2744,7 @@ static void P_ParticleTrailDraw (vec3_t startpos, vec3_t end, part_type_t *ptype float step; float stop; float tdegree = 2*M_PI/256; /* MSVC whine */ + float sdegree = 0; float nrfirst, nrlast; VectorCopy(startpos, start); @@ -2824,6 +2825,7 @@ static void P_ParticleTrailDraw (vec3_t startpos, vec3_t end, part_type_t *ptype // add offset start[2] += ptype->offsetup; + // spawn mode precalculations if (ptype->spawnmode == SM_SPIRAL) { VectorVectors(vec, right, up); @@ -2831,6 +2833,7 @@ static void P_ParticleTrailDraw (vec3_t startpos, vec3_t end, part_type_t *ptype // precalculate degree of rotation if (ptype->spawnparam1) tdegree = 2*M_PI/ptype->spawnparam1; /* distance per rotation inversed */ + sdegree = ptype->spawnparam2*(M_PI/180); } else if (ptype->spawnmode == SM_CIRCLE) { @@ -3001,8 +3004,8 @@ static void P_ParticleTrailDraw (vec3_t startpos, vec3_t end, part_type_t *ptype { float tsin, tcos; - tcos = cos(len*tdegree)*ptype->areaspread; - tsin = sin(len*tdegree)*ptype->areaspread; + tcos = cos(len*tdegree+sdegree)*ptype->areaspread; + tsin = sin(len*tdegree+sdegree)*ptype->areaspread; p->org[0] = start[0] + right[0]*tcos + up[0]*tsin; p->org[1] = start[1] + right[1]*tcos + up[1]*tsin;