Classic visual rendering of the object using MeshFilter inside the compnent SofaVisualModel.
Information
The Scene Graph Edition API is currently under development. This API provides a deeper level of control, allowing detailed editing and customization of SofaUnity components within the Unity environment. It offers an alternative to the traditional scene files or Python scripts typically used by SOFA users.
At this stage, these features are best used for finalizing the simulation graph of a loaded scene. Several components, described below, are already available, and it is also possible to manually add new SofaDAGNode
elements to the simulation graph.
SofaComponent specialization
As explain earlier in the SOFA Scene Parsing section. Several categories of component from SOFA are mapped as Unity3D specialized GameObject. The others are created as SofaComponent generic GameObject.
Those specialized implementation allows for example to see the multi-model representation of a 3D object. In the Liver scene it is possible to see the visual
FEM element can be displayed inside the SofaFEMForceField by activating the Mesh Renderer.
Note that it can slow down the simulation as for example the tetrahedron in this case need to be updated at each frame.
Collision model can also be displayed in the SofaCollisionModel by activating the option Draw collision elements.
Note that same as for FEM, this can slow down the simulation as the element need to be updated at each frame.
Specific SofaComponent
Several very specific components can be created on top of the simulation scene graph using the hierarchy panel.
1. SofaBeamModel
This component is used to create a visual rendering in Unity3D of a Beam simulation in SOFA. It should be created inside a node having a SofaMesh with a Edge topology. Check the demo scene BeamDemo.
This component has 3 parameters:
- SofaMesh: Link to the corresponding SofaMesh with the beam structure.
- Discretisation: Number of face wanted for this beam.
- Radius: Radius of the visual beam around the simulated structure.
Example of a beam with a high dicretisation value of 10
Same beam with a discretisation value of 2
2. SofaParticlesModel
This component is used to create a visual rendering in Unity3D of a SPHFluid simulation in SOFA. It should be created inside a node having a SofaMesh with a Point topology. Check the demo scene SPHFluid.
This component is used to create a visual rendering in Unity3D of a Beam simulation in SOFA. It should be created inside a node having a SofaMesh with a Edge topology. Check the demo scene BeamDemo.
This component has 3 parameters:
- SofaMesh: Link to the corresponding SofaMesh with the beam structure.
- Discretisation: Number of face wanted for this beam.
- Radius: Radius of the visual beam around the simulated structure.
3. SofaCollisionPipeline
This component will create the default collision pipeline used in SOFA. See this IntersectionMethod on the SOFA webiste documentation for more information. This Will automatically create a GameObject embedding. It is not yet possible to change the type of algorithm used :
- Collision Pipeline: DefaultPipeline
- Broad Phase: BruteForceDetection
- Narrow Phase: MinProximityIntersection
- Collision Response: DefaultContactManager