Generic Same Point Constraint
$$C(p1,p2)= -\mid \vec{x_{1}} - \vec{x_{2}}\mid$$
Gradient Function
$$\nabla_{pi}C(p1,p2) = \frac{\vec{x_{i}} - \vec{x_{3-i}}}{\mid\mid \vec{x_{3-i}} - \vec{x_{i}} \mid\mid} $$
Stiffness=0.2(soft body) Note: If while simulation at any time step the Same Point Constraint is negative below a certain threshold value, the body can be assumed to be broken there.
The Same Point Constraint of these points have to be removed and redistributed.
Soft Body Simulation Using Position Based Dynamics
copy the folders CS775, GenericConstraintsDemos and Simulation and file CMakeLists.txt to the Demos folder of the library.(replace any file which is to be replaced).
Now execute commands from the main folder of the library
cmake .
make
The executable for the simulation will be created in the bin folder.
Run the makefile in the visualization folder.
Instructions to view visualization
run the executable in the visualization folder.
press i to initialize the load.
enter the name of the file which is to be visualized.