Ball Physics not working as expected

Post Reply
LtBrick
Posts: 6
Joined: Mon Apr 14, 2014 6:39 pm

Ball Physics not working as expected

Post 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.
Plot of X vs Z position
Plot of X vs Z position
XZ Plot.tiff (39.93 KiB) Viewed 4539 times
Can anyone tell me what is going on, or have I not set part of the physics engine correctly?

Thanks,

LtBrick
bwelch
Posts: 48
Joined: Thu Dec 12, 2013 4:04 pm

Re: Ball Physics not working as expected

Post 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?
LtBrick
Posts: 6
Joined: Mon Apr 14, 2014 6:39 pm

Re: Ball Physics not working as expected

Post 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.
Post Reply