Main principles
To effectively use the SOFA-Unity3D integration, it’s essential to have a basic understanding of both the Unity3D Editor and the SOFA physics engine. For more comprehensive documentation and tutorials, refer to the Unity Manual and the SOFA documentation. For further assistance, including training opportunities, consider contacting the SOFA consortium.
Technical Details
The SOFA-Unity3D integration enables running SOFA simulations in the background while your Unity project is active. It offers a full integration with two-way communication between Unity and SOFA. Here are the key features and technical aspects:
- Simulation Execution: During each Unity update cycle, a SOFA simulation step is computed. However, this execution occurs asynchronously, meaning that the simulation’s time step may not match Unity’s update frequency.
- Hierarchy and Mapping: The integration uses a hierarchy of C# classes based on Unity’s MonoBehaviour system. This maps SOFA components to Unity GameObjects, allowing for scene recreation and interaction within Unity. The SOFA simulation scene is parsed and represented using these GameObjects, which can be edited through the Unity Inspector view. Parameters and configurations are saved as part of the scene graph accessible via the Hierarchy view.
- Scenes: Additionally, the package includes several basic examples demonstrating SOFA’s capabilities and advanced demos for interacting with deformable objects, controlling objects on the SOFA side, and deploying a catheter.
Limitations
SOFA integrates a wide range of physics principles, leading to potentially complex simulation scene graphs.
- Knowledge Requirement: SOFA integrates a wide range of physics principles, leading to potentially complex simulation scene graphs. Users need to be familiar with creating SOFA simulation scenes, as the asset does not currently support high-level SOFA-Unity object creation or direct SOFA component creation within the Unity3D editor. These interactions are still a work in progress and can be approached in several ways:
- Loading Existing SOFA Scenes: The simplest integration method involves loading pre-existing SOFA simulation scenes (*.scn files). For more information, refer to the SOFA Scene Parsing section.
- Creating High-Level SOFA-Unity Objects: Users can create high-level objects that bridge SOFA and Unity. Details on this process are available in the Object Creation section.
- Direct Creation of SOFA Components in Unity: Advanced users can directly represent SOFA components within the Unity3D scene graph. Guidance on this approach can be found in the Graph Edition section.
Specialized Applications: This asset serves as a foundational toolkit and does not include pre-configured solutions for specialized applications such as medical training, robotics research, or virtual prototyping.
Platform Support: The Windows DLLs required for SOFA must be downloaded separately, as they are not included in the asset. Additionally, there is currently no support for Linux, Mac, or Android platforms.