summaryrefslogtreecommitdiff
path: root/src/Math
diff options
context:
space:
mode:
Diffstat (limited to 'src/Math')
-rw-r--r--src/Math/AABB.cpp1
-rw-r--r--src/Math/AABB.hpp2
2 files changed, 3 insertions, 0 deletions
diff --git a/src/Math/AABB.cpp b/src/Math/AABB.cpp
index b16960e..7f2c05d 100644
--- a/src/Math/AABB.cpp
+++ b/src/Math/AABB.cpp
@@ -29,5 +29,6 @@ AABB::CollisionResponse AABB::collision_response(Vector<3> v, AABB against) cons
return {
.v_to_collision = raycast.point - origin,
.v_slide = projected_velocity,
+ .normal = raycast.normal,
};
}
diff --git a/src/Math/AABB.hpp b/src/Math/AABB.hpp
index b50ba56..b298126 100644
--- a/src/Math/AABB.hpp
+++ b/src/Math/AABB.hpp
@@ -83,6 +83,8 @@ struct AABB {
// 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;
+ // Normal of the collision plane.
+ Vec3 normal;
};
CollisionResponse collision_response(Vector<3> v, AABB against) const;