summary refs log tree commit diff
path: root/src/Math/AABB.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Math/AABB.hpp')
-rw-r--r--src/Math/AABB.hpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Math/AABB.hpp b/src/Math/AABB.hpp
index 4ad5534..b50ba56 100644
--- a/src/Math/AABB.hpp
+++ b/src/Math/AABB.hpp
@@ -76,7 +76,15 @@ struct AABB {
         };
     }
 
-    Vec3 pushout(Vector<3> v, AABB against) const;
+    struct CollisionResponse {
+        // Velocity until the collision.
+        // Always has the same direction as the original velocity, and lower magnitude.
+        Vec3 v_to_collision;
+        // Velocity sliding along the collision plane.
+        // Projection of the fraction of the original velocity that was blocked by collision, onto the collision plane.
+        Vec3 v_slide;
+    };
+    CollisionResponse collision_response(Vector<3> v, AABB against) const;
 
     Vector<3> min, max;
 };