NcEngine
CollisionListener.h
Go to the documentation of this file.
1
5#pragma once
6
9
10#include <functional>
11
12namespace nc
13{
15using OnCollisionHitEvent_t = std::move_only_function<void(Entity self,
16 Entity other,
17 const HitInfo& hit,
18 ecs::Ecs world)>;
19
21using OnCollisionEvent_t = std::move_only_function<void(Entity self,
22 Entity other,
23 ecs::Ecs world)>;
24
27{
28 OnCollisionHitEvent_t onEnter = nullptr;
29 OnCollisionEvent_t onExit = nullptr;
30 OnCollisionEvent_t onTriggerEnter = nullptr;
31 OnCollisionEvent_t onTriggerExit = nullptr;
32};
33} // namespace nc
std::move_only_function< void(Entity self, Entity other, const HitInfo &hit, ecs::Ecs world)> OnCollisionHitEvent_t
Callback type for collision enter events.
Definition: CollisionListener.h:18
std::move_only_function< void(Entity self, Entity other, ecs::Ecs world)> OnCollisionEvent_t
Callback type for collision exit, trigger enter, and trigger exit events.
Definition: CollisionListener.h:23
Identifies an object in the registry.
Definition: Entity.h:18
Interface for higher-level entity and component operations with optional type access restriction.
Definition: Ecs.h:18
Component that receives collision event callbacks.
Definition: CollisionListener.h:27
Collision event information.
Definition: HitInfo.h:41