Page 1 of 1

Ball Physics not working as expected

Posted: Mon Apr 14, 2014 7:09 pm
by LtBrick
Hi,

I am new to Bullet and as a starting point thought I would get a ball rolling along a surface. I used the RollingFrictionDemo as a starting point, which worked fine. I then changed the btBoxShape to a btBvhTriangleMeshShape and set all the Y coordinates to 0.0.

All seems to work as expected when I apply an impulse to ball in a single axis.

However when I do:

Code: Select all

body->applyCentralImpulse( btVector3( 1.0f, 0.f, -8.0f ) );
I expected the ball to roll along the given vector until coming to rest as a result of the friction. However the ball starts to move along the vector and then stops moving in X and continues along the Z axis, as shown in XZ position plot below.
XZ Plot.tiff
Can anyone tell me what is going on, or have I not set part of the physics engine correctly?

Thanks,

LtBrick

Re: Ball Physics not working as expected

Posted: Fri Apr 18, 2014 1:39 pm
by bwelch
For some reason your plot isn't showing for me. Anyway, I'm not sure if this will do anything for you, but IIRC there's a line in the demo about anisotropic rolling friction. Maybe try commenting that out?

Re: Ball Physics not working as expected

Posted: Sat Apr 19, 2014 8:18 am
by LtBrick
Hi bwelch

This is happening with the call to set anisotropic friction.

I found another tread "rolling friction issue" which identified the same issue so added more info to that. Can't seem to find a solution.