Toggle navigation
ivorium
iv_components
Example project
GitHub
Main Page
Modules
Classes
Files
File List
File Members
ivorium_graphics
Elements
Camera.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
Slot.hpp
"
4
#include "
ElementRenderer.hpp
"
5
#include <
ivorium_systems/ivorium_systems.hpp
>
6
7
namespace
iv
8
{
9
17
class
Camera
:
public
Slot
,
private
ElementRenderer
18
{
19
public
:
20
ClientMarker
cm
;
21
using
Slot::instance
;
22
23
Camera
(
Instance
*,
RenderTarget::Geometry
);
24
~Camera
();
25
26
void
status
(
iv::TableDebugView
* view );
27
33
void
render_scene
(
Elem
* view =
nullptr
);
34
37
void
geometry
(
RenderTarget::Geometry
geometry
);
38
41
virtual
Camera
*
elem_getRoot
()
override
;
42
43
//----------------- math --------------------------------------
44
float3
FromLocalSpaceToViewportSpace
(
float4x4
model_transform,
float3
);
45
float3
FromViewportSpaceToLocalSpace
(
float4x4
model_transform,
float3
);
46
float2
FromViewportPlaneToLocalPlane
(
float4x4
model_transform,
float2
);
47
48
private
:
49
float3
WNormalized(
float4
in );
50
float3
FromViewportSpaceToCameraSpace(
float3
screen_point );
51
float3
FromCameraSpaceToViewportSpace(
float3
camera_point );
52
53
private
:
54
CameraState
state;
55
float2
viewport_size;
56
};
57
58
}