LevelBoundsBehaviorSystem Class
System that handles entity behavior when colliding with level boundaries. More...
Declaration
Base class
| class | System |
|
Abstract base class for game systems. More... | |
Public Member Functions Index
| void | update (helios::engine::game::UpdateContext &updateContext) noexcept override |
|
Updates all entities that may have left level bounds. More... | |
Private Static Functions Index
| static helios::math::vec3f | bounce (helios::math::vec3f worldTranslation, helios::math::aabbf objectBounds, helios::math::aabbf levelBounds, helios::engine::game::components::physics::Move2DComponent &m2d, helios::engine::game::components::physics::LevelBoundsBehaviorComponent &bbc, helios::engine::game::components::physics::DirectionComponent &dc) noexcept |
|
Applies bounce behavior to an entity that has left level bounds. More... | |
Description
System that handles entity behavior when colliding with level boundaries.
This system checks if entities with movement components have exceeded the level bounds. When an entity leaves the bounds, it applies bounce behavior based on the LevelBoundsBehaviorComponent's restitution coefficient.
Definition at line 41 of file LevelBoundsBehaviorSystem.ixx.
Public Member Functions
update()
| inline noexcept virtual |
Updates all entities that may have left level bounds.
For each entity with the required components, checks if its world-space AABB is within level bounds. If not, applies bounce behavior.
- Parameters
-
updateContext Context containing deltaTime and other frame data.
Definition at line 54 of file LevelBoundsBehaviorSystem.ixx.
References helios::engine::game::System::gameWorld_, helios::math::mat4< T >::inverse, helios::math::vec4< T >::toVec3, helios::math::mat4< T >::translation and helios::math::mat4< T >::withTranslation.
Private Static Functions
bounce()
| inline nodiscard noexcept static |
Applies bounce behavior to an entity that has left level bounds.
Calculates the corrected position and reflected velocity when an entity collides with level boundaries. The restitution coefficient determines how much velocity is preserved after the bounce. The DirectionComponent will be updated with the new direction.
- Parameters
-
worldTranslation Current world position of the entity.
objectBounds World-space AABB of the entity.
levelBounds World-space AABB of the level.
m2d Reference to the Move2DComponent for velocity modification.
bbc Reference to the LevelBoundsBehaviorComponent for restitution.
dc Reference to the DirectionComponent for direction update.
- Returns
Corrected world position after bounce.
Definition at line 111 of file LevelBoundsBehaviorSystem.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.