mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 04:21:50 +00:00
add triggers
This commit is contained in:
parent
50c714692a
commit
5769be8ec8
15 changed files with 239 additions and 64 deletions
|
|
@ -1,8 +1,24 @@
|
|||
#ifndef PHYSICS_HITBOX_HPP_
|
||||
#define PHYSICS_HITBOX_HPP_
|
||||
|
||||
#include "../maths/aabb.hpp"
|
||||
#include "../typedefs.hpp"
|
||||
|
||||
#include <set>
|
||||
#include <functional>
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
struct Trigger {
|
||||
bool enabled = true;
|
||||
entityid_t entity;
|
||||
AABB aabb;
|
||||
AABB calculated;
|
||||
std::set<entityid_t> prevEntered;
|
||||
std::set<entityid_t> nextEntered;
|
||||
std::function<void(entityid_t, size_t, entityid_t)> enterCallback;
|
||||
std::function<void(entityid_t, size_t, entityid_t)> exitCallback;
|
||||
};
|
||||
|
||||
struct Hitbox {
|
||||
glm::vec3 position;
|
||||
glm::vec3 halfsize;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue