Blowbox 2017
A 3D Game Engine by Riko Ophorst using DirectX 12
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
blowbox::PerspectiveCamera Class Reference

#include <perspective_camera.h>

Public Member Functions

void SetFovRadians (float fov_in_radians)
 
void SetFovDegrees (float fov_in_degrees)
 
float GetFOVRadians () const
 
float GetFOVDegrees () const
 
- Public Member Functions inherited from blowbox::Camera
void Translate (const DirectX::XMFLOAT3 &translation)
 
void Rotate (const DirectX::XMFLOAT3 &rotation)
 
void SetPosition (const DirectX::XMFLOAT3 &position)
 
void SetRotation (const DirectX::XMFLOAT3 &rotation)
 
const DirectX::XMFLOAT3 & GetPosition () const
 
const DirectX::XMFLOAT3 & GetRotation () const
 
void SetNearPlane (float near_plane)
 
void SetFarPlane (float far_plane)
 
float GetNearPlane () const
 
float GetFarPlane () const
 
const DirectX::XMMATRIX & GetViewMatrix ()
 
const DirectX::XMMATRIX & GetProjectionMatrix ()
 

Protected Member Functions

void UpdateProjectionMatrix () override
 
- Protected Member Functions inherited from blowbox::Camera
void UpdateViewMatrix ()
 

Protected Attributes

float fov_in_radians_
 
- Protected Attributes inherited from blowbox::Camera
DirectX::XMFLOAT3 position_
 
DirectX::XMFLOAT3 rotation_
 
DirectX::XMMATRIX view_
 
DirectX::XMMATRIX projection_
 
bool view_dirty_
 
bool projection_dirty_
 
float near_plane_
 
float far_plane_
 

Detailed Description

A camera with perspective projection, useful for 3D stuff.

This class extends the base Camera class and offers functionality for creating perspective cameras, which are useful for many things.

Inheritance diagram for blowbox::PerspectiveCamera:
blowbox::Camera

Member Function Documentation

float blowbox::PerspectiveCamera::GetFOVDegrees ( ) const
Returns
The field of view for the camera in degrees.
float blowbox::PerspectiveCamera::GetFOVRadians ( ) const
Returns
The field of view for the camera in radians.
void blowbox::PerspectiveCamera::SetFovDegrees ( float  fov_in_degrees)

Sets the field of view for the camera in degrees.

Parameters
[in]fov_in_degreesThe field of view in degrees
void blowbox::PerspectiveCamera::SetFovRadians ( float  fov_in_radians)

Sets the field of view for the camera in radians.

Parameters
[in]fov_in_radiansThe field of view in radians
void blowbox::PerspectiveCamera::UpdateProjectionMatrix ( )
overrideprotectedvirtual

(Re)-calculates the projection matrix of the camera.

Implements blowbox::Camera.

Member Data Documentation

float blowbox::PerspectiveCamera::fov_in_radians_
protected

The field of view of the camera in radians.


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