Lugdunum
0.1.0
src
lug
Graphics
Render
Camera
Perspective.cpp
Go to the documentation of this file.
1
#include <
lug/Graphics/Render/Camera/Perspective.hpp
>
2
3
#include <
lug/Graphics/Render/View.hpp
>
4
#include <
lug/Math/Geometry/Transform.hpp
>
5
6
namespace
lug
{
7
namespace
Graphics {
8
namespace
Render {
9
namespace
Camera {
10
11
Perspective::Perspective
(
const
std::string& name) :
Camera
(name) {}
12
13
void
Perspective::updateProj
() {
14
if
(!
_renderView
) {
15
return
;
16
}
17
18
_projMatrix
=
Math::Geometry::perspective
(
19
Math::Geometry::radians
(
_fovy
),
20
_aspectRatio
== 0.0f ?
_renderView
->
getViewport
().
getRatio
() :
_aspectRatio
,
21
_znear
,
22
_zfar
23
);
24
25
_needUpdateProj
=
false
;
26
}
27
28
}
// Camera
29
}
// Render
30
}
// Graphics
31
}
// lug
lug::Graphics::Render::Camera::Camera::_needUpdateProj
bool _needUpdateProj
Definition:
Camera.hpp:118
View.hpp
lug::Graphics::Render::Camera::Perspective::_fovy
float _fovy
Definition:
Perspective.hpp:39
lug::Graphics::Render::Camera::Camera::_zfar
float _zfar
Definition:
Camera.hpp:116
lug::Graphics::Render::Camera::Perspective::Perspective
Perspective(const Perspective &)=delete
lug::Graphics::Render::Camera::Camera
Class for camera.
Definition:
Camera.hpp:30
lug::Graphics::Render::Camera::Perspective::_aspectRatio
float _aspectRatio
Definition:
Perspective.hpp:40
lug::Graphics::Render::View::Viewport::getRatio
float getRatio() const
Definition:
View.inl:44
lug::Graphics::Render::Camera::Camera::_projMatrix
Math::Mat4x4f _projMatrix
Definition:
Camera.hpp:121
lug::Graphics::Render::View::getViewport
const Viewport & getViewport() const
Definition:
View.inl:9
lug::Graphics::Render::Camera::Camera::_znear
float _znear
Definition:
Camera.hpp:115
lug
Definition:
Application.hpp:11
Perspective.hpp
Transform.hpp
lug::Math::Geometry::radians
T radians(T degrees)
Definition:
Trigonometry.inl:2
lug::Graphics::Render::Camera::Perspective::updateProj
void updateProj() override final
Definition:
Perspective.cpp:13
lug::Graphics::Render::Camera::Camera::_renderView
View * _renderView
Definition:
Camera.hpp:113
lug::Math::Geometry::perspective
Matrix< 4, 4, T > perspective(T fovy, T aspect, T zNear, T zFar)
Definition:
Transform.inl:95
Generated by
1.8.13