Rotational friction

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Rotational friction

Postby JoeWright2 » Tue Sep 08, 2015 10:15 am

I'm adding feet to my model using either a sphere or two spheres.

This is fine except they rotate freely on their point contact without friction (at least I think that's what's happening) when only one sphere is in contact (which can happen a lot).

In the real world, a foot would have an area of contact that would provide friction against such rotations. I'm struggling to see how I would simulate this easily without going into soft bodies.

Any ideas?

Thanks, Joe
JoeWright2
 
Posts: 14
Joined: Tue Aug 11, 2015 10:13 am

Re: Rotational friction

Postby Julio Jerez » Tue Sep 08, 2015 10:42 am

you can add a dry friction joint, look it up in the joint library.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Rotational friction

Postby JoeWright2 » Fri Sep 11, 2015 7:28 pm

Thanks Julio, the CustomDryRollingFriction joint seems to be what I'm after.

Should I enable/disable it using NewtonMaterialSetCollisionCallback so that it is only active when the sphere is in contact with the floor surface I want it to have friction against?

Joe
JoeWright2
 
Posts: 14
Joined: Tue Aug 11, 2015 10:13 am

Re: Rotational friction

Postby Julio Jerez » Fri Sep 11, 2015 7:35 pm

no you attach the joint to row ball, and when it will be activated when the ball has a contact applying a rolling friction.
you might won to modified so that it also applies a torsion torque, that is a true the try to zero out rotation along the contact normal.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Rotational friction

Postby JoeWright2 » Sat Sep 12, 2015 5:16 am

Oh right. So I see the parent body in CustomDryRollingFriction is null. Does that mean the SubmitContraints function gets called when there is a contact?
JoeWright2
 
Posts: 14
Joined: Tue Aug 11, 2015 10:13 am

Re: Rotational friction

Postby Julio Jerez » Sat Sep 12, 2015 6:42 am

oh no, it apply fruition when the ball is spinning.
it will have to be modified so that is check If there is a contact, this seem like a case for the feature that I was thing about, user defined contacts.

you can modified that joint to check If the body has an active contact contact and only emit the row friction conditional on that.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Rotational friction

Postby JoeWright2 » Sun Sep 13, 2015 8:44 pm

I've had a go with the joint, and added the test for contact. Unfortunately it doesn't seem to be resisting rotation.

I'm not sure why.

Joe
JoeWright2
 
Posts: 14
Joined: Tue Aug 11, 2015 10:13 am

Re: Rotational friction

Postby JoeJ » Mon Sep 14, 2015 2:27 am

I'd suggest you try another shape for feet, like a box or a compound of 2 capsules.
That way you get planar feet that rest nicely on ground as long as you do not produce too large ankle torque.

Even if you get it to work with the dry rolling friction joint, it's a cheat because you apply a magical exterenal force. Might lead to other problems later.

One source of the problem is that the rolling friction joint is only aware of it's own single body, but not the whole creature that applies unknown amounts of forces to the foot.
User avatar
JoeJ
 
Posts: 1489
Joined: Tue Dec 21, 2010 6:18 pm

Re: Rotational friction

Postby Julio Jerez » Mon Sep 14, 2015 1:08 pm

yes I agree with Joe, why don you try a capsule lied down, the will produce two contacts with should be enough to produce the friction.
using a sphere with a ideal contact point going in the limitation of a rigid body simulation.
the dolling friction is no really a solution because I misunderstood the problem.
basically a ball resting on a surface generate a contact patch, which a physic engine has no knowledge off.
a contact patch can simulated with the concept of contact trail, this is the radios of the contact and have be used to generate rolling resistance and friction, but the engine has no way to simulate that with the current contact model. Later for 3.15 there will be more contact support and these things can get simulated, but for now try using a capsule.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 5 guests

cron