diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2021-07-16 08:58:38 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2022-03-28 19:53:32 -0700 |
commit | 605dc2454a5b6d8e1e203bea2d42ee7b1bd1a27f (patch) | |
tree | f1150d781ab5137eec367a84116a95ab72f8d632 /src/modules/swarm | |
parent | 9d4abba0d4f80b691cffea53322f0a4912653d25 (diff) |
modules/swarm: remove extra ticks multiply on leader rads
No idea why this was in there. Though it makes the leader jump
by huge values, since it still winds up as samples on the same
path, just non-continuous, the swarm still appears correct,
hiding this braino.
If you reduce the SWARM_SIZE to a tiny number like 2 though, it
becomes very obvious that the leader is teleporting all over the
place.
Diffstat (limited to 'src/modules/swarm')
-rw-r--r-- | src/modules/swarm/swarm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/modules/swarm/swarm.c b/src/modules/swarm/swarm.c index c64ef8e..7c8caeb 100644 --- a/src/modules/swarm/swarm.c +++ b/src/modules/swarm/swarm.c @@ -183,7 +183,7 @@ static void swarm_update(swarm_context_t *ctxt, unsigned ticks) float wleader, wcenter, wdirection; { /* [0] = leader */ - float r = (float)ticks * ((cosf((float)ticks * .0001f) * .5f + .5f) * .1f); + float r = M_PI * 2 * ((cosf((float)ticks * .001f) * .5f + .5f)); ctxt->boids[0].position.x = cosf(r); ctxt->boids[0].position.y = sinf(r); |