#include <renderablemeshcomponent.h>
Public Member Functions | |
virtual void | getDependentComponents (std::vector< rtti::TypeInfo > &components) const override |
IMesh & | getMeshResource () |
![]() | |
virtual const rtti::TypeInfo | getInstanceType () const =0 |
![]() | |
Resource () | |
![]() | |
Object () | |
virtual | ~Object () |
virtual bool | init (utility::ErrorState &errorState) |
virtual void | onDestroy () |
Object (Object &)=delete | |
Object & | operator= (const Object &)=delete |
Object (Object &&)=delete | |
Object & | operator= (Object &&)=delete |
Public Attributes | |
ResourcePtr< IMesh > | mMesh |
Property: 'Mesh' Resource to render. More... | |
MaterialInstanceResource | mMaterialInstanceResource |
Property: 'MaterialInstance' instance of the material, used to override uniforms for this instance. More... | |
math::Rect | mClipRect |
Property: 'ClipRect' Optional clipping rectangle, in pixel coordinates. More... | |
float | mLineWidth = 1.0f |
Property: 'LineWidth' Width of the line when rendered, values higher than 1.0 only work when the GPU supports it. More... | |
![]() | |
bool | mVisible = true |
Property: 'Visible' if this object is rendered to target by the render service. More... | |
ResourcePtr< RenderLayer > | mLayer |
Property: 'Layer' the render layer assigned to this component. More... | |
std::vector< ResourcePtr< RenderTag > > | mTags |
Property: 'Tags' List of tags specifying the category this render component belongs to. More... | |
![]() | |
std::string | mID |
Property: 'mID' unique name of the object. Used as an identifier by the system. More... | |
Additional Inherited Members | |
![]() | |
static bool | isIDProperty (rtti::Instance &object, const rtti::Property &property) |
Resource part of the renderable mesh component. Renders a mesh to screen or any other render target. The link to the mesh and clipping rectangle (property) are optional. You can set the mesh at runtime if necessary. The material is required.
A mesh becomes 'renderable' when it is used in combination with a material. Such a mesh-material combination forms a 'nap::RenderableMesh'. Vertex attributes in both the shader and mesh should match. Otherwise, the RenderableMesh is invalid. The nap::RenderableMesh is created based on the given mesh and the material properties.
It is, however, possible to switch the mesh and / or material from the RenderableMeshComponent to some other mesh and / or material. To do so, other components should create their own nap::RenderableMesh by calling nap::RenderService::createRenderableMesh, and pass the returned object to setMesh(). The object calling nap::RenderService::createRenderableMesh should own the custom mesh and / or material and should validate the result on init().
The model view and projection matrices are automatically set when the vertex shader exposes a struct with the 'uniform::mvpStruct' name. If exposed by the shader it is required that the model, view and projection matrix names match those as declared in 'renderglobals.h'.
A Transform component is required to position the mesh.
|
overridevirtual |
RenderableMesh requires a transform to position itself in the world.
components | the components this component depends upon. |
Reimplemented from Component.
IMesh& getMeshResource | ( | ) |
math::Rect mClipRect |
Property: 'ClipRect' Optional clipping rectangle, in pixel coordinates.
float mLineWidth = 1.0f |
Property: 'LineWidth' Width of the line when rendered, values higher than 1.0 only work when the GPU supports it.
MaterialInstanceResource mMaterialInstanceResource |
Property: 'MaterialInstance' instance of the material, used to override uniforms for this instance.
ResourcePtr<IMesh> mMesh |