linux-wallpaperengine/WallpaperEngine/camera.cpp
Alexis Maiquez 654918904a ~ Changed namespace names for wp::core and wp to a more suited name
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2019-08-15 01:53:40 +02:00

49 lines
1.1 KiB
C++

#include "camera.h"
#include "WallpaperEngine/Core/Core.h"
namespace WallpaperEngine
{
camera::camera (json json_data)
{
json::const_iterator center_it = json_data.find ("center");
json::const_iterator eye_it = json_data.find ("eye");
json::const_iterator up_it = json_data .find ("up");
if (center_it != json_data.end ())
{
// get center value first
std::string center = *center_it;
this->m_center = Core::ato3vf(center.c_str());
}
if (eye_it != json_data.end ())
{
std::string eye = *eye_it;
this->m_eye = Core::ato3vf(eye.c_str());
}
if (up_it != json_data.end ())
{
std::string up = *up_it;
this->m_up = Core::ato3vf(up.c_str());
}
}
irr::core::vector3df camera::getCenter ()
{
return this->m_center;
}
irr::core::vector3df camera::getEye ()
{
return this->m_eye;
}
irr::core::vector3df camera::getUp ()
{
return this->m_up;
}
}