Skip to content

Instantly share code, notes, and snippets.

@thomasvanta
Created May 14, 2013 21:54
Show Gist options
  • Save thomasvanta/5579927 to your computer and use it in GitHub Desktop.
Save thomasvanta/5579927 to your computer and use it in GitHub Desktop.
openFrameworks: drag force
drag.set(particles[i]->vel.getNormalized());//copy of the velocity vectors direction
float speed = particles[i]->vel.length(); //get the vectors length in order to:
drag.scale(c*speed); //multiply it by coeficient
particles[i]->applyForce(drag);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment