Closed Andrews54757 closed 5 years ago
Thanks for digging into what triggers it! Do you have a simple setup to reproduce this?
Yes, I do have a setup:
https://andrews54757.github.io/PhysiJS2-Test/error.html
Code is visible here:
Sorry for the delay looking into this. Thank you for all the initial info, and that simple test case!
You've over-constrained the system, and the NaN
is it blowing up in response :)
Instead of restricting the box's movements along all 6 degrees of freedom (setting all factors to 0
), set its mass to Infinity
. The engine looks specifically for this mass and treats those objects differently.
Thanks for your help! That seems to work!
Using the 2.0 branch, I found this error:
Upon researching why this error happened, I found out that it happens when an object collides with another when the object is "frozen" with
angular_factor
andlinear_factor
.Internally, this error is caused by the direction argument in the findSupportPoint function with the value of
Vector3 {x: NaN, y: NaN, z: NaN}
. The function is called in theaddPoint
function and passesnext_direction
tofindSupportPoint()
. The direction is NaN because the positions of the objects become NaN in goblin.