le2d v0.4.3
2D game engine framework
 
Loading...
Searching...
No Matches
le::Transform Struct Reference

2D transformation. More...

#include <le2d/transform.hpp>

Public Member Functions

auto to_model () const -> glm::mat4
 
auto to_view () const -> glm::mat4
 
auto to_inverse_view () const -> glm::mat4
 

Static Public Member Functions

static auto accumulate (Transform const &a, Transform const &b) -> Transform
 

Public Attributes

glm::vec2 position {}
 
nvec2 orientation {right_v}
 
glm::vec2 scale {1.0f}
 

Static Public Attributes

static constexpr auto identity_mat_v = glm::mat4{1.0f}
 

Detailed Description

2D transformation.

Member Function Documentation

◆ accumulate()

static auto le::Transform::accumulate ( Transform const &  a,
Transform const &  b 
) -> Transform
static
Returns
Transform with positions and orientations added and scales multiplied together.

◆ to_inverse_view()

auto le::Transform::to_inverse_view ( ) const -> glm::mat4
Returns
Inverse of view matrix.

◆ to_model()

auto le::Transform::to_model ( ) const -> glm::mat4
Returns
Model matrix.

◆ to_view()

auto le::Transform::to_view ( ) const -> glm::mat4
Returns
View matrix.

Member Data Documentation

◆ identity_mat_v

constexpr auto le::Transform::identity_mat_v = glm::mat4{1.0f}
staticconstexpr

◆ orientation

nvec2 le::Transform::orientation {right_v}

◆ position

glm::vec2 le::Transform::position {}

◆ scale

glm::vec2 le::Transform::scale {1.0f}

The documentation for this struct was generated from the following file: