xxxxxxxxxx
25
const gravity = 0.0981;
const atm = 1;
const it = 500;
const ground = 100;
let dt;
let s;
function setup() {
dt = 1/sqrt(it);
createCanvas(1080, 720);
s = new Softbody(width / 2, height / 2, 100, 10, 69, 0.1, 0.5);
}
function draw() {
// frameRate(1);
background(0);
push();
stroke(255);
line(-width, height - ground, width * 2, height - ground);
pop();
s.gravitate();
s.updateForces();
s.updatePos();
s.display();
}