You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working with a SOFA scene.scn where a mesh undergoes a rigid translation in 3D space (no deformation), driven by a set of springs.
The scene is loaded in Unity using SofaContext, and the simulation itself runs correctly.
However, I need to retrieve and record the coordinates of this mesh while it is moving, ideally in SOFA coordinates, but Unity coordinates would also be acceptable.
From my observations:
• The Transform values shown in the Unity Inspector are never updated, even though the objects visibly move.
• I cannot find any SofaUnity component or API that exposes the runtime position of an element of the scene.
• This behavior is consistent not only in my own scene, but also in the official SofaUnity demos and tutorials.
Is there a recommended or supported way to access the runtime position (SOFA or Unity coordinates) of an object in a SofaUnity scene.scn?
thank you for your explanation. Yes, depending on the template (Rigid3d or Vec3) of your mechanicalObject in SOFA, there are several ways to get the position in the SOFA or Unity world space.
you can check for example this code for a Rigid3d object:
Activity
epernod commentedon Jan 15, 2026
Hi,
thank you for your explanation. Yes, depending on the template (Rigid3d or Vec3) of your mechanicalObject in SOFA, there are several ways to get the position in the SOFA or Unity world space.
you can check for example this code for a Rigid3d object:
SofaUnity/Core/Scripts/Modules/Controllers/SofaRigidMapper.cs
Lines 72 to 90 in 58c9660
More generally in the SofaMesh, the
GetRawPositionswill return position in the SOFA coordinate systemSofaUnity/Core/Scripts/Core/Components/SofaMesh.cs
Lines 187 to 191 in 58c9660
Otherwise the SofaMesh creates a unity MeshFilter and you can access its vertices which will be in the Unity coordinate system:. For example:
SofaUnity/Core/Scripts/Modules/Controllers/SofaMeshController.cs
Line 63 in 58c9660
Let me know if this works
Best regards