LevelBoundsBehaviorSystem Class
System that handles entity behavior when colliding with level boundaries. More...
Declaration
Public Member Typedefs Index
| using | EngineRoleTag = helios::engine::common::tags::SystemRole |
Public Member Functions Index
| void | update (helios::engine::runtime::world::UpdateContext &updateContext) noexcept |
|
Updates all entities that may have left level bounds. More... | |
Private Member Functions Index
| void | updateCollisionResponse (helios::engine::ecs::GameObject go, BounceResult bounceResult, helios::engine::modules::physics::collision::types::CollisionResponse collisionResponse) |
|
Updates the entity's state based on the configured collision response. More... | |
| BounceResult | bounce (helios::math::vec3f worldTranslation, helios::math::aabbf objectBounds, helios::math::aabbf levelBounds, const float restitution, helios::engine::modules::physics::motion::components::Move2DComponent &m2d, helios::engine::modules::physics::motion::components::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 58 of file LevelBoundsBehaviorSystem.ixx.
Public Member Typedefs
EngineRoleTag
|
Definition at line 79 of file LevelBoundsBehaviorSystem.ixx.
Public Member Functions
update()
| inline noexcept |
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 90 of file LevelBoundsBehaviorSystem.ixx.
References helios::engine::modules::physics::collision::types::Bounce, helios::engine::modules::physics::collision::types::Despawn, helios::math::mat4< T >::inverse, helios::engine::modules::physics::collision::types::Reflect, helios::math::vec4< T >::toVec3, helios::math::vec3< T >::toVec4, helios::math::mat4< T >::translation and helios::math::mat4< T >::withTranslation.
Private Member Functions
bounce()
| inline nodiscard noexcept |
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.
restitution m2d Reference to the Move2DComponent for velocity modification.
dc Reference to the DirectionComponent for direction update.
- Returns
Corrected world position after bounce.
Definition at line 209 of file LevelBoundsBehaviorSystem.ixx.
updateCollisionResponse()
| inline |
Updates the entity's state based on the configured collision response.
If the response is set to AlignHeadingToDirection, this method updates the SteeringComponent to match the new bounce direction.
- Parameters
-
go Pointer to the GameObject to update.
bounceResult The result data from the bounce calculation.
collisionResponse The type of response to apply.
Definition at line 173 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.