- #1
DrKrunklehorn
- 5
- 0
Homework Statement
Hello! I'm working on my final project for a programming class. Currently I can successfully
detect 2D collision between a ball, and a line that can rotate in any direction.
However when the ball hits the line I need to change it's velocity so it bounces
in the right direction. I'm not worrying about elasticity or friction or anything, just
post collision direction.
Homework Equations
I know basic Trig is involved and maybe Dot product, but I'm pretty sure we don't need that.
The Attempt at a Solution
I thought if the racket was horizontal, it would be as easy as incident angle = reflection
angle. But as the racket tilts upward I pictured the reflection angle decreases at the same
time.
So I tried taking the racket's rotation relative to the ground and subtract it from the ball's
movement angle. This I thought would be the new angle of reflection.
Sadly it didn't work out. Sometimes the ball sort of bounces in the right direction but it's
really shoddy.
Thanks for the assistance!