Add zooming

This commit is contained in:
asraelite 2018-03-03 13:29:14 +00:00
parent 56a09f98c5
commit b02675f4fb
12 changed files with 156 additions and 29 deletions

View file

@ -10,7 +10,7 @@ export default class Body {
this.rvel = 0;
this.mass = mass;
}
tickGravity(bodies) {
bodies.forEach(b => {
let force = b.mass / this.mass / (distanceTo(b) ** 2) * G;