+
+void Hair::update(float dt)
+{
+ for(size_t i = 0; i < hair.size(); i++) {
+ /* in local space */
+ Vec3 hair_end = hair[i].spawn_pt + hair[i].spawn_dir * hair_length;
+ Vec3 anchor = xform * hair_end;
+
+ Vec3 force = (anchor - hair[i].pos) * K_ANC;
+
+ Vec3 accel = force; /* mass 1 */
+ hair[i].velocity += ((-hair[i].velocity * DAMPING) + accel) * dt;
+ hair[i].pos += hair[i].velocity * dt;
+
+ dbg_force = force;
+ }
+}