Transform component.
More...
#include <TransformComponent.h>
|
| Transform () |
| Default constructor.
|
|
| Transform (Math::Vector3 position, Math::Quaternion rotation=Math::Quaternion::Identity, Math::Vector3 scale=Math::Vector3::One) |
| Parametrized constructor.
|
|
| Transform (const Transform &)=default |
| Copy constructor (defaulted)
|
|
| Transform (Transform &&)=default |
| Move constructor (defaulted)
|
|
| ~Transform ()=default |
| Destructor (defaulted)
|
|
Transform & | operator= (const Transform &)=default |
| Copy assignment operator.
|
|
Transform & | operator= (Transform &&) noexcept=default |
| Move assignment operator.
|
|
auto | operator<=> (const Transform &) const =default |
| Comparison operator.
|
|
NUI_NODISCARD_TRANSFROM_GETTER const Math::Quaternion & | GetRotation () const |
| Const reference getter for rotation.
|
|
NUI_NODISCARD_TRANSFROM_GETTER Math::Quaternion | GetRotation () |
| Getter for rotation.
|
|
NUI_NODISCARD_TRANSFROM_GETTER const Math::Vector3 & | GetPosition () const |
| Const reference getter for position.
|
|
NUI_NODISCARD_TRANSFROM_GETTER Math::Vector3 | GetPosition () |
| Getter for position.
|
|
NUI_NODISCARD_TRANSFROM_GETTER const Math::Vector3 & | GetScale () const |
| Const reference getter for scale.
|
|
NUI_NODISCARD_TRANSFROM_GETTER Math::Vector3 | GetScale () |
| Getter for scale.
|
|
NUI_NODISCARD_TRANSFROM_GETTER Math::Matrix | GetWorldMatrix () const |
| Getter for world matrix.
|
|
void | SetRotation (const Math::Quaternion &rotation) |
| Setter for rotation.
|
|
void | SetPosition (const Math::Vector3 &position) |
| Setter for position.
|
|
void | SetScale (const Math::Vector3 &scale) |
| Setter for scale.
|
|
void | RecalculateWorldMatrix () |
| Recalculates world matrix (used when transform is dirty)
|
|
| ComponentBase () |
| Constructor (sets dirty flag to true)
|
|
bool | IsDirty () const |
| Checks if the component is dirty.
|
|
bool | IsActive () const |
| Checks if the component is active.
|
|
void | SetActive (bool isActive) |
| Sets the active flag.
|
|
|
void | SetDirty (bool isDirty=true) |
| Sets the dirty flag.
|
|
std::bitset< ComponentFlags::CF_COUNT > | m_flags |
| Bitset of component flags.
|
|
◆ Transform()
Nui::Components::Transform::Transform |
( |
Math::Vector3 | position, |
|
|
Math::Quaternion | rotation = Math::Quaternion::Identity, |
|
|
Math::Vector3 | scale = Math::Vector3::One ) |
Parametrized constructor.
- Parameters
-
position | Position of the transform |
rotation | Rotation of the transform (defaults to identity rotation) |
scale | Scale of the transform (defaults to 1, 1, 1) |
◆ GetPosition() [1/2]
NUI_NODISCARD_TRANSFROM_GETTER Math::Vector3 Nui::Components::Transform::GetPosition |
( |
| ) |
|
|
inline |
Getter for position.
- Returns
- Position of the transform
◆ GetPosition() [2/2]
NUI_NODISCARD_TRANSFROM_GETTER const Math::Vector3 & Nui::Components::Transform::GetPosition |
( |
| ) |
const |
|
inline |
Const reference getter for position.
- Returns
- Position of the transform
◆ GetRotation() [1/2]
NUI_NODISCARD_TRANSFROM_GETTER Math::Quaternion Nui::Components::Transform::GetRotation |
( |
| ) |
|
|
inline |
Getter for rotation.
- Returns
- Rotation of the transform
◆ GetRotation() [2/2]
NUI_NODISCARD_TRANSFROM_GETTER const Math::Quaternion & Nui::Components::Transform::GetRotation |
( |
| ) |
const |
|
inline |
Const reference getter for rotation.
- Returns
- Rotation of the transform
◆ GetScale() [1/2]
NUI_NODISCARD_TRANSFROM_GETTER Math::Vector3 Nui::Components::Transform::GetScale |
( |
| ) |
|
|
inline |
Getter for scale.
- Returns
- Scale of the transform
◆ GetScale() [2/2]
NUI_NODISCARD_TRANSFROM_GETTER const Math::Vector3 & Nui::Components::Transform::GetScale |
( |
| ) |
const |
|
inline |
Const reference getter for scale.
- Returns
- Scale of the transform
◆ GetWorldMatrix()
NUI_NODISCARD_TRANSFROM_GETTER Math::Matrix Nui::Components::Transform::GetWorldMatrix |
( |
| ) |
const |
|
inline |
Getter for world matrix.
- Returns
- World matrix from position, rotation and scale
◆ operator<=>()
auto Nui::Components::Transform::operator<=> |
( |
const Transform & | | ) |
const |
|
default |
Comparison operator.
- Returns
- 0 if equal
◆ operator=() [1/2]
Copy assignment operator.
- Returns
- Reference to self
◆ operator=() [2/2]
Move assignment operator.
- Returns
- Reference to self
◆ SetPosition()
void Nui::Components::Transform::SetPosition |
( |
const Math::Vector3 & | position | ) |
|
Setter for position.
- Parameters
-
◆ SetRotation()
void Nui::Components::Transform::SetRotation |
( |
const Math::Quaternion & | rotation | ) |
|
Setter for rotation.
- Parameters
-
◆ SetScale()
void Nui::Components::Transform::SetScale |
( |
const Math::Vector3 & | scale | ) |
|
Setter for scale.
- Parameters
-
The documentation for this class was generated from the following files:
- Engine/Core/Engine/Components/TransformComponent.h
- Engine/Core/Engine/Components/TransformComponent.cpp