Rendering Engine
0.2.9
Modular Graphics Rendering Engine | v0.2.9
static_mesh.hpp
Go to the documentation of this file.
1
// This file is part of the Rendering Engine project.
2
// Author: Alexander Obzherin <alexanderobzherin@gmail.com>
3
// Copyright (c) 2026 Alexander Obzherin
4
// Distributed under the terms of the zlib License. See LICENSE.md for details.
5
6
#pragma once
7
8
#include "
rendering_engine_export.hpp
"
9
#include "
drawable_3d.hpp
"
10
11
#include <unordered_map>
12
#include <string>
13
#include <cstdint>
14
15
namespace
rendering_engine
16
{
17
class
Scene;
18
struct
StaticMeshParams
19
{
20
std::string
meshName
;
21
22
// {slot number, material name}
23
std::unordered_map<uint32_t, std::string>
materials
;
24
25
bool
castShadows
=
false
;
26
bool
receiveShadows
=
false
;
27
};
28
29
/**
30
* @class StaticMesh
31
* @brief 3D drawable component for rendering static (non-animated) meshes.
32
*
33
* @note Not copyable or assignable.
34
* @see Drawable3D, DrawableComponent, SceneComponent, Camera
35
*/
36
class
RE_API
StaticMesh
:
public
Drawable3D
37
{
38
public
:
39
/**
40
* @brief Constructs a StaticMesh component associated with a given render context.
41
* @param renderContext Rendering resource context for material and mesh initialization.
42
*/
43
StaticMesh
(
RenderResourceContext
renderContext,
Scene
& scene,
StaticMeshParams
params);
44
45
/**
46
* @copydoc DrawableComponent::Initialize
47
*/
48
void
Initialize()
override
;
49
50
/**
51
* @copydoc DrawableComponent::Update
52
*/
53
void
Update(
float
deltaTime)
override
;
54
55
/**
56
* @copydoc Drawable3D::Draw
57
*/
58
void
Draw(
const
Camera
& camera)
override
;
59
60
StaticMesh
(
const
StaticMesh
& rhs) =
delete
;
61
StaticMesh
&
operator=
(
const
StaticMesh
& rhs) =
delete
;
62
63
protected
:
64
StaticMeshParams
mParams
;
65
};
66
67
68
}
// namespace rendering_engine
rendering_engine::Camera
Represents a 3D perspective camera with world transform and projection settings.
Definition:
camera.hpp:48
rendering_engine::Drawable3D
3D drawable component for rendering objects in 3D space.
Definition:
drawable_3d.hpp:27
rendering_engine::Scene
Base class representing a renderable scene.
Definition:
scene.hpp:44
rendering_engine::StaticMesh
3D drawable component for rendering static (non-animated) meshes.
Definition:
static_mesh.hpp:37
rendering_engine::StaticMesh::mParams
StaticMeshParams mParams
Definition:
static_mesh.hpp:64
rendering_engine::StaticMesh::operator=
StaticMesh & operator=(const StaticMesh &rhs)=delete
rendering_engine::StaticMesh::StaticMesh
StaticMesh(const StaticMesh &rhs)=delete
drawable_3d.hpp
rendering_engine
Definition:
actor.hpp:13
rendering_engine_export.hpp
RE_API
#define RE_API
Definition:
rendering_engine_export.hpp:10
rendering_engine::RenderResourceContext
Aggregates pointers to global rendering resource managers.
Definition:
render_resource_context.hpp:26
rendering_engine::StaticMeshParams
Definition:
static_mesh.hpp:19
rendering_engine::StaticMeshParams::materials
std::unordered_map< uint32_t, std::string > materials
Definition:
static_mesh.hpp:23
rendering_engine::StaticMeshParams::castShadows
bool castShadows
Definition:
static_mesh.hpp:25
rendering_engine::StaticMeshParams::receiveShadows
bool receiveShadows
Definition:
static_mesh.hpp:26
rendering_engine::StaticMeshParams::meshName
std::string meshName
Definition:
static_mesh.hpp:20
RenderingEngine
RenderingLibrary
Include
static_mesh.hpp
Generated by
1.9.4