LevelBoundsBehaviorComponent Class
Component that defines how an entity reacts to level boundaries. More...
Declaration
Public Constructors Index
| LevelBoundsBehaviorComponent (const float restitution) | |
|
Constructs a LevelBoundsBehaviorComponent with a specified restitution. More... | |
| LevelBoundsBehaviorComponent (const helios::engine::modules::physics::collision::types::CollisionBehavior collisionBehavior=helios::engine::modules::physics::collision::types::CollisionBehavior::Reflect, const helios::engine::modules::physics::collision::types::CollisionResponse collisionResponse=helios::engine::modules::physics::collision::types::CollisionResponse::None) | |
|
Constructs a LevelBoundsBehaviorComponent with a specified collision behavior. More... | |
| LevelBoundsBehaviorComponent (const LevelBoundsBehaviorComponent &other) | |
|
Copy constructor. More... | |
| LevelBoundsBehaviorComponent (LevelBoundsBehaviorComponent &&) noexcept=default | |
Public Operators Index
| LevelBoundsBehaviorComponent & | operator= (const LevelBoundsBehaviorComponent &)=default |
| LevelBoundsBehaviorComponent & | operator= (LevelBoundsBehaviorComponent &&) noexcept=default |
Public Member Functions Index
| bool | isEnabled () const noexcept |
|
Checks whether this component is enabled. More... | |
| void | enable () noexcept |
|
Enables this component. More... | |
| void | disable () noexcept |
|
Disables this component. More... | |
| float | restitution () const noexcept |
|
Retrieves the restitution coefficient. More... | |
| helios::engine::modules::physics::collision::types::CollisionBehavior | collisionBehavior () const noexcept |
|
Retrieves the collision behavior type. More... | |
| helios::engine::modules::physics::collision::types::CollisionResponse | collisionResponse () const noexcept |
|
Retrieves the collision response type. More... | |
| void | setCollisionResponse (const helios::engine::modules::physics::collision::types::CollisionResponse collisionResponse) noexcept |
|
Sets the collision response type. More... | |
| void | setCollisionBehavior (const helios::engine::modules::physics::collision::types::CollisionBehavior collisionBehavior) noexcept |
|
Sets the collision behavior type. More... | |
| void | setRestitution (const float restitution) noexcept |
|
Sets the coefficient of restitution (bounciness). More... | |
Private Member Attributes Index
| float | restitution_ = 0.5f |
|
Coefficient of restitution (bounciness). More... | |
| helios::engine::modules::physics::collision::types::CollisionBehavior | collisionBehavior_ = helios::engine::modules::physics::collision::types::CollisionBehavior::Bounce |
|
The behavior type for boundary collisions. More... | |
| helios::engine::modules::physics::collision::types::CollisionResponse | collisionResponse_ = helios::engine::modules::physics::collision::types::CollisionResponse::None |
| bool | isEnabled_ = true |
|
Whether this component is enabled. More... | |
Description
Component that defines how an entity reacts to level boundaries.
This component stores properties related to boundary interactions, such as restitution (bounciness) when colliding with level walls, used by physics or movement systems to resolve out-of-bounds conditions.
Definition at line 29 of file LevelBoundsBehaviorComponent.ixx.
Public Constructors
LevelBoundsBehaviorComponent()
| inline explicit |
Constructs a LevelBoundsBehaviorComponent with a specified restitution.
- Parameters
-
restitution The coefficient of restitution (0.0 to 1.0).
Definition at line 87 of file LevelBoundsBehaviorComponent.ixx.
Reference restitution.
Referenced by LevelBoundsBehaviorComponent, LevelBoundsBehaviorComponent, operator= and operator=.
LevelBoundsBehaviorComponent()
| inline explicit |
Constructs a LevelBoundsBehaviorComponent with a specified collision behavior.
- Parameters
-
collisionBehavior The collision behavior type (default: Reflect).
Definition at line 95 of file LevelBoundsBehaviorComponent.ixx.
References collisionBehavior, collisionResponse, helios::engine::modules::physics::collision::types::None and helios::engine::modules::physics::collision::types::Reflect.
LevelBoundsBehaviorComponent()
| inline |
Copy constructor.
- Parameters
-
other The component to copy from.
Definition at line 107 of file LevelBoundsBehaviorComponent.ixx.
Reference LevelBoundsBehaviorComponent.
LevelBoundsBehaviorComponent()
| noexcept default |
Definition at line 114 of file LevelBoundsBehaviorComponent.ixx.
Reference LevelBoundsBehaviorComponent.
Public Operators
operator=()
| default |
Definition at line 113 of file LevelBoundsBehaviorComponent.ixx.
Reference LevelBoundsBehaviorComponent.
operator=()
| noexcept default |
Definition at line 115 of file LevelBoundsBehaviorComponent.ixx.
Reference LevelBoundsBehaviorComponent.
Public Member Functions
collisionBehavior()
| inline nodiscard noexcept |
Retrieves the collision behavior type.
- Returns
The collision behavior (e.g., Bounce, Reflect, Clamp, Despawn).
Definition at line 131 of file LevelBoundsBehaviorComponent.ixx.
Referenced by LevelBoundsBehaviorComponent and setCollisionBehavior.
collisionResponse()
| inline nodiscard noexcept |
Retrieves the collision response type.
- Returns
The collision response type (e.g., None, Event).
Definition at line 140 of file LevelBoundsBehaviorComponent.ixx.
Referenced by LevelBoundsBehaviorComponent and setCollisionResponse.
disable()
| inline noexcept |
Disables this component.
Definition at line 78 of file LevelBoundsBehaviorComponent.ixx.
enable()
| inline noexcept |
Enables this component.
Definition at line 71 of file LevelBoundsBehaviorComponent.ixx.
isEnabled()
| inline nodiscard noexcept |
Checks whether this component is enabled.
- Returns
True if enabled, false otherwise.
Definition at line 64 of file LevelBoundsBehaviorComponent.ixx.
restitution()
| inline nodiscard noexcept |
Retrieves the restitution coefficient.
- Returns
The restitution value.
Definition at line 122 of file LevelBoundsBehaviorComponent.ixx.
Reference restitution.
Referenced by LevelBoundsBehaviorComponent, restitution and setRestitution.
setCollisionBehavior()
| inline noexcept |
Sets the collision behavior type.
- Parameters
-
collisionBehavior The new collision behavior to set.
Definition at line 158 of file LevelBoundsBehaviorComponent.ixx.
Reference collisionBehavior.
setCollisionResponse()
| inline noexcept |
Sets the collision response type.
- Parameters
-
collisionResponse The new collision response to set.
Definition at line 149 of file LevelBoundsBehaviorComponent.ixx.
Reference collisionResponse.
setRestitution()
| inline noexcept |
Sets the coefficient of restitution (bounciness).
- Parameters
-
restitution The new restitution value to set. Must be within the range [0.0, 1.0]. Values outside this range will be clamped.
Definition at line 168 of file LevelBoundsBehaviorComponent.ixx.
Reference restitution.
Private Member Attributes
collisionBehavior_
|
The behavior type for boundary collisions.
Defines how the entity reacts when hitting level bounds (e.g., Bounce, Reflect, Clamp, Despawn).
Definition at line 48 of file LevelBoundsBehaviorComponent.ixx.
collisionResponse_
|
Definition at line 50 of file LevelBoundsBehaviorComponent.ixx.
isEnabled_
|
Whether this component is enabled.
Definition at line 55 of file LevelBoundsBehaviorComponent.ixx.
restitution_
|
Coefficient of restitution (bounciness).
A value of 1.0 means a perfectly elastic collision (no energy lost). A value of 0.0 means a perfectly inelastic collision (no bounce). Default is 0.5.
Definition at line 40 of file LevelBoundsBehaviorComponent.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.