Physics Simulation & Visualization Tool
0.1
A C++ physics simulation engine with real-time 3D visualization
Loading...
Searching...
No Matches
Scene.h
Go to the documentation of this file.
1
#pragma once
2
#include <
graphics/core/Camera.h
>
3
#include <
graphics/components/Gizmo.h
>
4
#include <
math/MathUtils.h
>
5
#include <
graphics/core/UniformBuffer.h
>
6
#include <vector>
7
#include <deque>
8
#include <unordered_set>
9
#include <memory>
10
11
class
Scene
{
12
public
:
13
Scene
(QOpenGLFunctions_4_5_Core* glFuncs);
14
~Scene
() =
default
;
15
void
draw
(
const
std::optional<std::vector<ObjectSnapshot>>& snapshots,
const
std::unordered_set<uint32_t>& hoverIDs,
const
std::unordered_set<uint32_t>& selectIDs);
16
17
void
addDrawable
(
IDrawable
* drawable);
18
void
removeDrawable
(
IDrawable
* drawable);
19
20
uint32_t
allocateObjectID
();
21
void
freeObjectID
(uint32_t objID);
22
23
Camera
*
getCamera
();
24
private
:
25
QOpenGLFunctions_4_5_Core* funcs;
26
27
Camera
camera;
28
std::vector<IInstancedDrawable*> instancedDrawables;
29
std::vector<ICustomDrawable*> customDrawables;
30
31
Shader
* basicShader;
32
33
UniformBuffer
cameraUBO;
34
UniformBuffer
hoverUBO;
35
UniformBuffer
selectUBO;
36
37
uint32_t nextID = 0;
38
std::deque<uint32_t> freeIDs;
39
};
Camera.h
Gizmo.h
Interactive 3D manipulation gizmo for scene objects.
MathUtils.h
Mathematical utility functions for 3D graphics and physics.
UniformBuffer.h
Camera
Definition
Camera.h:13
IDrawable
Base interface for all renderable objects in the scene.
Definition
IDrawable.h:33
Scene
Definition
Scene.h:11
Scene::freeObjectID
void freeObjectID(uint32_t objID)
Definition
Scene.cpp:87
Scene::removeDrawable
void removeDrawable(IDrawable *drawable)
Definition
Scene.cpp:204
Scene::allocateObjectID
uint32_t allocateObjectID()
Definition
Scene.cpp:78
Scene::~Scene
~Scene()=default
Scene::getCamera
Camera * getCamera()
Definition
Scene.cpp:190
Scene::addDrawable
void addDrawable(IDrawable *drawable)
Definition
Scene.cpp:194
Scene::draw
void draw(const std::optional< std::vector< ObjectSnapshot > > &snapshots, const std::unordered_set< uint32_t > &hoverIDs, const std::unordered_set< uint32_t > &selectIDs)
Definition
Scene.cpp:91
Shader
Definition
Shader.h:6
UniformBuffer
Definition
UniformBuffer.h:4
src
graphics
core
Scene.h
Generated by
1.9.8