Java-Gaming.org Hi !
 Featured games (88) games approved by the League of Dukes Games in Showcase (681) Games in Android Showcase (196) games submitted by our members Games in WIP (746) 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 923 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

You cannot reply to this message, because it is very, very old.

 GrandCastle (17 views) 2016-07-01 09:13:47 GrandCastle (18 views) 2016-07-01 09:09:45 CopyableCougar4 (75 views) 2016-06-25 16:56:52 Hydroque (105 views) 2016-06-22 02:17:53 SwampChicken (110 views) 2016-06-20 13:22:57 SwampChicken (111 views) 2016-06-20 13:22:49 SwampChicken (104 views) 2016-06-20 13:22:26 Hydroque (148 views) 2016-06-15 08:22:50 Hydroque (144 views) 2016-06-13 06:40:55 DarkCart (251 views) 2016-05-29 02:30:33
 Spasi 49x theagentd 40x NegativeZero 38x KaiHH 34x LiquidNitrogen 23x princec 22x DavidBVal 19x Opiop 17x ra4king 13x TritonDreyja 11x ags1 10x Archive 10x CoDi^R 10x purenickery 9x delt0r 7x Roquen 7x
 Making a Dynamic Plugin Systemby Hydroque2016-06-25 00:13:25Java Data structures2016-06-13 21:22:09Java Data structures2016-06-13 21:20:42FPS Camera Tutorialby Hydroque2016-05-22 05:40:58Website offering 3D Models specifically for games for freeby vusman2016-05-18 17:23:09Website offering 3D Models specifically for games for freeby vusman2016-05-09 08:50:56Website offering 3D Models specifically for games for freeby vusman2016-05-06 11:10:21Website offering 3D Models specifically for games for freeby vusman2016-04-29 12:56:17
 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