Camera.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Slot.hpp"
4 #include "ElementRenderer.hpp"
6 
7 namespace iv
8 {
9 
17 class Camera : public Slot, private ElementRenderer
18 {
19 public:
21 using Slot::instance;
22 
24  ~Camera();
25 
26  void status( iv::TableDebugView * view );
27 
33  void render_scene( Elem * view = nullptr );
34 
38 
41  virtual Camera * elem_getRoot() override;
42 
43 //----------------- math --------------------------------------
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 }