engine/include/components/collider.hpp

30 lines
443 B
C++
Raw Normal View History

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;
bool isStatic = true;
bool isTrigger = false; // entity receives an event on collision enter and exit
2023-02-09 20:44:37 +00:00
AABB aabb{}; // broad phase
2023-02-02 17:32:19 +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
};
}