#include <rendercomponent.h>
Public Member Functions | |
RenderableComponentInstance (EntityInstance &entity, Component &resource) | |
virtual bool | init (utility::ErrorState &errorState) override |
void | draw (IRenderTarget &renderTarget, VkCommandBuffer commandBuffer, const glm::mat4 &viewMatrix, const glm::mat4 &projectionMatrix) |
void | setVisible (bool visible) |
bool | isVisible () const |
virtual bool | isSupported (nap::CameraComponentInstance &camera) const |
![]() | |
ComponentInstance (EntityInstance &entity, Component &resource) | |
virtual void | update (double deltaTime) |
nap::EntityInstance * | getEntityInstance () const |
nap::Component * | getComponent () const |
template<typename T > | |
T * | getComponent () const |
virtual bool | init (utility::ErrorState &errorState) |
![]() | |
Object () | |
virtual | ~Object () |
virtual void | onDestroy () |
Object (Object &)=delete | |
Object & | operator= (const Object &)=delete |
Object (Object &&)=delete | |
Object & | operator= (Object &&)=delete |
Protected Member Functions | |
virtual void | onDraw (IRenderTarget &renderTarget, VkCommandBuffer commandBuffer, const glm::mat4 &viewMatrix, const glm::mat4 &projectionMatrix)=0 |
Additional Inherited Members | |
![]() | |
static bool | isIDProperty (rtti::Instance &object, const rtti::Property &property) |
![]() | |
std::string | mID |
Property: 'mID' unique name of the object. Used as an identifier by the system. More... | |
Represents an object that can be rendered to screen or any other type of render target. This is the base class for all render-able types. Override the draw call to implement custom draw behavior.
RenderableComponentInstance | ( | EntityInstance & | entity, |
Component & | resource | ||
) |
void draw | ( | IRenderTarget & | renderTarget, |
VkCommandBuffer | commandBuffer, | ||
const glm::mat4 & | viewMatrix, | ||
const glm::mat4 & | projectionMatrix | ||
) |
Called by the render service, calls onDraw() if visible. Renders the object to the given render target using the provided command buffer, view and projection matrix.
renderTarget | target to render to |
commandBuffer | active command buffer |
viewMatrix | often the camera world space location. |
projectionMatrix | often the camera projection matrix. |
|
overridevirtual |
Make sure to this in derived classes
Reimplemented from ComponentInstance.
Reimplemented in Renderable2DTextComponentInstance, RenderToTextureComponentInstance, RenderableMeshComponentInstance, Renderable3DTextComponentInstance, RenderGnomonComponentInstance, RenderableTextComponentInstance, and RenderVideoComponentInstance.
|
virtual |
Called by the Render Service. By default every camera type is supported If your renderable component doesn't support a specific camera return false In that case the object won't be rendered.
Reimplemented in Renderable2DTextComponentInstance, RenderToTextureComponentInstance, RenderVideoComponentInstance, and RenderGnomonComponentInstance.
bool isVisible | ( | ) | const |
|
protectedpure virtual |
Called by the render service. Override this method to implement your own custom draw behavior. This method won't be called if the mesh isn't visible.
renderTarget | currently bound render target |
commandBuffer | active command buffer |
viewMatrix | the camera world space location |
projectionMatrix | the camera projection matrix |
Implemented in Renderable2DTextComponentInstance, RenderableMeshComponentInstance, RenderToTextureComponentInstance, Renderable3DTextComponentInstance, RenderVideoComponentInstance, RenderBloomComponentInstance, and RenderGnomonComponentInstance.
void setVisible | ( | bool | visible | ) |
Toggles visibility.
visible | if this object should be drawn or not |