CPP-TOOLBOX
Loading...
Searching...
No Matches
Camera2D Struct Reference

#include <fps_camera.hpp>

Inheritance diagram for Camera2D:
ICamera

Public Member Functions

 Camera2D (unsigned int &screen_width_px, unsigned int &screen_height_px)
 
Frustum get_visible_frustum_world_space () override
 
glm::mat4 get_view_matrix () const override
 
bool is_visible (const std::vector< glm::vec3 > &xyz_positions, Transform &transform) override
 
bool is_visible (const vertex_geometry::AxisAlignedBoundingBox &aabb, Transform &transform) override
 
glm::mat4 get_projection_matrix () const override
 
glm::mat4 get_transform_matrix () const
 
void on_scroll (double x_offset, double y_offset)
 
void update (double mouse_delta_x, double mouse_delta_y, unsigned int width, unsigned int height, bool is_dragging)
 
- Public Member Functions inherited from ICamera
virtual ~ICamera ()=default
 

Public Attributes

float zoom = 1.0f
 
glm::vec2 offset = glm::vec2(0)
 
double last_mouse_pos_x = 0.0f
 
double last_mouse_pos_y = 0.0f
 
bool is_dragging = false
 
unsigned int & screen_width_px
 
unsigned int & screen_height_px
 
- Public Attributes inherited from ICamera
Transform transform
 

Constructor & Destructor Documentation

◆ Camera2D()

Camera2D::Camera2D ( unsigned int & screen_width_px,
unsigned int & screen_height_px )
inline

Member Function Documentation

◆ get_projection_matrix()

glm::mat4 Camera2D::get_projection_matrix ( ) const
inlineoverridevirtual

Implements ICamera.

◆ get_transform_matrix()

glm::mat4 Camera2D::get_transform_matrix ( ) const
inline

◆ get_view_matrix()

glm::mat4 Camera2D::get_view_matrix ( ) const
inlineoverridevirtual

Implements ICamera.

◆ get_visible_frustum_world_space()

Frustum Camera2D::get_visible_frustum_world_space ( )
inlineoverridevirtual

Implements ICamera.

◆ is_visible() [1/2]

bool Camera2D::is_visible ( const std::vector< glm::vec3 > & xyz_positions,
Transform & transform )
inlineoverridevirtual

Implements ICamera.

◆ is_visible() [2/2]

bool Camera2D::is_visible ( const vertex_geometry::AxisAlignedBoundingBox & aabb,
Transform & transform )
inlineoverridevirtual

Implements ICamera.

◆ on_scroll()

void Camera2D::on_scroll ( double x_offset,
double y_offset )
inline

◆ update()

void Camera2D::update ( double mouse_delta_x,
double mouse_delta_y,
unsigned int width,
unsigned int height,
bool is_dragging )
inline

Member Data Documentation

◆ is_dragging

bool Camera2D::is_dragging = false

◆ last_mouse_pos_x

double Camera2D::last_mouse_pos_x = 0.0f

◆ last_mouse_pos_y

double Camera2D::last_mouse_pos_y = 0.0f

◆ offset

glm::vec2 Camera2D::offset = glm::vec2(0)

◆ screen_height_px

unsigned int & Camera2D::screen_height_px

◆ screen_width_px

unsigned int& Camera2D::screen_width_px

◆ zoom

float Camera2D::zoom = 1.0f

The documentation for this struct was generated from the following file: