LevelBoundsBehaviorComponent.ixx File
Component defining behavior when an entity interacts with level boundaries. More...
Included Headers
#include <algorithm>
#include <cassert>
#include <helios.engine.modules.physics.collision.types.CollisionResponse>
#include <helios.engine.modules.physics.collision.types.CollisionBehavior>
Namespaces Index
| namespace | helios |
| namespace | engine |
|
Main engine module aggregating core infrastructure and game systems. More... | |
| namespace | mechanics |
|
High-level gameplay systems and components for game logic. More... | |
| namespace | bounds |
| namespace | components |
|
Boundary behavior configuration components. More... | |
Classes Index
| class | LevelBoundsBehaviorComponent |
|
Component that defines how an entity reacts to level boundaries. More... | |
Description
Component defining behavior when an entity interacts with level boundaries.
File Listing
The file content with the documentation metadata removed is:
18export namespace helios::engine::mechanics::bounds::components {
29 class LevelBoundsBehaviorComponent {
48 helios::engine::modules::physics::collision::types::CollisionBehavior collisionBehavior_ = helios::engine::modules::physics::collision::types::CollisionBehavior::Bounce;
50 helios::engine::modules::physics::collision::types::CollisionResponse collisionResponse_ = helios::engine::modules::physics::collision::types::CollisionResponse::None;
87 explicit LevelBoundsBehaviorComponent(const float restitution) :
88 restitution_(restitution) {}
95 explicit LevelBoundsBehaviorComponent(
96 const helios::engine::modules::physics::collision::types::CollisionBehavior collisionBehavior = helios::engine::modules::physics::collision::types::CollisionBehavior::Reflect,
97 const helios::engine::modules::physics::collision::types::CollisionResponse collisionResponse = helios::engine::modules::physics::collision::types::CollisionResponse::None) :
98 collisionBehavior_(collisionBehavior),
99 collisionResponse_(collisionResponse)
107 LevelBoundsBehaviorComponent(const LevelBoundsBehaviorComponent& other) :
113 LevelBoundsBehaviorComponent& operator=(const LevelBoundsBehaviorComponent&) = default;
114 LevelBoundsBehaviorComponent(LevelBoundsBehaviorComponent&&) noexcept = default;
115 LevelBoundsBehaviorComponent& operator=(LevelBoundsBehaviorComponent&&) noexcept = default;
122 [[nodiscard]] float restitution() const noexcept {
131 [[nodiscard]] helios::engine::modules::physics::collision::types::CollisionBehavior collisionBehavior() const noexcept {
140 [[nodiscard]] helios::engine::modules::physics::collision::types::CollisionResponse collisionResponse() const noexcept {
149 void setCollisionResponse(const helios::engine::modules::physics::collision::types::CollisionResponse collisionResponse) noexcept {
150 collisionResponse_ = collisionResponse;
158 void setCollisionBehavior(const helios::engine::modules::physics::collision::types::CollisionBehavior collisionBehavior) noexcept {
159 collisionBehavior_ = collisionBehavior;
168 void setRestitution(const float restitution) noexcept {
169 assert(restitution >= 0.0f && restitution <= 1.0f && "Unexpected value for restitution");
170 restitution_ = std::clamp(restitution, 0.0f, 1.0f);
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.