Vis 2
Kinetic Visualization for 3D shape and structure
 All Classes Namespaces Functions Pages
SurfaceAlignedParticleGroup.h
1 #pragma once
2 #include "SurfaceAlignedParticle.h"
3 #include "IParticleGroup.h"
4 #include "Texture.h"
5 #include "ParticleRenderer.h"
6 #include "HalfedgeMesh.h"
7 #include "SurfaceAlignedParticleGroupProperties.h"
8 
9 class ParticleManager;
10 
16 {
17 public:
18  //TODO add faceNormal
19  SurfaceAlignedParticleGroup(std::string name);
21 
22  void addParticle(SurfaceAlignedParticle* particle);
23  void addParticles(std::vector<SurfaceAlignedParticle*> particles);
24 
25  //IRenderable
26  void initialize();
27  void bindResources(const Shader * shader);
28  void unbindResources();
29  void draw();
30 
31  //IParticleGroup
32  void update();
33  int numberAlive();
34  void spawn(int i);
35  void ensureCapacity(int size);
36 
37  int size(); void updateWithProperties(SurfaceAlignedParticleGroupProperties* props);
38 private:
39  std::vector<SurfaceAlignedParticle*> _particles;
40 
41  GLuint _vao;
42  GLuint _vboPositions;
43  GLuint _vboHalfSizes;
44  GLuint _vboDirections;
45  GLuint _vboParticleColors;
46  //TODO: When particles are binned per face, it is not necessary to pass one normal per particle but one normal per face!
47  GLuint _vboFaceNormals;
48 
49  unsigned _numberOfAliveParticles = 0;
50  unsigned _waitingForSpawn = 0;
51 
52 };
53 
Definition: SurfaceAlignedParticleGroup.h:15
Definition: ParticleManager.h:20
Definition: SurfaceAlignedParticleGroupProperties.h:20
Definition: Shader.h:24
Definition: IParticleGroup.h:9
Definition: SurfaceAlignedParticle.h:13