Java-Gaming.org Hi !
 Featured games (91) games approved by the League of Dukes Games in Showcase (763) Games in Android Showcase (229) games submitted by our members Games in WIP (852) games currently in development
 News: Read the Java Gaming Resources, or peek at the official Java tutorials
Pages: [1]
 ignore  |  Print
 How to reflect an object, with constant acceleration, when hitting a circle?  (Read 1278 times) 0 Members and 1 Guest are viewing this topic.
tom_mai78101
 « Posted 2012-10-20 15:55:57 »

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.

Assuming:
• 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.
Pages: [1]
 ignore  |  Print

 EgonOlsen (489 views) 2018-06-10 19:43:48 EgonOlsen (553 views) 2018-06-10 19:43:44 EgonOlsen (405 views) 2018-06-10 19:43:20 DesertCoockie (701 views) 2018-05-13 18:23:11 nelsongames (1013 views) 2018-04-24 18:15:36 nelsongames (979 views) 2018-04-24 18:14:32 ivj94 (1503 views) 2018-03-24 14:47:39 ivj94 (556 views) 2018-03-24 14:46:31 ivj94 (1244 views) 2018-03-24 14:43:53 Solater (559 views) 2018-03-17 05:04:08
 orange451 17x SkyAphid 16x lacombej 10x Spasi 10x beeaware 8x dime26 7x nsigma 6x Mad Hatter 5x KaiHH 4x LeoOno 4x FabulousFellini 4x ral0r2 4x Sickan 4x princec 4x jezek2 3x VaTTeRGeR 3x
 Java Gaming Resourcesby philfrei2017-12-05 19:38:37Java Gaming Resourcesby philfrei2017-12-05 19:37:39Java Gaming Resourcesby philfrei2017-12-05 19:36:10Java Gaming Resourcesby philfrei2017-12-05 19:33:10List of Learning Resourcesby elect2017-03-13 14:05:44List of Learning Resourcesby elect2017-03-13 14:04:45SF/X Librariesby philfrei2017-03-02 08:45:19SF/X Librariesby philfrei2017-03-02 08:44:05
 java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org