engine/include/components/collider.hpp

28 lines
468 B
C++
Raw Normal View History

2023-05-01 12:55:49 +00:00
#ifndef ENGINE_INCLUDE_COMPONENTS_COLLIDER_H_
#define ENGINE_INCLUDE_COMPONENTS_COLLIDER_H_
2023-01-18 14:42:09 +00:00
2023-01-26 23:52:25 +00:00
#include <glm/vec3.hpp>
2023-05-01 12:55:49 +00:00
2023-01-26 23:52:25 +00:00
#include <cstdint>
2023-01-18 14:42:09 +00:00
namespace engine {
2023-05-01 12:55:49 +00:00
struct AABB {
glm::vec3 pos1;
glm::vec3 pos2;
};
2023-01-22 18:20:10 +00:00
2023-05-01 12:55:49 +00:00
class PhysicsSystem;
2023-02-02 17:32:19 +00:00
2023-05-01 12:55:49 +00:00
struct ColliderComponent {
friend PhysicsSystem;
2023-01-18 14:42:09 +00:00
2023-05-01 12:55:49 +00:00
bool is_static = true;
bool is_trigger =
false; // entity receives an event on collision enter and exit
AABB aabb{}; // broad phase
};
2023-02-02 17:32:19 +00:00
2023-05-01 12:55:49 +00:00
} // namespace engine
2023-01-18 14:42:09 +00:00
2023-05-01 12:55:49 +00:00
#endif