From fbe51078b2e064d4b38f65005f9435b61a548e3f Mon Sep 17 00:00:00 2001 From: TimeServ Date: Thu, 20 Apr 2006 22:21:42 +0000 Subject: [PATCH] fix to spiral trails git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2226 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/r_part.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/engine/client/r_part.c b/engine/client/r_part.c index 8d7b0e228..4e243c6bd 100644 --- a/engine/client/r_part.c +++ b/engine/client/r_part.c @@ -3003,20 +3003,24 @@ static void P_ParticleTrailDraw (vec3_t startpos, vec3_t end, part_type_t *ptype case SM_SPIRAL: { float tsin, tcos; + float tright, tup; - tcos = cos(len*tdegree+sdegree)*ptype->areaspread; - tsin = sin(len*tdegree+sdegree)*ptype->areaspread; + tcos = cos(len*tdegree+sdegree); + tsin = sin(len*tdegree+sdegree); - p->org[0] = start[0] + right[0]*tcos + up[0]*tsin; - p->org[1] = start[1] + right[1]*tcos + up[1]*tsin; - p->org[2] = start[2] + right[2]*tcos + up[2]*tsin; + tright = tcos*ptype->areaspread; + tup = tsin*ptype->areaspread; - tcos = cos(len*tdegree)*ptype->offsetspread; - tsin = sin(len*tdegree)*ptype->offsetspread; + p->org[0] = start[0] + right[0]*tright + up[0]*tup; + p->org[1] = start[1] + right[1]*tright + up[1]*tup; + p->org[2] = start[2] + right[2]*tright + up[2]*tup; - p->vel[0] = vec[0]*veladd+crandom()*randvel + right[0]*tcos + up[0]*tsin; - p->vel[1] = vec[1]*veladd+crandom()*randvel + right[1]*tcos + up[1]*tsin; - p->vel[2] = vec[2]*veladd+crandom()*randvelvert + right[2]*tcos + up[2]*tsin; + tright = tcos*ptype->offsetspread; + tup = tsin*ptype->offsetspread; + + p->vel[0] = vec[0]*veladd+crandom()*randvel + right[0]*tright + up[0]*tup; + p->vel[1] = vec[1]*veladd+crandom()*randvel + right[1]*tright + up[1]*tup; + p->vel[2] = vec[2]*veladd+crandom()*randvelvert + right[2]*tright + up[2]*tup; } break; // TODO: directionalize SM_BALL/SM_CIRCLE/SM_DISTBALL