BMC Engine v1.0.0
An open-source game engine powered by C and C++
|
#include <Camera.h>
Public Member Functions | |
Camera (int winWidth, int winHeight, glm::vec3 position) | |
Camera (Vector2 *size, glm::vec3 position) | |
void | updateMatrix (float FOVdeg, float nearPlane, float farPlane) |
void | matrix (Shader *shader, const char *uniform) |
void | inputs (Window *window) |
Public Attributes | |
glm::vec3 | position |
glm::vec3 | orientation = glm::vec3(0.0f, 0.0f, -1.0f) |
glm::vec3 | up = glm::vec3(0.0f, 1.0f, 0.0f) |
glm::mat4 | cameraMatrix = glm::mat4(1.0f) |
bool | firstClick = true |
int | winWidth |
int | winHeight |
float | speed = 0.012f |
float | sensitivity = 365.5f |
The camera manager. Creates a matrix, which is sent to the vertex shader.
Camera::Camera | ( | int | winWidth, |
int | winHeight, | ||
glm::vec3 | position ) |
Creates the camera.
winWidth | The window's width. |
winHeight | The window's height. |
position | The camera's position. |
Camera::Camera | ( | Vector2 * | size, |
glm::vec3 | position ) |
Creates the camera.
size | The window's size, as a Vector3. |
position | The camera's position. |
void Camera::inputs | ( | Window * | window | ) |
Process the camera's inputs.
window | The engine window. |
void Camera::matrix | ( | Shader * | shader, |
const char * | uniform ) |
Send the camera matrix to the shader.
shader | The vertex shader. |
uniform | The name of the matrix uniform. |
void Camera::updateMatrix | ( | float | FOVdeg, |
float | nearPlane, | ||
float | farPlane ) |
Project the matrix.
FOVdeg | The FOV, in degrees. |
nearPlane | How close to the camera objects can be before getting clipped. |
farPlane | How far away from the camera objects can be before getting clipped. |
glm::mat4 Camera::cameraMatrix = glm::mat4(1.0f) |
The camera's matrix, which all vertices are multiplied by.
bool Camera::firstClick = true |
To be removed - ignore this.
glm::vec3 Camera::orientation = glm::vec3(0.0f, 0.0f, -1.0f) |
The camera's rotation.
glm::vec3 Camera::position |
The camera's position.
float Camera::sensitivity = 365.5f |
The camera's rotation sensitivity.
float Camera::speed = 0.012f |
The camera's movement speed.
glm::vec3 Camera::up = glm::vec3(0.0f, 1.0f, 0.0f) |
The up vector.
int Camera::winHeight |
The window's height.
int Camera::winWidth |
The window's width.