Guest User

Untitled

a guest
Dec 12th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. PVector acc2 = new PVector();
  2. PVector vel2 = new PVector();
  3.  
  4. float grav2 = 5000;
  5. float mass2 = 10;
  6. boolean aiming2 = false;
  7.  
  8. void accCalc2() {
  9. PVector tempAcc = PVector.sub(pos2, pos);
  10. tempAcc.normalize();
  11. float tempForce = grav2*mass2/pow(PVector.dist(posa, pos2), 2);
  12.  
  13. tempAcc.mult(tempForce);
  14. acc2.add(tempAcc);
  15. }
  16.  
  17. void gravityControl2() {
  18. accCalc();
  19.  
  20. vel2.add(acc2);
  21. vel2.mult(0.3);
  22. posa.add(vel2);
  23. acc2 = new PVector();
  24. acc2.set(0, 0);
  25. }
  26.  
  27. void draw3() {
  28. gravityControl2();
  29. }
Add Comment
Please, Sign In to add comment