[ADDED] simple collision logic for entities

This commit is contained in:
Menno
2021-05-28 11:37:21 +02:00
parent 51cdc520e0
commit 28400fb320
6 changed files with 140 additions and 0 deletions

31
src/collision/collision.h Normal file
View File

@@ -0,0 +1,31 @@
#pragma once
#include <glm/gtc/matrix_transform.hpp>
#include "../entities/entity.h"
namespace collision
{
/*
* This structure represents a collision box inside the world.
*
* center_pos: The center position of the collision box
* size: The size in each axis of the collision box
*/
struct Box
{
glm::vec3 center_pos;
glm::vec3 size;
};
/*
* This structure represents a collision between 2 entities
*
* entity1: The first entity
* entity2: The second entity
*/
struct Collision
{
entities::Entity& entity1;
entities::Entity& entity2;
};
}