Added anchor points and hair strands.
[hair] / src / hair.h
1 #ifndef PARTICLES_H_
2 #define PARTICLES_H_
3
4 #include <gmath/gmath.h>
5
6 #include "mesh.h" 
7
8 struct HairStrand {
9         Vec3 pos;
10         Vec3 velocity;
11         /* directions relative to the spawn point */
12         Vec3 anchor_dirs[3];
13         Vec3 spawn_pt;
14         Vec3 spawn_dir;
15 };
16
17 class Hair {
18 private:
19         float hair_length;
20         std::vector<HairStrand> hair;
21
22 public:
23         Hair();
24         ~Hair();
25
26         bool init(const Mesh *m, int num_spawns, float thresh = 0.4);
27         void draw() const;
28 };
29
30 #endif //PARTICLES_H_
31