Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PVector acc2 = new PVector();
- PVector vel2 = new PVector();
- float grav2 = 5000;
- float mass2 = 10;
- boolean aiming2 = false;
- void accCalc2() {
- PVector tempAcc = PVector.sub(pos2, pos);
- tempAcc.normalize();
- float tempForce = grav2*mass2/pow(PVector.dist(posa, pos2), 2);
- tempAcc.mult(tempForce);
- acc2.add(tempAcc);
- }
- void gravityControl2() {
- accCalc();
- vel2.add(acc2);
- vel2.mult(0.3);
- posa.add(vel2);
- acc2 = new PVector();
- acc2.set(0, 0);
- }
- void draw3() {
- gravityControl2();
- }
Add Comment
Please, Sign In to add comment