summaryrefslogtreecommitdiff
path: root/src/modules/sparkler/spark.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2017-04-26 16:02:30 -0700
committerVito Caputo <vcaputo@pengaru.com>2017-04-26 16:02:30 -0700
commit9f499b0590b1a7d56c36ec5d093e82795c3aba19 (patch)
tree165f984ea248580a767a245a1fe5bde528375a59 /src/modules/sparkler/spark.c
parent9acecdfdd43c0eca5e7d0ec22aaf3ac51b94a7c2 (diff)
sparkler: add virtual flag to particle_props_t
The burst particle abused a zero mass to circumvent the effects of aging. Instead use an explicit virtual flag to suppress aging, change busrt_cb to ignore all virtual particles instead of only its center. Previously burst_cb would thrust other bursts like any other particle, and this was incorrect. Now burst centers are always stationary, even when they overlap other bursts.
Diffstat (limited to 'src/modules/sparkler/spark.c')
-rw-r--r--src/modules/sparkler/spark.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/modules/sparkler/spark.c b/src/modules/sparkler/spark.c
index aa449c6..16268a9 100644
--- a/src/modules/sparkler/spark.c
+++ b/src/modules/sparkler/spark.c
@@ -24,6 +24,7 @@ static int spark_init(particles_t *particles, particle_t *p)
p->props->drag = 20.0;
p->props->mass = 0.1;
+ p->props->virtual = 0;
ctxt->decay_rate = rand_within_range(SPARK_MIN_DECAY_RATE, SPARK_MAX_DECAY_RATE);
ctxt->lifetime = ctxt->longevity = rand_within_range(SPARK_MIN_LIFETIME, SPARK_MAX_LIFETIME);
© All Rights Reserved