#include <camera.hpp>
|
constexpr | Camera (glm::vec2 _screen_size, glm::vec2 _map_size) |
|
| Camera (const Camera &camera) |
|
virtual | ~Camera ()=default |
|
void | set_screen (const int width, const int height) |
| Set the width and height of the screen. More...
|
|
virtual void | move (float x_dir, float y_dir, float z_dir)=0 |
| Move the camera in the specified direction. Uses the map coordinate system, where the Z-axis is the map zoom. More...
|
|
virtual void | set_pos (float x, float y)=0 |
| Set the map position of the camera. More...
|
|
virtual glm::vec3 | get_map_pos () const =0 |
| Get the map position of the camera. More...
|
|
glm::vec3 | get_world_pos () const |
| Get the world positions of the camera. More...
|
|
glm::vec2 | get_map_size () const |
| Get the size of the map. More...
|
|
virtual void | update ()=0 |
| Update the movement of the camera. Used for smooth camera movement. More...
|
|
virtual glm::mat4 | get_projection () const |
| Get the projection matrix. More...
|
|
virtual glm::mat4 | get_view () const =0 |
| Get the view matrix. More...
|
|
virtual bool | get_cursor_map_pos (glm::ivec2 mouse_pos, glm::ivec2 &out_pos) const =0 |
| Get the cursors position on the map. More...
|
|
virtual glm::vec3 | get_tile_world_pos (glm::vec2 tile_pos) const =0 |
| Get the tiles world position. More...
|
|
virtual glm::vec2 | get_tile_screen_pos (glm::vec2 tile_pos) const |
| Get the tiles position on the screen. More...
|
|
Definition at line 34 of file camera.hpp.
◆ Camera() [1/2]
constexpr Eng3D::Camera::Camera |
( |
glm::vec2 |
_screen_size, |
|
|
glm::vec2 |
_map_size |
|
) |
| |
|
inlineconstexpr |
◆ Camera() [2/2]
Eng3D::Camera::Camera |
( |
const Camera & |
camera | ) |
|
|
inline |
◆ ~Camera()
virtual Eng3D::Camera::~Camera |
( |
| ) |
|
|
virtualdefault |
◆ get_cursor_map_pos()
virtual bool Eng3D::Camera::get_cursor_map_pos |
( |
glm::ivec2 |
mouse_pos, |
|
|
glm::ivec2 & |
out_pos |
|
) |
| const |
|
pure virtual |
Get the cursors position on the map.
- Parameters
-
mouse_pos | the cursor position on the screen |
out_pos | where the cursor position on the map is written to |
- Returns
- true if the the cursor is inside the map otherwise false
Implemented in Eng3D::OrbitCamera, and Eng3D::FlatCamera.
◆ get_map_pos()
virtual glm::vec3 Eng3D::Camera::get_map_pos |
( |
| ) |
const |
|
pure virtual |
◆ get_map_size()
glm::vec2 Eng3D::Camera::get_map_size |
( |
| ) |
const |
|
inline |
Get the size of the map.
Definition at line 83 of file camera.hpp.
◆ get_projection()
virtual glm::mat4 Eng3D::Camera::get_projection |
( |
| ) |
const |
|
inlinevirtual |
Get the projection matrix.
Definition at line 91 of file camera.hpp.
◆ get_tile_screen_pos()
virtual glm::vec2 Eng3D::Camera::get_tile_screen_pos |
( |
glm::vec2 |
tile_pos | ) |
const |
|
inlinevirtual |
Get the tiles position on the screen.
Definition at line 109 of file camera.hpp.
◆ get_tile_world_pos()
virtual glm::vec3 Eng3D::Camera::get_tile_world_pos |
( |
glm::vec2 |
tile_pos | ) |
const |
|
pure virtual |
◆ get_view()
virtual glm::mat4 Eng3D::Camera::get_view |
( |
| ) |
const |
|
pure virtual |
◆ get_world_pos()
glm::vec3 Eng3D::Camera::get_world_pos |
( |
| ) |
const |
|
inline |
Get the world positions of the camera.
Definition at line 78 of file camera.hpp.
◆ move()
virtual void Eng3D::Camera::move |
( |
float |
x_dir, |
|
|
float |
y_dir, |
|
|
float |
z_dir |
|
) |
| |
|
pure virtual |
◆ set_pos()
virtual void Eng3D::Camera::set_pos |
( |
float |
x, |
|
|
float |
y |
|
) |
| |
|
pure virtual |
◆ set_screen()
void Eng3D::Camera::set_screen |
( |
const int |
width, |
|
|
const int |
height |
|
) |
| |
|
inline |
Set the width and height of the screen.
Definition at line 64 of file camera.hpp.
◆ update()
virtual void Eng3D::Camera::update |
( |
| ) |
|
|
pure virtual |
◆ far_plane
float Eng3D::Camera::far_plane = 20000.0f |
◆ fov
float Eng3D::Camera::fov = 45.0f |
◆ map_position
glm::vec3 Eng3D::Camera::map_position |
|
protected |
◆ map_size
glm::vec2 Eng3D::Camera::map_size |
|
protected |
◆ near_plane
float Eng3D::Camera::near_plane = 1.0f |
◆ screen_size
glm::vec2 Eng3D::Camera::screen_size |
|
protected |
◆ world_position
glm::vec3 Eng3D::Camera::world_position |
|
protected |
The documentation for this class was generated from the following file: