Skip to content

Conversation

stezkmil
Copy link

The synchronization of velocities into the solver body was not working as it should have. Consider the following scene: there is a rigid static obstacle (let's say a box) at x coordinate 0. There is a rigid dynamic box not far from the obstacle in positive x axis direction. To this rigid dynamic box is connected another box, which is a deformable soft body. They are connected by, say, 5 deformable anchors to the nodes of the soft body. The soft body is sufficiently rigid, which also helps to amplify the problem described. Now, when the rigid dynamic box is pushed in the negative x direction into the obstacle (for example by a gravity force), then as soon as it hits the obstacle, the soft body explodes. The problem is that in btDeformableMultiBodyConstraintSolver::solveDeformableGroupIterations, the resulting velocity always ends up with negative x component, which makes the body go though the obstacle. The proper result should be a slightly positive x velocity, because the obstacle is blocking that direction. The reason for this is wrong synchro of solver body velocities, which this PR fixes.

Sorry for the unrelated formatting changes. Probably caused by clang-format.

Fixes bad synchronization of body to solver body velocities
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant