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

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

#include <CeresEngine/Renderer/RendererTerrain.hpp>

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

Classes

class  Element
 The rendering element for the terrain chunks. More...
 

Public Member Functions

 RendererTerrain (RendererTerrainManager &manager, RendererScene &scene)
 Creates a new RendererTerrain.
 
 ~RendererTerrain () noexcept final
 Destroys the renderer terrain and releases any renderer (and RenderAPI)-related resources.
 
void synchronize (const Transform &transform, const TerrainRenderableComponent &component)
 Update the renderer terrain with data from a transform and the component.
 
void prepare (RendererContext &context)
 Prepares the terrain for the rendering of the current frame.
 
void draw (GPUCommandBuffer &commandBuffer)
 
const RendererTerrainFlagsgetFlags () const noexcept
 A set of flags that customize and represent the state of the object.
 
void setFlags (const RendererTerrainFlags &flags)
 A set of flags that customize and represent the state of the object.
 
const RendererTerrainDirtyFlagsgetDirtyFlags () const noexcept
 A set of flags that represent the dirty portions of the object.
 
bool isDirty () const noexcept
 If set to true, the terrain is dirty and needs to be synchronized from the entity.
 
void markAsDirty (const RendererTerrainDirtyFlags &flags=RendererTerrainDirtyFlag::All) noexcept
 If set to true, the terrain is dirty and needs to be synchronized from the entity.
 
const RendererTerrainInfogetInfo () const
 A structure that holds renderer-specific information for the terrain.
 
RendererTerrainInfogetInfo ()
 A structure that holds renderer-specific information for the terrain.
 
const GPUBindlessBuffergetUniformBuffer () const
 The uniform buffer storing the terrain GPU parameters used by the renderer.
 
const SPtr< RendererMaterial > & getMaterial () const noexcept
 
const Vector< UPtr< Element > > & getElements () const noexcept
 
- Public Member Functions inherited from CeresEngine::TRendererSceneObject< RendererTerrain >
 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< RendererTerrain >
 

Private Attributes

TerrainRenderableComponent mComponent
 A copy of the latest terrain component.
 
RendererTerrainFlags mFlags
 A set of flags that customize and represent the state of the object.
 
RendererTerrainDirtyFlags mDirtyFlags = RendererTerrainDirtyFlag::All
 A set of flags that represent the dirty portions of the object.
 
bool mDirty = true
 If set to true, the terrain is dirty and needs to be synchronized from the entity.
 
RendererTerrainInfo mInfo
 A structure that holds renderer-specific information for the terrain.
 
RendererTerrainParams mParameters
 The GPU parameters. Will be copied to the GPU uniform buffer.
 
GPUDynamicBindlessBuffer< RendererTerrainParamsmUniformBuffer
 The uniform buffer storing the terrain GPU parameters used by the renderer.
 
SPtr< RendererMaterialmMaterial
 
Vector< UPtr< Element > > mElements
 
bool mInitialized = false
 

Friends

class RendererTerrainManager
 

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 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 terrain inside the renderer.

Member Typedef Documentation

◆ super

Constructor & Destructor Documentation

◆ RendererTerrain()

CeresEngine::RendererTerrain::RendererTerrain ( RendererTerrainManager manager,
RendererScene scene 
)
explicit

Creates a new RendererTerrain.

Parameters
sceneA reference to the owning scene.

◆ ~RendererTerrain()

CeresEngine::RendererTerrain::~RendererTerrain ( )
finalnoexcept

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

Member Function Documentation

◆ draw()

void CeresEngine::RendererTerrain::draw ( GPUCommandBuffer commandBuffer)

◆ getDirtyFlags()

const RendererTerrainDirtyFlags & CeresEngine::RendererTerrain::getDirtyFlags ( ) const
inlinenoexcept

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

◆ getElements()

const Vector< UPtr< Element > > & CeresEngine::RendererTerrain::getElements ( ) const
inlinenoexcept

◆ getFlags()

const RendererTerrainFlags & CeresEngine::RendererTerrain::getFlags ( ) const
inlinenoexcept

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

◆ getInfo() [1/2]

RendererTerrainInfo & CeresEngine::RendererTerrain::getInfo ( )
inline

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

◆ getInfo() [2/2]

const RendererTerrainInfo & CeresEngine::RendererTerrain::getInfo ( ) const
inline

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

◆ getMaterial()

const SPtr< RendererMaterial > & CeresEngine::RendererTerrain::getMaterial ( ) const
inlinenoexcept

◆ getUniformBuffer()

const GPUBindlessBuffer & CeresEngine::RendererTerrain::getUniformBuffer ( ) const
inline

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

◆ isDirty()

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

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

◆ markAsDirty()

void CeresEngine::RendererTerrain::markAsDirty ( const RendererTerrainDirtyFlags flags = RendererTerrainDirtyFlag::All)
noexcept

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

◆ prepare()

void CeresEngine::RendererTerrain::prepare ( RendererContext context)

Prepares the terrain 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.

◆ setFlags()

void CeresEngine::RendererTerrain::setFlags ( const RendererTerrainFlags flags)

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

◆ synchronize()

void CeresEngine::RendererTerrain::synchronize ( const Transform transform,
const TerrainRenderableComponent component 
)

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

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

Friends And Related Symbol Documentation

◆ RendererTerrainManager

Member Data Documentation

◆ mComponent

TerrainRenderableComponent CeresEngine::RendererTerrain::mComponent
private

A copy of the latest terrain component.

◆ mDirty

bool CeresEngine::RendererTerrain::mDirty = true
private

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

◆ mDirtyFlags

RendererTerrainDirtyFlags CeresEngine::RendererTerrain::mDirtyFlags = RendererTerrainDirtyFlag::All
private

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

◆ mElements

Vector<UPtr<Element> > CeresEngine::RendererTerrain::mElements
private

◆ mFlags

RendererTerrainFlags CeresEngine::RendererTerrain::mFlags
private

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

◆ mInfo

RendererTerrainInfo CeresEngine::RendererTerrain::mInfo
private

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

◆ mInitialized

bool CeresEngine::RendererTerrain::mInitialized = false
private

◆ mMaterial

SPtr<RendererMaterial> CeresEngine::RendererTerrain::mMaterial
private

◆ mParameters

RendererTerrainParams CeresEngine::RendererTerrain::mParameters
private

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

◆ mUniformBuffer

GPUDynamicBindlessBuffer<RendererTerrainParams> CeresEngine::RendererTerrain::mUniformBuffer
private

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


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