-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(collisions): emit event on collision
- Loading branch information
1 parent
eb22748
commit 6ac6f55
Showing
2 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
engine/include/cubos/engine/collisions/collision_event.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/// @file | ||
/// @brief Event @ref cubos::engine::CollisionEvent. | ||
/// @ingroup collisions-plugin | ||
|
||
#pragma once | ||
|
||
#include <glm/vec3.hpp> | ||
|
||
#include <cubos/core/ecs/entity/entity.hpp> | ||
|
||
namespace cubos::engine | ||
{ | ||
/// @brief Represents a collision event. | ||
/// @ingroup collisions-plugin | ||
struct CollisionEvent | ||
{ | ||
cubos::core::ecs::Entity entity; ///< Entity involved in the collision. | ||
cubos::core::ecs::Entity other; ///< Other entity involved in the collision. | ||
float penetration; ///< Penetration depth of the collision. | ||
glm::vec3 position; ///< Position of contact on the surface of the entity. | ||
glm::vec3 normal; ///< Normal of contact on the surface of the entity. | ||
}; | ||
}; // namespace cubos::engine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters