MAGE  v0.171.0
Matthias Advanced Game Engine
mage::rendering::PerspectiveCamera Class Reference

#include <perspective_camera.hpp>

Inheritance diagram for mage::rendering::PerspectiveCamera:
mage::rendering::Camera mage::Component

Public Member Functions

 PerspectiveCamera (ID3D11Device &device)
 
 PerspectiveCamera (const PerspectiveCamera &camera)=delete
 
 PerspectiveCamera (PerspectiveCamera &&camera) noexcept
 
virtual ~PerspectiveCamera ()
 
PerspectiveCameraoperator= (const PerspectiveCamera &camera)=delete
 
PerspectiveCameraoperator= (PerspectiveCamera &&camera) noexcept
 
F32 GetFOVX () const noexcept
 
F32 GetFOVY () const noexcept
 
void SetFOVY (F32 fov_y) noexcept
 
F32 GetAspectRatio () const noexcept
 
void SetAspectRatio (F32 aspect_ratio) noexcept
 
void SetAspectRatio (F32 width, F32 height) noexcept
 
virtual const XMMATRIX XM_CALLCONV GetCameraToProjectionMatrix () const noexcept override
 
virtual const XMMATRIX XM_CALLCONV GetProjectionToCameraMatrix () const noexcept override
 
- Public Member Functions inherited from mage::rendering::Camera
virtual ~Camera ()
 
Cameraoperator= (const Camera &camera)=delete
 
Cameraoperator= (Camera &&camera) noexcept
 
const F32x2 GetClippingPlanes () const noexcept
 
void SetClippingPlanes (F32x2 clipping_planes) noexcept
 
CameraLensGetLens () noexcept
 
const CameraLensGetLens () const noexcept
 
ViewportGetViewport () noexcept
 
const ViewportGetViewport () const noexcept
 
CameraSettingsGetSettings () noexcept
 
const CameraSettingsGetSettings () const noexcept
 
void UpdateBuffer (ID3D11DeviceContext &device_context, AntiAliasing aa) const
 
template<typename PipelineStageT >
void BindBuffer (ID3D11DeviceContext &device_context, U32 slot) const noexcept
 
- Public Member Functions inherited from mage::Component
virtual ~Component ()
 
Componentoperator= (const Component &component) noexcept
 
Componentoperator= (Component &&component) noexcept
 
State GetState () const noexcept
 
void SetState (State state) noexcept
 
U64 GetGuid () const noexcept
 
bool HasOwner () const noexcept
 
ProxyPtr< NodeGetOwner () noexcept
 
ProxyPtr< const NodeGetOwner () const noexcept
 

Private Attributes

F32 m_aspect_ratio
 
F32 m_fov_y
 

Additional Inherited Members

- Protected Member Functions inherited from mage::rendering::Camera
 Camera (ID3D11Device &device)
 
 Camera (const Camera &camera)=delete
 
 Camera (Camera &&camera) noexcept
 
- Protected Member Functions inherited from mage::Component
 Component () noexcept
 
 Component (const Component &component) noexcept
 
 Component (Component &&component) noexcept
 

Detailed Description

A class of perspective cameras.

Constructor & Destructor Documentation

◆ PerspectiveCamera() [1/3]

mage::rendering::PerspectiveCamera::PerspectiveCamera ( ID3D11Device &  device)
explicit

Constructs a perspective camera.

Parameters
[in,out]deviceA reference to the device.

◆ PerspectiveCamera() [2/3]

mage::rendering::PerspectiveCamera::PerspectiveCamera ( const PerspectiveCamera camera)
delete

Constructs a perspective camera from the given perspective camera.

Parameters
[in]cameraA reference to the perspective camera to copy.

◆ PerspectiveCamera() [3/3]

mage::rendering::PerspectiveCamera::PerspectiveCamera ( PerspectiveCamera &&  camera)
defaultnoexcept

Constructs a perspective camera by moving the given perspective camera.

Parameters
[in]cameraA reference to the perspective camera to move.

◆ ~PerspectiveCamera()

mage::rendering::PerspectiveCamera::~PerspectiveCamera ( )
virtualdefault

Destructs this perspective camera.

Member Function Documentation

◆ GetAspectRatio()

F32 mage::rendering::PerspectiveCamera::GetAspectRatio ( ) const
noexcept

Returns the aspect ratio of this perspective camera.

Returns
The aspect ratio of this perspective camera.

◆ GetCameraToProjectionMatrix()

virtual const XMMATRIX XM_CALLCONV mage::rendering::PerspectiveCamera::GetCameraToProjectionMatrix ( ) const
overridevirtualnoexcept

Returns the camera-to-projection matrix of this perspective camera.

Returns
The camera-to-projection matrix of this perspective camera.

Implements mage::rendering::Camera.

◆ GetFOVX()

F32 mage::rendering::PerspectiveCamera::GetFOVX ( ) const
noexcept

Returns the horizontal field-of-view of this perspective camera.

Returns
The horizontal field-of-view of this perspective camera.

◆ GetFOVY()

F32 mage::rendering::PerspectiveCamera::GetFOVY ( ) const
noexcept

Returns the vertical field-of-view of this perspective camera.

Returns
The vertical field-of-view of this perspective camera.

◆ GetProjectionToCameraMatrix()

virtual const XMMATRIX XM_CALLCONV mage::rendering::PerspectiveCamera::GetProjectionToCameraMatrix ( ) const
overridevirtualnoexcept

Returns the projection-to-camera matrix of this perspective camera.

Returns
The projection-to-camera matrix of this perspective camera.

Implements mage::rendering::Camera.

◆ operator=() [1/2]

PerspectiveCamera& mage::rendering::PerspectiveCamera::operator= ( const PerspectiveCamera camera)
delete

Copies the given perspective camera to this perspective camera.

Parameters
[in]cameraA reference to the perspective camera to copy.
Returns
A reference to the copy of the given perspective camera (i.e. this perspective camera).

◆ operator=() [2/2]

PerspectiveCamera & mage::rendering::PerspectiveCamera::operator= ( PerspectiveCamera &&  camera)
defaultnoexcept

Moves the given perspective camera to this perspective camera.

Parameters
[in]cameraA reference to the perspective camera to move.
Returns
A reference to the moved perspective camera (i.e. this perspective camera).

◆ SetAspectRatio() [1/2]

void mage::rendering::PerspectiveCamera::SetAspectRatio ( F32  aspect_ratio)
noexcept

Sets the aspect ratio of this perspective camera to the given value.

Parameters
[in]aspect_ratioThe aspect ratio.

◆ SetAspectRatio() [2/2]

void mage::rendering::PerspectiveCamera::SetAspectRatio ( F32  width,
F32  height 
)
noexcept

Sets the aspect ratio of this perspective camera.

Parameters
[in]widthThe width.
[in]heightThe height.

◆ SetFOVY()

void mage::rendering::PerspectiveCamera::SetFOVY ( F32  fov_y)
noexcept

Sets the vertical field-of-view of this perspective camera to the given value.

Parameters
[in]fov_yThe vertical field-of-view.

Member Data Documentation

◆ m_aspect_ratio

F32 mage::rendering::PerspectiveCamera::m_aspect_ratio
private

The aspect ratio of this perspective camera.

◆ m_fov_y

F32 mage::rendering::PerspectiveCamera::m_fov_y
private

The vertical field-of-view of this perspective camera.