diff options
author | JAROWMR <jarorutjes07@gmail.com> | 2024-11-21 22:32:15 +0100 |
---|---|---|
committer | JAROWMR <jarorutjes07@gmail.com> | 2024-11-21 22:32:15 +0100 |
commit | 3c7fada86fd4145f2f9ca4f7af4bbacb6ebc6f65 (patch) | |
tree | b7d86773c9a915806ca99ca1feb265e565c8595f /src/crepe | |
parent | d58a059fd6398527274e77a37b65aa105c8a778b (diff) |
copy constructor for collider for collision system
Diffstat (limited to 'src/crepe')
-rw-r--r-- | src/crepe/Collider.h | 9 |
1 files changed, 9 insertions, 0 deletions
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; }; |