- This topic has 3 replies, 3 voices, and was last updated 4 years, 9 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
Home › Forum › SOFA › Programming with SOFA › [SOLVED] Cpp controller
From @lakehanne on 28 January 2020 at 15 h 20 min
The Soft Robots plugin is really nice.
Is there a C++ Controller equivalent to the PythonScriptController utilized in that plugin?
Tagging you @Hugo.
The Soft Robots plugin is really nice.
Is there a C++ Controller equivalent to the PythonScriptController utilized in that plugin?
Tagging you @Hugo.
Hi @lakehanne
Usually C++ controllers tend to disappear with the growth of the Python scripting. This is due to the fact that Python allows for an easy, live scripting providing a maximum freedom to the user. On the other hand, C++ requires C++ coding, compilation and a controller usually implements one “controlling” feature.
If you implemented your own ForceField, it should work fine with SofaPython, since the forcefield class has already been bound.
For controller examples in C++, you can take a look at MechanicalStateController (in modules/SofaUserInteraction). There, you could implement the function handleEvent() (handling the respective events: onBeginAnimationStep and onEndAnimationStep).
Best,
Hugo
Thanks for the useful information as always! ‘Preciate it!
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.