2023-01-18 14:42:09 +00:00
|
|
|
#pragma once
|
|
|
|
|
2023-01-26 23:52:25 +00:00
|
|
|
#include <glm/vec3.hpp>
|
|
|
|
#include <cstdint>
|
|
|
|
|
2023-01-18 14:42:09 +00:00
|
|
|
namespace engine {
|
|
|
|
|
2023-02-02 17:32:19 +00:00
|
|
|
struct AABB {
|
|
|
|
glm::vec3 pos1;
|
|
|
|
glm::vec3 pos2;
|
2023-01-22 18:20:10 +00:00
|
|
|
};
|
|
|
|
|
2023-02-02 17:32:19 +00:00
|
|
|
class PhysicsSystem;
|
|
|
|
|
2023-01-18 14:42:09 +00:00
|
|
|
struct ColliderComponent {
|
|
|
|
friend PhysicsSystem;
|
|
|
|
|
2023-02-02 17:32:19 +00:00
|
|
|
ColliderComponent()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2023-02-09 15:21:37 +00:00
|
|
|
bool isStatic = true;
|
|
|
|
bool isTrigger = false; // entity receives an event on collision enter and exit
|
|
|
|
AABB aabb{};
|
2023-02-02 17:32:19 +00:00
|
|
|
|
2023-02-09 15:21:37 +00:00
|
|
|
bool getIsColliding() { return isColliding; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool isColliding = false;
|
2023-02-02 17:32:19 +00:00
|
|
|
|
2023-01-18 14:42:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|