
#ifndef TTORCHE_H_INCLUDED
#define TTORCHE_H_INCLUDED

/*
OBJET       classe d'un point de lumiere > torche

DATE        10/2024

AUTEUR      philippe Thebaud

COMMENTAIRE
*/

#include <GL/glew.h>
#include <string>
#include <vector>

#include "../ECO/OUtils.h"
#include "../ECO/OTexturelist.h"
#include "../ECO/defered/ODBuffer.h"
#include "../ECO/defered/ODshNull.h"
#include "../ECO/defered/ODshPoint.h"
#include "../ECO/defered/OLightPnt.h"
#include "../ECO/defered/ODshGeo.h"
#include "../ECO/shader/OShParticle3d.h"
#include "../ECO/OMesh_obj.h"

#include "common.h"
#include "TprtTorche.h"




class Ttorche
{
public:
	Ttorche();
	~Ttorche();

	void        addLight(std::string flux);
    void        addModel(std::string flux);
	void        addParticle();

    void        create(std::string flux);

	void        draw(ODshGeo& dshGeo);
    //void        draw(ODshGeoClipZ& dshGeoClipZ);
    void        draw_light_point(ODBuffer& buffer, ODshNull& dshNull, ODshPoint& dshPoint);
	void        draw_particle();

	//uint32_t    getId_diffuseMap(size_t part);
	//uint32_t    getId_normalMap(size_t part);
	//OMat4&      getModel(size_t part);
	//size_t      getPart_size();

    void        setState(int value);

	void        update(float ambient);

private:

    void        _composition();

	void		_setModel(size_t idx);

private:

    std::string m_code, m_path, m_file;
	bool        m_cull_face;
	OMesh_obj   mesh;

    std::vector<OMat4>      m_model;
	std::vector<OMat4>      m_model_multi;
    std::vector<OVec3_f>    m_pos;
    std::vector<OVec3_f>    m_rot;
    std::vector<OVec3_f>    m_scale;

	std::deque<TprtTorche>  prtTorche;
	std::deque<OLightPnt>   lightPnt;

};

#endif
