diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-03-23 12:04:56 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-03-23 12:04:56 +0100 |
commit | 2752606d3014e29eae4a522917b805d86b505400 (patch) | |
tree | e7329bf5613b27bc12ede0086504afff2fa72f1d /src | |
parent | 9ee762d7171b65d92fa937c4dcb2cef1ff88ed6c (diff) |
w
Diffstat (limited to 'src')
-rw-r--r-- | src/critter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/critter.cpp b/src/critter.cpp index e335747b..318a5d53 100644 --- a/src/critter.cpp +++ b/src/critter.cpp @@ -194,7 +194,7 @@ void critter::update_movement(size_t i, const Ns& dt, rotation new_r) { const auto vec = rotation_to_vec(rotations[j]); using Frac = decltype(critter::offset_frac)::Type; - constexpr auto frac = float{limits<Frac>::max}; + constexpr auto frac = (float{limits<Frac>::max}+1)/2; constexpr auto inv_frac = 1 / frac; const auto sign_vec = Math::sign(vec); auto offset_ = vec + Vector2(offset_frac) * sign_vec * inv_frac; @@ -213,7 +213,7 @@ void critter::update_movement(size_t i, const Ns& dt, rotation new_r) else { can_move = true; - offset_frac = Math::Vector2<Frac>(Math::min({1.f,1.f}, Math::abs(offset_)) * frac); + offset_frac = Math::Vector2<Frac>(Math::min({2.f,2.f}, Math::abs(offset_)) * frac); break; } } |