MAGE  v0.171.0
Matthias Advanced Game Engine
mage::rendering::Camera Class Referenceabstract

#include <camera.hpp>

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

Public Member Functions

virtual ~Camera ()
 
Cameraoperator= (const Camera &camera)=delete
 
Cameraoperator= (Camera &&camera) noexcept
 
const F32x2 GetClippingPlanes () const noexcept
 
void SetClippingPlanes (F32x2 clipping_planes) noexcept
 
virtual const XMMATRIX XM_CALLCONV GetCameraToProjectionMatrix () const noexcept=0
 
virtual const XMMATRIX XM_CALLCONV GetProjectionToCameraMatrix () const noexcept=0
 
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
 

Protected Member Functions

 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
 

Private Attributes

ConstantBuffer< CameraBufferm_buffer
 
F32x2 m_clipping_planes
 
CameraLens m_lens
 
Viewport m_viewport
 
CameraSettings m_settings
 

Detailed Description

A class of cameras.

Constructor & Destructor Documentation

◆ ~Camera()

mage::rendering::Camera::~Camera ( )
virtualdefault

Destructs this camera.

◆ Camera() [1/3]

mage::rendering::Camera::Camera ( ID3D11Device &  device)
explicitprotected

Constructs a camera.

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

◆ Camera() [2/3]

mage::rendering::Camera::Camera ( const Camera camera)
protecteddelete

Constructs a camera from the given camera.

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

◆ Camera() [3/3]

mage::rendering::Camera::Camera ( Camera &&  camera)
protecteddefaultnoexcept

Constructs a camera by moving the given camera.

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

Member Function Documentation

◆ BindBuffer()

template<typename PipelineStageT >
void mage::rendering::Camera::BindBuffer ( ID3D11DeviceContext &  device_context,
U32  slot 
) const
noexcept

Binds the buffer of this camera to the given pipeline stage.

Template Parameters
PipelineStageTThe pipeline stage type.
Parameters
[in,out]device_contextA reference to the device context.
[in]slotThe index into the device's zero-based array to set the constant buffer to (ranges from 0 to D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1).

◆ GetCameraToProjectionMatrix()

virtual const XMMATRIX XM_CALLCONV mage::rendering::Camera::GetCameraToProjectionMatrix ( ) const
pure virtualnoexcept

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

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

Implemented in mage::rendering::PerspectiveCamera, and mage::rendering::OrthographicCamera.

◆ GetClippingPlanes()

const F32x2 mage::rendering::Camera::GetClippingPlanes ( ) const
noexcept

Returns the clipping planes of this camera expressed in camera space.

Returns
The clipping planes of this camera expressed in camera space.

◆ GetLens() [1/2]

CameraLens& mage::rendering::Camera::GetLens ( )
noexcept

Returns the lens of this camera.

Returns
A reference to the lens of this camera.

◆ GetLens() [2/2]

const CameraLens& mage::rendering::Camera::GetLens ( ) const
noexcept

Returns the lens of this camera.

Returns
A reference to the lens of this camera.

◆ GetProjectionToCameraMatrix()

virtual const XMMATRIX XM_CALLCONV mage::rendering::Camera::GetProjectionToCameraMatrix ( ) const
pure virtualnoexcept

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

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

Implemented in mage::rendering::PerspectiveCamera, and mage::rendering::OrthographicCamera.

◆ GetSettings() [1/2]

CameraSettings& mage::rendering::Camera::GetSettings ( )
noexcept

Returns the settings of this camera.

Returns
A reference to the settings of this camera.

◆ GetSettings() [2/2]

const CameraSettings& mage::rendering::Camera::GetSettings ( ) const
noexcept

Returns the settings of this camera.

Returns
A reference to the settings of this camera.

◆ GetViewport() [1/2]

Viewport& mage::rendering::Camera::GetViewport ( )
noexcept

Returns the viewport of this camera.

Returns
A reference to the viewport of this camera.

◆ GetViewport() [2/2]

const Viewport& mage::rendering::Camera::GetViewport ( ) const
noexcept

Returns the viewport of this camera.

Returns
A reference to the viewport of this camera.

◆ operator=() [1/2]

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

Copies the given camera to this camera.

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

◆ operator=() [2/2]

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

Moves the given camera to this camera.

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

◆ SetClippingPlanes()

void mage::rendering::Camera::SetClippingPlanes ( F32x2  clipping_planes)
noexcept

Sets the clipping planes of this camera expressed in camera space to the given clipping planes.

Parameters
[in]clipping_planesThe clipping planes.

◆ UpdateBuffer()

void mage::rendering::Camera::UpdateBuffer ( ID3D11DeviceContext &  device_context,
AntiAliasing  aa 
) const

Updates the buffer of this camera.

Parameters
[in,out]device_contextA reference to the device context.
[in]aaThe anti-aliasing mode.

Member Data Documentation

◆ m_buffer

ConstantBuffer< CameraBuffer > mage::rendering::Camera::m_buffer
mutableprivate

The buffer of this camera.

◆ m_clipping_planes

F32x2 mage::rendering::Camera::m_clipping_planes
private

The clipping planes of this camera expressed in camera space.

◆ m_lens

CameraLens mage::rendering::Camera::m_lens
private

The lens of this camera.

◆ m_settings

CameraSettings mage::rendering::Camera::m_settings
private

The settings of this camera.

◆ m_viewport

Viewport mage::rendering::Camera::m_viewport
private

The viewport of this camera.