From 519482aaf30b099b8cf68d3c060d61d798ef7abf Mon Sep 17 00:00:00 2001 From: Robert Garrett Date: Mon, 15 Jul 2024 14:42:39 -0500 Subject: [PATCH] Rename separation_force parameters --- src/birdoids_plugin.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/birdoids_plugin.rs b/src/birdoids_plugin.rs index 09637ac6..d12b9a42 100644 --- a/src/birdoids_plugin.rs +++ b/src/birdoids_plugin.rs @@ -311,9 +311,9 @@ fn cohesive_force(boid: Vec2, target: Vec2) -> Force { } // f(x) = x^2 - 1 -fn separation_force(us: Vec2, neighbor: Vec2) -> Force { +fn separation_force(boid: Vec2, target: Vec2) -> Force { // Scale from BOID_VIEW_RANGE to unit space - let distance_unit = (neighbor - us) / BOID_VIEW_RANGE; + let distance_unit = (target - boid) / BOID_VIEW_RANGE; let mag = distance_unit.length(); let force_mag = mag.powf(2.0) - 1.0; let force = force_mag * distance_unit.normalize();