mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-25 13:11:00 +00:00
Clean up R_RocketTrail_trail a bit.
In preparation for a redesign of the trail creation.
This commit is contained in:
parent
fff6d799b6
commit
db6e0faae4
1 changed files with 30 additions and 14 deletions
|
@ -749,6 +749,34 @@ add_trail_to_ent (entity_t *ent)
|
||||||
trails_active = ent->trail;
|
trails_active = ent->trail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline particle_t *
|
||||||
|
new_trail_point (const vec3_t origin, float pscale, float percent)
|
||||||
|
{
|
||||||
|
particle_t *point;
|
||||||
|
int ramp;
|
||||||
|
|
||||||
|
point = new_point ();
|
||||||
|
VectorCopy (origin, point->org);
|
||||||
|
point->color = ramp3[ramp = mtwist_rand (&mt) & 3];
|
||||||
|
point->tex = part_tex_smoke;
|
||||||
|
point->scale = pscale + percent * 4.0;
|
||||||
|
point->alpha = 0.5 + qfrandom (0.125) - percent * 0.40;
|
||||||
|
VectorCopy (vec3_origin, point->vel);
|
||||||
|
point->die = vr_data.realtime + 2.0 - percent * 2.0;
|
||||||
|
point->ramp = ramp;
|
||||||
|
point->physics = R_ParticlePhysics ("pt_float");
|
||||||
|
|
||||||
|
return point;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
add_point_to_trail (trail_t *trail, particle_t *point)
|
||||||
|
{
|
||||||
|
*trail->head = point;
|
||||||
|
trail->head = &point->next;
|
||||||
|
trail->num_points++;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
R_RocketTrail_trail (entity_t *ent)
|
R_RocketTrail_trail (entity_t *ent)
|
||||||
{
|
{
|
||||||
|
@ -768,25 +796,13 @@ R_RocketTrail_trail (entity_t *ent)
|
||||||
pscale = 1.5 + qfrandom (1.5);
|
pscale = 1.5 + qfrandom (1.5);
|
||||||
|
|
||||||
while (len < maxlen) {
|
while (len < maxlen) {
|
||||||
int ramp;
|
|
||||||
pscalenext = 1.5 + qfrandom (1.5);
|
pscalenext = 1.5 + qfrandom (1.5);
|
||||||
dist = (pscale + pscalenext) * 3.0;
|
dist = (pscale + pscalenext) * 3.0;
|
||||||
percent = len * origlen;
|
percent = len * origlen;
|
||||||
|
|
||||||
point = new_point ();
|
point = new_trail_point (old_origin, pscale, percent);
|
||||||
VectorCopy (old_origin, point->org);
|
|
||||||
point->color = ramp3[ramp = mtwist_rand (&mt) & 3];
|
|
||||||
point->tex = part_tex_smoke;
|
|
||||||
point->scale = pscale + percent * 4.0;
|
|
||||||
point->alpha = 0.5 + qfrandom (0.125) - percent * 0.40;
|
|
||||||
VectorCopy (vec3_origin, point->vel);
|
|
||||||
point->die = vr_data.realtime + 2.0 - percent * 2.0;
|
|
||||||
point->ramp = ramp;
|
|
||||||
point->physics = R_ParticlePhysics ("pt_fire");
|
|
||||||
|
|
||||||
*ent->trail->head = point;
|
add_point_to_trail (ent->trail, point);
|
||||||
ent->trail->head = &point->next;
|
|
||||||
ent->trail->num_points++;
|
|
||||||
|
|
||||||
len += dist;
|
len += dist;
|
||||||
VectorMultAdd (old_origin, len, vec, old_origin);
|
VectorMultAdd (old_origin, len, vec, old_origin);
|
||||||
|
|
Loading…
Reference in a new issue