4#ifndef TRAM_SDK_COMPONENTS_TRIGGERCOMPONENT_H
5#define TRAM_SDK_COMPONENTS_TRIGGERCOMPONENT_H
12class btCollisionShape;
13class btCollisionObject;
49 std::vector<Physics::Collision>
Poll ();
53 uint32_t collisionMask = -1;
54 uint32_t collisionGroup = -1;
56 vec3 location =
vec3(0.0f, 0.0f, 0.0f);
57 quat rotation =
vec3(0.0f, 0.0f, 0.0f);
60 Physics::trigger_t trigger = {
nullptr};
62 void (*activation_callback)(
TriggerComponent*, Physics::Collision) =
nullptr;
63 void (*deactivation_callback)(
TriggerComponent*, Physics::Collision) =
nullptr;
66 bool store_collisions =
false;
68 std::vector<std::pair<uint32_t, Physics::Collision>> active_collisions;
70 std::vector<Physics::Collision> stored_collisions;
Definition: entitycomponent.h:18
Definition: collisionmodel.h:12
static CollisionModel * Find(name_t model_name)
Finds a model.
Definition: collisionmodel.cpp:21
Definition: resource.h:47
uint32_t GetCollisionMask()
Definition: trigger.h:38
void SetLocation(vec3 location)
Sets the location of the component.
Definition: trigger.cpp:71
void EventHandler(Event &event)
Definition: trigger.h:21
void SetModel(name_t model)
Definition: trigger.h:25
void SetActivationCallback(void(*activation_callback)(TriggerComponent *, Physics::Collision))
Definition: trigger.h:29
void SetDectivationCallback(void(*deactivation_callback)(TriggerComponent *, Physics::Collision))
Definition: trigger.h:30
void SetFilterCallback(bool(*filter_callback)(TriggerComponent *, PhysicsComponent *))
Definition: trigger.h:31
void Start()
Definition: trigger.cpp:15
void SetStoreCollisions(bool store_collisions)
Definition: trigger.h:36
void ResetCollisions()
Resets registered collisions.
Definition: trigger.cpp:118
void SetCollisionGroup(uint32_t flags)
Sets a collision group for the trigger.
Definition: trigger.cpp:62
uint32_t GetCollisionGroup()
Definition: trigger.h:39
~TriggerComponent()
Definition: trigger.cpp:37
void SetCollisionMask(uint32_t flags)
Sets a collision mask for the trigger.
Definition: trigger.cpp:51
Physics::CollisionModel * GetModel()
Definition: trigger.h:24
TriggerComponent()
Definition: trigger.h:19
void Collision(const Physics::Collision &collision)
Registers a collision.
Definition: trigger.cpp:90
std::vector< Physics::Collision > Poll()
Checks for collisions with the trigger.
Definition: trigger.cpp:186
void SetModel(Physics::CollisionModel *model)
Definition: trigger.h:26
void SetShape(Physics::CollisionShape shape)
Sets a collision shape for the trigger.
Definition: trigger.cpp:44
const std::vector< Physics::Collision > & GetStoredCollisions()
Definition: trigger.h:44
void SetRotation(quat rotation)
Sets the rotation of the component.
Definition: trigger.cpp:80
glm::vec3 vec3
Definition: math.h:12
glm::quat quat
Definition: math.h:13
Definition: collisionshape.h:25