Tweaking MAX_ANGVEL

gfm
Posts: 16
Joined: Tue Sep 09, 2008 8:56 am

Tweaking MAX_ANGVEL

Post by gfm »

I have a very small sphere that I want to behave realistically when it impacts a surface with a high angular velocity, much like a golf ball topspin/backspin. In order to get such a small object to actually pop backwards when it has a backspin, I have to substantially bump up the MAX_ANGVEL value in btRigidBody::integrateVelocities(), otherwise it can't get enough spin to effect the direction after impact.

MAX_ANGVEL seems to be set really low.. a half radian per second? Am I reading that correctly?

I removed the MAX_ANGVEL code and the ball seems to behave fine, but there's a comment above the code that worries me:

/// clamp angular velocity. collision calculations will fail on higher angular velocities

Thoughts on this anyone? Thanks!
gfm
Posts: 16
Joined: Tue Sep 09, 2008 8:56 am

Re: Tweaking MAX_ANGVEL

Post by gfm »

Actually, I just did come across some cases where setting this MAX_ANGVEL thing larger than 1/2 pi causes some odd results. If the sphere hits a plane at a considerably low angle, close to being parallel to the plane, the sphere sometimes passes right through the triangle.... At least, thats what it looks like.

I've come up with another way to handle the spin I want--fake it--so I'm tossing this MAX_ANGVEL change I made. But if someone could explain it I would appreciate to know why this causes instabilities.