Mixing several methods
Combination of both methods
Finally, it is also possible to combine both approach. That is to say load a *scn simulation scene and then add some Geometric objects from Unity menu.
But the scene should have the default collision pipeline form SOFA, otherwise the collision won't be possible with basic objects created. This is work in progress.
Interaction of a SRigidSphere GameObject with soft tissue simulated in Sofa
Youtube demo movie: Sofa in Unity - 3D Cloth Simulation
Adding collision sphere to Unity ObjectsThis is the last feature integrated in the V03 version. It is now possible to add the SSphereCollisionModel script to a unity GameObject. This will create spheres that can be seen as gizmos on the Unity side which are mapped to collision sphere inside the Sofa simulation scene.
The demo scene Tissue_fall is an example of that feature.
Several parameters can be set:
- Interpolation factor: a factor to compute the number of sphere to create on the given geometry.
- Sphere radius: radius of the collision spheres.
- Activate collision: collide or not with the other objects.
- Contact stiffness: the force of the repulsion used by the collision sphere.