mirror of
https://github.com/Almamu/linux-wallpaperengine.git
synced 2025-09-14 05:46:48 +08:00

~ 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>
39 lines
956 B
C++
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)
|
|
);
|
|
} |