DirectionComponent Class
Component that holds a normalized direction vector. More...
Declaration
Public Constructors Index
| DirectionComponent ()=default | |
|
Default constructor. More... | |
| DirectionComponent (const DirectionComponent &other) | |
|
Copy constructor. More... | |
| DirectionComponent (DirectionComponent &&) noexcept=default | |
Public Operators Index
| DirectionComponent & | operator= (const DirectionComponent &)=default |
| DirectionComponent & | operator= (DirectionComponent &&) 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... | |
| void | setDirection (const helios::math::vec3f direction) noexcept |
|
Sets the direction vector. More... | |
| helios::math::vec3f | direction () const noexcept |
|
Retrieves the stored direction vector. More... | |
Private Member Attributes Index
| helios::math::vec3f | direction_ {} |
|
The stored normalized direction vector. More... | |
| bool | isEnabled_ = true |
|
Whether this component is enabled. More... | |
Description
Component that holds a normalized direction vector.
This component is used to store a direction for various purposes, such as movement direction, facing direction, or other vector-based properties. It enforces normalization of the stored vector.
Definition at line 26 of file DirectionComponent.ixx.
Public Constructors
DirectionComponent()
| default |
Default constructor.
Definition at line 66 of file DirectionComponent.ixx.
Referenced by DirectionComponent, DirectionComponent, operator= and operator=.
DirectionComponent()
| inline |
Copy constructor.
- Parameters
-
other The component to copy from.
Definition at line 73 of file DirectionComponent.ixx.
References direction and DirectionComponent.
DirectionComponent()
| noexcept default |
Definition at line 76 of file DirectionComponent.ixx.
Reference DirectionComponent.
Public Operators
operator=()
| default |
Definition at line 75 of file DirectionComponent.ixx.
Reference DirectionComponent.
operator=()
| noexcept default |
Definition at line 77 of file DirectionComponent.ixx.
Reference DirectionComponent.
Public Member Functions
direction()
| inline nodiscard noexcept |
Retrieves the stored direction vector.
- Returns
The current normalized direction vector.
Definition at line 98 of file DirectionComponent.ixx.
Referenced by DirectionComponent and setDirection.
disable()
| inline noexcept |
Disables this component.
Definition at line 59 of file DirectionComponent.ixx.
enable()
| inline noexcept |
Enables this component.
Definition at line 52 of file DirectionComponent.ixx.
isEnabled()
| inline nodiscard noexcept |
Checks whether this component is enabled.
- Returns
True if enabled, false otherwise.
Definition at line 45 of file DirectionComponent.ixx.
setDirection()
| inline noexcept |
Sets the direction vector.
The provided vector must be normalized. An assertion checks this in debug builds.
- Parameters
-
direction The new normalized direction vector.
Definition at line 87 of file DirectionComponent.ixx.
References direction, helios::math::EPSILON_LENGTH and setDirection.
Referenced by setDirection.
Private Member Attributes
direction_
|
The stored normalized direction vector.
Definition at line 31 of file DirectionComponent.ixx.
isEnabled_
|
Whether this component is enabled.
Definition at line 36 of file DirectionComponent.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.