NAP
Public Member Functions | List of all members
RenderGnomonComponentInstance Class Reference

#include <rendergnomoncomponent.h>

Public Member Functions

 RenderGnomonComponentInstance (EntityInstance &entity, Component &resource)
 
virtual void onDraw (IRenderTarget &renderTarget, VkCommandBuffer commandBuffer, const glm::mat4 &viewMatrix, const glm::mat4 &projectionMatrix) override
 
virtual bool isSupported (nap::CameraComponentInstance &camera) const override
 
virtual bool init (utility::ErrorState &errorState) override
 
- Public Member Functions inherited from RenderableComponentInstance
 RenderableComponentInstance (EntityInstance &entity, Component &resource)
 
void draw (IRenderTarget &renderTarget, VkCommandBuffer commandBuffer, const glm::mat4 &viewMatrix, const glm::mat4 &projectionMatrix)
 
void setVisible (bool visible)
 
bool isVisible () const
 
const std::vector< ResourcePtr< RenderTag > > & getTags () const
 
RenderMask getMask () const
 
bool includesMask (RenderMask otherMask)
 
int getRank () const
 
const RenderLayergetLayer () const
 
- Public Member Functions inherited from ComponentInstance
 ComponentInstance (EntityInstance &entity, Component &resource)
 
virtual void update (double deltaTime)
 
nap::EntityInstancegetEntityInstance () const
 
nap::ComponentgetComponent () const
 
template<typename T >
T * getComponent () const
 
virtual bool init (utility::ErrorState &errorState)
 
- Public Member Functions inherited from Object
 Object ()
 
virtual ~Object ()
 
virtual void onDestroy ()
 
 Object (Object &)=delete
 
Objectoperator= (const Object &)=delete
 
 Object (Object &&)=delete
 
Objectoperator= (Object &&)=delete
 

Additional Inherited Members

- Static Public Member Functions inherited from Object
static bool isIDProperty (rtti::Instance &object, const rtti::Property &property)
 
- Public Attributes inherited from Object
std::string mID
 Property: 'mID' unique name of the object. Used as an identifier by the system. More...
 
- Protected Attributes inherited from RenderableComponentInstance
RenderServicemRenderService = nullptr
 

Description

Renders a nap::GnomonMesh using a hard-coded nap::GnomonShader to target. The Gnomon material is automatically created on initialization. A Transform component is required to position the Gnomon.

Inheritance diagram for RenderGnomonComponentInstance:
[legend]
Collaboration diagram for RenderGnomonComponentInstance:
[legend]

Constructor & Destructor Documentation

◆ RenderGnomonComponentInstance()

RenderGnomonComponentInstance ( EntityInstance entity,
Component resource 
)

Member Function Documentation

◆ init()

virtual bool init ( utility::ErrorState errorState)
overridevirtual

Initialize based on resource

Parameters
errorStateholds the error message when initialization fails
Returns
if the component initialized successfully

Reimplemented from RenderableComponentInstance.

◆ isSupported()

virtual bool isSupported ( nap::CameraComponentInstance camera) const
overridevirtual

Called by the Render Service. Supports orthographic and perspective cameras

Reimplemented from RenderableComponentInstance.

◆ onDraw()

virtual void onDraw ( IRenderTarget renderTarget,
VkCommandBuffer  commandBuffer,
const glm::mat4 &  viewMatrix,
const glm::mat4 &  projectionMatrix 
)
overridevirtual

Draws the Gnomon to the currently active render target.

Parameters
renderTargetthe target to render to.
commandBufferthe currently active command buffer.
viewMatrixoften the camera world space location
projectionMatrixoften the camera projection matrix

Implements RenderableComponentInstance.