#include <camera.h>
|
| Camera (int screen_width=1280, int screen_height=720) |
| Creates a camera that looks onto the scene. More...
|
|
void | update (Shader &program) |
| Updates the camera matrix value in the shader program that is passed to it. More...
|
|
void | move (const glm::vec2 &direction) |
| Moves the camera using a two-dimensional displacement vector to describe the movement. More...
|
|
void | zoom (float factor) |
| Zooms the camera by an incremental amount. More...
|
|
yage::Camera::Camera |
( |
int |
screen_width = 1280 , |
|
|
int |
screen_height = 720 |
|
) |
| |
Creates a camera that looks onto the scene.
The screen width and screen height should be the current size of the window that the camera is being used on so that is functions correctly.
- Parameters
-
screen_width | Current screen width of the Window. |
screen_height | Current screen height of the Window. |
void yage::Camera::move |
( |
const glm::vec2 & |
direction | ) |
|
Moves the camera using a two-dimensional displacement vector to describe the movement.
- Parameters
-
direction | Two-dimensional vector to describe the displacement of the camera. |
void yage::Camera::update |
( |
Shader & |
program | ) |
|
Updates the camera matrix value in the shader program that is passed to it.
This must be a parameter P
in the shader for this function to work.
- Parameters
-
program | Shader program to make changes to. |
- Todo:
- Make this function more general to be able to be able to use any parametre in then shader as the camera matrix and not make it dependent on it being
P
.
void yage::Camera::zoom |
( |
float |
factor | ) |
|
Zooms the camera by an incremental amount.
- Parameters
-
factor | Factor by which the camera should zoom. This can also be a negative number for the camera to zoom out. |
The documentation for this class was generated from the following files: