Skip to content
Snippets Groups Projects
Commit f08c6bb1 authored by BATON Theau's avatar BATON Theau
Browse files

Rename PathGenerator -> PathUniqueGenerator

parent 0a4595fd
No related branches found
No related tags found
No related merge requests found
......@@ -2,12 +2,11 @@
Pos=60,60
Size=400,400
[Window][Particle Generator]
Pos=86,73
Size=848,814
[Window][Dear ImGui Demo]
Pos=984,78
Size=598,693
Collapsed=1
Pos=650,20
Size=550,680
[Window][Particle Generator]
Pos=60,60
Size=141,81
#pragma once
#include "PathGenerator.hpp"
#include "PathUniqueGenerator.hpp"
#include <imgui.h>
#include "../../Particle/generator/PathGenerator.hpp"
#include "../../Particle/generator/PathUniqueGenerator.hpp"
namespace pg::interface {
PathGenerator::PathGenerator(particle::PathGenerator * parent, scene::Trajectory * trajectory)
PathUniqueGenerator::PathUniqueGenerator(particle::PathUniqueGenerator * parent, scene::Trajectory * trajectory)
: Generator(parent),
_trajectory(trajectory),
_next(0.f, 0.f, 0.f),
_index(0) {}
void PathGenerator::draw(double current_time) {
void PathUniqueGenerator::draw(double current_time) {
ImGui::Text("Physic generator at %f / %f / %f (x, y, z) - variation : %f.", this->parent()->m_position.x, this->parent()->m_position.y, this->parent()->m_position.z, this->parent()->m_positionVariation);
ImGui::Text("Default u : %f", this->parent()->m_u);
ImGui::Text("u increment : %f", this->parent()->m_increment);
......
......@@ -6,11 +6,11 @@
#include <glm/vec3.hpp>
namespace pg::particle {
class PathGenerator;
class PathUniqueGenerator;
}
namespace pg::interface {
class PathGenerator : public Generator<particle::PathGenerator> {
class PathUniqueGenerator : public Generator<particle::PathUniqueGenerator> {
private:
scene::Trajectory * _trajectory;
......@@ -18,8 +18,8 @@ namespace pg::interface {
int _index;
public:
PathGenerator(particle::PathGenerator *, scene::Trajectory * = nullptr);
virtual ~PathGenerator() = default;
PathUniqueGenerator(particle::PathUniqueGenerator *, scene::Trajectory * = nullptr);
virtual ~PathUniqueGenerator() = default;
void draw(double) override;
virtual inline std::string title() const {return "Path Generator Interface";}
......
......@@ -6,7 +6,7 @@
#include "../../tfd/tinyfiledialogs.h"
namespace pg::interface {
Path::Path(scene::Path * parent, particle::PathGenerator * generator, scene::Trajectory * trajectory)
Path::Path(scene::Path * parent, particle::PathUniqueGenerator * generator, scene::Trajectory * trajectory)
: Scene(parent), SceneParticle(parent), _interface(generator, trajectory) {}
void Path::draw(double current_time) {
......
......@@ -2,7 +2,7 @@
#include "../Interface.hpp"
#include "SceneParticle.hpp"
#include "../Generator/PathGenerator.hpp"
#include "../Generator/PathUniqueGenerator.hpp"
#include "../../Scene/Scenes/Trajectory.hpp"
#include <glm/vec4.hpp>
......@@ -15,10 +15,10 @@ namespace pg::scene {
namespace pg::interface {
class Path : public Scene<scene::Path>, public SceneParticle {
private:
PathGenerator _interface;
PathUniqueGenerator _interface;
public:
Path(scene::Path *, particle::PathGenerator *, pg::scene::Trajectory * = nullptr);
Path(scene::Path *, particle::PathUniqueGenerator *, pg::scene::Trajectory * = nullptr);
virtual ~Path() = default;
virtual void draw(double);
......
#include "PathGenerator.hpp"
#include "PathUniqueGenerator.hpp"
#include <random>
......@@ -6,14 +6,14 @@
#include <glm/gtx/rotate_vector.hpp>
namespace pg::particle {
PathGenerator::PathGenerator(ct::CurveGenerator * generator, const ct::Curve& controlPoints, const ct::Point& position, float positionVariation)
PathUniqueGenerator::PathUniqueGenerator(ct::CurveGenerator * generator, const ct::Curve& controlPoints, const ct::Point& position, float positionVariation)
: Generator(position, positionVariation), m_generator(generator), m_controlPoints(), m_u(0.0), m_spacing(0.0), m_increment(0.0) {
for(auto & point : controlPoints) {
this->m_controlPoints.push_back(this->m_position + glm::vec3(point));
}
}
std::vector<std::unique_ptr<Path>> PathGenerator::generate(size_t count, size_t birth) const {
std::vector<std::unique_ptr<Path>> PathUniqueGenerator::generate(size_t count, size_t birth) const {
std::random_device device;
std::mt19937 randomEngine(device());
......
......@@ -3,19 +3,21 @@
#include "Generator.hpp"
#include "../Path.hpp"
#include <set>
namespace pg::interface {
class PathGenerator;
class PathUniqueGenerator;
}
namespace pg::particle {
class PathGenerator : public Generator<Path> {
class PathUniqueGenerator : public Generator<Path> {
private:
ct::Curve m_controlPoints;
ct::CurveGenerator * m_generator;
float m_u, m_spacing, m_increment, m_limitor;
public:
PathGenerator(ct::CurveGenerator * generator, const ct::Curve& controlPoints, const ct::Point& position = ct::Point(), float positionVariation = 0.0);
PathUniqueGenerator(ct::CurveGenerator * generator, const ct::Curve& controlPoints, const ct::Point& position = ct::Point(), float positionVariation = 0.0);
inline ct::CurveGenerator * getGenerator() const {return this->m_generator;}
inline const ct::Curve& getControlPoint() const {return this->m_controlPoints;}
......@@ -32,6 +34,6 @@ namespace pg::particle {
virtual std::vector<std::unique_ptr<Path>> generate(size_t count, size_t birth = 0) const;
friend class interface::PathGenerator;
friend class interface::PathUniqueGenerator;
};
}
\ No newline at end of file
......@@ -4,7 +4,7 @@
#include "Trajectory.hpp"
#include "../../Renderer/Renderer.hpp"
#include "../../Particle/generator/PathGenerator.hpp"
#include "../../Particle/generator/PathUniqueGenerator.hpp"
#include "../../Interface/Scene/Path.hpp"
#include "../../Mesh/Billboard.hpp"
#include "../../System/Window.hpp"
......@@ -18,7 +18,7 @@ namespace pg::scene {
Billboard _billboard;
Trajectory _trajectory;
Material _texture;
particle::PathGenerator _generator;
particle::PathUniqueGenerator _generator;
glm::vec4 _color;
interface::Path _interface;
......@@ -34,7 +34,7 @@ namespace pg::scene {
inline const Program & getProgram() const {return this->_program;}
inline const Material & getTexture() const {return this->_texture;}
inline const particle::PathGenerator & getGenerator() const {return this->_generator;}
inline const particle::PathUniqueGenerator & getGenerator() const {return this->_generator;}
void changeParticletexture(const std::string &);
......
......@@ -4,7 +4,7 @@
#include <CurveTools/CPU/CurveSampler.hpp>
namespace pg::scene {
Trajectory::Trajectory(particle::PathGenerator * generator, double increment)
Trajectory::Trajectory(particle::PathUniqueGenerator * generator, double increment)
: _generator(generator),
_vbo(this->_vao, {layout::POSITION, layout::COLOR}),
_increment(increment),
......
#pragma once
#include "../../Renderer/Renderer.hpp"
#include "../../Particle/generator/PathGenerator.hpp"
#include "../../Particle/generator/PathUniqueGenerator.hpp"
#include "../../Interface/Scene/Trajectory.hpp"
#include "../Scene.hpp"
namespace pg::scene {
class Trajectory : public Scene {
private:
particle::PathGenerator * _generator;
particle::PathUniqueGenerator * _generator;
VertexArray _vao;
VerticeBuffer _vbo;
Program _program;
......@@ -22,9 +22,9 @@ namespace pg::scene {
interface::Trajectory _interface;
public:
Trajectory(particle::PathGenerator *, double = 0.01f);
Trajectory(particle::PathUniqueGenerator *, double = 0.01f);
inline particle::PathGenerator * getGenerator() const {return this->_generator;}
inline particle::PathUniqueGenerator * getGenerator() const {return this->_generator;}
inline double getIncrement() const {return this->_increment;}
inline const glm::vec4 & getColor() const {return this->_color;}
inline float getPointSize() const {return this->_pointSize;}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment