Reputation: 31
I am doing a 2D ball to wall collision/bouncing animation program. I manage to do ball to ball collision, and ball to straight line wall collision (where both are elastyic collsion).
My question is, how can i work the collision for a ball bouncing off a curve surface? For example a ball bouncing around while being trapped in a circle (the circle is the wall).
Cheers
p.s. i am using c programming language
Upvotes: 1
Views: 2949
Reputation: 27277
The basic principle is always:
In case of circle-circle collisions:
r1
be the radius of one circle (in 3d, ball)r2
be the radius of the other circled
be the distance of their centersd>r1+r2
, the circles are completely outside each otherr1>r2+d
, the second circle is completely within the first oner2>r1+d
, the first circle is completely within the last oneUpvotes: 2
Reputation: 263
IMHO, when a ball is trapped inside a circular wall, the reflection of the ball will be governed just as in case of normal wall, given the point of contact between wall and ball is negligible. The only change is the plane of the reflection which will be tangent at the point of the contact between the ball and the wall. So, the angle of the tangent will be different at different points of collision which will decide the angle of velocity of the ball.
We can deal with Convex surface by considering the surface as a huge ball with the radius equal to the curvature of the surface. So, we are just calculating collision between 2 balls. Of course, in this case we have to consider that the mass of the surface is infinite and derive the equation from elastic collision equation.
Upvotes: 1