AireEngine
A 3D Open-World Game Engine
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Aire::Camera Class Reference

#include <camera.h>

Public Member Functions

 Camera (Rigidbody *rigidbody, Config config, glm::vec3 offset=glm::vec3(0, 0, 0))
 
 Camera ()=default
 Default constructor for camera.
 
void update (glm::vec3 forward, glm::vec3 up)
 
glm::mat4 getViewMatrix () const
 
glm::mat4 getProjectionMatrix () const
 

Public Attributes

glm::vec3 camOffset
 Offset from rigidbody.
 
glm::vec3 position
 World position of the camera.
 

Detailed Description

A class for defining a camera. Maintains it's own orientation and optionally position.

Constructor & Destructor Documentation

◆ Camera()

Camera::Camera ( Rigidbody * rigidbody,
Config config,
glm::vec3 offset = glm::vec3(0,0,0) )

Camera constructor - attatch to rigid body Creates a camera that is attached to a rigidbody. Therefore inheriting it's position.

Parameters
rigidbodyrigidbody to attatch camera to
offsetoffset from the rigidbody position for the camera (defaults to (0,0,0))
configconfig used for this game
Here is the call graph for this function:

Member Function Documentation

◆ getProjectionMatrix()

glm::mat4 Camera::getProjectionMatrix ( ) const

Function to return the Projection matrix

Returns
ViewMatrix
Here is the caller graph for this function:

◆ getViewMatrix()

glm::mat4 Camera::getViewMatrix ( ) const

Function to return the view matrix

Returns
ViewMatrix
Here is the caller graph for this function:

◆ update()

void Camera::update ( glm::vec3 forward,
glm::vec3 up )

Update the state of the camera

Parameters
forwardforward facing direction of the camera
upupward facing direction from the camera
Here is the caller graph for this function:

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