transform guizmos, math and bugfixing file open/save
This commit is contained in:
@@ -31,4 +31,5 @@
|
||||
#include "open_engine/renderer/shader.hpp"
|
||||
#include "open_engine/scene/entity.hpp"
|
||||
#include "open_engine/scene/scene.hpp"
|
||||
|
||||
#endif // OPEN_ENGINE_HPP
|
||||
|
||||
13
open_engine/include/open_engine/math/math.hpp
Normal file
13
open_engine/include/open_engine/math/math.hpp
Normal file
@@ -0,0 +1,13 @@
|
||||
#ifndef MATH_HPP
|
||||
#define MATH_HPP
|
||||
|
||||
#include <glm/fwd.hpp>
|
||||
|
||||
namespace OpenEngine::Math {
|
||||
|
||||
bool DecomposeTransform(const glm::mat4& transform,
|
||||
glm::vec3& out_translation, glm::vec3& out_rotation,
|
||||
glm::vec3& out_scale);
|
||||
}
|
||||
|
||||
#endif // MATH_HPP
|
||||
@@ -9,6 +9,10 @@
|
||||
#include <glm/gtc/type_ptr.hpp>
|
||||
#include <glm/fwd.hpp>
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
#define GLM_ENABLE_EXPERIMENTAL
|
||||
#include <glm/gtx/quaternion.hpp>
|
||||
|
||||
#include <imgui_internal.h>
|
||||
#include <imgui.h>
|
||||
#include <string>
|
||||
@@ -55,10 +59,7 @@ namespace OpenEngine {
|
||||
{
|
||||
glm::mat4 transform = glm::translate(glm::mat4(1.0f), translation);
|
||||
|
||||
transform *= glm::rotate(glm::mat4(1.0f), rotation.x, { 1, 0, 0 })
|
||||
* glm::rotate(glm::mat4(1.0f), rotation.y, { 0, 1, 0 })
|
||||
* glm::rotate(glm::mat4(1.0f), rotation.z, { 0, 0, 1 });
|
||||
|
||||
transform *= glm::toMat4(glm::quat(rotation));
|
||||
transform *= glm::scale(glm::mat4(1.0f), scale);
|
||||
|
||||
return transform;
|
||||
|
||||
@@ -22,6 +22,8 @@ namespace OpenEngine {
|
||||
|
||||
entt::registry& GetRegistry() { return registry; };
|
||||
|
||||
Entity GetPrimaryCamera();
|
||||
|
||||
private:
|
||||
entt::registry registry;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user