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

#include <bounding_volume_pass.hpp>

Public Member Functions

 BoundingVolumePass (ID3D11Device &device, ID3D11DeviceContext &device_context, StateManager &state_manager, ResourceManager &resource_manager)
 
 BoundingVolumePass (const BoundingVolumePass &pass)=delete
 
 BoundingVolumePass (BoundingVolumePass &&pass) noexcept
 
 ~BoundingVolumePass ()
 
BoundingVolumePassoperator= (const BoundingVolumePass &pass)=delete
 
BoundingVolumePassoperator= (BoundingVolumePass &&pass) noexcept
 
void XM_CALLCONV Render (const World &world, FXMMATRIX world_to_projection)
 

Private Member Functions

void BindFixedState () const noexcept
 
void BindLightColor ()
 
void BindModelColor ()
 
void BindColor (const RGBA &color)
 
void XM_CALLCONV BindTransform (FXMMATRIX cube_to_world)
 
void XM_CALLCONV Render (const AABB &aabb, FXMMATRIX object_to_world)
 

Private Attributes

std::reference_wrapper< ID3D11DeviceContext > m_device_context
 
std::reference_wrapper< StateManagerm_state_manager
 
VertexShaderPtr m_vs
 
PixelShaderPtr m_ps
 
ConstantBuffer< RGBAm_color_buffer
 
ConstantBuffer< XMMATRIX > m_transform_buffer
 

Detailed Description

A class of bounding volume passes for rendering model and finite light volumes.

Constructor & Destructor Documentation

◆ BoundingVolumePass() [1/3]

mage::rendering::BoundingVolumePass::BoundingVolumePass ( ID3D11Device &  device,
ID3D11DeviceContext &  device_context,
StateManager state_manager,
ResourceManager resource_manager 
)
explicit

Constructs a bounding volume pass.

Parameters
[in,out]deviceA reference to the device.
[in,out]device_contextA reference to the device context.
[in,out]state_managerA reference to the state manager.
[in,out]resource_managerA reference to the resource manager.

◆ BoundingVolumePass() [2/3]

mage::rendering::BoundingVolumePass::BoundingVolumePass ( const BoundingVolumePass pass)
delete

Constructs a bounding volume pass from the given bounding volume pass.

Parameters
[in]passA reference to the bounding volume pass to copy.

◆ BoundingVolumePass() [3/3]

mage::rendering::BoundingVolumePass::BoundingVolumePass ( BoundingVolumePass &&  pass)
defaultnoexcept

Constructs a bounding volume pass by moving the given bounding volume pass.

Parameters
[in]passA reference to the bounding volume pass to move.

◆ ~BoundingVolumePass()

mage::rendering::BoundingVolumePass::~BoundingVolumePass ( )
default

Destructs this bounding volume pass.

Member Function Documentation

◆ BindColor()

void mage::rendering::BoundingVolumePass::BindColor ( const RGBA color)
private

Binds the color of this bounding volume pass.

Parameters
[in]colorA reference to the color.
Exceptions
ExceptionFailed to bind the light color of this bounding volume pass.

◆ BindFixedState()

void mage::rendering::BoundingVolumePass::BindFixedState ( ) const
privatenoexcept

Binds the fixed state of this bounding volume pass.

◆ BindLightColor()

void mage::rendering::BoundingVolumePass::BindLightColor ( )
private

Binds the light color of this bounding volume pass.

Exceptions
ExceptionFailed to bind the light color of this bounding volume pass.

◆ BindModelColor()

void mage::rendering::BoundingVolumePass::BindModelColor ( )
private

Binds the model color of this bounding volume pass.

Exceptions
ExceptionFailed to bind the model color of this bounding volume pass.

◆ BindTransform()

void XM_CALLCONV mage::rendering::BoundingVolumePass::BindTransform ( FXMMATRIX  cube_to_world)
private

Binds the transform of this bounding volume pass.

Parameters
[in]cube_to_worldThe cube-to-world transformation matrix used for transforming cube vertices.
Exceptions
ExceptionFailed to bind the transform of this bounding volume pass.

◆ operator=() [1/2]

BoundingVolumePass& mage::rendering::BoundingVolumePass::operator= ( const BoundingVolumePass pass)
delete

Copies the given bounding volume pass to this bounding volume pass.

Parameters
[in]passA reference to the bounding volume pass to copy.
Returns
A reference to the copy of the given bounding volume pass (i.e. this bounding volume pass).

◆ operator=() [2/2]

BoundingVolumePass & mage::rendering::BoundingVolumePass::operator= ( BoundingVolumePass &&  pass)
defaultnoexcept

Moves the given bounding volume pass to this bounding volume pass.

Parameters
[in]passA reference to the bounding volume pass to move.
Returns
A reference to the moved bounding volume pass (i.e. this bounding volume pass).

◆ Render() [1/2]

void XM_CALLCONV mage::rendering::BoundingVolumePass::Render ( const World world,
FXMMATRIX  world_to_projection 
)

Renders the world.

Parameters
[in]worldA reference to the world.
[in]world_to_projectionThe world-to-projection transformation matrix.
Exceptions
ExceptionFailed to render the world.

◆ Render() [2/2]

void XM_CALLCONV mage::rendering::BoundingVolumePass::Render ( const AABB aabb,
FXMMATRIX  object_to_world 
)
private

Renders the given AABB.

Parameters
[in]aabbA reference to the AABB.
[in]object_to_worldThe object-to-world transformation matrix.
Exceptions
ExceptionFailed to bind the render the given AABB.

Member Data Documentation

◆ m_color_buffer

ConstantBuffer< RGBA > mage::rendering::BoundingVolumePass::m_color_buffer
private

The color buffer of this bounding volume pass.

◆ m_device_context

std::reference_wrapper< ID3D11DeviceContext > mage::rendering::BoundingVolumePass::m_device_context
private

A reference to the device context of this bounding volume pass.

◆ m_ps

PixelShaderPtr mage::rendering::BoundingVolumePass::m_ps
private

A pointer to the pixel shader of this bounding volume pass.

◆ m_state_manager

std::reference_wrapper< StateManager > mage::rendering::BoundingVolumePass::m_state_manager
private

A reference to the state manager of this bounding volume pass.

◆ m_transform_buffer

ConstantBuffer< XMMATRIX > mage::rendering::BoundingVolumePass::m_transform_buffer
private

The transform buffer of this bounding volume pass.

◆ m_vs

VertexShaderPtr mage::rendering::BoundingVolumePass::m_vs
private

A pointer to the vertex shader of this bounding volume pass.