Created
May 14, 2013 21:54
-
-
Save thomasvanta/5579927 to your computer and use it in GitHub Desktop.
openFrameworks: drag force
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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