Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (710)
Games in Android Showcase (212)
games submitted by our members
Games in WIP (785)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Game Mechanics / Re: Basic Physics Engine on: 2002-12-29 18:46:11
first you have to find the result of all forces on your object (if they apply on the same point), just sum up all your forces vectors and use this to find the acceleration. (F=ma, you divide your force vector by mass and you find acceleration, but it's a vector).

Now you need to integrate this over time. For this step, you need an accurate timer and the difference of time between your current frame and the last one (delta_time). Multiply your acceleration vector by this delta_time and add this new vector to your object velocity. Now take this freshly updated velocity vector and multiply it by delta_time. Add this vector to your object position and you get the updated object position. This is the Euler integrator which is not THAT accurate but still good for simple stuff.

I wrote an article in french about (basic) particles physics :

There's some code in the middle of the article that performs this integration, you should be able to understand it, it's C. For advanced motion, you'll have to read some docs about torque and momentum. (Chris Hecker series are a good start :
Pages: [1]
numerical (112 views)
2017-02-21 07:32:16

numerical (112 views)
2017-02-21 07:31:46

theagentd (217 views)
2017-02-18 13:42:33

theagentd (220 views)
2017-02-18 13:35:16

h.pernpeintner (1382 views)
2017-01-24 22:39:11

h.pernpeintner (1370 views)
2017-01-24 22:38:32

Galdo (1932 views)
2017-01-12 13:44:09

Archive (2004 views)
2017-01-02 05:31:41

0AndrewShepherd0 (2541 views)
2016-12-16 03:58:39

0AndrewShepherd0 (2317 views)
2016-12-15 21:50:57
List of Learning Resources
by elect
2016-09-09 09:47:55

List of Learning Resources
by elect
2016-09-08 09:47:20

List of Learning Resources
by elect
2016-09-08 09:46:51

List of Learning Resources
by elect
2016-09-08 09:46:27

List of Learning Resources
by elect
2016-09-08 09:45:41

List of Learning Resources
by elect
2016-09-08 08:39:20

List of Learning Resources
by elect
2016-09-08 08:38:19

Rendering resources
by Roquen
2016-08-08 05:55:21 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‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!