Cogs.Core
InstancedMeshRenderComponent.h
1#pragma once
2
3#include "Components/Core/RenderComponent.h"
4
5#include "Rendering/Common.h"
6
7#include "Resources/Resources.h"
8
9namespace Cogs::Core
10{
15 {
16 public:
18 static void registerType();
19
22
25
27 uint32_t startIndex = 0;
28
31
33 uint32_t startInstance = 0;
34
37
40
41 public:
43 static constexpr uint32_t DrawRest = static_cast<uint32_t>(-1);
44
57 static uint32_t getRenderCount(uint32_t startIndex, uint32_t instanceCount, uint32_t meshCount);
58 };
59}
60
61template<> inline Cogs::StringView getName<Cogs::Core::InstancedMeshRenderComponent>() { return "InstancedMeshRenderComponent"; }
uint32_t startIndex
Start vertex index to render from.
uint32_t vertexCount
Number of vertexes to draw. uint32_t(-1) to draw all remaining vertices.
uint32_t instanceCount
Instance count. uint32_t(-1) to draw all remaining instances.
static void registerType()
Register the type in the type system.
static uint32_t getRenderCount(uint32_t startIndex, uint32_t instanceCount, uint32_t meshCount)
Get number of instanced Meshes to render.
MaterialInstanceHandle material
Material instance used to render the mesh.
static constexpr uint32_t DrawRest
Special value for vertex/instance Count to draw all elements from start index.
PrimitiveType::EPrimitiveType primitiveType
Primitive type to use when drawing. Default value -1 means use primitive type from mesh.
MeshHandle instanceMesh
Mesh containing instancing data.
Base component for all rendering content.
Provides a weakly referenced view over the contents of a string.
Definition: StringView.h:24
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....
EPrimitiveType
Primitive type enumeration.
Definition: Common.h:114