Symphony Of Empires
|
#include <flat_camera.hpp>
Public Member Functions | |
FlatCamera (glm::vec2 _screen_size, glm::vec2 _map_size) | |
FlatCamera (const Camera &camera) | |
void | move (float x_dir, float y_dir, float z_dir) override |
Move the camera in the specified direction. Uses the map coordinate system, where the Z-axis is the map zoom. More... | |
void | update () override |
Update the movement of the camera. Used for smooth camera movement. More... | |
void | set_pos (float x, float y) override |
Set the map position of the camera. More... | |
glm::vec3 | get_map_pos () const override |
Get the map position of the camera. More... | |
glm::mat4 | get_view () const override |
Get the view matrix. More... | |
bool | get_cursor_map_pos (glm::ivec2 mouse_pos, glm::ivec2 &out_pos) const override |
Get the cursors position on the map. More... | |
glm::vec3 | get_tile_world_pos (glm::vec2 tile_pos) const override |
Get the tiles world position. More... | |
Public Member Functions inherited from Eng3D::Camera | |
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... | |
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 glm::mat4 | get_projection () const |
Get the projection matrix. More... | |
virtual glm::vec2 | get_tile_screen_pos (glm::vec2 tile_pos) const |
Get the tiles position on the screen. More... | |
Public Attributes | |
glm::vec3 | target |
ValueChase< glm::vec3 > | chase { 0.2f } |
Public Attributes inherited from Eng3D::Camera | |
float | fov = 45.0f |
float | near_plane = 1.0f |
float | far_plane = 20000.0f |
Additional Inherited Members | |
Protected Attributes inherited from Eng3D::Camera | |
glm::vec3 | map_position |
glm::vec3 | world_position |
glm::vec2 | screen_size |
glm::vec2 | map_size |
Definition at line 37 of file flat_camera.hpp.
|
inline |
Definition at line 42 of file flat_camera.hpp.
|
inline |
Definition at line 50 of file flat_camera.hpp.
|
inlineoverridevirtual |
Get the cursors position on the map.
mouse_pos | the cursor position on the screen |
out_pos | where the cursor position on the map is written to |
Implements Eng3D::Camera.
Definition at line 98 of file flat_camera.hpp.
|
inlineoverridevirtual |
Get the map position of the camera.
Implements Eng3D::Camera.
Definition at line 84 of file flat_camera.hpp.
|
inlineoverridevirtual |
Get the tiles world position.
Implements Eng3D::Camera.
Definition at line 129 of file flat_camera.hpp.
|
inlineoverridevirtual |
Get the view matrix.
Implements Eng3D::Camera.
Definition at line 90 of file flat_camera.hpp.
|
inlineoverridevirtual |
Move the camera in the specified direction. Uses the map coordinate system, where the Z-axis is the map zoom.
Implements Eng3D::Camera.
Definition at line 57 of file flat_camera.hpp.
|
inlineoverridevirtual |
Set the map position of the camera.
Implements Eng3D::Camera.
Definition at line 76 of file flat_camera.hpp.
|
inlineoverridevirtual |
Update the movement of the camera. Used for smooth camera movement.
Implements Eng3D::Camera.
Definition at line 66 of file flat_camera.hpp.
ValueChase<glm::vec3> Eng3D::FlatCamera::chase { 0.2f } |
Definition at line 40 of file flat_camera.hpp.
glm::vec3 Eng3D::FlatCamera::target |
Definition at line 39 of file flat_camera.hpp.