aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/system/CollisionSystem.h
diff options
context:
space:
mode:
authorJAROWMR <jarorutjes07@gmail.com>2024-11-15 15:05:19 +0100
committerJAROWMR <jarorutjes07@gmail.com>2024-11-15 15:05:19 +0100
commite6bc46a30152a7585dda24fde66622575349d25e (patch)
tree1d96d73bec54d14b2e4c9eaa3d01f73f294087f4 /src/crepe/system/CollisionSystem.h
parent37c016f1d5902cf7bbfed08d13ee2bc6ef725add (diff)
added data struct for event
Diffstat (limited to 'src/crepe/system/CollisionSystem.h')
-rw-r--r--src/crepe/system/CollisionSystem.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/crepe/system/CollisionSystem.h b/src/crepe/system/CollisionSystem.h
index 9a72948..c7e8e0b 100644
--- a/src/crepe/system/CollisionSystem.h
+++ b/src/crepe/system/CollisionSystem.h
@@ -17,8 +17,9 @@ private:
using collider_stor = std::variant<BoxCollider, CircleCollider>;
private:
struct CollidedInfoStor {
- collider_stor collider; // Store either BoxCollider or CircleCollider
- Transform transform; // Transform data
+ //! Store either BoxCollider or CircleCollider
+ collider_stor collider;
+ Transform transform;
Rigidbody rigidbody; // Rigidbody data
};
public:
@@ -31,6 +32,16 @@ private:
bool check_box_circle_collision(const BoxCollider& box1, const CircleCollider& circle2, const Transform& transform1, const Transform& transform2, const Rigidbody& rigidbody1, const Rigidbody& rigidbody2);
bool check_circle_circle_collision(const CircleCollider& circle1, const CircleCollider& circle2, const Transform& transform1, const Transform& transform2, const Rigidbody& rigidbody1, const Rigidbody& rigidbody2);
Vector2 current_position(const Collider& collider, const Transform& transform, const Rigidbody& rigidbody);
+public:
+ struct ColliderInfo {
+ Collider collider;
+ Transform transform;
+ Rigidbody rigidbody;
+ };
+ struct CollisionInfo{
+ ColliderInfo first;
+ ColliderInfo second;
+ };
};
} // namespace crepe