Rename 'target_position' clojure to 'partial_path_tgt_pos'

This commit is contained in:
Dr. Dystopia 2022-03-01 22:33:25 +01:00
parent 7e70d7648e
commit 4d24ff0027

View File

@ -2274,7 +2274,7 @@ impl<'a> AgentData<'a> {
speed_multiplier: Option<f32>,
) -> bool {
let pos = self.pos.0;
let target_position = |vec3: Vec3<f32>| {
let partial_path_tgt_pos = |vec3: Vec3<f32>| {
pos + PARTIAL_PATH_DIST * vec3.try_normalized().unwrap_or_else(Vec3::zero)
};
let distance_to_target = tgt_pos - pos;
@ -2308,12 +2308,12 @@ impl<'a> AgentData<'a> {
}
}
}
target_position(
partial_path_tgt_pos(
sep_vec * SEPARATION_BIAS + distance_to_target * (1.0 - SEPARATION_BIAS),
)
},
Path::Separate => tgt_pos,
Path::Partial => target_position(distance_to_target),
Path::Partial => partial_path_tgt_pos(distance_to_target),
};
let speed_multiplier = speed_multiplier.unwrap_or(1.0).min(1.0);
if let Some((bearing, speed)) = agent.chaser.chase(