SofaAPAPI-Unity3D Getting Started Features Available Examples Assets Available Release Notes License
     

SofaAPAPI-Unity3D [Plugin v1.1] // [Plugin v2.0]

Release date: 2020-08-13

Both releases have the same enhancements and fixes based on v1.0, but they are based on different version of SOFA physics engine:

- SofaAPAPI-Unity3D Plugin v1.1 is based on a custom version of the SOFA Release v19.12 with some fixes in Geomagic plugin (included in v20.06).
- SofaAPAPI-Unity3D Plugin v2.0 is based on SOFA Release v20.06.

Enhancements

Fixes

    Core enhancements:
  • Add: several methods to compute UV texture mapping for SOFA visual models.
  • Add: several Material and shaders to use double side materials and highligted rendering.
  • Add: support for non 3D mesh: 1D, 2D and Rigids.
  • Add: Mechanism to propagate Key events from Unity to SOFA.
  • Add: methods to get SOFA simulation FPS.
  • Add: new liver interaction scene with HD liver resolution.
  • Improve: The mouse picking option in Unity. Still work in progress. A demo scene "TissuePicking" has been added.
  • Improve: The license checking mechanism.

  • Plugins Enhancements:
  • Geomagic multiple tools simulation is now supported.
  • SOFA Beam Adapter plugin is now supported.
  • Electrophysiology as well as Heat reaction-diffussion simulation are now supported.
    Major bug fix:
  • Fix: Several issues in the factory while creating Simulation Node or Primitives objects.
  • Fix: Component factory was not registering new components when new SOFA plugins were loaded.
  • Fix: Scene build and export.
  • Fix: Simulation of SOFA Sphere collision models mapped on unity object.
  • [Geomagic]Fix: initialisation of the tools at start.

  • Other bug Fix:
  • Fix: Beam UV mapping computation.
  • Fix: basic primitive object creation (Cube, Sphere, Cylidner and plan) as rigid or deformable objects.
  • Fix: LiverInteraction demo scene.

Known bugs

Other limitations

  • SOFA is still executed asynchronously but Multi-threading has been deactived for the moment.
  • In ParticlesModel, the max number of particles can be increased during the simulation. User need to higher the limit before starting simulation.
  • SofaVR_API and VR SofaPlayer curved interfaced have been temporary disabled.
  • Texture interpolation has been temporary disabled.
  • The interaction with the mesh in the Unity 3D view is only working on triangulation.
  • For the moment it not possible to create components directly in the Unity3D hierarchy and then change the type of component.
    Only a few set of components are handled. See graph edition
  • It is only possible to set Data value, not to link them between components inside Unity3D.
  • A list of supported component need to be setup.
  • Quad and Hexahedron topology are not yet supported.
  • Building Unity App copy all SofaUnity resources and not only the one used.




SofaAPAPI-Unity3D Plugin v1.0

Release date: 2020-04-16

Enhancements

Fixes

    Major enhancements:
  • SofaAPAPI-Unity3D API has been fully rewritten. It is now recreating the SOFA simulation graph at the component level, instead of a higher Object level, in Unity3D using GameObjects.
    10 different categories of component have been isolated and specialized. All the other components are created using a generic interface. SOFA DAG Node hierarchy is also recreated in Unity scene hierarchy. See scene parsing.
  • Many interaction are now possible in Unity3D to edit the SOFA simulation scene. But this is still WIP.
  • Also, SOFA component parameters are now better serialized in Unity3D. Allowing a cleaner save and reload of projects. See Object creation

  • Creation of SofaPrimitiveObject or SofaObject are fully parsed and converted into SofaDAGNode and SofaComponents
  • Whole plugin is based on the SOFA v19.12 Release.
  • Multi-model representation of 3D object can be reproduced like in SOFA gui implementation. Info here

  • Other Enhancements:
  • It is now possible to add manually new plugin dll directly from the interface
  • Support SOFA SPH fluid simulation using a specific SofaUnity component. Info here
  • Support SOFA Beam simulation using a specific SofaUnity component. Info here
  • In addition to Triangles and Tetrhedron topology, now support Point and Edge topologies as well.
  • Possiblity to apply a Transform in SOFA 3D space directly inside a SofaDAGNode inspector.
    Major bug fix:
  • SofaUnity are now fully serialized avoiding tricky behavior bewteen editor and player
  • Reloading of Simulation Graph is now working (reloading scene or recreating root node)
  • Gravity and timestep set in SOFA scene file is now correctly used.
  • The Sofa.ini is updated automatically with the good paths at install.

  • Other bug Fix:
  • Fix bad possible discretisation when creating sphere collision on top of Unity3D object.
  • SofaRayCaster parameters like ray length or stiffness is now correctly updated on SOFA side.
  • Fix SOFA logs handling.

Known bugs

Other limitations

  • SOFA is still executed asynchronously but Multi-threading has been deactived for the moment.
  • In ParticlesModel, the max number of particles can be increased during the simulation. User need to higher the limit before starting simulation.
  • SofaVR_API and VR SofaPlayer curved interfaced have been temporary disabled.
  • Texture interpolation has been temporary disabled.
  • SceneInfo and SofaObjectInfo scripts have been temporary disabled.
  • The interaction with the mesh in the Unity 3D view is not working perfectly.
  • For the moment it not possible to create components directly in the Unity3D hierarchy and then change the type of component.
    Only a few set of components are handled. See graph edition
  • It is only possible to set Data value, not to link them between components inside Unity3D.
  • A list of supported component need to be setup.
  • Quad and Hexahedron topology are not yet supported.
  • Building Unity App copy all SofaUnity resources and not only the one used.




Sofa-Unity Plugin v0.4

Last release update date: 2019-09-13

Enhancements

Fixes

- 2019-09-13: Release update v0.4.3
    Major enhancements:
  • Whole plugin is now compatible with SOFA v19.06 Release.

  • Other Enhancements:
  • Add: SceneInfo scripts to log simulation information: fps, number of vertices and triangles per model.
  • Update: Improve SOFA plugin messsage loading logs.
  • Update: Correct all SOFA scene files to not produce warnings at start.
    Bug Fix:
  • Fix: Bad button interaction in the ObjectController prefab.
  • Fix: Remove some false SOFA error logs.
- 2019-06-12: Release update v0.4.2
    Enhancements:
  • Update: Regenerate sofa.ini file at load for the current pc. Avoid problem of resource path.
  • Add: Option to run SOFA simulation asynchronously from Unity animation loop.
  • Update: Several Unity metarials and prefabs.
    Bug Fix:
  • Fix: Problem of mesh display when camera is too close.
  • Fix: Update several SOFA logs parsing.
  • Fix: Tetrahedron FEM mesh display.
  • Fix: Unload SOFA scene before closing Unity animation to avoid possible bad memory access.
- 2019-02-12: Release update v0.4.1
    Major enhancements:
  • Update: Whole code to be compatible with SOFA v18.12.
  • Add: Option in SofaContext to catch SOFA logs at simulation time.

  • Improve LiverInteraction demo:
  • Update: ThirdPersonCamera.cs for better mouse trackball displacement.
  • Update: Objectcontroller.cs to offer more movement for several tools using keyboard keys.
  • Add: 3D environment around the liver with mirror and logo walls.
  • Release: Executable demo which can be downloaded here.

    Major bug fix:
  • Fix: bad ray casting direction inside Sofa from Unity.
  • Fix: clean the main asset from other assets (Geomagic, organs, VR) to avoid missing files and dependencies in the final package.
  • Fix: clean the loadPlugin method to only add the needed one by default, fixing some scene behavior.

  • Other bug Fix:
  • Fix: Geomagic tool init and reinit (when multiple initialisation occurred) and also tool release.
- 2018-12-05: Release SofaUnity v0.4
    Major enhancements:
  • Add: Support for several SOFA types for parameter exchange: Vec3, vector, vector, vector, Mat3 and string
  • Add: Security breakdown: if high velocity is detected. It is possible to use callback to unactive Unity components.
  • Add: Handling of sofa.ini file inside Unity to set Sofa resources and examples path. This fix the caduceus absolute path issue.
  • Add: New script to copy SofaUnity resources when building App with Unity.

  • Create SofaUnity additional assets regarding (see Assets Available):
    • Geomagic Haptic tool controller: Track tool position from Sofa simulation and tool buttons activation.
    • Organ models: 3D organs models, with textures and correspongin collision models as well as an example scene.
    • XRay rendering: Render X-Ray image of 3D organs from SOFA simulation.
    • VR Surgical Room: Collection of 3D models of surgical tools and devices. With textures and controller scripts.
    • VR Interaction tools: collection of script to be able to use the VR controller (Oculus or Vive) to interact with the 3D view and SOFA simulation.

  • Other enhancements:
  • Add: Bool to activate or freeze the simulation in sofaContext.
  • Add: Dictionnary to translate the error code return by SofAdvancePhysicsAPI.dll and update all the logs.
  • Add: Method: sofaLog() to automatically format info in the logs. Can be display using bool log parameter.
  • Add: New script to reverse all normals of a mesh at start.
  • Add: Method and counter to track unity life cycle.
  • Add: Option in SSphereCollision to be able to use a unique sphere position.
  • Change: SofaBaseMesh is now using Sofa componoent topology revision to detect changes.
  • Move: all object hiearchy creation into a specific class created as soon as one SObject is created.

  • Experimental Work on Multi-threading support:
  • Change: There are now 2 SofaContext update method, either sync or async updateImpl. Set to sync for the moment as async is experimental.
  • Change: Use the new sofaAdvancePhysicsAPI signature to pass the number of thread to be created at construction inside Sofa.
  • Change: SObject and SRayCaster register themself inside the hiearchy to be able to run Async update.
    Major bug fix:
  • Fix: It is now possible to reload a SOFA scene inside the SofaContext.
  • Fix: All assets to be compatible with unity windows App build.
  • Fix: Crash when closing simulation. SofaContext was free twice at end.
  • Fix: Crash when license checked failed.
  • Fix: Sofa plugin loading method to use relative path to the Unity app.
  • Fix: All Unity components check that their corresponding Sofa object is well init. If not, Unity object is disabled.
  • Fix: Check code error when creating SOFA context. Set sofaContextAPI to not ready if creation failed.
  • Fix: Components GUI parameters are now well saved between editor and play mode.

  • Other bug Fix:
  • Fix: problem of bad normal directions after changing the topology in visual mesh.
  • Fix: Attach tool interactor explosing the liver because of too high stiffness. Add option to be able to change this value.
  • Fix: Texture2DFromRaw init when no target and inherite from SBaseObject and be in the Sofa object hierachy.
  • Fix: SpereCollisionModel problem of allocating too big buffers and freezing Unity.
  • Fix: Bug of bad deletion of rayCaster causing Unity to crash.
  • Fix: Liver, demo_fall_1, demo_fall_2, benchmarks, tissue_fall and interactions demos.

Known bugs

Other limitations

  • Will be updated by feedbacks.
  • Not possible to interact with mesh in the Unity 3D view.
  • Need to manullay set the Sofa plugin required. Doesn't parse the requiredplugin attribute.
  • Building Unity App copy all SofaUnity resources and not only the one used.
  • Only some FEM can be control inside Unity Editor.







Sofa-Unity Plugin v0.3

Release date: 2018-03-12

Enhancements

Fixes

  • Add Sphere Collision script that map sphere collision model on a Unity Mesh filter.
  • Add SComponentObject that is linked to a SofaComponentListener. It allows to listen to all Sofa Data of the target component.
  • Add a 2DTexture Raw component that allows to display a texture from raw data coming from Sofa.
  • Add new demo scenes: Christmas and tissue_fall.

  • Improve the communication of Data of basic type: Bool, float, int, vector3, vector3, vector, vector and string.
  • Improve the update rate: Only call simulation step every dt, like a fix update based on the dt. Update all component at the same rate.
  • Improve the copy of mesh positions by using sparse vector with only vertices that have changed.
  • Improve the cutting with ray. Delete now a zone instead of only one tetra.
  • Disable the mesh rendering of Deformable or Rigid mesh by default. Only update the component if rendering is activated.
  • Major bug on the sofa object hierarchy creation.
  • Major bug on memory leak. The sofa plugin was not well released when ending the simulation.
  • Error Data listening that were not present in sofa objects.
  • Bug of scale between unity and sofa that was messing up the ray casting for example.


Known bugs

Other limitations

  • Parameters set in the components GUI are replaced by sofa scene file value after runtime.
  • Cylinder shape has holes.
  • Changing Grid resolution doesn’t work.
  • Display of Tetrahedron FEM slow down the application.
  • All Sofa scene loaded by SofaContext needs to have relative paths to the meshes.
  • Not possible to interact with mesh in the Unity 3D view.
  • Only some FEM can be control inside Unity Editor.



Sofa-Unity Plugin v0.2

Release date: 2017-11-14

Enhancements

Fixes

  • Add support of topology changes.
  • Add VR support and demo scene of Sofa in VR.
  • Upgrade most of the materials with good normal maps.
  • Add ray casting methods to interact with Sofa 3D models. Interactions possible are element resections, vertex grasping and fix constraint
  • Add Springs support in Unity Editor.
  • Major bug of performance, reduce by 4 the cost of simulation in the unity scene.
  • Bug of bad texture coordinate computation.
  • Material of all the demo scenes.
  • Bug of FEM parameters not found.
  • Add value ranges for the FEM and springs parameters.


Known bugs

Other limitations

  • Cylinder shape has holes.
  • Changing Grid resolution doesn’t work.
  • Display of Tetrahedron FEM slow down the application.
  • All Sofa scene loaded by SofaContext needs to have relative paths to the meshes.
  • Not possible to interact with mesh in the Unity 3D view.
  • Only some FEM can be control inside Unity Editor.



Sofa-Unity Plugin v0.1

Release date: 2017-08-03

Enhancements

Fixes

  • No logs as it is the first version
  • No logs as it is the first version


Known bugs

Other limitations

  • Cylinder shape has holes.
  • Changing Grid resolution doesn’t work.
  • Display of Tetrahedron FEM slow down the application.
  • All Sofa scene loaded by SofaContext needs to have relative paths to the meshes.
  • Not possible to interact with mesh in the Unity 3D view.
  • Only TriangularFEM and TetrahedronFEM forcefield bindings are handle.