API Documentation
Public Member Functions | List of all members
nkGraphics::Entity Class Referencefinal

An entity in a render queue. It drives the shader and possible graph position for a set of renderables (SubEntity). More...

Inheritance diagram for nkGraphics::Entity:
nkExport::Exportable

Public Member Functions

const EntityRenderInfogetRenderInfo () const
 
EntityRenderInfogetRenderInfo ()
 
NodegetParentNode () const
 
RenderQueuegetRenderQueue () const
 
void * getUserData () const
 
void setRenderInfo (const EntityRenderInfo &info)
 
void setParentNode (Node *parent)
 
void setDirtyNodeTransform (bool value)
 
void setUserData (void *value)
 
void updateMeshBinding (Mesh *oldMesh)
 
virtual void exportClassToTree (nkExport::Node *rootNode) override
 
virtual void importClassFromTree (nkExport::Node *rootNode) override
 
- Public Member Functions inherited from nkExport::Exportable
 Exportable () noexcept
 
virtual ~Exportable ()
 

Detailed Description

An entity in a render queue. It drives the shader and possible graph position for a set of renderables (SubEntity).

It is possible to create one by calling RenderQueue::addEntity().
Adding it to a graph can be done by setting its parent node through setParentNode().

Member Function Documentation

◆ getRenderInfo() [1/2]

const EntityRenderInfo& nkGraphics::Entity::getRenderInfo ( ) const
Returns
A const reference over the render information.

◆ getRenderInfo() [2/2]

EntityRenderInfo& nkGraphics::Entity::getRenderInfo ( )
Returns
An editable reference over the render information.

◆ getParentNode()

Node* nkGraphics::Entity::getParentNode ( ) const
Returns
The parent node.

◆ getRenderQueue()

RenderQueue* nkGraphics::Entity::getRenderQueue ( ) const
Returns
The parent render queue.

◆ getUserData()

void* nkGraphics::Entity::getUserData ( ) const
Returns
The currently registered user data.

◆ setRenderInfo()

void nkGraphics::Entity::setRenderInfo ( const EntityRenderInfo info)

Sets the render information the entity should use to be rendered during a pass.

Parameters
infoThe information to use.

◆ setParentNode()

void nkGraphics::Entity::setParentNode ( Node parent)

Sets the parent node of the entity. This will impact the transformation applied to the entity when painting it. At all times, an entity can be attached to one node.

Parameters
parentThe node to get a transformation from.

◆ setDirtyNodeTransform()

void nkGraphics::Entity::setDirtyNodeTransform ( bool  value)

Invalidates the node transformation to recompute some internal states when required. Used internally.

Parameters
valueWhether to dirtify or not.

◆ setUserData()

void nkGraphics::Entity::setUserData ( void *  value)

Sets custom user data to link to the entity. Linking user data can be useful to help for custom instance shader slots implementation, for instance.

Parameters
valueThe user data to link to the entity.

◆ updateMeshBinding()

void nkGraphics::Entity::updateMeshBinding ( Mesh oldMesh)

Updates the mesh bindings for a renderable sub entity. Used internally.

Parameters
oldMeshThe old mesh that was set before.

◆ exportClassToTree()

virtual void nkGraphics::Entity::exportClassToTree ( nkExport::Node rootNode)
overridevirtual

Exports an item into a tree describing its structure and its data.

Parameters
rootNodeThe node into which the object has to write its related information.

Implements nkExport::Exportable.

◆ importClassFromTree()

virtual void nkGraphics::Entity::importClassFromTree ( nkExport::Node rootNode)
overridevirtual

Imports information from a tree which is supposed to describe its structure and data.

Parameters
rootNodeThe root node of the tree holding the information.

Implements nkExport::Exportable.


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