BMC Engine v1.0.0
An open-source game engine powered by C and C++
Loading...
Searching...
No Matches
Camera Class Reference

#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
 

Detailed Description

The camera manager. Creates a matrix, which is sent to the vertex shader.

Constructor & Destructor Documentation

◆ Camera() [1/2]

Camera::Camera ( int winWidth,
int winHeight,
glm::vec3 position )

Creates the camera.

Parameters
winWidthThe window's width.
winHeightThe window's height.
positionThe camera's position.

◆ Camera() [2/2]

Camera::Camera ( Vector2 * size,
glm::vec3 position )

Creates the camera.

Parameters
sizeThe window's size, as a Vector3.
positionThe camera's position.

Member Function Documentation

◆ inputs()

void Camera::inputs ( Window * window)

Process the camera's inputs.

Parameters
windowThe engine window.

◆ matrix()

void Camera::matrix ( Shader * shader,
const char * uniform )

Send the camera matrix to the shader.

Parameters
shaderThe vertex shader.
uniformThe name of the matrix uniform.

◆ updateMatrix()

void Camera::updateMatrix ( float FOVdeg,
float nearPlane,
float farPlane )

Project the matrix.

Parameters
FOVdegThe FOV, in degrees.
nearPlaneHow close to the camera objects can be before getting clipped.
farPlaneHow far away from the camera objects can be before getting clipped.

Member Data Documentation

◆ cameraMatrix

glm::mat4 Camera::cameraMatrix = glm::mat4(1.0f)

The camera's matrix, which all vertices are multiplied by.

◆ firstClick

bool Camera::firstClick = true

To be removed - ignore this.

◆ orientation

glm::vec3 Camera::orientation = glm::vec3(0.0f, 0.0f, -1.0f)

The camera's rotation.

◆ position

glm::vec3 Camera::position

The camera's position.

◆ sensitivity

float Camera::sensitivity = 365.5f

The camera's rotation sensitivity.

◆ speed

float Camera::speed = 0.012f

The camera's movement speed.

◆ up

glm::vec3 Camera::up = glm::vec3(0.0f, 1.0f, 0.0f)

The up vector.

◆ winHeight

int Camera::winHeight

The window's height.

◆ winWidth

int Camera::winWidth

The window's width.


The documentation for this class was generated from the following files: