Friction using Panda ODE

Hi.

I’m trying to use ODE in Panda. I’m using the demo from the manual as a base and I modified it to use GeoMipTerrain for my surface using OdeTriMeshGeom.

Now, the problem is friction. It doesn’t matter what value I set in the mu parameter when I call setSurfaceEntry, the friction doesn’t happen.

I’m using this in a golf game I’m creating and when I add a force to the ball and get it moving, it doesn’t stop; just keeps on rolling.

Any tips on setting the friction between the two surfaces, my OdeSphereGeom and my GeoMipTerrain ?

Balls keep rolling is normal, actually balls will not roll if friction is zero. If it is just a perfect sphere on a plane, I am afraid that it may roll a long long way without stopping, no matter how big is the friction.

A ball rolling on a grass, I believe it can be emulated by adding a reverse force to the current moving direction to reduce its speed.

You can play around the demo program I uploaded recently:
discourse.panda3d.org/viewtopic.php?t=5915
The ode demo are based on the objects in odebase.py
In odebase.py, looking for “motionfriction” and “angularfriction”, those are extra parameters I use to emulate simple air frictions.

Try this:
Select “ODE - Demo 1”, and then select “Chained Monkey”. Shoot it.
And open demo_ode/ode1.py, now looking for Demo6 method, change the line:

            sphere.motionfriction = 0.1
            sphere.angularfriction = 0.005
to
            sphere.motionfriction = 0
            sphere.angularfriction = 0

The monkey will swing forever since no other friction force is introduced.

( I find that the trimeshgeom is not very stable with other trimeshgeom. I am not sure if trimeshgeom with a sphere may introduce any instability? Looks like it is not the case. )