Updated README.md with build instructions
[hair] / src / hair.cc
index b2eb4a0..a369465 100644 (file)
@@ -110,6 +110,7 @@ bool Hair::init(const Mesh *m, int max_num_spawns, float thresh)
                if (res && !kd_res_end(res)) {
                        Vec3 nearest;
                        kd_res_item3f(res, &nearest.x, &nearest.y, &nearest.z);
+                       kd_res_free(res);
                        if(distance_sq(rpoint, nearest) < min_dist * min_dist)
                                continue;
                }
@@ -147,6 +148,7 @@ void Hair::draw() const
                glVertex3f(p.x, p.y, p.z);
                Vec3 dir = normalize(hair[i].pos - p) * hair_length;
                Vec3 end = p + dir;
+               glColor3f(1, 1, 0);
                glVertex3f(end.x, end.y, end.z);
 /*
                glColor3f(1, 1, 0);