Curved Ramp?
Posted: Mon Apr 13, 2009 7:14 pm
(insert physics newbie disclaimer)
I'm trying to build a shape like a skeeball lane with a ramp at the end: http://farm1.static.flickr.com/5/4649778_35c91e1a3c.jpg
When I roll a ball down this ramp with enough speed to launch it off the ramp, it can sometimes glitch (depending on how much initial force I give the ball) in such a way that when it hits the ramp it'll either slow way down, veer off in some weird/unnatural angle, or bounce straight back as if it hit a wall.
I built the lane out of several convex hulls. The main length of the lane is a single hull, but the ramp itself is made up of 8 other hulls sliced vertically (so it's 8 progressively taller boxes setting right next to each other with slanting tops so it gives the ramp it's curved shape).
My guess is that when the ball is moving fast enough, it penetrates one or two of the ramp's hulls in a weird way and then hits one farther in causing weird reactions. So to combat this, I tried to turn on the Ccd for the ball using this:
It appeared to help, but it didn't stop the problem. My understanding was that it'd do continuous collision if the ball moved > 3.5 units in a time step. Shouldn't that prevent this from ever happening?
This is probably not the best way to model this shape. I thought about using a height map instead, but it's not clear to me if that would really help the situation with a fast moving ball or not. Suggestions?
I'm trying to build a shape like a skeeball lane with a ramp at the end: http://farm1.static.flickr.com/5/4649778_35c91e1a3c.jpg
When I roll a ball down this ramp with enough speed to launch it off the ramp, it can sometimes glitch (depending on how much initial force I give the ball) in such a way that when it hits the ramp it'll either slow way down, veer off in some weird/unnatural angle, or bounce straight back as if it hit a wall.
I built the lane out of several convex hulls. The main length of the lane is a single hull, but the ramp itself is made up of 8 other hulls sliced vertically (so it's 8 progressively taller boxes setting right next to each other with slanting tops so it gives the ramp it's curved shape).
My guess is that when the ball is moving fast enough, it penetrates one or two of the ramp's hulls in a weird way and then hits one farther in causing weird reactions. So to combat this, I tried to turn on the Ccd for the ball using this:
Code: Select all
rigidBody->setCcdMotionThreshold(kGeometryBallRadius); // ball radius is 3.5 units
rigidBody->setCcdSweptSphereRadius(0.2*kGeometryBallRadius);
This is probably not the best way to model this shape. I thought about using a height map instead, but it's not clear to me if that would really help the situation with a fast moving ball or not. Suggestions?