From 24246e115c3b7829d2981a2f60ac77da657f2ed5 Mon Sep 17 00:00:00 2001 From: JAROWMR Date: Wed, 4 Dec 2024 20:42:53 +0100 Subject: added collision layers --- src/crepe/system/CollisionSystem.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/crepe/system/CollisionSystem.h') diff --git a/src/crepe/system/CollisionSystem.h b/src/crepe/system/CollisionSystem.h index 6b5a4bb..a22baf2 100644 --- a/src/crepe/system/CollisionSystem.h +++ b/src/crepe/system/CollisionSystem.h @@ -214,6 +214,22 @@ private: std::vector> gather_collisions(std::vector & colliders); + /** + * \brief Checks if two collision layers have at least one common layer. + * + * This function checks if there is any overlapping layer between the two input + * collision layer vectors. It compares each layer from the first vector to see + * if it exists in the second vector. If at least one common layer is found, + * the function returns true, indicating that the two colliders share a common + * collision layer. + * + * \param layers1 A vector of collision layers for the first collider. + * \param layers2 A vector of collision layers for the second collider. + * \return Returns true if there is at least one common layer, false otherwise. + */ + + bool have_common_layer(const std::vector& layers1, const std::vector& layers2); + /** * \brief Checks for collision between two colliders. * -- cgit v1.2.3