Skip to content
Snippets Groups Projects
Commit 9562484e authored by BATON Theau's avatar BATON Theau
Browse files
parents 04b10a68 5e77bdb3
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,11 @@ Pos=60,60
Size=400,400
[Window][Particle Generator]
<<<<<<< HEAD
Pos=13,14
Size=505,662
=======
Pos=60,60
Size=733,329
>>>>>>> 5e77bdb39edb229deb0a1553d2ba4f5719d591a6
This diff is collapsed.
......@@ -6,13 +6,11 @@
#include <imgui.h>
#include <imgui_impl_glfw.h>
#include <imgui_impl_opengl3.h>
#include <implot.h>
namespace pg::interface {
Manager::Manager(const Window & window, pg::Manager & manager)
: _window(window), _manager(manager), _title(window.title()) {
ImGui::CreateContext();
ImPlot::CreateContext();
ImGui::GetIO().IniFilename = "config/imgui.ini";
ImGui_ImplGlfw_InitForOpenGL(window.address(), true);
......@@ -28,7 +26,6 @@ namespace pg::interface {
ImGui_ImplOpenGL3_Shutdown();
ImGui_ImplGlfw_Shutdown();
ImPlot::DestroyContext();
ImGui::DestroyContext();
}
......
#include "PathAnimated.hpp"
#include <imgui.h>
#include <implot.h>
#include "../../Scene/Scenes/Path.hpp"
#include "../../tfd/tinyfiledialogs.h"
......
......@@ -41,19 +41,3 @@ namespace pg::particle {
inline std::vector<std::unique_ptr<T>> operator()(size_t count, size_t birth = 0) const {return this->generate(count, birth);}
};
}
\ No newline at end of file
template <typename T>
using ParticleContainer = std::vector<T>;
using Vec3 = glm::vec3;
template <typename T>
class Generator {
private:
Vec3 position;
Vec3 positionVariation;
Vec3 rotation;
public:
virtual Container<T> generate(unsigned int number, long when) const = 0;
};
\ No newline at end of file
......@@ -5,6 +5,7 @@
#define GLM_ENABLE_EXPERIMENTAL
#include <glm/gtx/normal.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <iostream>
namespace pg::scene {
MeshGenerator::MeshGenerator()
......@@ -176,14 +177,20 @@ namespace pg::scene {
void MeshGenerator::changeMesh(const std::string & path) {
this->_particles.clear();
this->_generators.clear();
std::cout << "mark_-1" << std::endl;
Model model(path);
std::cout << "mark_0" << std::endl;
MeshGeometry geometry = model.getMeshGeometry();
this->_mesh.generate(geometry.vertices, geometry.indices);
auto & vertices = geometry.vertices;
auto & indices = geometry.indices;
std::cout << "mark_1" << std::endl;
for(size_t i = 0; i < geometry.indices.size(); i+= 3) {
particle::PhysicsGenerator generator;
glm::vec3 & p1 = vertices[indices[i]].position, p2 = vertices[indices[i+1]].position, p3 = vertices[indices[i+2]].position;
......@@ -197,6 +204,8 @@ namespace pg::scene {
generator.setPositionVariation(0.5f);
this->_generators.push_back(generator);
}
std::cout << "mark_2" << std::endl;
}
void MeshGenerator::spawn(int count, double current_time) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment