Commit c8ffa2f3 authored by grunt92's avatar grunt92
Browse files

collision

parent f6ea7460
#ifndef COLLISION_COMPONENT_
#define COLLISION_COMPONENT_
namespace gdw{
class collision_component
{
public:
collision_component(engine &engine, shape_type shape_type);
~collision_component();
private:
std::unique_ptr<collision_shape> collision_shape_;
};
}
#endif
\ No newline at end of file
#ifndef COLLISION_SHAPE_
#define COLLISION_SHAPE_
namespace gdw{
enum class shape_type
{
sphere,
ray
};
class collision_shape
{
public:
collision_shape(shape_type shape_type);
~collision_shape();
};
}
#endif
\ No newline at end of file
#ifndef RAY_
#define RAY_
namespace gdw{
class ray(glm::vec3 source, glm::vec3 destination):collision_shape(){
vec3 source;
vec3 destination;
}
}
#endif
\ No newline at end of file
#ifndef SPHERE_
#define SPHERE_
namespace gdw{
class sphere(glm::vec3 position, float radius):collision_shape(){
glm::vec3 position;
float radius;
}
}
#endif
\ No newline at end of file
#include <collision_component/collision_component.h>
#include <core/engine.hpp>
namespace gdw {
collision_component::collision_component(engine &engine, shape_type shape_type){
shape_type shape_type;
}
collision_component::~collision_component(){
}
}
#include "collision_shape.cpp"
#include <core/engine>
namespace gdw {
class collision_shape
{
public:
collision_shape(shape_type shape_type);
~collision_shape();
};
}
\ No newline at end of file
#include "sphere.cpp"
#include <core/engine>
class sphere
{
public:
vec3 position;
float radius;
sphere(glm::vec3 position, float radius){
this.position = position;
this.radius = radius;
}
~sphere();
};
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment