Physics Simulation & Visualization Tool 0.1
A C++ physics simulation engine with real-time 3D visualization
Loading...
Searching...
No Matches
Colliders.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4#include <QOpenGLFunctions_4_5_Core>
9
10class SceneManager;
11
12class Colliders : public ICustomDrawable {
13public:
14 Colliders(SceneManager* sceneManager, QOpenGLFunctions_4_5_Core* glFuncs);
15 ~Colliders() override = default;
16
17 Shader* getShader() const override { return basicShader; }
18 Mesh* getMesh() const override { return nullptr; }
19 uint32_t getObjectID() const override { return 0; }
20
21 void draw() const override;
22
23 void setEnabled(bool value) { enabled = value; }
24
25private:
26 SceneManager* sceneManager;
27 QOpenGLFunctions_4_5_Core* gl;
28 Shader* basicShader = nullptr;
29 Mesh* cubeMesh = nullptr;
30 bool enabled = false;
31
33 mutable std::vector<Rendering::InstanceData> m_instanceScratch;
34};
Core interfaces for the rendering system supporting both instanced and custom drawing.
Mesh * getMesh() const override
Gets the mesh geometry for this object.
Definition Colliders.h:18
~Colliders() override=default
void setEnabled(bool value)
Definition Colliders.h:23
Shader * getShader() const override
Gets the shader used to render this object.
Definition Colliders.h:17
void draw() const override
Performs custom rendering for this object.
Definition Colliders.cpp:22
uint32_t getObjectID() const override
Gets the unique identifier for this object.
Definition Colliders.h:19
Interface for objects with specialized rendering requirements.
Definition IDrawable.h:181
GPU mesh representation with support for instanced rendering.
Definition Mesh.h:58
Definition Shader.h:6