Compare commits

...

2 Commits

Author SHA1 Message Date
56dc32cce3 Ensure direction is normalized. 2025-01-07 20:52:06 -05:00
7470e8fa8d Move to fixed schedule. 2025-01-07 20:51:50 -05:00
2 changed files with 2 additions and 2 deletions

View File

@ -127,7 +127,7 @@ pub struct FootstepPlugin;
impl Plugin for FootstepPlugin {
fn build(&self, app: &mut App) {
app.add_systems(PreUpdate, added).add_systems(
PostUpdate,
FixedPostUpdate,
update.after(TransformSystem::TransformPropagate),
);
}

View File

@ -86,7 +86,7 @@ impl Viewshed {
} else {
let should_push = std::cell::RefCell::new(true);
let coord = Vec2::new(coord.x as f32 + 0.5, coord.y as f32 + 0.5);
let dir = Dir2::new_unchecked((coord - *start).normalize());
let dir = Dir2::new_unchecked((coord - *start).normalize_or_zero());
// println!("Casting from {coord} to {dir:?}");
spatial_query.cast_ray_predicate(
*start,