aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/Collider.h
blob: 78e48cfd4cb16c02514051f3227ba84c3807fe6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once

#include "api/Vector2.h"

#include "Component.h"

namespace crepe {

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;
};

} // namespace crepe