Closed moonheart08 closed 6 years ago
You mean something like this?
world.on('postStep', function(){
body.force[0] -= 100 * body.position[0];
body.force[1] -= 100 * body.position[1];
if(p2.vec2.length(body.position) < 2){
// destroy logic
}
});
@schteppe Similar, yes, but with support for multiple points.
Yeah. Just loop over every point mass, then add the forces for each one yourself.
Yea, i see the point. Thanks. Gonna close.
I.e. a point in the world that pulls on other objects. Why? For things like, say, a black hole that wanders around the world and destroys objects that are pulled into it.