p2.js
p2.js copied to clipboard
[bug]Some concave shapes will fall into other when fall down.
This is werid case, I have no idea to deal it.
Hi @guawoo.
Have you tried using the Body
parameter ccdSpeedThreshold
?
It's default value is -1
, and it is disabled by default. If you need high resolution impacts, because objects are moving very fast, set it to 0 in your Body
constructor, and that should fix the problem.
const body = new Body({
...,
ccdSpeedThreshold: 0,
...
});
Note, you may have to use the github version of p2.js
by installing it via npm using:
npm install --save schteppe/p2.js
@jtenner Thank you so much, I have to set ccSpeedTreshold to 0 and use github version,but this case still appear. It is not normal appearance, need to special shapes and special positions like gif in. :(
Can you please replicate the problem with an online environment like codepen?
This bug is probably fixed after adding polygon clipping. Could you try getting the latest master branch, rebuilding the library and see if it works better? Thanks.