Game Programming: Planetary Physics Fun
2,159 views · Published 19 April 2015 · 1:26 · Indexed 26 October 2026
Channel: Numerical Jungle · 2015 · Gaming
Full netbeans project: https://www.dropbox.com/s/vy7kvlqfmggtdqy/OrbitBall%20%28Netbeans%20project%29.zip?dl=0 Planet masses are determined by their area (pi * radius²), which determines how strong their gravity is. Every planet affects every other planet, no matter how far apart they are. This causes planets to be attracted to the total center of mass of all other planets. If there are 100 planets, each planet needs to look at 99 other planets, every single update of the primary loop. I still might add semi elastic collisions (so glancing collisions will not cause merging). Maybe powerful collisions will cause planets to break apart or eject smaller pieces while conserving total mass. Currently when 2 planets collide and merge, the resulting planet's size is just determined by adding the areas of the original planets, and a radius is calculated from that. The new planet's position, velocity, and color values are found by looking at the proportion of the masses of the original planets. Music: Ronald Jenkees - Simpletank ■ Website: http://jnumerical.com
More from this channel
-
1:50
Boom Blox Glitch- Compression
-
0:18
Animation: Attack of the Flying Stickmen
-
4:54
Rubik's Cube- Average of 5 Solves 1/18/09
-
1:01
V-Cube 7 Pattern: E's
-
3:25
Megaminx Solve- 3 Minutes
-
5:33
My Cube Collection
-
5:08
Medal of Honor: Rising Sun: Split-Screen Match 3
-
8:09
Advanced Center-Switching Tutorial (Part 2)