gdk-graphics 0b051eb9b5c1eaa0658babaa4463dd7a80aa9d2c
Loading...
Searching...
No Matches
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
9namespace gdk {
10 class camera {
11 public:
18
20 virtual void set_perspective_projection(const float aFieldOfView,
21 const float aNearClippingPlane,
22 const float aFarClippingPlane,
23 const float aViewportAspectRatio) = 0;
24
26 virtual void set_orthographic_projection(const float aWidth,
27 const float aHeight,
28 const float aNearClippingPlane,
29 const float aFarClippingPlane,
30 const float aViewportAspectRatio) = 0;
31
32 //TODO: consider removing set_ortho, set_perspective. graphics_matrix4x4_type already has methods for those
33 // sets projection matrix from an arbitrary 4x4
34 //virtual void set_projection(const gdk::graphics_matrix_type &aMatrix) = 0;
35
37 //[[nodiscard]] virtual void is_within_frustum(const gdk::graphics_vector3_type &aOtherWorldPosition) = 0;
38 //[[nodiscard]] virtual void is_within_frustum(const gdk::graphics_matrix_type &aOtherWorldTransform) = 0;
39
41 virtual void set_transform(const gdk::graphics_vector3_type &aWorldPos,
42 const gdk::graphics_quaternion_type &aRotation) = 0;
43 virtual void set_transform(const gdk::graphics_matrix4x4_type &aMatrix) = 0;
44
46 virtual void set_clear_color(const gdk::color &acolor) = 0;
47
49 virtual void set_clear_mode(const clear_mode aClearMode) = 0;
50
51 virtual ~camera() = default;
52 };
53}
54
55#endif
56
Definition camera.h:10
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_mode(const clear_mode aClearMode)=0
clear mode decides which buffers to clear. see enum
virtual void set_transform(const gdk::graphics_vector3_type &aWorldPos, const gdk::graphics_quaternion_type &aRotation)=0
checks whether a point in world space is within the camera's frustum
clear_mode
controls which buffers in the active frame buffer object to clear
Definition camera.h:13
@ depth_only
Clear the Depth buffer.
Definition camera.h:16
@ nothing
Do not clear any buffers.
Definition camera.h:14
@ color_and_depth
Clear the color and depth buffers.
Definition camera.h:15
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_color(const gdk::color &acolor)=0
sets the clear color, used to fill color buffer after it is cleared.
Represents a 4 channel color: {Red, Green, Blue, Alpha}. TODO: channel values should be limited to th...
Definition color.h:11