le2d v0.4.8
2D game engine framework
 
Loading...
Searching...
No Matches
transform.hpp
Go to the documentation of this file.
1#pragma once
2#include "le2d/nvec2.hpp"
3#include <glm/gtx/norm.hpp>
4#include <glm/mat4x4.hpp>
5
6namespace le {
8struct Transform {
9 static constexpr auto identity_mat_v = glm::mat4{1.0f};
10
12 [[nodiscard]] auto to_model() const -> glm::mat4;
14 [[nodiscard]] auto to_view() const -> glm::mat4;
16 [[nodiscard]] auto to_inverse_view() const -> glm::mat4;
17
19 [[nodiscard]] static auto accumulate(Transform const& a, Transform const& b) -> Transform;
20
21 glm::vec2 position{};
23 glm::vec2 scale{1.0f};
24};
25} // namespace le
Normalized 2D vector.
Definition nvec2.hpp:11
Definition animation.hpp:8
constexpr auto right_v
Definition nvec2.hpp:7
2D transformation.
Definition transform.hpp:8
static auto accumulate(Transform const &a, Transform const &b) -> Transform
auto to_model() const -> glm::mat4
auto to_view() const -> glm::mat4
glm::vec2 position
Definition transform.hpp:21
auto to_inverse_view() const -> glm::mat4
static constexpr auto identity_mat_v
Definition transform.hpp:9
nvec2 orientation
Definition transform.hpp:22
glm::vec2 scale
Definition transform.hpp:23