gdk-graphics 0b051eb9b5c1eaa0658babaa4463dd7a80aa9d2c
Loading...
Searching...
No Matches
webgl1es2_camera.h
1// © Joseph Cameron - All Rights Reserved
2
3#ifndef GDK_GFX_WEBGL1ES2_CAMERA_H
4#define GDK_GFX_WEBGL1ES2_CAMERA_H
5
6#include <gdk/camera.h>
7#include <gdk/color.h>
8#include <gdk/graphics_types.h>
9#include <gdk/webgl1es2_texture.h>
10#include <jfc/unique_handle.h>
11
12#include <memory>
13#include <vector>
14
15namespace gdk
16{
17 class entity;
18
21 {
22 public:
25 //
27 graphics_matrix4x4_type get_world_matrix() const;
28
31 graphics_matrix4x4_type get_view_matrix() const;
32
34 graphics_matrix4x4_type get_projection_matrix() const;
35
41
46
49
50 virtual ~webgl1es2_camera() = default;
51
52 protected:
55 //
56 void set_perspective_projection(const float aFieldOfView,
57 const float aNearClippingPlane,
58 const float aFarClippingPlane,
59 const float aViewportAspectRatio);
60
61 void set_orthographic_projection(const float aWidth,
62 const float aHeight,
63 const float aNearClippingPlane,
64 const float aFarClippingPlane,
65 const float aViewportAspectRatio);
66
67 void set_clear_color(const gdk::color& acolor);
68
69 void set_clear_mode(const gdk::camera::clear_mode aClearMode);
70
71 void set_transform(const gdk::graphics_vector3_type& aWorldPos,
72 const gdk::graphics_quaternion_type& aRotation);
73 void set_transform(const gdk::graphics_matrix4x4_type &aMatrix);
74
75 void activate_clear_mode() const;
76
77 camera::clear_mode get_clearmode() const;
78
79 gdk::color get_clearcolor() const;
81
82 private:
83 graphics_matrix4x4_type m_WorldMatrix = graphics_matrix4x4_type::identity;
84 graphics_matrix4x4_type m_ViewMatrix = graphics_matrix4x4_type::identity;
85 graphics_matrix4x4_type m_ProjectionMatrix = graphics_matrix4x4_type::identity;
86
89 };
90}
91
92#endif
93
clear_mode
controls which buffers in the active frame buffer object to clear
Definition camera.h:13
@ color_and_depth
Clear the color and depth buffers.
Definition camera.h:15
represents an observable 3d object.
Definition entity.h:13
webgl1es2_camera & operator=(const webgl1es2_camera &a)=default
copy semantics
webgl1es2_camera(webgl1es2_camera &&)=default
move semantics
graphics_matrix4x4_type get_projection_matrix() const
gets the projection matrix
graphics_matrix4x4_type get_world_matrix() const
position and rotation of the camera in worldspace, same as an entity model matrix
graphics_matrix4x4_type get_view_matrix() const
gets the view matrix
webgl1es2_camera()
constructs with reasonable default values
webgl1es2_camera & operator=(webgl1es2_camera &&a)=default
move semantics
webgl1es2_camera(const webgl1es2_camera &a)=default
copy semantics
Represents a 4 channel color: {Red, Green, Blue, Alpha}. TODO: channel values should be limited to th...
Definition color.h:11
static const color cornflower_blue
an opaque pastel blue color
Definition color.h:67