Open ar065 opened 4 years ago
There is a way to disable ejected mass from colliding, but it also disables your cells from colliding:
src/worlds/world.js
/**
* @param {Cell} a
* @param {Cell} b
*/
resolveRigidCheck(a, b) {
let dx = 0;
let dy = 0;
let d = Math.sqrt(dx * dx + dy * dy);
const m = a.size + b.size - d;
if (m <= 0) return;
if (d === 0) d = 1, dx = 1, dy = 0;
else dx /= d, dy /= d;
const M = a.squareSize + b.squareSize;
const aM = b.squareSize / M;
const bM = a.squareSize / M;
a.x -= dx * m * aM;
a.y -= dy * m * aM;
b.x += dx * m * bM;
b.y += dy * m * bM;
this.bounceCell(a);
this.bounceCell(b);
this.updateCell(a);
this.updateCell(b);
}
basically change the dx and dy variables to zero. Basically it disables all collisions
Hoped this helped, probably not...
Currently, there is no option to disable ejected mass from colliding.