gdk-graphics 0a0aef92e917cfbac53dffbc32c295e4de914093
Loading...
Searching...
No Matches
camera.h
1// © Joseph Cameron - MIT License
2
3#ifndef GDK_GRAPHICS_CAMERA_H
4#define GDK_GRAPHICS_CAMERA_H
5
6#include <gdk/graphics/color.h>
7#include <gdk/graphics/types.h>
8
9namespace gdk::graphics {
12 class camera {
13 public:
20
26 virtual void set_perspective_projection(const floating_point_type aFieldOfView,
27 const floating_point_type aNearClippingPlane, const floating_point_type aFarClippingPlane,
28 const floating_point_type aViewportAspectRatio) = 0;
29
35 virtual void set_perspective_projection(const floating_point_type aFieldOfView,
36 const floating_point_type aNearClippingPlane, const floating_point_type aFarClippingPlane,
37 const floating_point_type aViewportAspectRatio, const vector2_type &aShift) = 0;
38
41 virtual void set_orthographic_projection(const gdk::graphics::vector2_type &aOrthographicSize,
42 const floating_point_type aNearClippingPlane, const floating_point_type aFarClippingPlane,
43 const floating_point_type aViewportAspectRatio) = 0;
44
46 virtual void set_transform(const gdk::graphics::matrix4x4_type &aMatrix) = 0;
47 virtual void set_transform(const gdk::graphics::vector3_type &aWorldPos, const gdk::graphics::quaternion_type &aRotation) = 0;
48
50 virtual void set_clear_color(const gdk::graphics::color &acolor) = 0;
51
53 virtual void set_clear_mode(const clear_mode aClearMode) = 0;
54
55 virtual ~camera() = default;
56 };
57}
58
59#endif
60
a point of view a scene is drawn from. A camera starts at the origin looking down -Z,...
Definition camera.h:12
virtual void set_orthographic_projection(const gdk::graphics::vector2_type &aOrthographicSize, const floating_point_type aNearClippingPlane, const floating_point_type aFarClippingPlane, const floating_point_type aViewportAspectRatio)=0
use an orthographic projection with the given view volume aOrthographicSize is the full extent of the...
virtual void set_clear_color(const gdk::graphics::color &acolor)=0
sets the clear color, used to fill color buffer after it is cleared.
virtual void set_transform(const gdk::graphics::matrix4x4_type &aMatrix)=0
sets the camera's world and view matrix
virtual void set_perspective_projection(const floating_point_type aFieldOfView, const floating_point_type aNearClippingPlane, const floating_point_type aFarClippingPlane, const floating_point_type aViewportAspectRatio, const vector2_type &aShift)=0
use a perspective projection whose window is off the view's axis: an asymmetric frustum,...
virtual void set_perspective_projection(const floating_point_type aFieldOfView, const floating_point_type aNearClippingPlane, const floating_point_type aFarClippingPlane, const floating_point_type aViewportAspectRatio)=0
use a perspective projection with the given view volume
virtual void set_clear_mode(const clear_mode aClearMode)=0
clear mode decides which buffers to clear. see enum
clear_mode
controls which buffers in the active frame buffer object to clear
Definition camera.h:15
@ depth_only
Clear the Depth buffer.
Definition camera.h:18
@ nothing
Do not clear any buffers.
Definition camera.h:16
@ color_and_depth
Clear the color and depth buffers.
Definition camera.h:17
Represents a 4 channel color: {Red, Green, Blue, Alpha}.
Definition color.h:10