Component that provide Mesh handling and rendering.
More...
#include <OxygenEngine/render/mesh_renderer.h>
Component that provide Mesh handling and rendering.
◆ addMaterial()
| void oe::render::MeshRenderer::addMaterial |
( |
bool | assign_to_primitives = false | ) |
|
|
inline |
Add a new material.
Add the material then init the list (by default the material will not be applied to any primitives)
- Parameters
-
| assign_to_primitives | Assign the newly created material to all primitives |
- Note
- No material deletion method available because removal might break the ids on user side
-
(you can still manipulate primitives_by_material and materials yourself)
◆ fillRenderCommands()
Generate a list of {primitives, Material*} to render this mesh.
- Returns
- Does this mesh need to be rendered
◆ fillShader()
Send shader uniforms related to this mesh.
- Note
- At this point the mesh is considered to be ready to be drawn, no need to add any checks :)
◆ materials
◆ primitives_by_material
| std::vector<std::vector<bool> > oe::render::MeshRenderer::primitives_by_material |
List to assign materials to primitives.
Keys are material ids (ie. position in materials list) and values are primitive flags (ie. true means the corresponding primitive will be drawn using the material)
- Note
- Primitives assigned to multiple materials will be drawn multiple times (to let use creative effects)
The documentation for this struct was generated from the following file: