--- /dev/null
+#ifndef COLLIDER_H_
+#define COLLIDER_H_
+
+#include <msp/game/component.h>
+#include <msp/linal/vector.h>
+
+enum class ColliderType
+{
+ CIRCLE,
+ BOX
+};
+
+struct ColliderSetup
+{
+ ColliderType type = ColliderType::CIRCLE;
+ union
+ {
+ float radius = 1.0f;
+ Msp::LinAl::Vector<float, 2> size;
+ };
+};
+
+
+class Collider: public Msp::Game::Component
+{
+public:
+ using Setup = ColliderSetup;
+
+private:
+ Setup setup;
+
+public:
+ Collider(Msp::Game::Handle<Msp::Game::Entity>, const Setup &);
+
+ ColliderType get_type() const { return setup.type; }
+ float get_radius() const { return (setup.type==ColliderType::CIRCLE ? setup.radius : 0.0f); }
+ Msp::LinAl::Vector<float, 2> get_size() const { return (setup.type==ColliderType::BOX ? setup.size : Msp::LinAl::Vector<float, 2>()); }
+};
+
+#endif