Commit 1af4351f authored by Georg Schaefer's avatar Georg Schaefer
Browse files

add proper cannon rotation and beam position / size

parent 20a6400c
......@@ -16,7 +16,7 @@ public:
void update(float dt);
glm::vec3 get_world_mouse_pos();
void render_ray(ray* r, float length, float radius, glm::vec3 color);
void render_ray(ray* r, const glm::vec3& offset, float length, float radius, bool invert, glm::vec3 color);
void process_beam_collision(ray& r, glm::vec3 &ray_unnormalized, float &beam_velocity, float &ray_length_, bool &asteroid_hit, int &portal_type, float &remaining_ray_length);
private:
void handle_key_input(float dt);
......
......@@ -72,6 +72,9 @@ private:
maploader maploader_;
float map_load_timer_;
float plane_offset_y_;
glm::vec4 cannon_socket_offset_;
glm::vec4 cannon_offset_;
bool is_level_build_;
};
......
......@@ -17,77 +17,77 @@
#include <glm/glm.hpp>
namespace gdw {
class engine;
class entity;
class engine;
class entity;
class maploader{
enum SamplePolyAreas
{
SAMPLE_POLYAREA_GROUND,
SAMPLE_POLYAREA_WATER,
SAMPLE_POLYAREA_ROAD,
SAMPLE_POLYAREA_DOOR,
SAMPLE_POLYAREA_GRASS,
SAMPLE_POLYAREA_JUMP,
};
enum SamplePolyFlags
{
SAMPLE_POLYFLAGS_WALK = 0x01, // Ability to walk (ground, grass, road)
SAMPLE_POLYFLAGS_SWIM = 0x02, // Ability to swim (water).
SAMPLE_POLYFLAGS_DOOR = 0x04, // Ability to move through doors.
SAMPLE_POLYFLAGS_JUMP = 0x08, // Ability to jump.
SAMPLE_POLYFLAGS_DISABLED = 0x10, // Disabled polygon
SAMPLE_POLYFLAGS_ALL = 0xffff // All abilities.
};
class maploader{
enum SamplePolyAreas
{
SAMPLE_POLYAREA_GROUND,
SAMPLE_POLYAREA_WATER,
SAMPLE_POLYAREA_ROAD,
SAMPLE_POLYAREA_DOOR,
SAMPLE_POLYAREA_GRASS,
SAMPLE_POLYAREA_JUMP,
};
enum SamplePolyFlags
{
SAMPLE_POLYFLAGS_WALK = 0x01, // Ability to walk (ground, grass, road)
SAMPLE_POLYFLAGS_SWIM = 0x02, // Ability to swim (water).
SAMPLE_POLYFLAGS_DOOR = 0x04, // Ability to move through doors.
SAMPLE_POLYFLAGS_JUMP = 0x08, // Ability to jump.
SAMPLE_POLYFLAGS_DISABLED = 0x10, // Disabled polygon
SAMPLE_POLYFLAGS_ALL = 0xffff // All abilities.
};
private:
engine &engine_;
unsigned char* triareas_;
rcHeightfield* solid_;
rcCompactHeightfield* chf_;
rcContourSet* cset_;
rcPolyMesh* pmesh_;
rcConfig cfg_;
rcPolyMeshDetail* dmesh_;
dtNavMesh* navMesh_;
dtNavMeshQuery* navQuery_;
dtCrowd* crowd_;
BuildContext ctx_;
float m_targetPos[3];
dtPolyRef m_targetRef;
std::unordered_map<int,unsigned long long> entityAgent;
private:
engine &engine_;
unsigned char* triareas_;
rcHeightfield* solid_;
rcCompactHeightfield* chf_;
rcContourSet* cset_;
rcPolyMesh* pmesh_;
rcConfig cfg_;
rcPolyMeshDetail* dmesh_;
dtNavMesh* navMesh_;
dtNavMeshQuery* navQuery_;
dtCrowd* crowd_;
BuildContext ctx_;
float m_targetPos[3];
dtPolyRef m_targetRef;
std::unordered_map<int,unsigned long long> entityAgent;
static constexpr float agent_size_ = 2.25f;
public:
maploader(engine &engine);
virtual ~maploader();
public:
maploader(engine &engine);
virtual ~maploader();
std::unique_ptr<map> load(const std::vector<std::string>& meshnames,
const float& modelscale,
const int& mapWidth,const int& mapHeight,const int& mapDeep,
const int& startX,const int& startY,const int& startZ,
const int& seed = 27389,const int& scatter= 17,
const float& minAstroidRadius = 1,const float& maxAstroidRadius = 1, bool debug = false);
std::unique_ptr<map> load(const std::vector<std::string>& meshnames,
const float& modelscale,
const int& mapWidth,const int& mapHeight,const int& mapDeep,
const int& startX,const int& startY,const int& startZ,
const int& seed = 27389,const int& scatter= 17,
const float& minAstroidRadius = 1,const float& maxAstroidRadius = 1, bool debug = false);
int add_agent(const float *p, unsigned long long int entityID);
void set_move_target(const float *p, bool adjust);
void set_move_target(const float *p, bool adjust);
void update(const float dt);
void render();
void update(const float dt);
void render();
void removeAgent(int idx);
void removeAgent(int idx);
void set_agent_pos(int idx, const glm::vec3 &pos);
void set_agent_pos(int idx, const glm::vec3 &pos);
void set_agent_pos(unsigned long long int entityID, const glm::vec3 &pos);
private:
private:
void cleanup();
void cleanup();
void generate_cylinder(float size,
float x, float y,float z,std::vector<int>& in,
std::vector<float>& v,
int segments = 8);
void generate_cylinder(float size,
float x, float y,float z,std::vector<int>& in,
std::vector<float>& v,
int segments = 8);
};
}
#endif //GDW_SS15_CPP_MAPLOADER_HPP
......@@ -14,38 +14,38 @@ class entity;
class movement_component : public component {
public:
movement_component(engine& engine, entity& owner);
~movement_component();
movement_component(engine& engine, entity& owner);
~movement_component();
void update(float dt);
void update(float dt);
void set_mass(float mass){mass_ = mass;}
void set_damping(float damping){damping_ = damping;}
void set_mass(float mass){mass_ = mass;}
void set_damping(float damping){damping_ = damping;}
float mass() {return mass_;}
float damping() {return damping_;}
float mass() {return mass_;}
float damping() {return damping_;}
void set_current_velocity(glm::vec3 velocity) {current_velocity_ = velocity;}
glm::vec3 current_velocity() {return current_velocity_;}
void set_current_velocity(glm::vec3 velocity) {current_velocity_ = velocity;}
glm::vec3 current_velocity() {return current_velocity_;}
void add_force(glm::vec3 force) {forces_.push_back(force);}
void add_force(glm::vec3 force) {forces_.push_back(force);}
void set_constant_force(glm::vec3 constant_force) {constant_force_ = constant_force;}
glm::vec3 constant_force() {return constant_force_;}
void set_constant_force(glm::vec3 constant_force) {constant_force_ = constant_force;}
glm::vec3 constant_force() {return constant_force_;}
void add_angular_force(glm::vec3 force){angular_forces_.push_back(force);}
static unsigned long long type_id() {
return gdw::type_id<gdw::movement_component>();
}
static unsigned long long type_id() {
return gdw::type_id<gdw::movement_component>();
}
private:
float mass_;
float damping_;
float mass_;
float damping_;
glm::vec3 current_velocity_;
glm::vec3 constant_force_;
std::vector<glm::vec3> forces_;
glm::vec3 current_velocity_;
glm::vec3 constant_force_;
std::vector<glm::vec3> forces_;
std::vector<glm::vec3> angular_forces_;
glm::vec3 angular_velocity_;
......
......@@ -16,35 +16,39 @@ class ray;
class physics_system {
public:
physics_system(engine& engine);
~physics_system();
physics_system(engine& engine);
~physics_system();
void update(float dt);
void narrow_phase();
void update(float dt);
void narrow_phase();
template <shape_type A, shape_type B>
bool checkCollisions(const collision_shape* s1, const collision_shape* s2);
template <shape_type A, shape_type B>
bool checkCollisions(const collision_shape* s1, const collision_shape* s2);
template <shape_type A>
std::vector<unsigned long long> checkCollisions(const collision_shape* s1);
gdw::collision_data_manager& collision_data_manager() noexcept {
return collision_data_manager_;
}
gdw::collision_data_manager& collision_data_manager() noexcept {
return collision_data_manager_;
}
auto& collision_components() {
return collision_components_;
}
private:
void register_movement_component(movement_component* comp);
void unregister_movement_component(movement_component* comp);
void register_movement_component(movement_component* comp);
void unregister_movement_component(movement_component* comp);
void register_collision_component(collision_component* comp);
void unregister_collision_component(collision_component* comp);
void register_collision_component(collision_component* comp);
void unregister_collision_component(collision_component* comp);
private:
friend class movement_component;
friend class collision_component;
engine &engine_;
std::vector<movement_component*> movement_components_;
std::vector<collision_component*> collision_components_;
gdw::collision_data_manager collision_data_manager_;
friend class movement_component;
friend class collision_component;
engine &engine_;
std::vector<movement_component*> movement_components_;
std::vector<collision_component*> collision_components_;
gdw::collision_data_manager collision_data_manager_;
};
} //Namespace gdw
......
#include <glm/gtx/string_cast.hpp>
#include <gameplay/game_input_manager.h>
#include <core/engine.hpp>
#include <SDL.h>
......@@ -60,7 +62,7 @@ namespace gdw {
auto plane_normal = glm::vec3(0,1,0); //Hardcoded ground plane
//HNF
float d = glm::dot(glm::vec3(0,3,15) - glm::vec3(world_pos_near), plane_normal) / glm::dot(glm::vec3(glm::normalize(-ray_dir)), plane_normal);
float d = glm::dot(glm::vec3(0.f, 0.f, 0.f) - glm::vec3(world_pos_near), plane_normal) / glm::dot(glm::vec3(glm::normalize(-ray_dir)), plane_normal);
return camera->position()-glm::vec3((glm::normalize(ray_dir))*d);
}
......@@ -145,24 +147,13 @@ namespace gdw {
auto intersection_point = get_world_mouse_pos();
auto cannon = level_manager.cannon();
auto cannon_pos = glm::vec3(cannon->position().x, 3.f, cannon->position().z);
ray r(cannon_pos, intersection_point);
//SPAWN LASER
auto v1 = glm::vec3(0,0,-1);
auto v2 = glm::normalize(r.destination-r.source);
auto angle = std::acos(glm::dot(v1, v2) / glm::length(v1) * glm::length(v2));
auto cross = glm::cross(v1, v2);
if(glm::length(cross) < 0.01f) return;
auto axis = glm::normalize(cross);
auto s = sin(angle/2.f);
auto qx = axis.x *s;
auto qy = axis.y *s;
auto qz = axis.z *s;
auto qw = cos(angle/2.f);
auto rot = glm::angleAxis(glm::radians(180.f), glm::vec3(0,1,0));
rot *= glm::quat(qw,qx,qy,qz);
if (!cannon) {
return;
}
auto cannon_pos = cannon->position();
auto cannon_rotation = glm::toMat4(cannon->rotation());
auto offset = glm::vec3(cannon_rotation * glm::vec4(0.f, 0.57352f, 1.3088f, 1.f));
ray r(cannon_pos + offset, intersection_point);
auto ray_unnormalized = glm::vec3(1.f);
if (input.isDown(inputMapping::beam_normal)) {
......@@ -183,10 +174,10 @@ namespace gdw {
if (input.isDown(inputMapping::beam_normal)) {
auto ray_length = (std::abs(ray_length_ - 0.f) < 0.001f)? glm::length(ray_unnormalized): ray_length_;
render_ray(&r, ray_length, std::max((beam_velocity/10.f)/2.f, 1.f), glm::vec3(0,0,1));
render_ray(&r, offset, ray_length, 0.18f, false, glm::vec3(0.5f, 0.6f, 0.9f));
} else {
auto ray_length = (std::abs(ray_length_ - 0.f) < 0.001f)? glm::length(ray_unnormalized): ray_length_;
render_ray(&r, ray_length, std::max((beam_velocity/10.f)/2.f, 1.f), glm::vec3(1,0,0));
render_ray(&r, offset, ray_length, 0.18f, true, glm::vec3(0.8f, 0.4f, 0.f));
}
// do {
switch(portal_type) {
......@@ -198,9 +189,9 @@ namespace gdw {
ray_length_ = remaining_length;
process_beam_collision(r2, ray_unnormalized, beam_velocity, ray_length_, asteroid_hit, portal_type, remaining_length);
if (input.isDown(inputMapping::beam_normal)) {
render_ray(&r2, remaining_length, std::max((beam_velocity/10.f)/2.f, 1.f), glm::vec3(0,0,1));
render_ray(&r2, offset, remaining_length, 0.18f, false, glm::vec3(0,0,1));
} else {
render_ray(&r2, remaining_length, std::max((beam_velocity/10.f)/2.f, 1.f), glm::vec3(1,0,0));
render_ray(&r2, offset, remaining_length, 0.18f, true, glm::vec3(1,0,0));
}
}
break;
......@@ -213,9 +204,9 @@ namespace gdw {
ray_length_ = remaining_length;
process_beam_collision(r2, ray_unnormalized, beam_velocity, ray_length_, asteroid_hit, portal_type, remaining_length);
if (input.isDown(inputMapping::beam_normal)) {
render_ray(&r2, remaining_length, std::max((beam_velocity/10.f)/2.f, 1.f), glm::vec3(0,0,1));
render_ray(&r2, offset, remaining_length, 0.18f, false, glm::vec3(0,0,1));
} else {
render_ray(&r2, remaining_length, std::max((beam_velocity/10.f)/2.f, 1.f), glm::vec3(1,0,0));
render_ray(&r2, offset, remaining_length, 0.18f, true, glm::vec3(1,0,0));
}
}
break;
......@@ -239,6 +230,16 @@ namespace gdw {
break;
}
}
auto cannon = level_manager.cannon();
if (cannon) {
const static auto cannon_dir = glm::vec3(0.f, 0.f, 1.f);
auto ray_dir = get_world_mouse_pos() - cannon->position();
auto alpha = glm::atan(ray_dir.x, ray_dir.z);
auto beta = glm::atan(cannon_dir.x, cannon_dir.z);
auto cannon_rotation = glm::angleAxis(alpha + beta, glm::vec3(0.f, 1.f, 0.f));
cannon->rotation(cannon_rotation);
}
}
void game_input_manager::process_beam_collision(ray& r, glm::vec3 &ray_unnormalized, float &beam_velocity, float &ray_length_, bool &asteroid_hit, int &portal_type, float &remaining_ray_length) {
......@@ -262,7 +263,6 @@ namespace gdw {
//BEAM X ASTEROIDS
for(auto &coll : collider) {
auto c = engine_.entity_manager().resolve(coll);
auto type_comp = c->component<object_type_component>();
if(type_comp) {
if(type_comp->get_object_type() == "ASTEROID") {
......@@ -315,27 +315,20 @@ namespace gdw {
auto distance = glm::length(r.source - c->position());
if(glm::length(r.source - c->position()) < ray_length_) {
move->add_force((attract_dir * beam_velocity) / std::max(distance/20.f, 2.f));
ray_length_ = std::min(ray_length_, glm::length(c->position() - r.source));
}
}
}
}
void game_input_manager::render_ray(ray* r, float length, float radius, glm::vec3 color) {
auto v1 = glm::vec3(0,0,-1);
auto v2 = glm::normalize(r->destination-r->source);
auto angle = std::acos(glm::dot(v1, v2) / glm::length(v1) * glm::length(v2));
auto cross = glm::cross(v1, v2);
if(glm::length(cross) < 0.01f) return;
auto axis = glm::normalize(cross);
auto s = sin(angle/2.f);
auto qx = axis.x * s;
auto qy = axis.y * s;
auto qz = axis.z * s;
auto qw = cos(angle/2.f);
auto rot = glm::angleAxis(glm::radians(180.f), glm::vec3(0,1,0));
rot *= glm::quat(qw,qx,qy,qz);
engine_.rendering_system().render_trakor_beam(r->source, rot, length, radius, false, color);
void game_input_manager::render_ray(ray* r, const glm::vec3& offset, float length, float radius, bool invert, glm::vec3 color) {
const static auto cannon_dir = glm::vec3(0.f, 0.f, 1.f);
auto ray_dir = glm::normalize(r->destination - (r->source - offset));
auto alpha = glm::atan(ray_dir.x, ray_dir.z);
auto beta = glm::atan(cannon_dir.x, cannon_dir.z);
auto cannon_rotation = glm::angleAxis(alpha + beta, glm::vec3(0.f, 1.f, 0.f));
engine_.rendering_system().render_trakor_beam(r->source, cannon_rotation, length, radius, invert, color);
}
} //Namespace gdw
......@@ -34,7 +34,7 @@ namespace gdw {
auto &placed_item_coll = placed_item.emplace_back<collision_component>(new sphere(glm::vec3(0.f),7.f));
placed_item.emplace_back<object_type_component>("MAGNET_FIELD");
placed_item_coll.set_trigger([this](unsigned long long self_id, unsigned long long coll_id) {
auto collider = engine_.entity_manager().resolve(coll_id);
auto type_comp = collider->component<object_type_component>();
if(type_comp) {
......@@ -128,7 +128,7 @@ namespace gdw {
auto pos = ent->position();
ray r(pos-glm::vec3(2.5f,0,0), pos+glm::vec3(2.5f,0,0));
game_input_manager.render_ray(&r, glm::length(r.destination - r.source), 1.f, glm::vec3(0,1,0));
game_input_manager.render_ray(&r, glm::vec3(0.f), glm::length(r.destination - r.source), 1.f, false, glm::vec3(0,1,0));
a->alive_timer += dt;
if(a->alive_timer >= 20.f) {
......
#include <glm/gtx/string_cast.hpp>
#include <gameplay/level_manager.h>
#include <core/engine.hpp>
#include <ecs/entity_manager.hpp>
......@@ -44,7 +46,10 @@ namespace gdw {
player_(0),
camera_(0),
cannon_(0),
deathstar_(0){
deathstar_(0),
plane_offset_y_(0.f),
cannon_socket_offset_(0.f, 0.9163f, 3.9824f, 1.f),
cannon_offset_(0.f, 0.57352f, 1.3088f, 1.f) {
auto ptr = engine_.config_manager().load("config/settings");
map_load_timer_ = ptr->get<float>("map_load_timer", 0.f);
}
......@@ -99,7 +104,7 @@ namespace gdw {
// -------- PLAYER --------
if (player_ == 0) {
auto &player = engine_.entity_manager().emplace_back(glm::vec3(0.f, 3.f, 42.f),
auto &player = engine_.entity_manager().emplace_back(glm::vec3(0.f, plane_offset_y_ - cannon_socket_offset_.y - cannon_offset_.y, 42.f),
glm::angleAxis(glm::radians(90.f),
glm::vec3(0.f, 1.f, 0.f)));
player.emplace_back<object_type_component>("PLAYER");
......@@ -133,18 +138,18 @@ namespace gdw {
// ------- CANNON -----------
if (cannon_ == 0) {
auto &cannon = engine_.entity_manager().emplace_back(glm::vec3(0.f, 0.f, 3.f),
auto &cannon = engine_.entity_manager().emplace_back(glm::vec3(0.f, 0.f, 0.f),
glm::angleAxis(glm::radians(-90.f),
glm::vec3(0.f, 1.f, 0.f)));
cannon.emplace_back<staticmesh_component>("mesh/cannon.msh");
cannon_ = cannon.id();
}
maploader_.load({"mesh/asteroid.msh", "mesh/asteroid2.msh", "mesh/asteroid3.msh"}, 1.f, 50, 1, 40, -25, 3, -2,
maploader_.load({"mesh/asteroid.msh", "mesh/asteroid2.msh", "mesh/asteroid3.msh"}, 1.f, 50, 1, 40, -25, plane_offset_y_, -2,
static_cast<int>(time(0)), 30, 1.0f, 2.0f,
engine_.getConfig().get("navDebug", false)); //old seed: 27389
float tpos[]{20 + 15, 3, 15};
float tpos[]{20 + 15, plane_offset_y_, 15};
maploader_.set_move_target(tpos, false);
is_level_build_ = true;
......@@ -201,10 +206,8 @@ namespace gdw {
auto cannon = engine_.entity_manager().resolve(cannon_);
if (!cannon) return;
auto offset = glm::vec4(0.f, 0.9163f, 3.9824f, 1.f);
auto rotated_offset = glm::toMat4(p->rotation()) * offset;
auto rotated_offset = glm::toMat4(p->rotation()) * cannon_socket_offset_;
cannon->position(p->position() + rotated_offset.xyz());
cannon->rotation(p->rotation());
// ----- ITEMS DROPS ------
unsigned int item_drop_chance = 100; // percent
......@@ -272,7 +275,7 @@ namespace gdw {
void level_manager::create_asteroid(glm::vec3 pos, std::string mesh_name, float scale, glm::vec3 rotation) {
auto &entity_manager = engine_.entity_manager();
pos.y = plane_offset_y_;
auto &asteroid = entity_manager.emplace_back(pos, glm::angleAxis(glm::radians(0.f), glm::vec3(0.f, 0.f, 0.f)));
auto x_quat = glm::angleAxis(rotation.x, glm::vec3(1, 0, 0));
auto y_quat = glm::angleAxis(rotation.y, glm::vec3(0, 1, 0));
......@@ -282,8 +285,7 @@ namespace gdw {
auto col_data = engine_.physics_system().collision_data_manager().load("physic/asteroid.col");
auto &asteroid_coll = asteroid.emplace_back<collision_component>(
new sphere(col_data->center() + glm::vec3(0, (-pos.y) + 3.f, 0),
(scale / 4.f) * glm::length(col_data->half_extend())));
new sphere(glm::vec3(0.f), scale / 2.f * glm::length(col_data->half_extend())));
asteroid.scale(glm::vec3(scale));
asteroid.emplace_back<staticmesh_component>(mesh_name.data(), true);
......@@ -295,14 +297,14 @@ namespace gdw {
void level_manager::create_victim(float z) {
auto &entity_manager = engine_.entity_manager();
auto &victim = entity_manager.emplace_back(glm::vec3(-40.f, 3.f, z),
glm::angleAxis(glm::radians(90.f), glm::vec3(0.f, 1.f, 0.f)));
victim.scale(glm::vec3(0.6f));
auto &victim = entity_manager.emplace_back(glm::vec3(-40.f, plane_offset_y_, z),
glm::angleAxis(glm::radians(90.f), glm::vec3(0.f, 1.f, 0.f)),
glm::vec3(0.6f));
auto col_data = engine_.physics_system().collision_data_manager().load("physic/pirate_ship.col");
auto col_data = engine_.physics_system().collision_data_manager().load("physic/victim.col");
auto &victim_coll = victim.emplace_back<collision_component>(
new sphere(col_data->center(), 0.3f * glm::length(col_data->half_extend())));
new sphere(glm::vec3(0.f), 1.0f));
victim.emplace_back<object_type_component>("VICTIM");
victim_coll.set_trigger([this](unsigned long long self_id, unsigned long long coll_id) {
......@@ -334,7 +336,7 @@ namespace gdw {
void level_manager::create_item(glm::vec3 pos, int type) {
auto &entity_manager = engine_.entity_manager();
auto &item = entity_manager.emplace_back(glm::vec3(pos.x - 1.f, 3.f, pos.z),
auto &item = entity_manager.emplace_back(glm::vec3(pos.x - 1.f, plane_offset_y_, pos.z),
glm::angleAxis(glm::radians(90.f), glm::vec3(0.f, 1.f, 0.f)));
item.emplace_back<staticmesh_component>("mesh/coin.msh", true);
......@@ -365,7 +367,7 @@ namespace gdw {
}
}
auto &portal = engine_.entity_manager().emplace_back(glm::vec3(world_pos.x, 3.f, world_pos.z),
auto &portal = engine_.entity_manager().emplace_back(glm::vec3(world_pos.x, plane_offset_y_, world_pos.z),
glm::angleAxis(glm::radians(-45.f),
glm::vec3(1.f, 0.f, 0.f)));
portal.emplace_back<staticmesh_component>("mesh/coin.msh");
......@@ -386,7 +388,7 @@ namespace gdw {
}
}
auto &portal = engine_.entity_manager().emplace_back(glm::vec3(world_pos.x, 3.f, world_pos.z),
auto &portal = engine_.entity_manager().emplace_back(glm::vec3(world_pos.x, plane_offset_y_, world_pos.z),
glm::angleAxis(glm::radians(-45.f),
glm::vec3(1.f, 0.f, 0.f)));
portal.emplace_back<staticmesh_component>("mesh/coin.msh");
......
......@@ -8,33 +8,33 @@
#include <iostream>
namespace gdw {
movement_component::movement_component(engine& engine, entity& owner):
component(engine, owner), mass_(1.f), damping_(1.f), constant_force_(glm::vec3(0.f)),
movement_component::movement_component(engine& engine, entity& owner):
component(engine, owner), mass_(1.f), damping_(1.f), constant_force_(glm::vec3(0.f)),
current_velocity_(glm::vec3(0.f)), angular_velocity_(glm::vec3(0.f)) {
//Register