Home › Forum › SOFA › Using SOFA › SofaPhysicsAPI improvements/backward compatibility
Tagged: 64_bits, Linux_ubuntu, SOFA_1608, SofaPhysicsAPI
- This topic has 10 replies, 3 voices, and was last updated 7 years, 3 months ago by Hugo.
-
AuthorPosts
-
12 December 2016 at 16:23 #8078epernodBlocked
Hi,
I’m working on the SofaPhysicsAPI which right now do not compile due to recent changes on master (mainly move of opengl code into plugins).
In order to not break code with my fixes and improvements, I would like to know who is still using this API and how.
We could also discuss how to improve that API.
Erik
10 January 2017 at 11:26 #8295epernodBlockedUp!
If no news by the end of the week, I will assume I can change behaviour of methods like this one without impacting any current work:
SofaPhysicsOutputMesh** SofaPhysicsSimulation::Impl::getOutputMeshes() { if (outputMeshes.empty()) return NULL; else return &(outputMeshes[0]); }
19 June 2017 at 16:49 #9334WongBlockedHello @epernod ,
Which way do you use to combine Sofa with Unity? Managed Plugins or Native Plugins? How to use the C++ classes in C#?
The data structure type in C++ is different from that in C#.So how to pass the data from C++ to C# ?
26 June 2017 at 09:57 #9362epernodBlockedHi @Wong ,
I’m combining Sofa with Unity using, on the first side, one API that abstract main concept of SOFA and on the Unity side a plugin that recreate the main concept of Sofa.
The communication is done using Native plugin.Right now I’m completing some dev on both side. I hope to put that API on the Sofa Marketsplace really soon.
Let me know what are you interests on this topic. I could provide you some help.
Erik
26 June 2017 at 10:07 #9363WongBlockedHello @epernod,
As far as I know, Native Plugin seemingly cannot export C++ classes in C#. So how to use Sofa C++ classes in C#?
The data structure type in C++ is different from that in C#.So how to pass the data from C++ to C# ?
26 June 2017 at 10:13 #9364epernodBlockedYes, you need to go with C bindings in middle. This is what I’m doing in the API.
26 June 2017 at 10:18 #936529 June 2017 at 04:00 #9371WongBlockedHello @epernod,
If the C bindings are used, the C++ class object must be returned when the C function ends, or it will be destroyed. But the corresponding type cannot be found in C#. So how to address this issue?
Thanks.
1 July 2017 at 10:53 #9597epernodBlockedHi @Wong
I’m sorry, I can’t develop that part for the moment as my current work rely on this.
I hope to publish a first version of Sofa-Unity API in a few weeks. Then I will be happy to help you using it.But clearly, in Unity, it is not possible to interpret directly a C++ class pointer that you passed through C bindings.
1 July 2017 at 11:05 #9598WongBlockedHello @epernod,
I have searched some information. To be used in C#, a C function (if it returns a C++ class object) is usually wrapped into a particular form to return the C++ class pointer of the object and exported in a .dll file. Then the P/Invoke Interop is used to import the C function in C# and the corresponding object of the returned value is a IntPtr type object.
Do you do like that? Thanks.
7 August 2017 at 15:53 #9907 -
AuthorPosts
- You must be logged in to reply to this topic.