gdk-graphics  1b6d84e044c2c953fd7c9501e628a67e80f4da0d
camera.h
1 // © Joseph Cameron - All Rights Reserved
2 
3 #ifndef GDK_GFX_CAMERA_H
4 #define GDK_GFX_CAMERA_H
5 
6 #include <gdk/color.h>
7 #include <gdk/graphics_types.h>
8 
9 namespace gdk
10 {
11  class camera
12  {
13  public:
16  enum class clear_mode
17  {
18  nothing,
20  depth_only
21  };
22 
24  virtual void set_perspective_projection(const float aFieldOfView,
25  const float aNearClippingPlane,
26  const float aFarClippingPlane,
27  const float aViewportAspectRatio) = 0;
28 
30  virtual void set_orthographic_projection(const float aWidth,
31  const float aHeight,
32  const float aNearClippingPlane,
33  const float aFarClippingPlane,
34  const float aViewportAspectRatio) = 0;
35 
37  virtual void set_view_matrix(const gdk::graphics_vector3_type &aWorldPos,
38  const gdk::graphics_quaternion_type &aRotation) = 0;
39 
41  virtual void set_clear_color(const gdk::color &acolor) = 0;
42 
44  virtual void set_clear_mode(const clear_mode aClearMode) = 0;
45 
46  virtual ~camera() = default;
47  };
48 }
49 
50 #endif
51 
virtual void set_orthographic_projection(const float aWidth, const float aHeight, const float aNearClippingPlane, const float aFarClippingPlane, const float aViewportAspectRatio)=0
sets the projection matrix to an orthographic projection
virtual void set_clear_color(const gdk::color &acolor)=0
sets the clear color, used to fill color buffer after it is cleared.
Definition: camera.h:9
Clear the Depth buffer.
virtual void set_perspective_projection(const float aFieldOfView, const float aNearClippingPlane, const float aFarClippingPlane, const float aViewportAspectRatio)=0
sets the projection matrix to a perspective projection
virtual void set_clear_mode(const clear_mode aClearMode)=0
clear mode decides which buffers to clear. see enum
Clear the color and depth buffers.
Definition: camera.h:11
Do not clear any buffers.
clear_mode
Describes camera clear behaviour: which buffers in the current FBO should be cleared?
Definition: camera.h:16
virtual void set_view_matrix(const gdk::graphics_vector3_type &aWorldPos, const gdk::graphics_quaternion_type &aRotation)=0
rebuilds the view matrix from a 3d position and rotation
Represents a 4 channel color: {Red, Green, Blue, Alpha}.
Definition: color.h:11