Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
Transform.h
Go to the documentation of this file.
1#pragma once
2
3#include <glm/glm.hpp>
4#include <glm/gtc/quaternion.hpp>
5
6namespace Engine::Ecs
7{
8 struct Transform;
9
11 {
12 private:
14 glm::vec3 skew;
15 glm::vec4 perspective;
16 glm::vec3 translation;
17 glm::vec3 scale;
18 glm::quat rotation;
19 };
20
21 static MatrixTransformComponent extractComponents(const glm::mat4& matrix);
22
23 public:
24 static glm::vec3 getPosition(const glm::mat4& matrix);
25 static glm::quat getRotation(const glm::mat4& matrix);
26 static glm::vec3 getRotationEuler(const glm::mat4& matrix);
27 static glm::vec3 getScale(const glm::mat4& matrix);
28
29 static glm::vec3 getForwardVector(const glm::mat4& matrix);
30 static glm::vec3 getUpVector(const glm::mat4& matrix);
31 static glm::vec3 getRightVector(const glm::mat4& matrix);
32
33 static void setPosition(Ecs::Transform& transform, const glm::vec3& newPosition);
34 static void setRotation(Ecs::Transform& transform, const glm::vec3& newRotation);
35 static void setRotation(Ecs::Transform& transform, const glm::quat& newQuaternion);
36 static void setScale(Ecs::Transform& transform, const glm::vec3& newScale);
37 static void setFacing(Ecs::Transform& transform, const glm::vec3& newFacing);
38 };
39}
static glm::vec3 getPosition(const glm::mat4 &matrix)
static void setRotation(Ecs::Transform &transform, const glm::vec3 &newRotation)
static glm::quat getRotation(const glm::mat4 &matrix)
static void setScale(Ecs::Transform &transform, const glm::vec3 &newScale)
static void setFacing(Ecs::Transform &transform, const glm::vec3 &newFacing)
static glm::vec3 getRightVector(const glm::mat4 &matrix)
static void setPosition(Ecs::Transform &transform, const glm::vec3 &newPosition)
static glm::vec3 getForwardVector(const glm::mat4 &matrix)
static glm::vec3 getScale(const glm::mat4 &matrix)
static MatrixTransformComponent extractComponents(const glm::mat4 &matrix)
static void setRotation(Ecs::Transform &transform, const glm::quat &newQuaternion)
static glm::vec3 getUpVector(const glm::mat4 &matrix)
static glm::vec3 getRotationEuler(const glm::mat4 &matrix)