Bare minimum to get a sphere rolling on a cube top.

Post Reply
darkheron
Posts: 2
Joined: Fri Oct 03, 2014 11:45 pm

Bare minimum to get a sphere rolling on a cube top.

Post by darkheron »

Hello all,

I am new to Bullet, and consequently this is probably a dumb question... but I'm pretty stuck.

I am creating a box shape and a sphere shape. I drop the sphere shape onto the box shape and sorta expected the darn thing to roll, however, instead of rolling like I would expect I get the message:

Overflow in AABB, object removed from simulation
If you can reproduce this, please email bugs@continuousphysics.com

Please include above information, your Platform, version of OS.

Thanks.

This seems to happen when I use the setRollingFriction method. If I do not use this method, the code works just fine, but the sphere just sticks to the cube top, and slides whenever I apply an impulse instead of rolling. Once I use this setting, following the example in the RollingFrictionDemo, bullet starts returning NaN in the setWorldTransform transform, and will eventually implode with the above message.

I feel like there is some little thing I must be missing, so what is the bare minimum I need to do in order to get my spheres to act as spheres instead of darts? :)

TIA
RyanFavale
Posts: 9
Joined: Mon Jan 17, 2011 11:10 pm

Re: Bare minimum to get a sphere rolling on a cube top.

Post by RyanFavale »

Have you tried applying a randomized, slight, angular velocity on them at creation time?
In a vacuum with no external forces, I'd expect the spheres to act as you describe.
Though I have not played with friction much yet in Bullet, my spheres have been rolling just fine when dropped on non-flat surfaces.
darkheron
Posts: 2
Joined: Fri Oct 03, 2014 11:45 pm

Re: Bare minimum to get a sphere rolling on a cube top.

Post by darkheron »

RyanFavale wrote:Have you tried applying a randomized, slight, angular velocity on them at creation time?
In a vacuum with no external forces, I'd expect the spheres to act as you describe.
Though I have not played with friction much yet in Bullet, my spheres have been rolling just fine when dropped on non-flat surfaces.
Thank you this helped me make some progress... by setting the angular velocity, at least the sphere rolls now... Not correctly, but there is some rolling action at least :)

Is it safe to say what I need to do is check for a collision, calculate the angle of incidence between the contact point of the sphere and whatever it contacts, then set the angular velocity based upon this angle?

Man I really need a book or a comprehensive set of tutorials. The online documentation is not really super useful the way it is with Ogre.

I really can't figure out why this doesn't seem necessary in the demos but it does seem necessary in my code. I mean the RollingFriction demo doesn't even use setAngularVelocity and those sphere and cones seem to work ok.

I'm sure it's something dumb ... thanks for helping me make some progress.
Post Reply