Created
May 14, 2013 21:52
-
-
Save thomasvanta/5579913 to your computer and use it in GitHub Desktop.
Processing: 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
PVector drag = p.vel.get(); //get a copy of velocity | |
drag.normalize(); //normalize it | |
float c = -0.005; //coeficient | |
float speed = p.vel.mag(); //modulo de la velocidad | |
drag.mult(c*speed*speed); | |
p.applyForce(drag); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment