Skip to content
Advertisement

incorrect bouncing behaviour in p5js play library

I’m using the play library: https://molleindustria.github.io/p5.play/

I’m doing a simple bouncing balls demo, with one large ball whose mass in play is given by $pi r^2$. The basic physics looks right to me. But after a few seconds, the large ball starts to jump large distances when struck by a small ball.

Here’s my complete code (EDIT, also pasted below): https://editor.p5js.org/jmmcd/sketches/BMPtPY098

It seems like a bug in the collision/bounce code. But my code is conceptually the same as https://molleindustria.github.io/p5.play/examples/index.html?fileName=collisions4.js, which doesn’t have this problem.

JavaScript

Advertisement

Answer

It seems there are some bugs in the p5.play physics, in particular tunneling. Some big improvements already implemented, and more are to come. See https://github.com/molleindustria/p5.play/issues/214.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement