Struct TransformComponent#

Struct Documentation#

struct TransformComponent#

Transform component. Every entity has a transform component containing position, rotation and scale.

Public Functions

constexpr TransformComponent() noexcept = default#

Constructor.

inline explicit TransformComponent(const TRAP::Math::Vec3 &position) noexcept#

Constructor.

Parameters:

position – Position to use.

inline constexpr TransformComponent(const TRAP::Math::Vec3 &position, const TRAP::Math::Vec3 &rotationInRadians) noexcept#

Constructor.

Parameters:
  • position – Position to use.

  • rotationInRadians – Rotation to use.

inline constexpr TransformComponent(const TRAP::Math::Vec3 &position, const TRAP::Math::Vec3 &rotationInRadians, const TRAP::Math::Vec3 &scale) noexcept#

Constructor.

Parameters:
  • position – Position to use.

  • rotationInRadians – Rotation to use.

  • scale – Scale to use.

inline constexpr Math::Mat4 GetTransform() const noexcept#

Retrieve the transform calculated from current position, rotation and scale.

Returns:

Transform as Math::Mat4.

Public Members

Math::Vec3 Position = {0.0f, 0.0f, 0.0f}#
Math::Vec3 Rotation = {0.0f, 0.0f, 0.0f}#
Math::Vec3 Scale = {1.0f, 1.0f, 1.0f}#