From 374005137721b99bca01c8368437641bc2984228 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Sat, 1 Mar 2025 16:18:02 -0500 Subject: collision tweak --- main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 9f191a7..30e9f8d 100644 --- a/main.cpp +++ b/main.cpp @@ -67,7 +67,11 @@ int main(int argc, const char *argv[]) [®istry](auto& s, auto& p) { registry.view().each( [&s, &p](auto& _, auto& pp, auto& pv, auto& pt) { - if (const auto c = s.collision(pp + pt.dim()); c) { + auto dim = pt.dim(); + + if (const auto c = s.collision(pp + dim); c) { + pv.y = (std::abs(c) > 1.f) ? c * 0.25f : 0.f; + } else if (const auto c = s.collision(pp + Point(0, dim.y)); c) { pv.y = (std::abs(c) > 1.f) ? c * 0.25f : 0.f; } else { pv.y += 0.1f; -- cgit v1.2.3