VulkanEngine 0.1
Graphics engine using Vulkan
Loading...
Searching...
No Matches
VulkanEngine::Camera Class Reference

#include <Camera.h>

Inheritance diagram for VulkanEngine::Camera:
VulkanEngine::SceneObject

Public Member Functions

 Camera (Eigen::Vector3f _look_at={0.0f, 0.0f, 0.0f}, Eigen::Vector3f _up_vector={0.0f, 1.0f, 0.0f}, float _z_near=0.1f, float _z_far=1000.0f, float _fov=45.0f, uint32_t _width=800, uint32_t _height=600)
 
virtual ~Camera ()
 Destructor.
 
void setLookAt (const Eigen::Vector3f &_look_at)
 
const Eigen::Vector3f getLookAt () const
 
const Eigen::Vector3f getUpVector () const
 
const Eigen::Matrix4f getPerspectiveProjectionMatrix () const
 
const Eigen::Matrix4f getViewMatrix () const
 
void setWidth (uint32_t _width)
 
void setHeight (uint32_t _height)
 
float getWidth () const
 
float getHeight () const
 
- Public Member Functions inherited from VulkanEngine::SceneObject
 SceneObject ()
 Contructor.
 
void addChildren (const std::vector< std::shared_ptr< SceneObject > > &_children)
 
const Eigen::Matrix4f getTransform () const
 
void setTransform (const Eigen::Matrix4f &_transform)
 

Additional Inherited Members

- Protected Member Functions inherited from VulkanEngine::SceneObject
virtual void preUpdate (std::shared_ptr< SceneState > scene_state)
 
virtual void update (std::shared_ptr< SceneState > scene_state)
 
virtual void postUpdate (std::shared_ptr< SceneState > scene_state)
 
- Protected Attributes inherited from VulkanEngine::SceneObject
Eigen::Matrix4f transform
 

Detailed Description

Represents a camera in the scene. The camera provides view and projection matrices for rendering based on the current state of the camera object.

Constructor & Destructor Documentation

◆ Camera()

VulkanEngine::Camera::Camera ( Eigen::Vector3f  _look_at = {0.0f, 0.0f, 0.0f},
Eigen::Vector3f  _up_vector = {0.0f, 1.0f, 0.0f},
float  _z_near = 0.1f,
float  _z_far = 1000.0f,
float  _fov = 45.0f,
uint32_t  _width = 800,
uint32_t  _height = 600 
)

Constructor.

Parameters
_look_atWhat position the Camera should be oriented towards initially.
_up_vectorThe up direction of the Camera.
_z_nearThe distance from the Camera's position to the near plane.
_z_farThe distance from the Camera's position to the far plane.
_fovThe field of view of the Camera.
_widthThe width of the camera.
_heightThe height of the camera.

Member Function Documentation

◆ getHeight()

float VulkanEngine::Camera::getHeight ( ) const
Returns
The height of the camera.

◆ getLookAt()

const Eigen::Vector3f VulkanEngine::Camera::getLookAt ( ) const
Returns
The current look at vector

◆ getPerspectiveProjectionMatrix()

const Eigen::Matrix4f VulkanEngine::Camera::getPerspectiveProjectionMatrix ( ) const
Returns
The projection matrix of the Camera.

◆ getUpVector()

const Eigen::Vector3f VulkanEngine::Camera::getUpVector ( ) const
Returns
The current up vector.

◆ getViewMatrix()

const Eigen::Matrix4f VulkanEngine::Camera::getViewMatrix ( ) const
Parameters
_transformThe transformation matrix to use when calculating the view matrix
Returns
The view matrix of the Camera.

◆ getWidth()

float VulkanEngine::Camera::getWidth ( ) const
Returns
The width of the camera.

◆ setHeight()

void VulkanEngine::Camera::setHeight ( uint32_t  _height)

Set the heigth of the camera.

Parameters
_heightThe height of the camera.

◆ setLookAt()

void VulkanEngine::Camera::setLookAt ( const Eigen::Vector3f &  _look_at)

Set the look at vector of the camera.

Parameters
_look_atThe look at vector to use.

◆ setWidth()

void VulkanEngine::Camera::setWidth ( uint32_t  _width)

Set the width of the camera.

Parameters
_widthThe width of the camera.

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