mirror of
https://github.com/nzp-team/fteqw.git
synced 2025-03-21 07:31:08 +00:00
Particles can be made to rotate now. Woo.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@232 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
e905573fc4
commit
7f4c682292
1 changed files with 26 additions and 0 deletions
|
@ -156,6 +156,9 @@ typedef struct part_type_s {
|
|||
float randscale;
|
||||
enum {BM_MERGE, BM_ADD, BM_SUBTRACT} blendmode;
|
||||
|
||||
float rotationstartmin, rotationstartmax;
|
||||
float rotationmin, rotationmax;
|
||||
|
||||
float scaledelta;
|
||||
float count;
|
||||
int texturenum;
|
||||
|
@ -331,6 +334,10 @@ void R_ParticleEffect_f(void)
|
|||
ptype->alpha = 1;
|
||||
ptype->alphachange = 1;
|
||||
ptype->colorindex = -1;
|
||||
ptype->rotationstartmin = -M_PI; //start with a random angle
|
||||
ptype->rotationstartmax = M_PI;
|
||||
ptype->rotationmin = 0; //but don't spin
|
||||
ptype->rotationmax = 0;
|
||||
|
||||
while(1)
|
||||
{
|
||||
|
@ -352,6 +359,23 @@ void R_ParticleEffect_f(void)
|
|||
if (!strcmp(var, "texture"))
|
||||
Q_strncpyz(ptype->texname, value, sizeof(ptype->texname));
|
||||
|
||||
else if (!strcmp(var, "rotationstart"))
|
||||
{
|
||||
ptype->rotationstartmin = atof(value);
|
||||
if (Cmd_Argc()>2)
|
||||
ptype->rotationstartmax = atof(Cmd_Argv(2));
|
||||
else
|
||||
ptype->rotationstartmax = ptype->rotationstartmin;
|
||||
}
|
||||
else if (!strcmp(var, "rotationspeed"))
|
||||
{
|
||||
ptype->rotationmin = atof(value);
|
||||
if (Cmd_Argc()>2)
|
||||
ptype->rotationmax = atof(Cmd_Argv(2));
|
||||
else
|
||||
ptype->rotationmax = ptype->rotationmin;
|
||||
}
|
||||
|
||||
else if (!strcmp(var, "scale"))
|
||||
ptype->scale = atof(value);
|
||||
else if (!strcmp(var, "scalerand"))
|
||||
|
@ -2459,6 +2483,8 @@ void DrawParticleTypes (void texturedparticles(particle_t *,part_type_t*), void
|
|||
p->vel[2] -= friction[2]*p->vel[2];
|
||||
p->vel[2] -= grav;
|
||||
|
||||
p->angle += p->rotationspeed*pframetime;
|
||||
|
||||
switch (type->rampmode)
|
||||
{
|
||||
case RAMP_ABSOLUTE:
|
||||
|
|
Loading…
Reference in a new issue