Add zooming
This commit is contained in:
parent
56a09f98c5
commit
b02675f4fb
12 changed files with 156 additions and 29 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue