NAP
Public Member Functions | Protected Member Functions | List of all members
RenderableMesh Class Referencefinal

#include <renderablemesh.h>

Public Member Functions

 RenderableMesh ()=default
 
 RenderableMesh (const RenderableMesh &rhs)
 
RenderableMeshoperator= (const RenderableMesh &rhs)
 
bool operator== (const RenderableMesh &rhs) const
 
bool isValid () const
 
IMeshgetMesh ()
 
const IMeshgetMesh () const
 
MaterialInstancegetMaterialInstance ()
 
const MaterialInstancegetMaterialInstance () const
 
const std::vector< VkBuffer > & getVertexBuffers ()
 
const std::vector< VkDeviceSize > & getVertexBufferOffsets () const
 
int getVertexBufferBindingIndex (const std::string &meshVertexAttributeID) const
 

Protected Member Functions

 RenderableMesh (IMesh &mesh, MaterialInstance &materialInstance)
 

Description

Represents the coupling between a mesh and a material that can be rendered to screen. Call RenderService.createRenderableMesh() from your own renderable component to create a renderable mesh on initialization. Renderable meshes are hashable, equality is based on the contained mesh and material.

Constructor & Destructor Documentation

◆ RenderableMesh() [1/3]

RenderableMesh ( )
default

Default constructor, by default this represents an invalid mesh / material combination. Can be used to declare a member of this type that is invalid on initialization.

◆ RenderableMesh() [2/3]

RenderableMesh ( const RenderableMesh rhs)

◆ RenderableMesh() [3/3]

RenderableMesh ( IMesh mesh,
MaterialInstance materialInstance 
)
protected

Constructor

Parameters
meshthe mesh that is rendered
materialInstancethe material the mesh is rendered with

Member Function Documentation

◆ getMaterialInstance() [1/2]

MaterialInstance& getMaterialInstance ( )
Returns
The material instance object used to create this object.

◆ getMaterialInstance() [2/2]

const MaterialInstance& getMaterialInstance ( ) const
Returns
The material instance object used to create this object.

◆ getMesh() [1/2]

IMesh& getMesh ( )
Returns
The mesh object used to create this object.

◆ getMesh() [2/2]

const IMesh& getMesh ( ) const
Returns
The mesh object used to create this object.

◆ getVertexBufferBindingIndex()

int getVertexBufferBindingIndex ( const std::string &  meshVertexAttributeID) const

Returns the vertex buffer binding index of the given mesh attribute, asserts and returs -1 if not found.

Parameters
meshVertexAttributeIDthe vertex attribute buffer name
Returns
the vertex buffer binding index of the given mesh attribute

◆ getVertexBufferOffsets()

const std::vector<VkDeviceSize>& getVertexBufferOffsets ( ) const
Returns
A list of the Vulkan vertex buffer offsets

◆ getVertexBuffers()

const std::vector<VkBuffer>& getVertexBuffers ( )
Returns
A list of the Vulkan vertex buffers, updates the internal buffer cache.

◆ isValid()

bool isValid ( ) const
Returns
whether the material and mesh form a valid combination. The combination is valid when the vertex attributes of a mesh match the vertex attributes of a shader.

◆ operator=()

RenderableMesh& operator= ( const RenderableMesh rhs)

◆ operator==()

bool operator== ( const RenderableMesh rhs) const