#pragma once #include "Particle.h" #include "ParticleEmitter.h" #include "Camera.h" #include class ParticleSystem { public: ParticleSystem(void); ~ParticleSystem(void); double m_LittleSystemRadius; private: Particle* m_ParticleList; //ez csak segédelem Particle* m_LastParticle; Particle* m_ParticleArray; float* VertexBuffer; float* TexcoordBuffer; float* NormalBuffer; float* ColorBuffer; unsigned int* IndexBuffer; unsigned int m_nVBOVertices; // Vertex VBO Name unsigned int m_nVBOTexCoords; // Texture Coordinate VBO Name unsigned int m_nVBOIndices; unsigned int m_Quota; unsigned int m_Count; int m_Type; //0=point 1=billboard Vector m_UpVector; Vector m_RightVector; Vector m_CameraPosition; Vector m_Position; bool m_refreshed; double m_BoundingRadius; public: ParticleEmitter m_Emitter; bool m_refreshonce; void setQuota(unsigned int quota){m_Quota=quota;} void setType(int type){m_Type=type;} void setPosition(Vector pos){m_Position=pos;} Vector getPosition(){return m_Position;} double getBoundingRadius(){return m_BoundingRadius;} void RefreshParticles(unsigned int Dt,unsigned int TimefromSecond); void RenderAsPoints(bool sprites=false); void RenderAsBillboard(); void RenderAsSpheres(); void RefreshCamera(Camera* cam) { m_CameraPosition=cam->getPosition(); m_UpVector=cam->getUpVector(); m_RightVector=cam->getRightVector(); } void CreateSphere(); GLfloat *P, *N, *uv; GLuint *indices; int nTris; int nVerts; void SortParticles(bool increment); void RefreshBuffer(bool billboard=true); void RefrBRadius_Dist(bool refresh_rad=true);//refresh bounding radius and distances void SortFromCamera(Camera* Camera,bool towardCamera,bool aspoints,bool refr_rad=false) { RefreshCamera(Camera); RefrBRadius_Dist(refr_rad); SortParticles(towardCamera); RefreshBuffer(!aspoints); }; Particle* getParticleArray(){return m_ParticleArray;}; float* getVertexBuffer(){return VertexBuffer;} };