linux-wallpaperengine/src/WallpaperEngine/Core/Scenes/CCamera.cpp
Alexis Maiquez 291b7e364a - removed/commented out most irrlicht-specific code
~ written close to equivalent versions in OpenGL code using GLM and GLFW
~ written replacements for texture and package loading to not use irrlicht anymore
~ updated shader compiler as we now don't need to replace attributes anymore
+ added support for texture flags in the texture header (as they're needed for opengl to get proper information)

TODO: REWRITE VIDEO PLAYER SUPPORT AS THIS UPDATE EFFECTIVELY BREAKS IT

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-08-31 01:14:08 +02:00

39 lines
956 B
C++

#include "CCamera.h"
using namespace WallpaperEngine::Core::Scenes;
using namespace WallpaperEngine::Core::Types;
CCamera::CCamera (glm::vec3 center, glm::vec3 eye, glm::vec3 up) :
m_center (center),
m_eye (eye),
m_up (up)
{
}
const glm::vec3& CCamera::getCenter () const
{
return this->m_center;
}
const glm::vec3& CCamera::getEye () const
{
return this->m_eye;
}
const glm::vec3& CCamera::getUp () const
{
return this->m_up;
}
CCamera* CCamera::fromJSON (json data)
{
auto center_it = jsonFindRequired (data, "center", "Camera must have a center position");
auto eye_it = jsonFindRequired (data, "eye", "Camera must have an eye position");
auto up_it = jsonFindRequired (data, "up", "Camera must have a up position");
return new CCamera (
WallpaperEngine::Core::aToVector3 (*center_it),
WallpaperEngine::Core::aToVector3 (*eye_it),
WallpaperEngine::Core::aToVector3 (*up_it)
);
}