- This topic has 3 replies, 2 voices, and was last updated 4 years 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 › Using SOFA › Modification of forcefields’ positions
Tagged: Forcefields
Hi
How can I change the center of forcefields at runtime using C++?
Dear @arnr
Could you detail what you mean by changing the center of a forcefield?
Are you talking about a specific forcefield?
Best wishes,
Hugo
Dear @Hugo
Hi!
I want to get the list of all forcefields in the scene and move them in runtime.
if it’s possible please give me an example for the Spherical ForceField.
Best regards.
Dear @arnr
ForceFields in SOFA corresponds to internal or external forces applied on bodies.
I think what you mean would be to modify the SphereForceField so that the center of force would be evolving among time. Is this correct?
If so, it would look like:
// definition of the sphereFF in the scene
typename sofa::component::forcefield::SphereForceField<Vec3d> SphereFF = New<sofa::component::forcefield::SphereForceField>();
m_root->addObject(SphereFF);
...
for( interation loop)
{
// move at each time step the SphereFF
SphereFF->setSphere(const Coord& center, Real radius);
}
I hope it helps.
Best,
Hugo
PS: are you working at Kyungpook NUT ?
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.