From 605dc2454a5b6d8e1e203bea2d42ee7b1bd1a27f Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Fri, 16 Jul 2021 08:58:38 -0700 Subject: 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. --- src/modules/swarm/swarm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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); -- cgit v1.2.3