From 3c7fada86fd4145f2f9ca4f7af4bbacb6ebc6f65 Mon Sep 17 00:00:00 2001 From: JAROWMR Date: Thu, 21 Nov 2024 22:32:15 +0100 Subject: copy constructor for collider for collision system --- src/crepe/Collider.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/crepe/Collider.h') diff --git a/src/crepe/Collider.h b/src/crepe/Collider.h index e910ae4..78e48cf 100644 --- a/src/crepe/Collider.h +++ b/src/crepe/Collider.h @@ -10,6 +10,15 @@ class Collider : public Component { public: Collider(game_object_id_t id, Vector2 offset); +protected: + // Friend class allowing access to copy constructor + friend class CollisionSystem; + + // Copy Constructor (Restricted to CollisionSystem) + Collider(const Collider &other) + : Component(other.game_object_id), offset(other.offset) {} + +public: //! Offset of the collider relative to rigidbody position Vector2 offset; }; -- cgit v1.2.3