CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::RendererCamera Class Referencefinal

A class that represents a camera inside the renderer. More...

#include <CeresEngine/Renderer/RendererCamera.hpp>

Inheritance diagram for CeresEngine::RendererCamera:
CeresEngine::RendererView CeresEngine::TRendererSceneObject< RendererCamera > CeresEngine::TRendererObject< SelfType, BaseType > CeresEngine::RendererObject

Public Member Functions

 RendererCamera (RendererCameraManager &manager, RendererScene &scene)
 Creates a new RendererCamera.
 
 ~RendererCamera () noexcept override
 Destroys the renderer camera and releases any renderer (and RenderAPI)-related resources.
 
void synchronize (const Transform &transform, const CameraComponent &component)
 Update the renderer camera with data from a transform and the component.
 
void prepare (RendererContext &context) final
 Prepares the camera for the rendering of the current frame.
 
RendererScenegetScene () const final
 
const CameraComponentgetComponent () const noexcept
 A copy of the latest camera component.
 
const RendererCameraSettingsgetSettings () const final
 
const RendererCameraFlagsgetFlags () const noexcept
 A set of flags that customize and represent the state of the object.
 
void setFlags (const RendererCameraFlags &flags)
 A set of flags that customize and represent the state of the object.
 
const RendererCameraDirtyFlagsgetDirtyFlags () const noexcept
 A set of flags that represent the dirty portions of the object.
 
bool isDirty () const noexcept
 If set to true, the camera is dirty and needs to be synchronized from the entity.
 
void markAsDirty (const RendererCameraDirtyFlags &flags=RendererCameraDirtyFlag::All) noexcept
 If set to true, the camera is dirty and needs to be synchronized from the entity.
 
const RendererCameraInfogetViewInfo () const final
 A structure that holds renderer-specific information for the view.
 
RendererCameraInfogetViewInfo () final
 A structure that holds renderer-specific information for the view.
 
const GPUBindlessBuffergetUniformBuffer () const final
 The uniform buffer storing the view GPU parameters used by the renderer.
 
const GPUImagePtrgetRenderImage () const final
 The render target that the view should render to.
 
const ConvexVolume & getFrustumVolume () const final
 Returns the latest view frustum volume, used to perform frustum culling.
 
- Public Member Functions inherited from CeresEngine::RendererView
 RendererView ()
 Creates a new RendererView.
 
virtual ~RendererView ()
 Destroys the RendererView and releases any renderer (and RenderAPI)-related resources.
 
RenderGraphgetRenderGraph () const noexcept
 The render graph instance used to render the view.
 
- Public Member Functions inherited from CeresEngine::TRendererSceneObject< RendererCamera >
 TRendererSceneObject (Args &&... args)
 Creates a new TRendererSceneObject instance.
 
 ~TRendererSceneObject () noexcept override
 Destroys an existing TRendererSceneObject instance.
 
- Public Member Functions inherited from CeresEngine::TRendererObject< SelfType, BaseType >
template<typename... Args>
 TRendererObject (ManagerType &manager, Args &&... args)
 Creates a new TRendererObject instance.
 
void destroy () noexcept override
 Destroys the RendererObject.
 
ManagerTypegetManager () const noexcept
 The owning object manager.
 
- Public Member Functions inherited from CeresEngine::RendererObject
 RendererObject ()=default
 Creates a new RendererObject instance.
 
virtual ~RendererObject () noexcept=default
 Destroys an existing RendererObject instance.
 
RendererObjectID getID () const noexcept
 An identifier that uniquely identifies this object in the renderer.
 

Private Types

using super = TRendererSceneObject< RendererCamera >
 

Private Attributes

CameraComponent mComponent
 A copy of the latest camera component.
 
RendererCameraFlags mFlags
 A set of flags that customize and represent the state of the object.
 
RendererCameraDirtyFlags mDirtyFlags = RendererCameraDirtyFlag::All
 A set of flags that represent the dirty portions of the object.
 
bool mDirty = true
 If set to true, the camera is dirty and needs to be synchronized from the entity.
 
RendererCameraInfo mInfo
 A structure that holds renderer-specific information for the camera.
 
RendererCameraParams mParameters
 The GPU parameters. Will be copied to the GPU uniform buffer.
 
GPUDynamicBindlessBuffer< RendererCameraParamsmUniformBuffer
 The uniform buffer storing the camera GPU parameters used by the renderer.
 

Friends

class RendererCameraManager
 

Additional Inherited Members

- Public Attributes inherited from CeresEngine::RendererObject
Event< void(RendererObjectID newID)> willChangeID
 An event called whenever the object is about to change it's ID.
 
Event< void(RendererObjectID oldID)> didChangeID
 An event called whenever the object changes it's ID.
 
- Protected Member Functions inherited from CeresEngine::RendererView
virtual void createRenderGraph ()
 Creates a new RenderGraph instance for the view.
 
- Protected Attributes inherited from CeresEngine::TRendererObject< SelfType, BaseType >
ManagerTypemManager
 The owning object manager.
 
- Protected Attributes inherited from CeresEngine::RendererObject
RendererObjectID mID
 An identifier that uniquely identifies this object in the renderer.
 

Detailed Description

A class that represents a camera inside the renderer.

Member Typedef Documentation

◆ super

Constructor & Destructor Documentation

◆ RendererCamera()

CeresEngine::RendererCamera::RendererCamera ( RendererCameraManager manager,
RendererScene scene 
)
explicit

Creates a new RendererCamera.

Parameters
managerThe owning manager.
sceneA reference to the owning scene.

◆ ~RendererCamera()

CeresEngine::RendererCamera::~RendererCamera ( )
overridenoexcept

Destroys the renderer camera and releases any renderer (and RenderAPI)-related resources.

Member Function Documentation

◆ getComponent()

const CameraComponent & CeresEngine::RendererCamera::getComponent ( ) const
inlinenoexcept

A copy of the latest camera component.

◆ getDirtyFlags()

const RendererCameraDirtyFlags & CeresEngine::RendererCamera::getDirtyFlags ( ) const
inlinenoexcept

A set of flags that represent the dirty portions of the object.

◆ getFlags()

const RendererCameraFlags & CeresEngine::RendererCamera::getFlags ( ) const
inlinenoexcept

A set of flags that customize and represent the state of the object.

◆ getFrustumVolume()

const ConvexVolume & CeresEngine::RendererCamera::getFrustumVolume ( ) const
inlinefinalvirtual

Returns the latest view frustum volume, used to perform frustum culling.

Implements CeresEngine::RendererView.

◆ getRenderImage()

const GPUImagePtr & CeresEngine::RendererCamera::getRenderImage ( ) const
inlinefinalvirtual

The render target that the view should render to.

Implements CeresEngine::RendererView.

◆ getScene()

RendererScene & CeresEngine::RendererCamera::getScene ( ) const
inlinefinalvirtual

◆ getSettings()

const RendererCameraSettings & CeresEngine::RendererCamera::getSettings ( ) const
inlinefinalvirtual

◆ getUniformBuffer()

const GPUBindlessBuffer & CeresEngine::RendererCamera::getUniformBuffer ( ) const
inlinefinalvirtual

The uniform buffer storing the view GPU parameters used by the renderer.

Implements CeresEngine::RendererView.

◆ getViewInfo() [1/2]

const RendererCameraInfo & CeresEngine::RendererCamera::getViewInfo ( ) const
inlinefinalvirtual

A structure that holds renderer-specific information for the view.

Implements CeresEngine::RendererView.

◆ getViewInfo() [2/2]

RendererCameraInfo & CeresEngine::RendererCamera::getViewInfo ( )
inlinefinalvirtual

A structure that holds renderer-specific information for the view.

Implements CeresEngine::RendererView.

◆ isDirty()

bool CeresEngine::RendererCamera::isDirty ( ) const
inlinenoexcept

If set to true, the camera is dirty and needs to be synchronized from the entity.

◆ markAsDirty()

void CeresEngine::RendererCamera::markAsDirty ( const RendererCameraDirtyFlags flags = RendererCameraDirtyFlag::All)
noexcept

If set to true, the camera is dirty and needs to be synchronized from the entity.

◆ prepare()

void CeresEngine::RendererCamera::prepare ( RendererContext context)
finalvirtual

Prepares the camera for the rendering of the current frame.

This will update uniform buffers and perform any other necessary operations necessary for rendering.

Parameters
contextA context struct that contains parameters given by the renderer.

Reimplemented from CeresEngine::RendererView.

◆ setFlags()

void CeresEngine::RendererCamera::setFlags ( const RendererCameraFlags flags)

A set of flags that customize and represent the state of the object.

◆ synchronize()

void CeresEngine::RendererCamera::synchronize ( const Transform transform,
const CameraComponent component 
)

Update the renderer camera with data from a transform and the component.

Note
This method is usually called from RenderingSystem during a synchronization point.
Parameters
transformThe camera transform.
componentThe camera component.

Friends And Related Symbol Documentation

◆ RendererCameraManager

Member Data Documentation

◆ mComponent

CameraComponent CeresEngine::RendererCamera::mComponent
private

A copy of the latest camera component.

◆ mDirty

bool CeresEngine::RendererCamera::mDirty = true
private

If set to true, the camera is dirty and needs to be synchronized from the entity.

◆ mDirtyFlags

RendererCameraDirtyFlags CeresEngine::RendererCamera::mDirtyFlags = RendererCameraDirtyFlag::All
private

A set of flags that represent the dirty portions of the object.

◆ mFlags

RendererCameraFlags CeresEngine::RendererCamera::mFlags
private

A set of flags that customize and represent the state of the object.

◆ mInfo

RendererCameraInfo CeresEngine::RendererCamera::mInfo
private

A structure that holds renderer-specific information for the camera.

◆ mParameters

RendererCameraParams CeresEngine::RendererCamera::mParameters
private

The GPU parameters. Will be copied to the GPU uniform buffer.

◆ mUniformBuffer

GPUDynamicBindlessBuffer<RendererCameraParams> CeresEngine::RendererCamera::mUniformBuffer
private

The uniform buffer storing the camera GPU parameters used by the renderer.


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