A few weeks ago, I learned about reflection, R = V + N*(V‧N). It works with velocity, and so far, I have no problems with it. Now I am expanding it further, by applying it to an object with a constant acceleration hitting towards a Pinball Bumper. That's right, a bumper with the ability to knock objects away with a higher velocity.
- O is an object with a constant acceleration heading west,
- B is a circular bumper on the path of O, and it doesn't move,
- A(O) stands for the old acceleration vector of the object,
- V(O) stands for velocity vector of the object, and
- P(O) stands for position vector of the object, and finally,
- A'(O) stands for the new acceleration vector of the object.
My current draft is:normalize(N), where N is normal vector of (O hit B)'s point of collision.
R = A(O) + N*(A(O)‧N)
A'(O) = R - A(O)
V(O) += A'(O)
P(O) += V(O)
The problem for me is the object, O, instantly warped away from Bumper and constantly stays moving in a westward direction, instead of (moving eastward
, slowing down, changing directions, speeding up westward, and repeat the cycle).
Does anyone know how to fix this? I hoped I have provided sufficient information. Thanks in advance.