I am building a plugin for Unreal Engine 5 for iMSTK, but was running into an issue with capsule to surface mesh and sphere to surface mesh collisions. It appears that there is a nan value being produced somewhere during the collision that spreads though the deformable model and the object touching it causing both to stop being simulated. m_dcdc and m_r in imstkPbdContactConstraint both seem to have this nan value spread through them during PbdContactConstraint::correctVelocity, but I am not sure what causes it to exist in the first place. I can circument this problem by creating a variable on the constraint for this update value https://gitlab.kitware.com/iMSTK/iMSTK/-/blob/master/Source/Constraint/PbdConstraints/imstkPbdContactConstraint.cpp#L22 and adding a check in PbdContactConstraint::correctVelocity that returns if the constraint has not been updated. Another way I can avoid the problem is by disabling the velocity correction entirely for the collision interaction, however I wanted to find a more permanent solution by determining the source of the nan value. I have also ran a similar scene within iMSTK standalone as well as run within Unreal using iMSTK’s visualizer and I was unable to produce this nan value. Lastly, point set to capsule and point set to sphere collisions seem to work normally. Any insight into where this nan may be appearing would be greatly appreciated.
Hi Justin. I need a bit more information to recreate this issue.
- What is your physics mesh (surface or tet mesh)?
- Does this happen at random, or is this only happening when you touch a fixed point (boundary condition)?
This occurs when using both a surface or tet mesh. Its hard to tell exactly when it happens, but it still occurs with no fixed points on the deformable mesh. It seems that with lower values for constraints the model needs much more agitation before the problem occurs. I’ve attached two gifs, the first one is with low constraint values and the second is with high.
Thanks for the help,