aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/system/CollisionSystem.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/system/CollisionSystem.h')
-rw-r--r--src/crepe/system/CollisionSystem.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/crepe/system/CollisionSystem.h b/src/crepe/system/CollisionSystem.h
index eb361b8..6995bb5 100644
--- a/src/crepe/system/CollisionSystem.h
+++ b/src/crepe/system/CollisionSystem.h
@@ -10,6 +10,7 @@
#include "api/Rigidbody.h"
#include "api/Transform.h"
#include "api/Vector2.h"
+#include "api/Event.h"
#include "Collider.h"
#include "System.h"
@@ -228,7 +229,7 @@ private:
* \return Returns true if there is at least one common layer, false otherwise.
*/
- bool have_common_layer(const std::vector<int> & layers1, const std::vector<int> & layers2);
+ bool have_common_layer(const std::set<int> & layers1, const std::set<int> & layers2);
/**
* \brief Checks for collision between two colliders.
@@ -297,4 +298,14 @@ private:
const Rigidbody & rigidbody2) const;
};
+/**
+ * \brief Event triggered during a collision between objects.
+ */
+class CollisionEvent : public Event {
+public:
+ crepe::CollisionSystem::CollisionInfo info;
+ CollisionEvent(const crepe::CollisionSystem::CollisionInfo & collisionInfo)
+ : info(collisionInfo) {}
+};
+
} // namespace crepe