Viscous friction ? #4659
Replies: 3 comments 4 replies
-
I read some of the code for |
Beta Was this translation helpful? Give feedback.
-
Still in if(normFt > fN)
{
const SReal factor = fN / normFt;
force[line+1] *= factor;
force[line+2] *= factor;
} returns a tangential force that either blocks tangential movement if normFt < fN, or is clamped to fN and represents the dry friction force that opposes tangential movement. So I need to find a way to bring velocity information to this function and replace I guess this means I may have to write new classes similar to |
Beta Was this translation helpful? Give feedback.
-
I worked on figuring out where the constraints are instantitated. CollisionResponse implements ContactManager and thus determines the contact response, in the method createNewContacts. In CollisionResponse.cpp, l. 168 : responseUsed is a string that is passed to a factory in Contact::Create. Contact.cpp, l.45: This means you have to register the collision response model with the contact manager. This sends us back to the FrictionContact class, where the registration must happen in l.39 of FrictionContact.h : From this, a Contact object must receive all its information about the scene from two CollisionModels and an IntersectionMethod. In order to implement the force I'm looking for directly with a contact, I must be able to get the velocity information from the collision models and the intersection method. If the data I need is accessible from those classes, I may not be able to implement viscous friction from the contact response. I may need to define a force field that takes into account collision information, instead of a collision response taking into account velocity. edit : goodish news, TetrahedronModel has methods v1, v2, v3, v4 that returns velocities of the vertices, and TriangleModel has a method velocity that returns the average of the velocities of the vertices. So, at least in the particular case of triangular mesh collision models, which is the one I'm interested in, this should work. |
Beta Was this translation helpful? Give feedback.
-
Hi SOFA community !
I'm looking to add a viscous friction force, i.e. a friction force proportionnal to the slipping velocity.
Is there a component that can help me do this ?
Otherwise, how can I get started to contribute one ?
Beta Was this translation helpful? Give feedback.
All reactions