How to get a ball to stop on a slope.

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Garfinkle
Posts: 36
Joined: Wed Jul 07, 2010 11:35 am
Location: Manchester, UK

How to get a ball to stop on a slope.

Post by Garfinkle »

Hi All,

I'm trying to create a simulation of a Ball rolling on a surface that causes friction or a form of resistance.

I am handling a standard sphere with a bulletSphere collision added to it. I am then dropping the ball onto a triangulatedMesh which runs at a slight slope downhill.

The ball at present lands on the slope and then continues to roll all the way down (as you would expect). However I want slope to be treated as a surface that create resistance on the ball, e.g. a ball on grass.

How can I apply a form of simulated friction to the ball to simulate the resistance and get the ball to stop on a slope.

I am currently very new to Bullet Physics and 3D maths so please bear with me if I'm not too sure what you mean.

Note: I have tried using angular and linear damping however I seem to have really bad effects with these.

Angular Damping only stops the ball when I set it to 0.99f;
Linear Damping also affect gravity so therefore the ball falls really slowly or even stop mid fall.

Any help with this would be great as Google doesn't seem to like this question :D
terier
Posts: 34
Joined: Sun Oct 05, 2008 4:46 pm

Post by terier »

I believe your damping values are way to high. You should set them to about 0.1 or 0.2 (I actually don't know, I've never used bullet, but I did work with newton. You should definitely try experimenting with those values). The thing is that spheres have nothing to do with friction if there is no damping, if you know what I mean. So I'd suggest that you leave the friction as is (default value shouldn't be 0, correct me if I'm wrong) and just experiment with angular damping for now..
d3jake
Posts: 198
Joined: Sat Mar 22, 2008 7:49 pm
Location: United States of America

Post by d3jake »

The dampening should be decreased, otherwise on a flat surface the ball may never roll without a large force being applied to it.

You could try turning up the friction value for both objects, and see if that would change anything.
The Open Descent Foundation is always looking for programmers! http://www.odf-online.org
"I'll find out if what I deleted was vital here shortly..." -d3jake
Garfinkle
Posts: 36
Joined: Wed Jul 07, 2010 11:35 am
Location: Manchester, UK

Post by Garfinkle »

Thanks guys I'll give that a try.
ent1ty
Competition winner
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

Post by ent1ty »

Well the whole point of rounded objects like wheel(cylinder) or a sphere, is that they have very low or even none friction at all when rolling.
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps

Step back! I have a void pointer, and I'm not afraid to use it!
kvakvs
Posts: 30
Joined: Wed Oct 14, 2009 1:50 am
Location: Sweden
Contact:

Post by kvakvs »

ent1ty wrote:Well the whole point of rounded objects like wheel(cylinder) or a sphere, is that they have very low or even none friction at all when rolling.
No or low friction means that wheel will slide, instead of rolling.
WEEEEE, zero friction let's sleigh!
Friction makes it roll, when the axle is moving.
ent1ty
Competition winner
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

Post by ent1ty »

ok, point, but i was talking compared to when you drag an object
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps

Step back! I have a void pointer, and I'm not afraid to use it!
Garfinkle
Posts: 36
Joined: Wed Jul 07, 2010 11:35 am
Location: Manchester, UK

Post by Garfinkle »

ent1ty wrote:Well the whole point of rounded objects like wheel(cylinder) or a sphere, is that they have very low or even none friction at all when rolling.
It does cause issues when you want to simulate situations such as rolling on grass or a ball rolling on sand :D

Working with the damping and friction levels seems to do what I expected :D
Post Reply