Decided to see if I could make something bounce off surfaces.
Only used my intuition, instead of doing the right thing and researching a little I’m assuming this is not the best way to do this type of physics simulation.
Here’s the elevator pitch:
- See if the ball will enter the mesh, given its current velocity
- If inside the mesh (collision), cast a ray equal to its negative velocity
- grab the face normal hit by the ray, update the balls velocity
This is me reinventing this wheel, would love to hear any other ways to do this
https://chrisboligprojects.pythonanywhere.com/bounceAround
https://chrisboligprojects.pythonanywhere.com/targetBounce
bounce around:
try to hit the target