Lugdunum
0.1.0
include
lug
Graphics
Scene
Node.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <memory>
4
#include <vector>
5
#include <
lug/Graphics/Export.hpp
>
6
#include <
lug/Graphics/Node.hpp
>
7
#include <
lug/Graphics/Render/Camera/Camera.hpp
>
8
#include <
lug/Graphics/Render/DirtyObject.hpp
>
9
#include <
lug/Graphics/Render/Light.hpp
>
10
#include <
lug/Graphics/Render/Material.hpp
>
11
#include <
lug/Graphics/Render/Mesh.hpp
>
12
13
namespace
lug
{
14
namespace
Graphics {
15
16
namespace
Render {
17
18
class
Queue;
19
class
View;
20
21
}
// Render
22
23
namespace
Scene {
24
25
class
Scene;
26
27
class
LUG_GRAPHICS_API
Node
:
public
::lug::Graphics::Node
,
public
Render::DirtyObject
{
28
friend
class
Scene
;
29
30
public
:
31
struct
MeshInstance
{
32
Resource::SharedPtr<Render::Mesh>
mesh{
nullptr
};
33
std::vector<Resource::SharedPtr<Render::Material>>
materials
;
34
};
35
36
public
:
37
Node
(
Scene
& scene,
const
std::string& name);
38
39
Node
(
const
Node
&) =
delete
;
40
Node
(
Node
&&) =
delete
;
41
42
Node
& operator=(
const
Node
&) =
delete
;
43
Node
& operator=(
Node
&&) =
delete
;
44
45
virtual
~
Node
() =
default
;
46
47
Node
* getNode(
const
std::string& name);
48
const
Node
* getNode(
const
std::string& name)
const
;
49
Scene
& getScene();
50
const
Scene
& getScene()
const
;
51
52
Node
* createSceneNode(
const
std::string& name);
53
54
void
attachLight(
Resource::SharedPtr<Render::Light>
light);
55
void
attachMeshInstance(
Resource::SharedPtr<Render::Mesh>
mesh,
Resource::SharedPtr<Render::Material>
material =
nullptr
);
56
void
attachCamera(
Resource::SharedPtr<Render::Camera::Camera>
camera);
57
58
Render::Light
* getLight();
59
const
Render::Light
* getLight()
const
;
60
61
const
MeshInstance
* getMeshInstance()
const
;
62
63
Render::Camera::Camera
* getCamera();
64
const
Render::Camera::Camera
* getCamera()
const
;
65
66
void
fetchVisibleObjects(
const
Renderer
& renderer,
const
Render::View
& renderView,
const
Render::Camera::Camera
& camera,
Render::Queue
& renderQueue)
const
;
67
68
virtual
void
needUpdate()
override
;
69
70
private
:
71
Scene
&
_scene
;
72
73
Resource::SharedPtr<Render::Light>
_light{
nullptr
};
74
MeshInstance
_meshInstance
;
75
Resource::SharedPtr<Render::Camera::Camera>
_camera{
nullptr
};
76
};
77
78
#include <
lug/Graphics/Scene/Node.inl
>
79
80
}
// Scene
81
}
// Graphics
82
}
// lug
Camera.hpp
lug::Graphics::Scene::Node::_scene
Scene & _scene
Definition:
Node.hpp:71
Mesh.hpp
lug::Graphics::Render::DirtyObject
Definition:
DirtyObject.hpp:11
lug::Graphics::Scene::Node::MeshInstance::materials
std::vector< Resource::SharedPtr< Render::Material > > materials
Definition:
Node.hpp:33
LUG_GRAPHICS_API
#define LUG_GRAPHICS_API
Definition:
Export.hpp:11
lug::Graphics::Scene::Node::MeshInstance
Definition:
Node.hpp:31
Light.hpp
lug::Graphics::Scene::Node
Definition:
Node.hpp:27
Node.inl
lug::Graphics::Render::Camera::Camera
Class for camera.
Definition:
Camera.hpp:30
lug::Graphics::Resource::SharedPtr
Dummy class for a shared pointer.
Definition:
Resource.hpp:66
lug::Graphics::Render::Queue
Definition:
Queue.hpp:17
lug::Graphics::Render::View
Definition:
View.hpp:18
lug::Graphics::Renderer
Definition:
Renderer.hpp:18
lug
Definition:
Application.hpp:11
Node.hpp
lug::Graphics::Scene::Scene
Definition:
Scene.hpp:30
DirtyObject.hpp
lug::Graphics::Node
Definition:
Node.hpp:13
Export.hpp
lug::Graphics::Render::Light
Class for Light.
Definition:
Light.hpp:26
Material.hpp
lug::Graphics::Scene::Node::_meshInstance
MeshInstance _meshInstance
Definition:
Node.hpp:74
Generated by
1.8.13